@jibb-open/jssdk 3.5.12 → 3.5.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/README.md +8 -1
- package/api/admin.js +1 -418
- package/api/auth.js +1 -246
- package/api/eventbus.js +1 -249
- package/api/index.js +1 -53
- package/api/meeting.js +1 -488
- package/api/recording.js +1 -260
- package/api/superadmin.js +1 -105
- package/api/user.js +1 -51
- package/api/webexbot.js +1 -41
- package/api/whiteboard.js +1 -179
- package/config.js +1 -16
- package/package.json +7 -3
- package/post-processing.js +1 -43
- package/types/exceptions.js +1 -55
- package/types/jibb.pb.js +1 -1324
- package/types/proto.js +1 -15
- package/types/types.js +1 -67
- package/utils/cached_variable.js +1 -25
- package/utils/future.js +1 -31
- package/utils/http/http.axios.js +1 -41
- package/utils/http/index.js +1 -10
- package/utils/index.js +1 -11
- package/utils/logger/index.js +1 -19
- package/utils/logger/logger.empty.js +1 -25
- package/utils/logger/logger.pino.js +1 -19
- package/ws/connection_base.js +1 -95
- package/ws/eventbus.js +1 -376
- package/ws/index.js +1 -36
- package/ws/ipsa.js +1 -262
- package/ws/meeting.js +1 -181
- package/ws/observable_connection.js +1 -87
- package/ws/retry_connection.js +1 -94
- package/examples/browser/462.jibb.js +0 -306
- package/examples/browser/index.html +0 -17
- package/examples/browser/jibb.js +0 -7381
- package/examples/browser/startSession.js +0 -102
- package/examples/examples.js +0 -6
- package/examples/webexDevicesMacros/cameraPresets/jibb.js +0 -279
- package/examples/webexDevicesMacros/jssdk/jibb_WebexXapi.js +0 -3033
- package/examples/webexDevicesMacros/simplestExample/jibb.js +0 -181
- package/examples/webexDevicesMacros/withCameraControl/jibb.js +0 -263
package/api/meeting.js
CHANGED
|
@@ -1,488 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createMeeting = createMeeting;
|
|
7
|
-
exports.createShare = createShare;
|
|
8
|
-
exports.createTemporaryShare = createTemporaryShare;
|
|
9
|
-
exports.deleteMeeting = deleteMeeting;
|
|
10
|
-
exports.deleteMeetingImages = deleteMeetingImages;
|
|
11
|
-
exports.deleteShare = deleteShare;
|
|
12
|
-
exports.deleteShareMe = deleteShareMe;
|
|
13
|
-
exports.endMeeting = endMeeting;
|
|
14
|
-
exports.getListShare = getListShare;
|
|
15
|
-
exports.getListShareMe = getListShareMe;
|
|
16
|
-
exports.getMeetingDetails = getMeetingDetails;
|
|
17
|
-
exports.getMeetingImage = getMeetingImage;
|
|
18
|
-
exports.getMeetingImages = getMeetingImages;
|
|
19
|
-
exports.getMeetingList = getMeetingList;
|
|
20
|
-
exports.getMeetingToken = getMeetingToken;
|
|
21
|
-
exports.getMeetingTokenFromTempShareId = getMeetingTokenFromTempShareId;
|
|
22
|
-
exports.isMeetingOwner = isMeetingOwner;
|
|
23
|
-
exports.startMeeting = startMeeting;
|
|
24
|
-
exports.updateMeeting = updateMeeting;
|
|
25
|
-
require("core-js/modules/es.promise.js");
|
|
26
|
-
require("core-js/modules/es.json.stringify.js");
|
|
27
|
-
var _config = require("../config.js");
|
|
28
|
-
var _auth = require("./auth.js");
|
|
29
|
-
var _index = require("../utils/logger/index.js");
|
|
30
|
-
var _exceptions = require("../types/exceptions.js");
|
|
31
|
-
var _index2 = require("../utils/http/index.js");
|
|
32
|
-
var _types = require("../types/types.js");
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @module meeting
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @async
|
|
42
|
-
* @param {Object} param0
|
|
43
|
-
* @param {string} [param0.title=""] - meeting title.
|
|
44
|
-
* @param {boolean} [param0.isTemporary=false] - meeting won't be saved in dashboard.
|
|
45
|
-
* @param {Number} [param0.capacity=2] - 1 or 2 , number of allowed stream to the meeting.
|
|
46
|
-
* @param {Number} [param0.meetingType=0] - 0 DEFAULT or 1 WHITEBOARD
|
|
47
|
-
* @returns {string} - ID of created meeting
|
|
48
|
-
*/
|
|
49
|
-
async function createMeeting(_ref) {
|
|
50
|
-
let {
|
|
51
|
-
title,
|
|
52
|
-
isTemporary,
|
|
53
|
-
capacity,
|
|
54
|
-
meetingType
|
|
55
|
-
} = _ref;
|
|
56
|
-
let headers = {
|
|
57
|
-
"Content-Type": "application/json",
|
|
58
|
-
Accept: "application/json",
|
|
59
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
60
|
-
};
|
|
61
|
-
let body = {
|
|
62
|
-
title: title || "",
|
|
63
|
-
isTemporary: isTemporary || false,
|
|
64
|
-
capacity: capacity || 2,
|
|
65
|
-
meetingType: meetingType || _types.MeetingTypes.DEFAULT
|
|
66
|
-
};
|
|
67
|
-
let response = await _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings"), body, headers);
|
|
68
|
-
return response.data.meetingId;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @export export async function function
|
|
74
|
-
* @param {object} param0
|
|
75
|
-
* @param {string} param0.meetingId - meeting ID.
|
|
76
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
77
|
-
* @param {Number} [param0.expiry=3600] - share time expiry in seconds.
|
|
78
|
-
* @param {object} [param0.auxData={}] - object that can be used to include specific data in meeting share like call ID for this share.
|
|
79
|
-
* @returns {string} - shareId
|
|
80
|
-
*/
|
|
81
|
-
async function createTemporaryShare(_ref2) {
|
|
82
|
-
let {
|
|
83
|
-
meetingId,
|
|
84
|
-
permission,
|
|
85
|
-
expiry,
|
|
86
|
-
auxData
|
|
87
|
-
} = _ref2;
|
|
88
|
-
let headers = {
|
|
89
|
-
"Content-Type": "application/json",
|
|
90
|
-
Accept: "application/json",
|
|
91
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
92
|
-
};
|
|
93
|
-
let body = {
|
|
94
|
-
permission: permission,
|
|
95
|
-
expiry: {
|
|
96
|
-
seconds: expiry || 3600
|
|
97
|
-
},
|
|
98
|
-
auxilary: auxData || {}
|
|
99
|
-
};
|
|
100
|
-
let response = await _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/temp-shares"), body, headers);
|
|
101
|
-
return response.data.shareId;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @async
|
|
107
|
-
* @param {object} param0
|
|
108
|
-
* @param {string} param0.meetingId
|
|
109
|
-
* @param {string} param0.shareId
|
|
110
|
-
* @returns {string} - token
|
|
111
|
-
*/
|
|
112
|
-
async function getMeetingTokenFromTempShareId(_ref3) {
|
|
113
|
-
let {
|
|
114
|
-
meetingId,
|
|
115
|
-
shareId
|
|
116
|
-
} = _ref3;
|
|
117
|
-
let headers = {
|
|
118
|
-
"Content-Type": "application/json",
|
|
119
|
-
Accept: "application/json"
|
|
120
|
-
};
|
|
121
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/temp-shares/").concat(shareId), headers);
|
|
122
|
-
return response.data.token;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @async
|
|
128
|
-
* @param {object} param0
|
|
129
|
-
* @param {string} param0.meetingId
|
|
130
|
-
* @param {string} param0.mtoken
|
|
131
|
-
* @returns - http response
|
|
132
|
-
*/
|
|
133
|
-
async function deleteMeetingImages(_ref4) {
|
|
134
|
-
let {
|
|
135
|
-
meetingId,
|
|
136
|
-
mtoken
|
|
137
|
-
} = _ref4;
|
|
138
|
-
let headers = {
|
|
139
|
-
"Content-Type": "application/json",
|
|
140
|
-
Accept: "application/json",
|
|
141
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
142
|
-
"x-jibb-meeting-jwt": mtoken
|
|
143
|
-
};
|
|
144
|
-
return _index2.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/images"), headers);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
*
|
|
149
|
-
* @async
|
|
150
|
-
* @param {object} param0
|
|
151
|
-
* @param {string} param0.meetingId
|
|
152
|
-
* @param {string} param0.meetingToken
|
|
153
|
-
* @returns {Array} - list of images
|
|
154
|
-
*/
|
|
155
|
-
async function getMeetingImages(_ref5) {
|
|
156
|
-
let {
|
|
157
|
-
meetingId,
|
|
158
|
-
meetingToken
|
|
159
|
-
} = _ref5;
|
|
160
|
-
let headers = {
|
|
161
|
-
"Content-Type": "application/json",
|
|
162
|
-
Accept: "application/json",
|
|
163
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
164
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
165
|
-
};
|
|
166
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/images"), headers);
|
|
167
|
-
return response.data;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
*
|
|
172
|
-
* @async
|
|
173
|
-
* @param {object} param0
|
|
174
|
-
* @param {string} param0.meetingId
|
|
175
|
-
* @param {string} param0.meetingToken
|
|
176
|
-
* @param {string} param0.imageId
|
|
177
|
-
* @returns {data} - base64 data
|
|
178
|
-
*/
|
|
179
|
-
async function getMeetingImage(_ref6) {
|
|
180
|
-
let {
|
|
181
|
-
meetingId,
|
|
182
|
-
meetingToken,
|
|
183
|
-
imageId
|
|
184
|
-
} = _ref6;
|
|
185
|
-
let headers = {
|
|
186
|
-
"Content-Type": "application/json",
|
|
187
|
-
Accept: "application/json",
|
|
188
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
189
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
190
|
-
};
|
|
191
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/images/").concat(imageId), headers);
|
|
192
|
-
return response.data;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
197
|
-
* @async
|
|
198
|
-
* @param {object} param0
|
|
199
|
-
* @param {string} param0.meetingId
|
|
200
|
-
* @param {string} param0.meetingToken
|
|
201
|
-
* @returns - http response
|
|
202
|
-
*/
|
|
203
|
-
async function startMeeting(_ref7) {
|
|
204
|
-
let {
|
|
205
|
-
meetingId,
|
|
206
|
-
meetingToken
|
|
207
|
-
} = _ref7;
|
|
208
|
-
let headers = {
|
|
209
|
-
"Content-Type": "application/json",
|
|
210
|
-
Accept: "application/json",
|
|
211
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
212
|
-
};
|
|
213
|
-
try {
|
|
214
|
-
let body = {};
|
|
215
|
-
return await _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/actions/start"), body, headers);
|
|
216
|
-
} catch (e) {
|
|
217
|
-
var _e$response;
|
|
218
|
-
if ((e === null || e === void 0 ? void 0 : (_e$response = e.response) === null || _e$response === void 0 ? void 0 : _e$response.status) == 404) throw new _exceptions.NotFoundError();else throw e;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @async
|
|
225
|
-
* @param {object} param0
|
|
226
|
-
* @param {string} param0.meetingId
|
|
227
|
-
* @param {string} param0.meetingToken
|
|
228
|
-
* @returns - http response
|
|
229
|
-
*/
|
|
230
|
-
async function endMeeting(_ref8) {
|
|
231
|
-
let {
|
|
232
|
-
meetingId,
|
|
233
|
-
meetingToken
|
|
234
|
-
} = _ref8;
|
|
235
|
-
let headers = {
|
|
236
|
-
"Content-Type": "application/json",
|
|
237
|
-
Accept: "application/json",
|
|
238
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
239
|
-
};
|
|
240
|
-
let body = {};
|
|
241
|
-
return _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/actions/end"), body, headers);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
*
|
|
246
|
-
* @async
|
|
247
|
-
* @param {string} meetingId
|
|
248
|
-
* @returns - http response
|
|
249
|
-
*/
|
|
250
|
-
async function deleteMeeting(meetingId) {
|
|
251
|
-
let headers = {
|
|
252
|
-
"Content-Type": "application/json",
|
|
253
|
-
Accept: "application/json",
|
|
254
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
255
|
-
};
|
|
256
|
-
return _index2.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId), headers);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
*
|
|
261
|
-
* @async
|
|
262
|
-
* @param {object} param0
|
|
263
|
-
* @param {string} param0.meetingId
|
|
264
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
265
|
-
* @param {Number} [param0.expiry=3600] - share time expiry in seconds.
|
|
266
|
-
* @returns {string} - token
|
|
267
|
-
*/
|
|
268
|
-
async function getMeetingToken(_ref9) {
|
|
269
|
-
let {
|
|
270
|
-
meetingId,
|
|
271
|
-
permission,
|
|
272
|
-
expiry = 3600
|
|
273
|
-
} = _ref9;
|
|
274
|
-
let userToken;
|
|
275
|
-
try {
|
|
276
|
-
userToken = await _auth.Auth.getUserToken();
|
|
277
|
-
} catch (err) {
|
|
278
|
-
_index.logger.error({
|
|
279
|
-
err
|
|
280
|
-
});
|
|
281
|
-
throw new _exceptions.PermissionDeniedError("user is not authenticated");
|
|
282
|
-
}
|
|
283
|
-
try {
|
|
284
|
-
let headers = {
|
|
285
|
-
"Content-Type": "application/json",
|
|
286
|
-
Accept: "application/json",
|
|
287
|
-
"x-jibb-user-jwt": userToken
|
|
288
|
-
};
|
|
289
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/token/").concat(permission, "?expiry.seconds=").concat(expiry), headers);
|
|
290
|
-
return response.data.token;
|
|
291
|
-
} catch (err) {
|
|
292
|
-
var _err$response;
|
|
293
|
-
if ((err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : _err$response.status) == 404) throw new _exceptions.NotFoundError("meeting not found");else throw err;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
*
|
|
299
|
-
* @async
|
|
300
|
-
* @param {*} pagination
|
|
301
|
-
* @returns {Array} - meeting list.
|
|
302
|
-
*/
|
|
303
|
-
async function getMeetingList(pagination) {
|
|
304
|
-
let headers = {
|
|
305
|
-
"Content-Type": "application/json",
|
|
306
|
-
Accept: "application/json",
|
|
307
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
308
|
-
};
|
|
309
|
-
if (pagination !== undefined) headers["x-jibb-pagination"] = JSON.stringify(pagination);
|
|
310
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings"), headers);
|
|
311
|
-
pagination = response.headers["x-jibb-pagination"];
|
|
312
|
-
pagination = pagination && JSON.parse(pagination);
|
|
313
|
-
return {
|
|
314
|
-
meetings: response.data.meetings,
|
|
315
|
-
pagination: pagination
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
*
|
|
321
|
-
* @async
|
|
322
|
-
* @param {string} meetingId
|
|
323
|
-
* @returns {object} - object with meeting details.
|
|
324
|
-
*/
|
|
325
|
-
async function getMeetingDetails(meetingId) {
|
|
326
|
-
let headers = {
|
|
327
|
-
"Content-Type": "application/json",
|
|
328
|
-
Accept: "application/json",
|
|
329
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
330
|
-
};
|
|
331
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId), headers);
|
|
332
|
-
return response.data;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
*
|
|
337
|
-
* @async
|
|
338
|
-
* @param {object} param0
|
|
339
|
-
* @param {string} param0.meetingId
|
|
340
|
-
* @param {string} param0.title
|
|
341
|
-
* @param {Number} param0.capacity
|
|
342
|
-
* @returns - http result
|
|
343
|
-
*/
|
|
344
|
-
async function updateMeeting(_ref10) {
|
|
345
|
-
let {
|
|
346
|
-
meetingId,
|
|
347
|
-
title,
|
|
348
|
-
capacity
|
|
349
|
-
} = _ref10;
|
|
350
|
-
let headers = {
|
|
351
|
-
"Content-Type": "application/json",
|
|
352
|
-
Accept: "application/json",
|
|
353
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
354
|
-
};
|
|
355
|
-
let body = {};
|
|
356
|
-
if (title) {
|
|
357
|
-
body["title"] = title;
|
|
358
|
-
}
|
|
359
|
-
if (capacity) {
|
|
360
|
-
body["capacity"] = capacity;
|
|
361
|
-
}
|
|
362
|
-
return _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId), body, headers);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
*
|
|
367
|
-
* @async
|
|
368
|
-
* @param {string} meetingToken
|
|
369
|
-
* @returns {Boolean}
|
|
370
|
-
*/
|
|
371
|
-
async function isMeetingOwner(meetingToken) {
|
|
372
|
-
try {
|
|
373
|
-
let meetingClaims = new _types.MeetingClaims(meetingToken);
|
|
374
|
-
let userClaims = new _types.UserClaims(await _auth.Auth.getUserToken());
|
|
375
|
-
return userClaims.email === meetingClaims.owner;
|
|
376
|
-
} catch (err) {
|
|
377
|
-
return false;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
*
|
|
383
|
-
* @async
|
|
384
|
-
* @param {object} param0
|
|
385
|
-
* @param {string} param0.email
|
|
386
|
-
* @param {string} param0.meetingId
|
|
387
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
388
|
-
* @param {string} param0.meetingToken
|
|
389
|
-
* @returns {string}
|
|
390
|
-
*/
|
|
391
|
-
|
|
392
|
-
async function createShare(_ref11) {
|
|
393
|
-
let {
|
|
394
|
-
email,
|
|
395
|
-
meetingId,
|
|
396
|
-
permission,
|
|
397
|
-
meetingToken
|
|
398
|
-
} = _ref11;
|
|
399
|
-
let headers = {
|
|
400
|
-
"Content-Type": "application/json",
|
|
401
|
-
Accept: "application/json",
|
|
402
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
403
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
404
|
-
};
|
|
405
|
-
let body = {
|
|
406
|
-
email: email,
|
|
407
|
-
permission: permission
|
|
408
|
-
};
|
|
409
|
-
let response = await _index2.http.post("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/shares"), body, headers);
|
|
410
|
-
return response.data;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
*
|
|
415
|
-
* @async
|
|
416
|
-
* @param {object} param0
|
|
417
|
-
* @param {string} param0.meetingId
|
|
418
|
-
* @param {string} param0.meetingToken
|
|
419
|
-
* @returns {list} - list of shares of this meeting
|
|
420
|
-
*/
|
|
421
|
-
async function getListShare(_ref12) {
|
|
422
|
-
let {
|
|
423
|
-
meetingId,
|
|
424
|
-
meetingToken
|
|
425
|
-
} = _ref12;
|
|
426
|
-
let headers = {
|
|
427
|
-
"Content-Type": "application/json",
|
|
428
|
-
Accept: "application/json",
|
|
429
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
430
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
431
|
-
};
|
|
432
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/shares"), headers);
|
|
433
|
-
return response.data.shares;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
*
|
|
438
|
-
* @async
|
|
439
|
-
* @param {object} param0
|
|
440
|
-
* @param {string} param0.meetingId
|
|
441
|
-
* @param {string} param0.userId
|
|
442
|
-
* @param {string} param0.meetingToken
|
|
443
|
-
* @returns - http result
|
|
444
|
-
*/
|
|
445
|
-
|
|
446
|
-
async function deleteShare(_ref13) {
|
|
447
|
-
let {
|
|
448
|
-
meetingId,
|
|
449
|
-
userId,
|
|
450
|
-
meetingToken
|
|
451
|
-
} = _ref13;
|
|
452
|
-
let headers = {
|
|
453
|
-
"Content-Type": "application/json",
|
|
454
|
-
Accept: "application/json",
|
|
455
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken(),
|
|
456
|
-
"x-jibb-meeting-jwt": meetingToken
|
|
457
|
-
};
|
|
458
|
-
return _index2.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/").concat(meetingId, "/shares/").concat(userId), headers);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
*
|
|
463
|
-
* @async
|
|
464
|
-
* @returns {array} - list of meeting shared with me.
|
|
465
|
-
*/
|
|
466
|
-
async function getListShareMe() {
|
|
467
|
-
let headers = {
|
|
468
|
-
"Content-Type": "application/json",
|
|
469
|
-
Accept: "application/json",
|
|
470
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
471
|
-
};
|
|
472
|
-
let response = await _index2.http.get("".concat(_config.Config.apiBaseURL, "/v1/meetings/shares"), headers);
|
|
473
|
-
return response.data.shares;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
*
|
|
478
|
-
* @param {string} meetingId
|
|
479
|
-
* @returns - http result.
|
|
480
|
-
*/
|
|
481
|
-
async function deleteShareMe(meetingId) {
|
|
482
|
-
let headers = {
|
|
483
|
-
"Content-Type": "application/json",
|
|
484
|
-
Accept: "application/json",
|
|
485
|
-
"x-jibb-user-jwt": await _auth.Auth.getUserToken()
|
|
486
|
-
};
|
|
487
|
-
return _index2.http.delete("".concat(_config.Config.apiBaseURL, "/v1/meetings/shares/").concat(meetingId), headers);
|
|
488
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createMeeting=createMeeting,exports.createShare=createShare,exports.createTemporaryShare=createTemporaryShare,exports.deleteMeeting=deleteMeeting,exports.deleteMeetingImages=deleteMeetingImages,exports.deleteShare=deleteShare,exports.deleteShareMe=deleteShareMe,exports.endMeeting=endMeeting,exports.getListShare=getListShare,exports.getListShareMe=getListShareMe,exports.getMeetingDetails=getMeetingDetails,exports.getMeetingImage=getMeetingImage,exports.getMeetingImages=getMeetingImages,exports.getMeetingList=getMeetingList,exports.getMeetingToken=getMeetingToken,exports.getMeetingTokenFromTempShareId=getMeetingTokenFromTempShareId,exports.isMeetingOwner=isMeetingOwner,exports.startMeeting=startMeeting,exports.updateMeeting=updateMeeting,require("core-js/modules/es.promise.js"),require("core-js/modules/es.json.stringify.js");var _config=require("../config.js"),_auth=require("./auth.js"),_index=require("../utils/logger/index.js"),_exceptions=require("../types/exceptions.js"),_index2=require("../utils/http/index.js"),_types=require("../types/types.js");async function createMeeting(a){let{title:b,isTemporary:c,capacity:d,meetingType:e}=a,f={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},g={title:b||"",isTemporary:c||!1,capacity:d||2,meetingType:e||_types.MeetingTypes.DEFAULT},h=await _index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings"),g,f);return h.data.meetingId}async function createTemporaryShare(a){let{meetingId:b,permission:c,expiry:d,auxData:e}=a,f={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},g=await _index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/temp-shares"),{permission:c,expiry:{seconds:d||3600},auxilary:e||{}},f);return g.data.shareId}async function getMeetingTokenFromTempShareId(a){let{meetingId:b,shareId:c}=a,d=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/temp-shares/").concat(c),{"Content-Type":"application/json",Accept:"application/json"});return d.data.token}async function deleteMeetingImages(a){let{meetingId:b,mtoken:c}=a,d={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":c};return _index2.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/images"),d)}async function getMeetingImages(a){let{meetingId:b,meetingToken:c}=a,d={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":c},e=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/images"),d);return e.data}async function getMeetingImage(a){let{meetingId:b,meetingToken:c,imageId:d}=a,e={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":c},f=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/images/").concat(d),e);return f.data}async function startMeeting(a){let{meetingId:b,meetingToken:c}=a;try{return await _index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/actions/start"),{},{"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":c})}catch(a){var d;if(404==(null===a||void 0===a||null===(d=a.response)||void 0===d?void 0:d.status))throw new _exceptions.NotFoundError;else throw a}}async function endMeeting(a){let{meetingId:b,meetingToken:c}=a;return _index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/actions/end"),{},{"Content-Type":"application/json",Accept:"application/json","x-jibb-meeting-jwt":c})}async function deleteMeeting(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index2.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(a),b)}async function getMeetingToken(a){let b,{meetingId:c,permission:d,expiry:e=3600}=a;try{b=await _auth.Auth.getUserToken()}catch(a){throw _index.logger.error({err:a}),new _exceptions.PermissionDeniedError("user is not authenticated")}try{let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":b},f=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(c,"/token/").concat(d,"?expiry.seconds=").concat(e),a);return f.data.token}catch(a){var f;if(404==(null===a||void 0===a||null===(f=a.response)||void 0===f?void 0:f.status))throw new _exceptions.NotFoundError("meeting not found");else throw a}}async function getMeetingList(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};void 0!==a&&(b["x-jibb-pagination"]=JSON.stringify(a));let c=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings"),b);return a=c.headers["x-jibb-pagination"],a=a&&JSON.parse(a),{meetings:c.data.meetings,pagination:a}}async function getMeetingDetails(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},c=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(a),b);return c.data}async function updateMeeting(a){let{meetingId:b,title:c,capacity:d}=a,e={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},f={};return c&&(f.title=c),d&&(f.capacity=d),_index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b),f,e)}async function isMeetingOwner(a){try{let b=new _types.MeetingClaims(a),c=new _types.UserClaims(await _auth.Auth.getUserToken());return c.email===b.owner}catch(a){return!1}}async function createShare(a){let{email:b,meetingId:c,permission:d,meetingToken:e}=a,f={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":e},g=await _index2.http.post("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(c,"/shares"),{email:b,permission:d},f);return g.data}async function getListShare(a){let{meetingId:b,meetingToken:c}=a,d={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":c},e=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/shares"),d);return e.data.shares}async function deleteShare(a){let{meetingId:b,userId:c,meetingToken:d}=a,e={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken(),"x-jibb-meeting-jwt":d};return _index2.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/").concat(b,"/shares/").concat(c),e)}async function getListShareMe(){let a={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()},b=await _index2.http.get("".concat(_config.Config.apiBaseURL,"/v1/meetings/shares"),a);return b.data.shares}async function deleteShareMe(a){let b={"Content-Type":"application/json",Accept:"application/json","x-jibb-user-jwt":await _auth.Auth.getUserToken()};return _index2.http.delete("".concat(_config.Config.apiBaseURL,"/v1/meetings/shares/").concat(a),b)}
|