Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions src/lib/seam/connect/models/acs/acs-encoder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
import { z } from 'zod'

const common_acs_encoder_error = z.object({
created_at: z
.string()
.datetime()
.describe('Date and time at which Seam created the error.'),
message: z
.string()
.describe(
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
),
})

const error_code_description =
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.'

const acs_encoder_removed = common_acs_encoder_error.extend({
error_code: z.literal('acs_encoder_removed').describe(error_code_description),
_event_id: z
.string()
.uuid()
.describe(
'ID of the event that was created when the `acs_encoder` was removed.',
),
})

const acs_encoder_error =
// z.union([
acs_encoder_removed
// ])
.describe('Error associated with the `acs_encoder`.')

export const acs_encoder_error_map = z.object({
acs_encoder_removed: acs_encoder_removed.optional().nullable(),
})

export type AcsEncoderErrorMap = z.infer<typeof acs_encoder_error_map>

export const acs_encoder = z.object({
acs_encoder_id: z.string().uuid().describe('ID of the `acs_encoder`.'),
acs_system_id: z
Expand All @@ -14,12 +51,9 @@ export const acs_encoder = z.object({
.describe(
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the `acs_system`.',
),
errors: z.array(
z.object({
error_code: z.string(),
message: z.string(),
}),
),
errors: z
.array(acs_encoder_error)
.describe('Errors associated with the `acs_encoder`.'),
created_at: z
.string()
.datetime()
Expand Down
50 changes: 29 additions & 21 deletions src/lib/seam/connect/models/acs/acs-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const seam_bridge_disconnected = common_acs_system_error.extend({
.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.
This error might also occur if the Seam Bridge is connected to the wrong [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
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).`)

const visionline_instance_unreachable = common_acs_system_error.extend({
error_code: z
.literal('visionline_instance_unreachable')
Expand All @@ -84,29 +85,36 @@ const visionline_instance_unreachable = common_acs_system_error.extend({
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).
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).`)

const salto_ks_subscription_limit_exceeded = common_acs_system_error.extend({
error_code: z
.literal('salto_ks_subscription_limit_exceeded')
.describe(
'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.',
),
})
const salto_ks_subscription_limit_exceeded = common_acs_system_error
.extend({
error_code: z
.literal('salto_ks_subscription_limit_exceeded')
.describe(error_code_description),
})
.describe(
'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.',
)

const acs_system_disconnected = common_acs_system_error.extend({
error_code: z
.literal('acs_system_disconnected')
.describe(
'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.',
),
})
const acs_system_disconnected = common_acs_system_error
.extend({
error_code: z
.literal('acs_system_disconnected')
.describe(error_code_description),
})
.describe(
'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.',
)

const account_disconnected = common_acs_system_error
.extend({
error_code: z
.literal('account_disconnected')
.describe(error_code_description),
})
.describe(
'Indicates that the login credentials are invalid. Reconnect the account using the Connect Webview to restore access.',
)

const account_disconnected = common_acs_system_error.extend({
error_code: z
.literal('account_disconnected')
.describe(
'Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access.',
),
})
const acs_system_error = z
.union([
seam_bridge_disconnected,
Expand Down
28 changes: 28 additions & 0 deletions src/lib/seam/connect/models/events/acs/encoders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { z } from 'zod'

import { common_acs_event } from './common.js'

const acs_encoder_event = common_acs_event.extend({
acs_encoder_id: z.string().uuid().describe('ID of the ACS encoder.'),
})

export const acs_encoder_added_event = acs_encoder_event
.extend({
event_type: z.literal('acs_encoder.added'),
})
.describe('An ACS encoder was added.')

export type AcsEncoderAddedEvent = z.infer<typeof acs_encoder_added_event>

export const acs_encoder_removed_event = acs_encoder_event
.extend({
event_type: z.literal('acs_encoder.removed'),
})
.describe('An ACS encoder was removed.')

export type AcsEncoderRemovedEvent = z.infer<typeof acs_encoder_removed_event>

export const acs_encoder_events = [
acs_encoder_added_event,
acs_encoder_removed_event,
] as const
2 changes: 2 additions & 0 deletions src/lib/seam/connect/models/events/acs/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { acs_credential_events } from './credentials.js'
import { acs_encoder_events } from './encoders.js'
import { acs_system_events } from './systems.js'
import { acs_user_events } from './users.js'

export const acs_events = [
...acs_system_events,
...acs_credential_events,
...acs_user_events,
...acs_encoder_events,
] as const
16 changes: 13 additions & 3 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ export default {
type: 'object',
},
{
description:
'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.',
properties: {
created_at: {
description:
Expand All @@ -709,7 +711,7 @@ export default {
},
error_code: {
description:
'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.',
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['salto_ks_subscription_limit_exceeded'],
type: 'string',
},
Expand All @@ -723,6 +725,8 @@ export default {
type: 'object',
},
{
description:
'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.',
properties: {
created_at: {
description:
Expand All @@ -732,7 +736,7 @@ export default {
},
error_code: {
description:
'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.',
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['acs_system_disconnected'],
type: 'string',
},
Expand All @@ -746,6 +750,8 @@ export default {
type: 'object',
},
{
description:
'Indicates that the login credentials are invalid. Reconnect the account using the Connect Webview to restore access.',
properties: {
created_at: {
description:
Expand All @@ -755,7 +761,7 @@ export default {
},
error_code: {
description:
'Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access.',
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
enum: ['account_disconnected'],
type: 'string',
},
Expand Down Expand Up @@ -13789,6 +13795,8 @@ export default {
'acs_user.deleted',
'acs_credential.deleted',
'acs_credential.issued',
'acs_encoder.added',
'acs_encoder.removed',
'enrollment_automation.deleted',
'client_session.deleted',
'action_attempt.lock_door.succeeded',
Expand Down Expand Up @@ -13863,6 +13871,8 @@ export default {
'acs_user.deleted',
'acs_credential.deleted',
'acs_credential.issued',
'acs_encoder.added',
'acs_encoder.removed',
'enrollment_automation.deleted',
'client_session.deleted',
'action_attempt.lock_door.succeeded',
Expand Down
28 changes: 16 additions & 12 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8148,23 +8148,23 @@ export interface Routes {
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'salto_ks_subscription_limit_exceeded'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'acs_system_disconnected'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'account_disconnected'
}
>
Expand Down Expand Up @@ -8295,23 +8295,23 @@ export interface Routes {
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'salto_ks_subscription_limit_exceeded'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'acs_system_disconnected'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'account_disconnected'
}
>
Expand Down Expand Up @@ -8442,23 +8442,23 @@ export interface Routes {
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'salto_ks_subscription_limit_exceeded'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'acs_system_disconnected'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'account_disconnected'
}
>
Expand Down Expand Up @@ -13749,6 +13749,8 @@ export interface Routes {
| 'acs_user.deleted'
| 'acs_credential.deleted'
| 'acs_credential.issued'
| 'acs_encoder.added'
| 'acs_encoder.removed'
| 'enrollment_automation.deleted'
| 'client_session.deleted'
| 'action_attempt.lock_door.succeeded'
Expand Down Expand Up @@ -13821,6 +13823,8 @@ export interface Routes {
| 'acs_user.deleted'
| 'acs_credential.deleted'
| 'acs_credential.issued'
| 'acs_encoder.added'
| 'acs_encoder.removed'
| 'enrollment_automation.deleted'
| 'client_session.deleted'
| 'action_attempt.lock_door.succeeded'
Expand Down Expand Up @@ -31777,23 +31781,23 @@ export interface Routes {
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'salto_ks_subscription_limit_exceeded'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** 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. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'acs_system_disconnected'
}
| {
/** Date and time at which Seam created the error. */
created_at: string
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
message: string
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
error_code: 'account_disconnected'
}
>
Expand Down