Skip to content
Merged
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
31 changes: 31 additions & 0 deletions src/lib/seam/connect/models/events/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,35 @@ export const device_name_changed_event = device_event.extend({

export type DeviceNameChangedEvent = z.infer<typeof device_name_changed_event>

export const camera_activated_event = device_event.extend({
event_type: z.literal('camera.activated'),
activation_reason: z
.enum(['motion_detected'])
.describe('The reason the camera was activated.'),
motion_sub_type: z
.enum(['human', 'vehicle', 'package', 'other'])
.optional()
.describe('Sub-type of motion detected, if available.'),
}).describe(`
---
route_path: /devices
---
A [camera](https://docs.seam.co/latest/core-concepts/devices) was activated, for example, by motion detection.
`)

export type CameraActivatedEvent = z.infer<typeof camera_activated_event>

export const device_doorbell_rang_event = device_event.extend({
event_type: z.literal('device.doorbell_rang'),
}).describe(`
---
route_path: /devices
---
A doorbell button was pressed on a [device](https://docs.seam.co/latest/core-concepts/devices).
`)

export type DeviceDoorbellRangEvent = z.infer<typeof device_doorbell_rang_event>

export const device_events = [
device_connected_event,
device_added_event,
Expand Down Expand Up @@ -740,4 +769,6 @@ export const device_events = [
temperature_reached_set_point_event,
temperature_changed_event,
device_name_changed_event,
camera_activated_event,
device_doorbell_rang_event,
] as const
169 changes: 169 additions & 0 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23086,6 +23086,159 @@ export default {
type: 'object',
'x-route-path': '/devices',
},
{
description:
'A [camera](https://docs.seam.co/latest/core-concepts/devices) was activated, for example, by motion detection.',
properties: {
activation_reason: {
description: 'The reason the camera was activated.',
enum: ['motion_detected'],
type: 'string',
},
connected_account_custom_metadata: {
additionalProperties: {
oneOf: [{ type: 'string' }, { type: 'boolean' }],
},
description:
'Custom metadata of the connected account, present when connected_account_id is provided.',
type: 'object',
},
connected_account_id: {
description:
'ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts) associated with the event.',
format: 'uuid',
type: 'string',
},
created_at: {
description: 'Date and time at which the event was created.',
format: 'date-time',
type: 'string',
},
customer_key: {
description:
'The customer key associated with the device, if any.',
type: 'string',
},
device_custom_metadata: {
additionalProperties: {
oneOf: [{ type: 'string' }, { type: 'boolean' }],
},
description:
'Custom metadata of the device, present when device_id is provided.',
type: 'object',
},
device_id: {
description: 'ID of the affected device.',
format: 'uuid',
type: 'string',
},
event_id: {
description: 'ID of the event.',
format: 'uuid',
type: 'string',
},
event_type: { enum: ['camera.activated'], type: 'string' },
motion_sub_type: {
description: 'Sub-type of motion detected, if available.',
enum: ['human', 'vehicle', 'package', 'other'],
type: 'string',
},
occurred_at: {
description: 'Date and time at which the event occurred.',
format: 'date-time',
type: 'string',
},
workspace_id: {
description:
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) associated with the event.',
format: 'uuid',
type: 'string',
},
},
required: [
'event_id',
'workspace_id',
'created_at',
'occurred_at',
'device_id',
'connected_account_id',
'event_type',
'activation_reason',
],
type: 'object',
'x-route-path': '/devices',
},
{
description:
'A doorbell button was pressed on a [device](https://docs.seam.co/latest/core-concepts/devices).',
properties: {
connected_account_custom_metadata: {
additionalProperties: {
oneOf: [{ type: 'string' }, { type: 'boolean' }],
},
description:
'Custom metadata of the connected account, present when connected_account_id is provided.',
type: 'object',
},
connected_account_id: {
description:
'ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts) associated with the event.',
format: 'uuid',
type: 'string',
},
created_at: {
description: 'Date and time at which the event was created.',
format: 'date-time',
type: 'string',
},
customer_key: {
description:
'The customer key associated with the device, if any.',
type: 'string',
},
device_custom_metadata: {
additionalProperties: {
oneOf: [{ type: 'string' }, { type: 'boolean' }],
},
description:
'Custom metadata of the device, present when device_id is provided.',
type: 'object',
},
device_id: {
description: 'ID of the affected device.',
format: 'uuid',
type: 'string',
},
event_id: {
description: 'ID of the event.',
format: 'uuid',
type: 'string',
},
event_type: { enum: ['device.doorbell_rang'], type: 'string' },
occurred_at: {
description: 'Date and time at which the event occurred.',
format: 'date-time',
type: 'string',
},
workspace_id: {
description:
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) associated with the event.',
format: 'uuid',
type: 'string',
},
},
required: [
'event_id',
'workspace_id',
'created_at',
'occurred_at',
'device_id',
'connected_account_id',
'event_type',
],
type: 'object',
'x-route-path': '/devices',
},
{
description:
'An [enrollment automation](https://docs.seam.co/latest/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut) was deleted.',
Expand Down Expand Up @@ -54914,6 +55067,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -55026,6 +55181,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -55471,6 +55628,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -55579,6 +55738,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -64693,6 +64854,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -64806,6 +64969,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -64982,6 +65147,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down Expand Up @@ -65090,6 +65257,8 @@ export default {
'thermostat.temperature_reached_set_point',
'thermostat.temperature_changed',
'device.name_changed',
'camera.activated',
'device.doorbell_rang',
'enrollment_automation.deleted',
'phone.deactivated',
'space.device_membership_changed',
Expand Down
Loading
Loading