From 5b877e3887feb7361d112f4361dd4e8415185993 Mon Sep 17 00:00:00 2001 From: Embbnux Ji Date: Mon, 2 Dec 2024 15:16:48 +0800 Subject: [PATCH] misc: support to pass options for removing party --- package.json | 2 +- src/Session.ts | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fc9a6ca..6e8c12b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ringcentral-call-control", - "version": "0.2.8", + "version": "0.2.9", "main": "lib/index.js", "license": "MIT", "repository": { diff --git a/src/Session.ts b/src/Session.ts index 1ce0a81..6cf9204 100644 --- a/src/Session.ts +++ b/src/Session.ts @@ -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) { @@ -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, ); }