backend: Remove status filter from recording API and related validation
This commit is contained in:
parent
94de7d6610
commit
195b56a4b4
@ -505,27 +505,27 @@ paths:
|
||||
security:
|
||||
- apiKeyInHeader: []
|
||||
parameters:
|
||||
- name: status
|
||||
in: query
|
||||
required: false
|
||||
description: |
|
||||
Filter recordings by their status.
|
||||
# - name: status
|
||||
# in: query
|
||||
# required: false
|
||||
# description: |
|
||||
# Filter recordings by their status.
|
||||
|
||||
Possible values:
|
||||
- `STARTING`
|
||||
- `ACTIVE`
|
||||
- `ENDING`
|
||||
- `COMPLETE`
|
||||
- `FAILED`
|
||||
- `ABORTED`
|
||||
- `LIMITED_REACHED`
|
||||
# Possible values:
|
||||
# - `STARTING`
|
||||
# - `ACTIVE`
|
||||
# - `ENDING`
|
||||
# - `COMPLETE`
|
||||
# - `FAILED`
|
||||
# - `ABORTED`
|
||||
# - `LIMITED_REACHED`
|
||||
|
||||
You can provide multiple statuses as a comma-separated list (e.g., `status=ACTIVE,FAILED`).
|
||||
If not specified, recordings with any status will be returned.
|
||||
# You can provide multiple statuses as a comma-separated list (e.g., `status=ACTIVE,FAILED`).
|
||||
# If not specified, recordings with any status will be returned.
|
||||
|
||||
> ⚠️ **Note:** Using this filter may impact performance for large datasets.
|
||||
schema:
|
||||
type: string
|
||||
# > ⚠️ **Note:** Using this filter may impact performance for large datasets.
|
||||
# schema:
|
||||
# type: string
|
||||
- name: roomId
|
||||
in: query
|
||||
required: false
|
||||
|
||||
@ -50,7 +50,7 @@ const GetRecordingsFiltersSchema: z.ZodType<MeetRecordingFilters> = z.object({
|
||||
.optional()
|
||||
.transform((val = 10) => (val > 100 ? 100 : val))
|
||||
.default(10),
|
||||
status: z.string().optional(),
|
||||
// status: z.string().optional(),
|
||||
roomId: z.string().optional(),
|
||||
nextPageToken: z.string().optional()
|
||||
});
|
||||
|
||||
@ -224,7 +224,7 @@ export class RecordingService {
|
||||
* - `nextPageToken`: (Optional) A token to retrieve the next page of results, if available.
|
||||
* @throws Will throw an error if there is an issue retrieving the recordings.
|
||||
*/
|
||||
async getAllRecordings({ maxItems, nextPageToken, roomId, status }: MeetRecordingFilters): Promise<{
|
||||
async getAllRecordings({ maxItems, nextPageToken, roomId }: MeetRecordingFilters): Promise<{
|
||||
recordings: MeetRecordingInfo[];
|
||||
isTruncated: boolean;
|
||||
nextPageToken?: string;
|
||||
@ -253,22 +253,7 @@ export class RecordingService {
|
||||
}
|
||||
});
|
||||
|
||||
let recordings: MeetRecordingInfo[] = await Promise.all(promises);
|
||||
|
||||
if (status) {
|
||||
// Filter recordings by status if a status filter is provided
|
||||
// status is already an array of RegExp after middleware validation.
|
||||
|
||||
const statusArray = status
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.map((s) => new RegExp(this.sanitizeRegExp(s)));
|
||||
|
||||
recordings = recordings.filter((recording) =>
|
||||
statusArray.some((regex) => regex.test(recording.status))
|
||||
);
|
||||
}
|
||||
const recordings: MeetRecordingInfo[] = await Promise.all(promises);
|
||||
|
||||
this.logger.info(`Retrieved ${recordings.length} recordings.`);
|
||||
// Return the paginated list of recordings
|
||||
@ -513,7 +498,9 @@ export class RecordingService {
|
||||
}
|
||||
|
||||
// Reject the REST request with a timeout error.
|
||||
rejectRequest(new Error(`Timeout waiting for '${SystemEventType.RECORDING_ACTIVE}' event in room '${roomId}'`));
|
||||
rejectRequest(
|
||||
new Error(`Timeout waiting for '${SystemEventType.RECORDING_ACTIVE}' event in room '${roomId}'`)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user