Skip to content

Commit

Permalink
misc: support to pass options for removing party
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux committed Dec 2, 2024
1 parent 59130c2 commit 5b877e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ringcentral-call-control",
"version": "0.2.8",
"version": "0.2.9",
"main": "lib/index.js",
"license": "MIT",
"repository": {
Expand Down
17 changes: 15 additions & 2 deletions src/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ export interface PickUpParams {
deviceId: string;
}

export interface RemovePartyOptions {
keepConferenceAlive?: boolean;
}

function objectEqual(obj1: any, obj2: any) {
let equal = true;
if (!obj1 || !obj2) {
Expand Down Expand Up @@ -590,10 +594,19 @@ export class Session extends EventEmitter {
return response.json();
}

async removeParty(partyId: string) {
async removeParty(partyId: string, options?: RemovePartyOptions) {
const requestOptions: {
userAgent: string;
body?: RemovePartyOptions;
} = {
...this.requestOptions,
};
if (options) {
requestOptions.body = options;
}
return await this._sdk.platform().delete(
`/restapi/v1.0/account/~/telephony/sessions/${this._data.id}/parties/${partyId}`,
this.requestOptions,
requestOptions,
);
}

Expand Down

0 comments on commit 5b877e3

Please sign in to comment.