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
1 change: 1 addition & 0 deletions src/lib/seam/connect/internal/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export {
magic_link,
access_code as managed_access_code,
device as managed_device,
media,
message_overrides,
neutral_resource,
noise_sensor_device_type,
Expand Down
1 change: 1 addition & 0 deletions src/lib/seam/connect/model-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type {
DeviceWarning,
InstantKey,
MagicLink,
Media,
NoiseThreshold,
Pagination,
SeamEvent,
Expand Down
12 changes: 9 additions & 3 deletions src/lib/seam/connect/models/events/devices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,11 @@ export const camera_activated_event = device_event.extend({
.url()
.optional()
.describe('URL to a short video clip captured at the time of activation.'),
media_status: z
.enum(['pending', 'available', 'unavailable', 'failed'])
media_ids: z
.array(z.string().uuid())
.optional()
.describe(
'Status of the recorded clip and thumbnail for this activation, when the camera supports event recordings. `pending` while Seam retrieves the recording, `available` once it is stored, `unavailable` if no recording covers the activation, and `failed` if retrieval failed.',
'IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one.',
),
}).describe(`
---
Expand All @@ -883,6 +883,12 @@ export const device_doorbell_rang_event = device_event.extend({
.describe(
'URL to a short video clip captured at the time the doorbell was pressed.',
),
media_ids: z
.array(z.string().uuid())
.optional()
.describe(
'IDs of the media, such as a video clip and a thumbnail image, captured when the doorbell was pressed. Use `/media/get` to retrieve each one.',
),
}).describe(`
---
route_path: /devices
Expand Down
1 change: 1 addition & 0 deletions src/lib/seam/connect/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from './datetime.js'
export * from './devices/index.js'
export * from './events/index.js'
export * from './instant-keys/index.js'
export * from './media/index.js'
export * from './noise-sensors/index.js'
export * from './pagination.js'
export * from './partner/index.js'
Expand Down
1 change: 1 addition & 0 deletions src/lib/seam/connect/models/media/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './media.js'
55 changes: 55 additions & 0 deletions src/lib/seam/connect/models/media/media.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import * as z from 'zod/v3'

import { datetime } from '../datetime.js'

export const media = z.object({
media_id: z.string().uuid().describe('ID of the media.'),
workspace_id: z
.string()
.uuid()
.describe('ID of the workspace that contains the media.'),
device_id: z
.string()
.uuid()
.nullable()
.describe('ID of the device that captured the media.'),
event_id: z
.string()
.uuid()
.nullable()
.describe('ID of the event that the media belongs to.'),
media_type: z
.enum(['video', 'image'])
.describe('Type of the media: a video clip or a still image.'),
content_type: z
.string()
.nullable()
.describe('MIME type of the media, such as `video/mp4` or `image/jpeg`.'),
status: z
.enum(['pending', 'available', 'unavailable', 'failed'])
.describe(
'Status of the media. `pending` means that Seam is still retrieving the media. `available` means that `url` can be used to download it. `unavailable` means that no media exists for the event, and `failed` means that Seam could not retrieve it.',
),
url: z
.string()
.url()
.nullable()
.describe(
'Short-lived URL from which you can download the media. Null unless `status` is `available`. The URL expires after about five minutes. Call `/media/get` again for a new URL.',
),
expires_at: datetime
.nullable()
.describe(
'Date and time at which the media stops being available. Null when Seam does not know when the media expires.',
),
created_at: datetime.describe(
'Date and time at which the media was created.',
),
}).describe(`
---
route_path: /media
---
Represents a piece of media, such as a video clip or a thumbnail image, that a device captured for an event. Media is in beta.
`)

export type Media = z.infer<typeof media>
158 changes: 154 additions & 4 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29172,11 +29172,11 @@ const openapi: OpenAPISpec = {
format: 'uri',
type: 'string',
},
media_status: {
media_ids: {
description:
'Status of the recorded clip and thumbnail for this activation, when the camera supports event recordings. `pending` while Seam retrieves the recording, `available` once it is stored, `unavailable` if no recording covers the activation, and `failed` if retrieval failed.',
enum: ['pending', 'available', 'unavailable', 'failed'],
type: 'string',
'IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one.',
items: { format: 'uuid', type: 'string' },
type: 'array',
},
motion_sub_type: {
description: 'Sub-type of motion detected, if available.',
Expand Down Expand Up @@ -29270,6 +29270,12 @@ const openapi: OpenAPISpec = {
format: 'uri',
type: 'string',
},
media_ids: {
description:
'IDs of the media, such as a video clip and a thumbnail image, captured when the doorbell was pressed. Use `/media/get` to retrieve each one.',
items: { format: 'uuid', type: 'string' },
type: 'array',
},
occurred_at: {
description: 'Date and time at which the event occurred.',
format: 'date-time',
Expand Down Expand Up @@ -29732,6 +29738,84 @@ const openapi: OpenAPISpec = {
'x-route-path': '/unstable_partner/building_blocks',
'x-undocumented': 'Unreleased.',
},
media: {
description:
'Represents a piece of media, such as a video clip or a thumbnail image, that a device captured for an event. Media is in beta.',
properties: {
content_type: {
description:
'MIME type of the media, such as `video/mp4` or `image/jpeg`.',
nullable: true,
type: 'string',
},
created_at: {
description: 'Date and time at which the media was created.',
format: 'date-time',
type: 'string',
},
device_id: {
description: 'ID of the device that captured the media.',
format: 'uuid',
nullable: true,
type: 'string',
},
event_id: {
description: 'ID of the event that the media belongs to.',
format: 'uuid',
nullable: true,
type: 'string',
},
expires_at: {
description:
'Date and time at which the media stops being available. Null when Seam does not know when the media expires.',
format: 'date-time',
nullable: true,
type: 'string',
},
media_id: {
description: 'ID of the media.',
format: 'uuid',
type: 'string',
},
media_type: {
description: 'Type of the media: a video clip or a still image.',
enum: ['video', 'image'],
type: 'string',
},
status: {
description:
'Status of the media. `pending` means that Seam is still retrieving the media. `available` means that `url` can be used to download it. `unavailable` means that no media exists for the event, and `failed` means that Seam could not retrieve it.',
enum: ['pending', 'available', 'unavailable', 'failed'],
type: 'string',
},
url: {
description:
'Short-lived URL from which you can download the media. Null unless `status` is `available`. The URL expires after about five minutes. Call `/media/get` again for a new URL.',
format: 'uri',
nullable: true,
type: 'string',
},
workspace_id: {
description: 'ID of the workspace that contains the media.',
format: 'uuid',
type: 'string',
},
},
required: [
'media_id',
'workspace_id',
'device_id',
'event_id',
'media_type',
'content_type',
'status',
'url',
'expires_at',
'created_at',
],
type: 'object',
'x-route-path': '/media',
},
noise_threshold: {
description:
'Represents a [noise threshold](https://www.seam.co/docs/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://www.seam.co/docs/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them.',
Expand Down Expand Up @@ -55215,6 +55299,72 @@ const openapi: OpenAPISpec = {
'x-title': 'Unlock a Lock',
},
},
'/media/get': {
get: {
description:
'Returns a specified piece of media, such as a video clip or thumbnail image captured for a camera event, with a short-lived URL from which you can download it. Camera events list their media in `media_ids`. This endpoint is in beta.',
operationId: 'mediaGetGet',
parameters: [
{
in: 'query',
name: 'media_id',
required: true,
schema: {
description: 'ID of the media that you want to get.',
format: 'uuid',
type: 'string',
},
},
{
in: 'query',
name: 'format',
required: false,
schema: {
default: 'json',
description:
"Response format. `json` returns the media object. `redirect` responds with a `302` redirect to the media's download URL, so you can use this endpoint directly as the source of an image or video.",
enum: ['json', 'redirect'],
type: 'string',
},
},
],
responses: {
'200': {
content: {
'application/json': {
schema: {
properties: {
media: { $ref: '#/components/schemas/media' },
ok: { type: 'boolean' },
},
required: ['media', 'ok'],
type: 'object',
},
},
},
description: 'OK',
},
'400': { description: 'Bad Request' },
'401': { description: 'Unauthorized' },
},
security: [
{ api_key: [] },
{ pat_with_workspace: [] },
{ console_session_with_workspace: [] },
{ client_session: [] },
{ client_session_with_customer: [] },
{ client_session_with_customer_ro: [] },
{ support_read_only_token: [] },
],
summary: '/media/get',
tags: [],
'x-fern-sdk-group-name': ['media'],
'x-fern-sdk-method-name': 'get',
'x-fern-sdk-return-value': 'media',
'x-response-key': 'media',
'x-title': 'Get Media',
},
},
'/noise_sensors/list': {
get: {
description:
Expand Down
Loading
Loading