diff --git a/src/lib/seam/connect/models/events/common.ts b/src/lib/seam/connect/models/events/common.ts index e43aaa90..de1ea928 100644 --- a/src/lib/seam/connect/models/events/common.ts +++ b/src/lib/seam/connect/models/events/common.ts @@ -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 diff --git a/src/lib/seam/connect/models/events/devices.ts b/src/lib/seam/connect/models/events/devices.ts index 3ecd242b..056ac402 100644 --- a/src/lib/seam/connect/models/events/devices.ts +++ b/src/lib/seam/connect/models/events/devices.ts @@ -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({ @@ -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 diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index df3ffa78..3b4e0c16 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -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 ', diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 5e88756c..36b150e9 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -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. */ @@ -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. */ @@ -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. */ @@ -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. */