diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index c0a609b7..6040d3d8 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -1851,6 +1851,19 @@ export default { is_managed: { enum: [false], type: 'boolean' }, properties: { properties: { + battery: { + description: + 'Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.', + properties: { + level: { maximum: 1, minimum: 0, type: 'number' }, + status: { + enum: ['critical', 'low', 'good', 'full'], + type: 'string', + }, + }, + required: ['level', 'status'], + type: 'object', + }, battery_level: { description: 'Indicates the battery level of the device as a decimal value between 0 and 1, inclusive.', @@ -1858,19 +1871,63 @@ export default { minimum: 0, type: 'number', }, - image_alt_text: { type: 'string' }, - image_url: { type: 'string' }, - manufacturer: { type: 'string' }, + image_alt_text: { + description: 'Alt text for the device image.', + type: 'string', + }, + image_url: { + description: 'Image URL for the device.', + format: 'uri', + type: 'string', + }, + manufacturer: { + description: 'Manufacturer of the device.', + type: 'string', + }, model: { properties: { - display_name: { type: 'string' }, - manufacturer_display_name: { type: 'string' }, + accessory_keypad_supported: { + description: + 'Indicates whether the device supports an accessory keypad.', + type: 'boolean', + }, + display_name: { + description: 'Display name of the device model.', + type: 'string', + }, + manufacturer_display_name: { + description: + 'Display name that corresponds to the manufacturer-specific terminology for the device.', + type: 'string', + }, + offline_access_codes_supported: { + description: + 'Indicates whether the device supports offline access codes.', + type: 'boolean', + }, + online_access_codes_supported: { + description: + 'Indicates whether the device supports online access codes.', + type: 'boolean', + }, }, required: ['display_name', 'manufacturer_display_name'], type: 'object', }, - name: { type: 'string' }, - online: { type: 'boolean' }, + name: { + description: + 'Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices.', + type: 'string', + }, + offline_access_codes_enabled: { + description: + 'Indicates whether it is currently possible to use offline access codes for the device.', + type: 'boolean', + }, + online: { + description: 'Indicates whether the device is online.', + type: 'boolean', + }, online_access_codes_enabled: { description: 'Indicates whether it is currently possible to use online access codes for the device.', diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 732259f5..69ee1148 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -3270,19 +3270,41 @@ export interface Routes { created_at: string is_managed: false properties: { + /** Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices. */ name: string + /** Indicates whether the device is online. */ online: boolean + /** Manufacturer of the device. */ manufacturer?: string | undefined + /** Image URL for the device. */ image_url?: string | undefined + /** Alt text for the device image. */ image_alt_text?: string | undefined - model: { - display_name: string - manufacturer_display_name: string - } /** Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. */ battery_level?: number | undefined + /** Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage. */ + battery?: + | { + level: number + status: 'critical' | 'low' | 'good' | 'full' + } + | undefined /** Indicates whether it is currently possible to use online access codes for the device. */ online_access_codes_enabled?: boolean | undefined + /** Indicates whether it is currently possible to use offline access codes for the device. */ + offline_access_codes_enabled?: boolean | undefined + model: { + /** Display name of the device model. */ + display_name: string + /** Display name that corresponds to the manufacturer-specific terminology for the device. */ + manufacturer_display_name: string + /** Indicates whether the device supports offline access codes. */ + offline_access_codes_supported?: boolean | undefined + /** Indicates whether the device supports online access codes. */ + online_access_codes_supported?: boolean | undefined + /** Indicates whether the device supports an accessory keypad. */ + accessory_keypad_supported?: boolean | undefined + } } } } @@ -3462,19 +3484,41 @@ export interface Routes { created_at: string is_managed: false properties: { + /** Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices. */ name: string + /** Indicates whether the device is online. */ online: boolean + /** Manufacturer of the device. */ manufacturer?: string | undefined + /** Image URL for the device. */ image_url?: string | undefined + /** Alt text for the device image. */ image_alt_text?: string | undefined - model: { - display_name: string - manufacturer_display_name: string - } /** Indicates the battery level of the device as a decimal value between 0 and 1, inclusive. */ battery_level?: number | undefined + /** Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage. */ + battery?: + | { + level: number + status: 'critical' | 'low' | 'good' | 'full' + } + | undefined /** Indicates whether it is currently possible to use online access codes for the device. */ online_access_codes_enabled?: boolean | undefined + /** Indicates whether it is currently possible to use offline access codes for the device. */ + offline_access_codes_enabled?: boolean | undefined + model: { + /** Display name of the device model. */ + display_name: string + /** Display name that corresponds to the manufacturer-specific terminology for the device. */ + manufacturer_display_name: string + /** Indicates whether the device supports offline access codes. */ + offline_access_codes_supported?: boolean | undefined + /** Indicates whether the device supports online access codes. */ + online_access_codes_supported?: boolean | undefined + /** Indicates whether the device supports an accessory keypad. */ + accessory_keypad_supported?: boolean | undefined + } } }> } diff --git a/src/lib/seam/connect/unstable/models/devices/unmanaged-device.ts b/src/lib/seam/connect/unstable/models/devices/unmanaged-device.ts index 62007fef..b95971e3 100644 --- a/src/lib/seam/connect/unstable/models/devices/unmanaged-device.ts +++ b/src/lib/seam/connect/unstable/models/devices/unmanaged-device.ts @@ -1,6 +1,6 @@ import { z } from 'zod' -import { managed_device } from './managed-device.js' +import { common_device_properties, managed_device } from './managed-device.js' export const unmanaged_device = managed_device .pick({ @@ -15,31 +15,17 @@ export const unmanaged_device = managed_device }) .extend({ is_managed: z.literal(false), - // todo: should pick from the managed_device schema instead of re-defining - properties: z.object({ - name: z.string(), - online: z.boolean(), - manufacturer: z.string().optional(), - image_url: z.string().optional(), - image_alt_text: z.string().optional(), - model: z.object({ - display_name: z.string(), - manufacturer_display_name: z.string(), - }), - battery_level: z - .number() - .min(0) - .max(1) - .optional() - .describe( - 'Indicates the battery level of the device as a decimal value between 0 and 1, inclusive.', - ), - online_access_codes_enabled: z - .boolean() - .describe( - 'Indicates whether it is currently possible to use online access codes for the device.', - ) - .optional(), + properties: common_device_properties.pick({ + name: true, + online: true, + manufacturer: true, + image_url: true, + image_alt_text: true, + battery_level: true, + battery: true, + online_access_codes_enabled: true, + offline_access_codes_enabled: true, + model: true, }), })