Refactor webcomponent events to use camelCase and enums to use snake_case naming conventions

This commit is contained in:
juancarmore 2025-09-09 20:01:48 +02:00
parent df6ebaa49a
commit 686af46102
29 changed files with 132 additions and 132 deletions

View File

@ -4,16 +4,16 @@ required: false
description: |
Filter recordings by their status.
You can provide multiple statuses as a comma-separated list (e.g., `status=ACTIVE,FAILED`).
You can provide multiple statuses as a comma-separated list (e.g., `status=active,failed`).
> ⚠️ **Note:** Using this filter may impact performance for large datasets.
schema:
type: string
enum:
- STARTING
- ACTIVE
- ENDING
- COMPLETE
- FAILED
- ABORTED
- LIMIT_REACHED
- starting
- active
- ending
- complete
- failed
- aborted
- limit_reached

View File

@ -7,7 +7,7 @@ content:
recordingId: 'room-123--EG_XYZ--XX445'
roomId: 'room-123'
roomName: 'room'
status: 'ACTIVE'
status: 'active'
filename: 'room-123--XX445.mp4'
startDate: 1600000000000
headers:

View File

@ -13,7 +13,7 @@ content:
recordingId: 'room-123--EG_XYZ--XX445'
roomId: 'room-123'
roomName: 'room'
status: 'ENDING'
status: 'ending'
filename: 'room-123--XX445.mp4'
startDate: 1600000000000
details: 'End reason: StopEgress API'

View File

@ -10,7 +10,7 @@ content:
recordingId: 'room-123--EG_XYZ--XX445'
roomId: 'room-123'
roomName: 'room'
status: 'COMPLETE'
status: 'complete'
filename: 'room-123--XX445.mp4'
startDate: 1600000000000
endDate: 1600000003600
@ -24,6 +24,6 @@ content:
recordingId: 'room-456--EG_ABC--QR789'
roomId: 'room-456'
roomName: 'room'
status: 'ACTIVE'
status: 'active'
filename: 'room-456--QR789.mp4'
startDate: 1682500000000

View File

@ -18,7 +18,7 @@ content:
- recordingId: 'room-123--EG_XYZ--XX445'
roomId: 'room-123'
roomName: 'room'
status: 'ACTIVE'
status: 'active'
filename: 'room-123--XX445.mp4'
startDate: 1620000000000
endDate: 1620000003600
@ -28,7 +28,7 @@ content:
- recordingId: 'room-456--EG_ZYX--XX678'
roomId: 'room-456'
roomName: 'room'
status: 'COMPLETE'
status: 'complete'
filename: 'room-456--XX678.mp4'
startDate: 1625000000000
endDate: 1625000007200
@ -54,11 +54,11 @@ content:
recordings:
- recordingId: 'room-123--EG_XYZ--XX445'
roomId: 'room-123'
status: 'ACTIVE'
status: 'active'
size: 1024
- recordingId: 'room-456--EG_ZYX--XX678'
roomId: 'room-456'
status: 'COMPLETE'
status: 'complete'
size: 2048
pagination:
isTruncated: false

View File

@ -13,12 +13,12 @@ AuthenticationPreferences:
type:
type: string
enum:
- single-user
default: single-user
example: single-user
- single_user
default: single_user
example: single_user
description: |
Specifies the authentication method used to access the application.
- `single-user`: Only one user account exists, which has administrative privileges and is used for all access.
- `single_user`: Only one user account exists, which has administrative privileges and is used for all access.
authModeToAccessRoom:
type: string
enum:

View File

@ -19,8 +19,8 @@ properties:
# The output mode of the recording. Possible value: "COMPOSED".
status:
type: string
enum: ['STARTING', 'ACTIVE', 'ENDING', 'COMPLETE', 'FAILED', 'ABORTED', 'LIMIT_REACHED']
example: 'ACTIVE'
enum: ['starting', 'active', 'ending', 'complete', 'failed', 'aborted', 'limit_reached']
example: 'active'
description: The status of the recording.
filename:
type: string

View File

