Skip to content
Open
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
15 changes: 15 additions & 0 deletions src/lib/seam/connect/models/events/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ export const common_event_warning = z
.describe(
'Warning associated with the resource, including the warning code, message, and creation timestamp.',
)

export const lock_access_denied_reason = z
.enum([
'unknown_code',
'expired_code',
'blocklisted_code',
'too_many_attempts',
'blocked_by_privacy_mode',
'credential_error',
])
.describe(
'Normalized reason a lock denied access. Provider-agnostic; not all providers report every value.',
)

export type LockAccessDeniedReason = z.infer<typeof lock_access_denied_reason>
12 changes: 12 additions & 0 deletions src/lib/seam/connect/models/events/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
common_event,
common_event_error,
common_event_warning,
lock_access_denied_reason,
} from './common.js'

const device_event = common_event.extend({
Expand Down Expand Up @@ -549,6 +550,17 @@ export const lock_access_denied_event = device_event.extend({
.uuid()
.optional()
.describe('ID of the affected device.'),
reason: z
.object({
reason_code: lock_access_denied_reason,
message: z
.string()
.describe('Human-readable explanation of why access was denied.'),
})
.optional()
.describe(
'Why access was denied, when the provider reports a determinable cause. Omitted when unknown.',
),
}).describe(`
---
route_path: /locks
Expand Down
26 changes: 26 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26164,6 +26164,32 @@ const openapi: OpenAPISpec = {
format: 'date-time',
type: 'string',
},
reason: {
description:
'Why access was denied, when the provider reports a determinable cause. Omitted when unknown.',
properties: {
message: {
description:
'Human-readable explanation of why access was denied.',
type: 'string',
},
reason_code: {
description:
'Normalized reason a lock denied access. Provider-agnostic; not all providers report every value.',
enum: [
'unknown_code',
'expired_code',
'blocklisted_code',
'too_many_attempts',
'blocked_by_privacy_mode',
'credential_error',
],
type: 'string',
},
},
required: ['reason_code', 'message'],
type: 'object',
},
user_identity_id: {
description:
'\n undocumented: Unreleased.\n ---\n ID of the user identity associated with the access-denied event.\n ',
Expand Down
60 changes: 60 additions & 0 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57707,6 +57707,21 @@ export type Routes = {
ID of the ACS entrance associated with the access-denied event.
*/
acs_entrance_id?: string | undefined
/** Why access was denied, when the provider reports a determinable cause. Omitted when unknown. */
reason?:
| {
/** Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. */
reason_code:
| 'unknown_code'
| 'expired_code'
| 'blocklisted_code'
| 'too_many_attempts'
| 'blocked_by_privacy_mode'
| 'credential_error'
/** Human-readable explanation of why access was denied. */
message: string
}
| undefined
}
| {
/** ID of the event. */
Expand Down Expand Up @@ -61570,6 +61585,21 @@ export type Routes = {
ID of the ACS entrance associated with the access-denied event.
*/
acs_entrance_id?: string | undefined
/** Why access was denied, when the provider reports a determinable cause. Omitted when unknown. */
reason?:
| {
/** Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. */
reason_code:
| 'unknown_code'
| 'expired_code'
| 'blocklisted_code'
| 'too_many_attempts'
| 'blocked_by_privacy_mode'
| 'credential_error'
/** Human-readable explanation of why access was denied. */
message: string
}
| undefined
}
| {
/** ID of the event. */
Expand Down Expand Up @@ -96959,6 +96989,21 @@ export type Routes = {
ID of the ACS entrance associated with the access-denied event.
*/
acs_entrance_id?: string | undefined
/** Why access was denied, when the provider reports a determinable cause. Omitted when unknown. */
reason?:
| {
/** Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. */
reason_code:
| 'unknown_code'
| 'expired_code'
| 'blocklisted_code'
| 'too_many_attempts'
| 'blocked_by_privacy_mode'
| 'credential_error'
/** Human-readable explanation of why access was denied. */
message: string
}
| undefined
}
| {
/** ID of the event. */
Expand Down Expand Up @@ -141912,6 +141957,21 @@ export type Routes = {
ID of the ACS entrance associated with the access-denied event.
*/
acs_entrance_id?: string | undefined
/** Why access was denied, when the provider reports a determinable cause. Omitted when unknown. */
reason?:
| {
/** Normalized reason a lock denied access. Provider-agnostic; not all providers report every value. */
reason_code:
| 'unknown_code'
| 'expired_code'
| 'blocklisted_code'
| 'too_many_attempts'
| 'blocked_by_privacy_mode'
| 'credential_error'
/** Human-readable explanation of why access was denied. */
message: string
}
| undefined
}
| {
/** ID of the event. */
Expand Down
Loading