Skip to content

Commit

Permalink
impl: new api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Apr 22, 2024
1 parent 540e102 commit 5e84c6b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
10 changes: 8 additions & 2 deletions deno_dist/examples/quickJoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ let isRoomActive = false,
const res = await pnm.isRoomActive({
room_id: roomId,
});
isRoomActive = res.status;

if (!isRoomActive) {
if (!res.status){
hasError = true;
console.log(res.msg);
}else if (typeof res.is_active !== "undefined"){
isRoomActive = res.is_active;
}

if (!isRoomActive && !hasError) {
const res = await pnm.createRoom(roomInfo);
if (!res.status) {
hasError = true;
Expand Down
7 changes: 7 additions & 0 deletions deno_dist/types/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export type RooMetadata = {
logout_url?: string;
room_features: RoomFeaturesParams;
default_lock_settings?: LockSettingsParams;
copyright_conf?: CopyrightConf;
extra_data?: string;
};

export type RoomFeaturesParams = {
Expand Down Expand Up @@ -119,3 +121,8 @@ export type CreateRoomResponseRoomInfo = {
enabled_codecs: Array<any>;
metadata: string;
};

export type CopyrightConf = {
display: boolean;
text: string;
}
1 change: 1 addition & 0 deletions deno_dist/types/isRoomActive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export type IsRoomActiveParams = {

export type IsRoomActiveResponse = {
status: boolean;
is_active?: boolean;
msg: string;
};
10 changes: 8 additions & 2 deletions examples/quickJoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ const plugNmeet = require('../').PlugNmeet;
let res = await pnm.isRoomActive({
room_id: roomId,
});
isRoomActive = res.status;

if (!isRoomActive) {
if (!res.status){
hasError = true;
console.log(res.msg);
}else if (typeof res.is_active !== "undefined"){
isRoomActive = res.is_active;
}

if (!isRoomActive && !hasError) {
res = await pnm.createRoom(roomInfo);
if (!res.status) {
hasError = true;
Expand Down
7 changes: 7 additions & 0 deletions src/types/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export type RooMetadata = {
logout_url?: string;
room_features: RoomFeaturesParams;
default_lock_settings?: LockSettingsParams;
copyright_conf?: CopyrightConf;
extra_data?: string;
};

export type RoomFeaturesParams = {
Expand Down Expand Up @@ -119,3 +121,8 @@ export type CreateRoomResponseRoomInfo = {
enabled_codecs: Array<any>;
metadata: string;
};

export type CopyrightConf = {
display: boolean;
text: string;
};
1 change: 1 addition & 0 deletions src/types/isRoomActive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export type IsRoomActiveParams = {

export type IsRoomActiveResponse = {
status: boolean;
is_active?: boolean;
msg: string;
};

0 comments on commit 5e84c6b

Please sign in to comment.