@ -30,15 +30,15 @@ MeetRecordingPreferences:
type: string
enum:
- admin
- admin-moderator
- admin-moderator-speaker
default: admin-moderator-speaker
example: admin-moderator-speaker
- admin_moderator
- admin_moderator_speaker
default: admin_moderator_speaker
example: admin_moderator_speaker
description: |
Defines who can access the recording. Options are:
- `admin`: Only administrators can access the recording.
- `admin-moderator`: Administrators and moderators can access the recording.
- `admin-moderator-speaker`: Administrators, moderators and speakers can access the recording.
- `admin_moderator`: Administrators and moderators can access the recording.
- `admin_moderator_speaker`: Administrators, moderators and speakers can access the recording.
MeetVirtualBackgroundPreferences:
type: object
properties:

View File

@ -38,7 +38,7 @@
description: |
Stops a recording with the specified recording ID.
> **Note:** The recording must be in an `ACTIVE` state; otherwise, a 409 error is returned.
> **Note:** The recording must be in an `active` state; otherwise, a 409 error is returned.
tags:
- Internal API - Recordings
security:

View File

@ -146,7 +146,7 @@
Deletes a recording with the specified recording ID.
> ⚠️ **Note:** The recording will only be deleted if it exists and is not in progress
> (i.e., not in a state such as `ACTIVE`, `STARTING`, or `ENDING`).
> (i.e., not in a state such as `active`, `starting`, or `ending`).
tags:
- OpenVidu Meet - Recordings
security:

View File

@ -4,7 +4,7 @@ recordingStarted:
description: |
This webhook is triggered when a recording starts.
> The recording can be in the `STARTING` status for a few seconds before it becomes `ACTIVE`.
> The recording can be in the `starting` status for a few seconds before it becomes `active`.
operationId: recordingStartedWebhook
parameters:
- $ref: ../components/parameters/x-timestamp.yaml
@ -26,8 +26,8 @@ recordingStarted:
- $ref: ../components/schemas/recording-base.yaml
- properties:
status:
enum: [STARTING, ACTIVE]
example: STARTING
enum: [starting, active]
example: starting
responses:
'200':
$ref: ../components/responses/webhook-success.yaml
@ -38,7 +38,7 @@ recordingUpdated:
description: |
This webhook is triggered when a recording update occurs.
> This update can be due to a change in the recording status (e.g., from `STARTING` to `ACTIVE`).
> This update can be due to a change in the recording status (e.g., from `starting` to `active`).
operationId: recordingUpdatedWebhook
parameters:
- $ref: ../components/parameters/x-timestamp.yaml
@ -60,8 +60,8 @@ recordingUpdated:
- $ref: ../components/schemas/recording-base.yaml
- properties:
status:
enum: [ACTIVE, ENDING]
example: ACTIVE
enum: [active, ending]
example: active
responses:
'200':
$ref: ../components/responses/webhook-success.yaml
@ -100,8 +100,8 @@ recordingEnded:
- $ref: ../components/schemas/recording-base.yaml
- properties:
status:
enum: [COMPLETE, FAILED, ABORTED, LIMIT_REACHED]
example: COMPLETE
enum: [complete, failed, aborted, limit_reached]
example: complete
endDate:
type: number
description: The date when the recording ended (milliseconds since the Unix epoch).

View File

