Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update via seamapi/seam-connect@c981995bfb41ed1ec2e86d8ca8409b8640bb024b #398

Closed
Closed
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
71 changes: 64 additions & 7 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,26 +1851,83 @@ 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.',
maximum: 1,
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.',
Expand Down
60 changes: 52 additions & 8 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
Expand Down Expand Up @@ -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
}
}
}>
}
Expand Down
38 changes: 12 additions & 26 deletions src/lib/seam/connect/unstable/models/devices/unmanaged-device.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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,
}),
})

Expand Down