@internxt/sdk 1.9.13 → 1.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/meet/index.d.ts +1 -0
- package/dist/meet/index.js +10 -0
- package/dist/meet/index.test.js +41 -0
- package/package.json +1 -1
package/dist/meet/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class Meet {
|
|
|
8
8
|
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity?: ApiSecurity): Meet;
|
|
9
9
|
createCall(): Promise<CreateCallResponse>;
|
|
10
10
|
joinCall(callId: string, payload: JoinCallPayload): Promise<JoinCallResponse>;
|
|
11
|
+
leaveCall(callId: string): Promise<void>;
|
|
11
12
|
getCurrentUsersInCall(callId: string): Promise<UsersInCallResponse[]>;
|
|
12
13
|
private headersWithToken;
|
|
13
14
|
private basicHeaders;
|
package/dist/meet/index.js
CHANGED
|
@@ -76,6 +76,16 @@ var Meet = /** @class */ (function () {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
+
Meet.prototype.leaveCall = function (callId) {
|
|
80
|
+
var _a;
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var headers;
|
|
83
|
+
return __generator(this, function (_b) {
|
|
84
|
+
headers = ((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token) ? this.headersWithToken() : this.basicHeaders();
|
|
85
|
+
return [2 /*return*/, this.client.post("call/".concat(callId, "/users/leave"), {}, headers)];
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
79
89
|
Meet.prototype.getCurrentUsersInCall = function (callId) {
|
|
80
90
|
var _a;
|
|
81
91
|
return __awaiter(this, void 0, void 0, function () {
|
package/dist/meet/index.test.js
CHANGED
|
@@ -193,6 +193,47 @@ describe('Meet service tests', function () {
|
|
|
193
193
|
});
|
|
194
194
|
}); });
|
|
195
195
|
});
|
|
196
|
+
describe('leaveCall method', function () {
|
|
197
|
+
var callId = 'call-123';
|
|
198
|
+
it('should leave a call successfully with token', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
+
var _a, client, headers, postCall;
|
|
200
|
+
return __generator(this, function (_b) {
|
|
201
|
+
switch (_b.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
_a = clientAndHeadersWithToken(), client = _a.client, headers = _a.headers;
|
|
204
|
+
postCall = sinon_1.default.stub(httpClient, 'post').resolves();
|
|
205
|
+
// Act
|
|
206
|
+
return [4 /*yield*/, client.leaveCall(callId)];
|
|
207
|
+
case 1:
|
|
208
|
+
// Act
|
|
209
|
+
_b.sent();
|
|
210
|
+
// Assert
|
|
211
|
+
expect(postCall.firstCall.args).toEqual(["call/".concat(callId, "/users/leave"), {}, headers]);
|
|
212
|
+
return [2 /*return*/];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}); });
|
|
216
|
+
it('should leave a call successfully without token', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
217
|
+
var _a, client, headers, postCall;
|
|
218
|
+
return __generator(this, function (_b) {
|
|
219
|
+
switch (_b.label) {
|
|
220
|
+
case 0:
|
|
221
|
+
_a = clientAndHeadersWithoutToken(), client = _a.client, headers = _a.headers;
|
|
222
|
+
postCall = sinon_1.default.stub(httpClient, 'post').resolves();
|
|
223
|
+
// Act
|
|
224
|
+
return [4 /*yield*/, client.leaveCall(callId)];
|
|
225
|
+
case 1:
|
|
226
|
+
// Act
|
|
227
|
+
_b.sent();
|
|
228
|
+
// Assert
|
|
229
|
+
expect(postCall.firstCall.args[0]).toEqual("call/".concat(callId, "/users/leave"));
|
|
230
|
+
expect(postCall.firstCall.args[1]).toEqual({});
|
|
231
|
+
expect(postCall.firstCall.args[2]).toEqual(headers);
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}); });
|
|
236
|
+
});
|
|
196
237
|
});
|
|
197
238
|
function clientAndHeadersWithToken(apiUrl, clientName, clientVersion, token) {
|
|
198
239
|
if (apiUrl === void 0) { apiUrl = ''; }
|