@ -361,7 +361,7 @@ export const expectValidStartRecordingResponse = (response: any, roomId: string,
expect(response.body).toHaveProperty('roomId', roomId);
expect(response.body).toHaveProperty('roomName', roomName);
expect(response.body).toHaveProperty('startDate');
expect(response.body).toHaveProperty('status', 'ACTIVE');
expect(response.body).toHaveProperty('status', 'active');
expect(response.body).toHaveProperty('filename');
expect(response.body).not.toHaveProperty('duration');
expect(response.body).not.toHaveProperty('endDate');

View File

@ -84,7 +84,7 @@ describe('Security Preferences API Tests', () => {
expectValidationError(
response,
'authentication.authMethod.type',
"Invalid enum value. Expected 'single-user', received 'invalid'"
"Invalid enum value. Expected 'single_user', received 'invalid'"
);
});

View File

@ -27,14 +27,14 @@ describe('Room API Tests', () => {
});
describe('Generate Recording Token Tests', () => {
it('should generate a recording token with canRetrieve and canDelete permissions when using the moderator secret and recording access is admin-moderator', async () => {
it('should generate a recording token with canRetrieve and canDelete permissions when using the moderator secret and recording access is admin_moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const response = await generateRecordingToken(roomData.room.roomId, roomData.moderatorSecret);
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.MODERATOR, true, true);
});
it('should generate a recording token with canRetrieve and canDelete permissions when using the moderator secret and recording access is admin-moderator-speaker', async () => {
it('should generate a recording token with canRetrieve and canDelete permissions when using the moderator secret and recording access is admin_moderator_speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -44,14 +44,14 @@ describe('Room API Tests', () => {
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.MODERATOR, true, true);
});
it('should generate a recording token without any permissions when using the speaker secret and recording access is admin-moderator', async () => {
it('should generate a recording token without any permissions when using the speaker secret and recording access is admin_moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const response = await generateRecordingToken(roomData.room.roomId, roomData.speakerSecret);
expectValidRecordingTokenResponse(response, roomData.room.roomId, ParticipantRole.SPEAKER, false, false);
});
it('should generate a recording token with canRetrieve permission but not canDelete when using the speaker secret and recording access is admin-moderator-speaker', async () => {
it('should generate a recording token with canRetrieve permission but not canDelete when using the speaker secret and recording access is admin_moderator_speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER

View File

@ -169,7 +169,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -183,7 +183,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -197,7 +197,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -208,7 +208,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -233,7 +233,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -249,7 +249,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -265,7 +265,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -278,7 +278,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -362,7 +362,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(404);
});
it('should fail when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should fail when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -378,7 +378,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -394,7 +394,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(404);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -407,7 +407,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -449,7 +449,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(400);
});
it('should fail when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should fail when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -466,7 +466,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -483,7 +483,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(400);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -497,7 +497,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -527,7 +527,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -543,7 +543,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -559,7 +559,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -572,7 +572,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -651,7 +651,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -667,7 +667,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -683,7 +683,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -696,7 +696,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -727,7 +727,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is speaker', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -744,7 +744,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should succeed when recording access is admin-moderator-speaker and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator_speaker and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(
roomData.room.roomId,
MeetRecordingAccess.ADMIN_MODERATOR_SPEAKER
@ -761,7 +761,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(200);
});
it('should fail when recording access is admin-moderator and participant is speaker', async () => {
it('should fail when recording access is admin_moderator and participant is speaker', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,
@ -775,7 +775,7 @@ describe('Recording API Security Tests', () => {
expect(response.status).toBe(403);
});
it('should succeed when recording access is admin-moderator and participant is moderator', async () => {
it('should succeed when recording access is admin_moderator and participant is moderator', async () => {
await updateRecordingAccessPreferencesInRoom(roomData.room.roomId, MeetRecordingAccess.ADMIN_MODERATOR);
const recordingCookie = await generateRecordingTokenCookie(
roomData.room.roomId,

View File

@ -125,7 +125,7 @@
<div class="video-unavailable-content">
<mat-icon class="status-icon">{{ getStatusIcon() }}</mat-icon>
<h3>{{ getStatusMessage() }}</h3>
@if (['STARTING', 'ACTIVE', 'ENDING'].includes(recording.status)) {
@if (['starting', 'active', 'ending'].includes(recording.status)) {
<p>The recording is still being processed. Please check back in a few minutes.</p>
<button mat-raised-button color="primary" (click)="retryLoad()">
<mat-icon>refresh</mat-icon>

View File

@ -141,17 +141,17 @@
.status-icon {
@include ov-icon(sm);
&.COMPLETE {
&.complete {
color: var(--ov-meet-color-success);
}
&.STARTING,
&.ACTIVE,
&.ENDING {
&.starting,
&.active,
&.ending {
color: var(--ov-meet-color-warning);
}
&.FAILED {
&.failed {
color: var(--ov-meet-color-error);
}
}

View File

@ -49,48 +49,48 @@ test.describe('Web Component E2E Tests', () => {
});
test.describe('Event Handling', () => {
test('should successfully join as moderator and receive JOINED event', async ({ page }) => {
test('should successfully join as moderator and receive joined event', async ({ page }) => {
await joinRoomAs('moderator', participantName, page);
await page.waitForSelector('.event-JOINED');
const joinElements = await page.locator('.event-JOINED').all();
await page.waitForSelector('.event-joined');
const joinElements = await page.locator('.event-joined').all();
expect(joinElements.length).toBe(1);
});
test('should successfully join as speaker and receive JOINED event', async ({ page }) => {
test('should successfully join as speaker and receive joined event', async ({ page }) => {
await joinRoomAs('speaker', participantName, page);
await page.waitForSelector('.event-JOINED');
const joinElements = await page.locator('.event-JOINED').all();
await page.waitForSelector('.event-joined');
const joinElements = await page.locator('.event-joined').all();
expect(joinElements.length).toBe(1);
});
test('should successfully join to room and receive LEFT event when using leave command', async ({ page }) => {
test('should successfully join to room and receive left event when using leave command', async ({ page }) => {
await joinRoomAs('moderator', participantName, page);
await page.click('#leave-room-btn');
await page.waitForSelector('.event-LEFT');
const leftElements = await page.locator('.event-LEFT').all();
await page.waitForSelector('.event-left');
const leftElements = await page.locator('.event-left').all();
expect(leftElements.length).toBe(1);
});
test('should successfully join to room and receive LEFT event when using disconnect button', async ({
test('should successfully join to room and receive left event when using disconnect button', async ({
page
}) => {
await joinRoomAs('moderator', participantName, page);
await leaveRoom(page, 'moderator');
await page.waitForSelector('.event-LEFT');
const leftElements = await page.locator('.event-LEFT').all();
await page.waitForSelector('.event-left');
const leftElements = await page.locator('.event-left').all();
expect(leftElements.length).toBe(1);
});
test('should successfully join to room and receive LEFT event when using end meeting command', async ({
test('should successfully join to room and receive left event when using end meeting command', async ({
page
}) => {
await joinRoomAs('moderator', participantName, page);
await page.click('#end-meeting-btn');
await page.waitForSelector('.event-LEFT');
const meetingEndedElements = await page.locator('.event-LEFT').all();
await page.waitForSelector('.event-left');
const meetingEndedElements = await page.locator('.event-left').all();
expect(meetingEndedElements.length).toBe(1);
});
});

View File

@ -268,7 +268,7 @@ export const leaveRoom = async (page: Page, role: 'moderator' | 'speaker' = 'spe
await option.click();
}
await page.waitForSelector('.event-LEFT');
await page.waitForSelector('.event-left');
};
export const startScreenSharing = async (page: Page) => {

View File

@ -52,7 +52,7 @@ describe('OpenViduMeet WebComponent Events', () => {
const dispatchEventSpy = jest.spyOn(component, 'dispatchEvent');
const event = new MessageEvent('message', {
origin: 'https://not-allowed.com',
data: { event: 'READY', payload: {} }
data: { event: 'ready', payload: {} }
});
(eventsManager as any).handleMessage(event);
@ -64,13 +64,13 @@ describe('OpenViduMeet WebComponent Events', () => {
const dispatchEventSpy = jest.spyOn(component, 'dispatchEvent');
const event = new MessageEvent('message', {
origin: testOrigin,
data: { event: 'READY', payload: { foo: 'bar' } }
data: { event: 'ready', payload: { foo: 'bar' } }
});
(eventsManager as any).handleMessage(event);
expect(dispatchEventSpy).toHaveBeenCalledWith(
expect.objectContaining({
type: 'READY',
type: 'ready',
detail: { foo: 'bar' }
})
);

View File

@ -22,14 +22,14 @@ describe('OpenViduMeet Event Handling', () => {
document.body.innerHTML = '';
});
it('should call sendMessage when READY event is received', () => {
it('should call sendMessage when ready event is received', () => {
const sendMessageSpy = jest.spyOn(commandsManager, 'sendMessage' as keyof CommandsManager);
(component as any).eventsManager.setTargetOrigin(testOrigin);
// Mock a message event
const readyEvent = new MessageEvent('message', {
data: { event: 'READY' },
data: { event: 'ready' },
origin: testOrigin
});
window.dispatchEvent(readyEvent);

View File

@ -194,17 +194,17 @@ const listenWebComponentEvents = () => {
return;
}
meet.on('JOINED', (event: CustomEvent<any>) => {
console.log('JOINED event received:', event);
addEventToLog('JOINED', JSON.stringify(event));
meet.on('joined', (event: CustomEvent<any>) => {
console.log('"joined" event received:', event);
addEventToLog('joined', JSON.stringify(event));
});
meet.on('LEFT', (event: CustomEvent<any>) => {
console.log('LEFT event received:', event);
addEventToLog('LEFT', JSON.stringify(event));
meet.on('left', (event: CustomEvent<any>) => {
console.log('"left" event received:', event);
addEventToLog('left', JSON.stringify(event));
});
meet.on('CLOSED', (event: CustomEvent<any>) => {
console.log('CLOSED event received:', event);
addEventToLog('CLOSED', JSON.stringify(event));
meet.on('closed', (event: CustomEvent<any>) => {
console.log('"closed" event received:', event);
addEventToLog('closed', JSON.stringify(event));
// Redirect to home page
// window.location.href = '/';

View File

@ -268,10 +268,10 @@
data-testid="recording-access-select"
>
<option value="admin">Admin Only</option>
<option value="admin-moderator">
<option value="admin_moderator">
Admin & Moderator
</option>
<option value="admin-moderator-speaker" selected>
<option value="admin_moderator_speaker" selected>
Admin, Moderator & Speaker
</option>
</select>

View File

@ -165,7 +165,7 @@ const processFormPreferences = (body: any): any => {
enabled: body['preferences.recordingPreferences.enabled'] === 'on',
// Only include allowAccessTo if recording is enabled
...(body['preferences.recordingPreferences.enabled'] === 'on' && {
allowAccessTo: body['preferences.recordingPreferences.allowAccessTo'] || 'admin-moderator-speaker'
allowAccessTo: body['preferences.recordingPreferences.allowAccessTo'] || 'admin_moderator_speaker'
})
},
virtualBackgroundPreferences: {

View File

@ -23,9 +23,9 @@ export interface AuthMethod {
* Enum for authentication types.
*/
export const enum AuthType {
SINGLE_USER = 'single-user',
// MULTI_USER = 'multi-user',
// OAUTH_ONLY = 'oauth-only'
SINGLE_USER = 'single_user',
// MULTI_USER = 'multi_user',
// OAUTH_ONLY = 'oauth_only'
}
/**

View File

@ -1,15 +1,15 @@
export const enum MeetRecordingStatus {
STARTING = 'STARTING',
ACTIVE = 'ACTIVE',
ENDING = 'ENDING',
COMPLETE = 'COMPLETE',
FAILED = 'FAILED',
ABORTED = 'ABORTED',
LIMIT_REACHED = 'LIMIT_REACHED'
STARTING = 'starting',
ACTIVE = 'active',
ENDING = 'ending',
COMPLETE = 'complete',
FAILED = 'failed',
ABORTED = 'aborted',
LIMIT_REACHED = 'limit_reached'
}
// export const enum MeetRecordingOutputMode {
// COMPOSED = 'COMPOSED',
// COMPOSED = 'composed',
// }
/**

View File

@ -17,8 +17,8 @@ export interface MeetRecordingPreferences {
export const enum MeetRecordingAccess {
ADMIN = 'admin', // Only admins can access the recording
ADMIN_MODERATOR = 'admin-moderator', // Admins and moderators can access
ADMIN_MODERATOR_SPEAKER = 'admin-moderator-speaker' // Admins, moderators and speakers can access
ADMIN_MODERATOR = 'admin_moderator', // Admins and moderators can access
ADMIN_MODERATOR_SPEAKER = 'admin_moderator_speaker' // Admins, moderators and speakers can access
}
export interface MeetChatPreferences {

View File

@ -7,21 +7,21 @@ export enum WebComponentCommand {
* This command is sent from the webcomponent to the iframe for intialice the domain.
* @private
*/
INITIALIZE = 'INITIALIZE',
INITIALIZE = 'initialize',
/**
* Ends the current meeting for all participants.
* @moderator
*/
END_MEETING = 'END_MEETING',
END_MEETING = 'endMeeting',
/**
* Disconnects the local participant from the current room.
*/
LEAVE_ROOM = 'LEAVE_ROOM',
LEAVE_ROOM = 'leaveRoom',
/**
* Kicks a participant from the meeting.
* @moderator
*/
KICK_PARTICIPANT = 'KICK_PARTICIPANT'
KICK_PARTICIPANT = 'kickParticipant'
}
/**

View File

@ -7,19 +7,19 @@ export enum WebComponentEvent {
* Event emitted when application is ready to receive commands.
* @private
*/
READY = 'READY',
READY = 'ready',
/**
* Event emitted when the local participant joins the room.
*/
JOINED = 'JOINED',
JOINED = 'joined',
/**
* Event emitted when the local participant leaves the room.
*/
LEFT = 'LEFT',
LEFT = 'left',
/**
* Event emitted when the application is closed.
*/
CLOSED = 'CLOSED'
CLOSED = 'closed'
}
/**