backend: Add recording fields parameter and enhance pagination in getRecordings response
This commit is contained in:
parent
5e11be08b4
commit
754dd3bd35
@ -0,0 +1,9 @@
|
|||||||
|
name: fields
|
||||||
|
in: query
|
||||||
|
description: >
|
||||||
|
The fields to retrieve from the recording.
|
||||||
|
Comma-separated list of fields to include in the response.
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: 'recordingId,roomId'
|
||||||
@ -12,7 +12,7 @@ content:
|
|||||||
$ref: '../schemas/meet-pagination.yaml'
|
$ref: '../schemas/meet-pagination.yaml'
|
||||||
examples:
|
examples:
|
||||||
successful_recording_retrieval:
|
successful_recording_retrieval:
|
||||||
summary: Successfully retrieved a list of recordings
|
summary: Full recording details response with multiple recordings
|
||||||
value:
|
value:
|
||||||
recordings:
|
recordings:
|
||||||
- recordingId: 'room-123--EG_XYZ--XX445'
|
- recordingId: 'room-123--EG_XYZ--XX445'
|
||||||
@ -24,13 +24,6 @@ content:
|
|||||||
duration: 3.6
|
duration: 3.6
|
||||||
size: 1024
|
size: 1024
|
||||||
details: 'Stopped using API'
|
details: 'Stopped using API'
|
||||||
pagination:
|
|
||||||
isTruncated: false
|
|
||||||
|
|
||||||
paginated_recording_list:
|
|
||||||
summary: A paginated response indicating more recordings are available
|
|
||||||
value:
|
|
||||||
recordings:
|
|
||||||
- recordingId: 'room-456--EG_ZYX--XX678'
|
- recordingId: 'room-456--EG_ZYX--XX678'
|
||||||
roomId: 'room-456'
|
roomId: 'room-456'
|
||||||
status: 'COMPLETE'
|
status: 'COMPLETE'
|
||||||
@ -41,12 +34,30 @@ content:
|
|||||||
size: 2048
|
size: 2048
|
||||||
details: 'Recording completed successfully'
|
details: 'Recording completed successfully'
|
||||||
pagination:
|
pagination:
|
||||||
isTruncated: true
|
isTruncated: false
|
||||||
nextPageToken: 'NEXT_PAGE_ABC123'
|
maxItems: 10
|
||||||
|
|
||||||
no_recordings_found:
|
fields=recordingId:
|
||||||
summary: No recordings found for the given query
|
summary: Response with only recordingId for each recording
|
||||||
value:
|
value:
|
||||||
recordings: []
|
recordings:
|
||||||
|
- recordingId: 'room-123--EG_XYZ--XX445'
|
||||||
|
- recordingId: 'room-456--EG_ZYX--XX678'
|
||||||
pagination:
|
pagination:
|
||||||
isTruncated: false
|
isTruncated: false
|
||||||
|
maxItems: 10
|
||||||
|
fields=recordingId,roomId,status,size:
|
||||||
|
summary: Recording details including recordingId, roomId, status, and size
|
||||||
|
value:
|
||||||
|
recordings:
|
||||||
|
- recordingId: 'room-123--EG_XYZ--XX445'
|
||||||
|
roomId: 'room-123'
|
||||||
|
status: 'ACTIVE'
|
||||||
|
size: 1024
|
||||||
|
- recordingId: 'room-456--EG_ZYX--XX678'
|
||||||
|
roomId: 'room-456'
|
||||||
|
status: 'COMPLETE'
|
||||||
|
size: 2048
|
||||||
|
pagination:
|
||||||
|
isTruncated: false
|
||||||
|
maxItems: 10
|
||||||
|
|||||||
@ -8,3 +8,8 @@ properties:
|
|||||||
nextPageToken:
|
nextPageToken:
|
||||||
type: [string, 'null']
|
type: [string, 'null']
|
||||||
description: The token to retrieve the next page of recordings.
|
description: The token to retrieve the next page of recordings.
|
||||||
|
maxItems:
|
||||||
|
type: integer
|
||||||
|
description: >
|
||||||
|
Maximum number of rooms returned in a single response page.
|
||||||
|
Corresponds to the `maxItems` query parameter in the request.
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
# > ⚠️ **Note:** Using this filter may impact performance for large datasets.
|
# > ⚠️ **Note:** Using this filter may impact performance for large datasets.
|
||||||
# schema:
|
# schema:
|
||||||
# type: string
|
# type: string
|
||||||
|
- $ref: '../components/parameters/recording-fields.yaml'
|
||||||
- $ref: '../components/parameters/room-id.yaml'
|
- $ref: '../components/parameters/room-id.yaml'
|
||||||
- $ref: '../components/parameters/max-items.yaml'
|
- $ref: '../components/parameters/max-items.yaml'
|
||||||
- $ref: '../components/parameters/next-page-token.yaml'
|
- $ref: '../components/parameters/next-page-token.yaml'
|
||||||
|
|||||||
@ -36,8 +36,17 @@ export const getRecordings = async (req: Request, res: Response) => {
|
|||||||
logger.verbose('Getting all recordings');
|
logger.verbose('Getting all recordings');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await recordingService.getAllRecordings(queryParams);
|
const { recordings, isTruncated, nextPageToken } = await recordingService.getAllRecordings(queryParams);
|
||||||
return res.status(200).json(response);
|
const maxItems = Number(queryParams.maxItems);
|
||||||
|
|
||||||
|
return res.status(200).json({
|
||||||
|
recordings,
|
||||||
|
pagination: {
|
||||||
|
isTruncated,
|
||||||
|
nextPageToken,
|
||||||
|
maxItems
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof OpenViduMeetError) {
|
if (error instanceof OpenViduMeetError) {
|
||||||
logger.error(`Error getting all recordings: ${error.message}`);
|
logger.error(`Error getting all recordings: ${error.message}`);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user