From 3a04fa9a537e35ee1a56cf0a552455cbdb7d0418 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 8 Nov 2023 10:20:59 -0800 Subject: [PATCH] feat: add is_one_time_use and is_offline_access_code (#252) --- src/lib/seam/connect/openapi.ts | 11 ++++--- src/lib/seam/connect/route-types.ts | 30 ++++++++++++------- .../access-codes/managed-access-code.ts | 2 ++ .../models/devices/device-metadata.ts | 4 +-- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index 2979a478..36f60264 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -14,6 +14,8 @@ export default { is_backup_access_code_available: { type: 'boolean' }, is_external_modification_allowed: { type: 'boolean' }, is_managed: { enum: [true], type: 'boolean' }, + is_offline_access_code: { type: 'boolean' }, + is_one_time_use: { type: 'boolean' }, is_scheduled_on_device: { type: 'boolean' }, is_waiting_for_code_assignment: { type: 'boolean' }, name: { nullable: true, type: 'string' }, @@ -42,6 +44,8 @@ export default { 'status', 'is_backup_access_code_available', 'is_external_modification_allowed', + 'is_one_time_use', + 'is_offline_access_code', ], type: 'object', }, @@ -585,12 +589,7 @@ export default { device_id: { type: 'string' }, device_name: { type: 'string' }, }, - required: [ - 'device_id', - 'bridge_id', - 'device_name', - 'bridge_name', - ], + required: ['device_id', 'device_name'], type: 'object', }, kwikset_metadata: { diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 0c6688f1..3bfe24a7 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -69,6 +69,8 @@ export interface Routes { is_backup?: boolean | undefined pulled_backup_access_code_id?: (string | null) | undefined is_external_modification_allowed: boolean + is_one_time_use: boolean + is_offline_access_code: boolean } } } @@ -116,6 +118,8 @@ export interface Routes { is_backup?: boolean | undefined pulled_backup_access_code_id?: (string | null) | undefined is_external_modification_allowed: boolean + is_one_time_use: boolean + is_offline_access_code: boolean }> } } @@ -206,6 +210,8 @@ export interface Routes { is_backup?: boolean | undefined pulled_backup_access_code_id?: (string | null) | undefined is_external_modification_allowed: boolean + is_one_time_use: boolean + is_offline_access_code: boolean } } } @@ -241,6 +247,8 @@ export interface Routes { is_backup?: boolean | undefined pulled_backup_access_code_id?: (string | null) | undefined is_external_modification_allowed: boolean + is_one_time_use: boolean + is_offline_access_code: boolean }> } } @@ -274,6 +282,8 @@ export interface Routes { is_backup?: boolean | undefined pulled_backup_access_code_id?: (string | null) | undefined is_external_modification_allowed: boolean + is_one_time_use: boolean + is_offline_access_code: boolean } } } @@ -1631,9 +1641,9 @@ export interface Routes { igloohome_metadata?: | { device_id: string - bridge_id: string device_name: string - bridge_name: string + bridge_id?: string | undefined + bridge_name?: string | undefined } | undefined nest_metadata?: @@ -2329,9 +2339,9 @@ export interface Routes { igloohome_metadata?: | { device_id: string - bridge_id: string device_name: string - bridge_name: string + bridge_id?: string | undefined + bridge_name?: string | undefined } | undefined nest_metadata?: @@ -4000,9 +4010,9 @@ export interface Routes { igloohome_metadata?: | { device_id: string - bridge_id: string device_name: string - bridge_name: string + bridge_id?: string | undefined + bridge_name?: string | undefined } | undefined nest_metadata?: @@ -4728,9 +4738,9 @@ export interface Routes { igloohome_metadata?: | { device_id: string - bridge_id: string device_name: string - bridge_name: string + bridge_id?: string | undefined + bridge_name?: string | undefined } | undefined nest_metadata?: @@ -5431,9 +5441,9 @@ export interface Routes { igloohome_metadata?: | { device_id: string - bridge_id: string device_name: string - bridge_name: string + bridge_id?: string | undefined + bridge_name?: string | undefined } | undefined nest_metadata?: diff --git a/src/lib/seam/connect/unstable/models/access-codes/managed-access-code.ts b/src/lib/seam/connect/unstable/models/access-codes/managed-access-code.ts index f2cf9379..eeff66d0 100644 --- a/src/lib/seam/connect/unstable/models/access-codes/managed-access-code.ts +++ b/src/lib/seam/connect/unstable/models/access-codes/managed-access-code.ts @@ -20,6 +20,8 @@ export const managed_access_code = z.object({ is_backup: z.boolean().optional(), pulled_backup_access_code_id: z.string().uuid().nullable().optional(), is_external_modification_allowed: z.boolean(), + is_one_time_use: z.boolean(), + is_offline_access_code: z.boolean(), }) export type ManagedAccessCode = z.infer diff --git a/src/lib/seam/connect/unstable/models/devices/device-metadata.ts b/src/lib/seam/connect/unstable/models/devices/device-metadata.ts index 40a42854..c4a383e1 100644 --- a/src/lib/seam/connect/unstable/models/devices/device-metadata.ts +++ b/src/lib/seam/connect/unstable/models/devices/device-metadata.ts @@ -141,9 +141,9 @@ export const device_metadata = z igloohome_metadata: z.object({ device_id: z.string(), - bridge_id: z.string(), device_name: z.string(), - bridge_name: z.string(), + bridge_id: z.string().optional(), + bridge_name: z.string().optional(), }), nest_metadata: z.object({