diff --git a/src/lib/seam/connect/internal/schemas.ts b/src/lib/seam/connect/internal/schemas.ts index c667ff40..1b78c3c6 100644 --- a/src/lib/seam/connect/internal/schemas.ts +++ b/src/lib/seam/connect/internal/schemas.ts @@ -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, diff --git a/src/lib/seam/connect/model-types.ts b/src/lib/seam/connect/model-types.ts index f1e8479b..15b16f33 100644 --- a/src/lib/seam/connect/model-types.ts +++ b/src/lib/seam/connect/model-types.ts @@ -29,6 +29,7 @@ export type { DeviceWarning, InstantKey, MagicLink, + Media, NoiseThreshold, Pagination, SeamEvent, diff --git a/src/lib/seam/connect/models/events/devices.ts b/src/lib/seam/connect/models/events/devices.ts index 1a29a80f..0067d1f8 100644 --- a/src/lib/seam/connect/models/events/devices.ts +++ b/src/lib/seam/connect/models/events/devices.ts @@ -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(` --- @@ -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 diff --git a/src/lib/seam/connect/models/index.ts b/src/lib/seam/connect/models/index.ts index 4d827db4..082956d1 100644 --- a/src/lib/seam/connect/models/index.ts +++ b/src/lib/seam/connect/models/index.ts @@ -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' diff --git a/src/lib/seam/connect/models/media/index.ts b/src/lib/seam/connect/models/media/index.ts new file mode 100644 index 00000000..81d6018b --- /dev/null +++ b/src/lib/seam/connect/models/media/index.ts @@ -0,0 +1 @@ +export * from './media.js' diff --git a/src/lib/seam/connect/models/media/media.ts b/src/lib/seam/connect/models/media/media.ts new file mode 100644 index 00000000..fb66c0fd --- /dev/null +++ b/src/lib/seam/connect/models/media/media.ts @@ -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 diff --git a/src/lib/seam/connect/openapi.ts b/src/lib/seam/connect/openapi.ts index c97057b0..3d47493c 100644 --- a/src/lib/seam/connect/openapi.ts +++ b/src/lib/seam/connect/openapi.ts @@ -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.', @@ -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', @@ -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.', @@ -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: diff --git a/src/lib/seam/connect/route-types.ts b/src/lib/seam/connect/route-types.ts index 3a93a5ff..93dede27 100644 --- a/src/lib/seam/connect/route-types.ts +++ b/src/lib/seam/connect/route-types.ts @@ -62748,10 +62748,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time of activation. */ video_url?: string | undefined - /** 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. */ - media_status?: - | ('pending' | 'available' | 'unavailable' | 'failed') - | undefined + /** IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -62787,6 +62785,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time the doorbell was pressed. */ video_url?: string | undefined + /** 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. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -67045,9 +67045,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time of activation. */ video_url?: string | undefined - /** 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. */ - media_status?: - ('pending' | 'available' | 'unavailable' | 'failed') | undefined + /** IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -67083,6 +67082,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time the doorbell was pressed. */ video_url?: string | undefined + /** 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. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -85914,6 +85915,45 @@ export type Routes = { } maxDuration: undefined } + '/media/get': { + route: '/media/get' + method: 'GET' | 'POST' + queryParams: {} + jsonBody: {} + commonParams: { + /** ID of the media that you want to get. */ + media_id: string + /** 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. */ + format?: 'json' | 'redirect' + } + formData: {} + jsonResponse: { + /** 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. */ + media: { + /** ID of the media. */ + media_id: string + /** ID of the workspace that contains the media. */ + workspace_id: string + /** ID of the device that captured the media. */ + device_id: string | null + /** ID of the event that the media belongs to. */ + event_id: string | null + /** Type of the media: a video clip or a still image. */ + media_type: 'video' | 'image' + /** MIME type of the media, such as `video/mp4` or `image/jpeg`. */ + content_type: string | null + /** 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. */ + status: 'pending' | 'available' | 'unavailable' | 'failed' + /** 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. */ + url: string | null + /** Date and time at which the media stops being available. Null when Seam does not know when the media expires. */ + expires_at: string | null + /** Date and time at which the media was created. */ + created_at: string + } + } + maxDuration: undefined + } '/noise_sensors/list': { route: '/noise_sensors/list' method: 'GET' | 'POST' @@ -105585,9 +105625,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time of activation. */ video_url?: string | undefined - /** 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. */ - media_status?: - ('pending' | 'available' | 'unavailable' | 'failed') | undefined + /** IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -105623,6 +105662,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time the doorbell was pressed. */ video_url?: string | undefined + /** 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. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -112226,9 +112267,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time of activation. */ video_url?: string | undefined - /** 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. */ - media_status?: - ('pending' | 'available' | 'unavailable' | 'failed') | undefined + /** IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -112264,6 +112304,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time the doorbell was pressed. */ video_url?: string | undefined + /** 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. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -160555,10 +160597,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time of activation. */ video_url?: string | undefined - /** 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. */ - media_status?: - | ('pending' | 'available' | 'unavailable' | 'failed') - | undefined + /** IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ @@ -160594,6 +160634,8 @@ export type Routes = { image_url?: string | undefined /** URL to a short video clip captured at the time the doorbell was pressed. */ video_url?: string | undefined + /** 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. */ + media_ids?: string[] | undefined } | { /** ID of the event. */ diff --git a/src/lib/seam/connect/schemas.ts b/src/lib/seam/connect/schemas.ts index 8efdc286..5897232d 100644 --- a/src/lib/seam/connect/schemas.ts +++ b/src/lib/seam/connect/schemas.ts @@ -25,6 +25,7 @@ export { device_provider, instant_key, magic_link, + media, noise_threshold, pagination, seam_event,