Skip to content

Commit

Permalink
Merge pull request #84 from mynaparrot/api_change
Browse files Browse the repository at this point in the history
impl: new api changes
  • Loading branch information
jibon57 authored May 3, 2024
2 parents 540e102 + d98b18c commit a1721ae
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 7 deletions.
1 change: 1 addition & 0 deletions deno_dist/PlugNmeet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export class PlugNmeet implements PlugNmeetAPI {

return {
status: output.response.status,
is_active: output.response.is_active,
msg: output.response.msg,
};
}
Expand Down
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plugnmeet-sdk-js",
"version": "1.3.2",
"version": "1.4.0",
"description": "plugNmeet JS SDK",
"author": "Jibon L. Costa",
"license": "MIT",
Expand Down
1 change: 1 addition & 0 deletions src/PlugNmeet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class PlugNmeet implements PlugNmeetAPI {

return {
status: output.response.status,
is_active: output.response.is_active,
msg: output.response.msg,
};
}
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 a1721ae

Please sign in to comment.