Skip to content

Commit

Permalink
feat: add is_one_time_use and is_offline_access_code (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot authored Nov 8, 2023
1 parent 9c5a78f commit 3a04fa9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
11 changes: 5 additions & 6 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down Expand Up @@ -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',
},
Expand Down Expand Up @@ -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: {
Expand Down
30 changes: 20 additions & 10 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -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
}>
}
}
Expand Down Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -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
}>
}
}
Expand Down Expand Up @@ -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
}
}
}
Expand Down Expand Up @@ -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?:
Expand Down Expand Up @@ -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?:
Expand Down Expand Up @@ -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?:
Expand Down Expand Up @@ -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?:
Expand Down Expand Up @@ -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?:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof managed_access_code>
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 3a04fa9

Please sign in to comment.