@jibb-open/jssdk 3.5.9 → 3.5.11
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 +5 -2
- package/{dist/api → api}/admin.js +0 -0
- package/{dist/api → api}/auth.js +0 -0
- package/{dist/api → api}/eventbus.js +0 -0
- package/{dist/api → api}/index.js +0 -0
- package/{dist/api → api}/meeting.js +0 -0
- package/{dist/api → api}/recording.js +0 -0
- package/{dist/api → api}/superadmin.js +0 -0
- package/{dist/api → api}/user.js +0 -0
- package/{dist/api → api}/webexbot.js +0 -0
- package/{dist/api → api}/whiteboard.js +0 -0
- package/{dist/config.js → config.js} +0 -0
- package/{dist/examples → examples}/browser/462.jibb.js +0 -0
- package/{dist/examples → examples}/browser/index.html +0 -0
- package/{dist/examples → examples}/browser/jibb.js +0 -0
- package/{dist/examples → examples}/browser/startSession.js +0 -0
- package/{dist/examples → examples}/examples.js +0 -0
- package/{dist/examples → examples}/webexDevicesMacros/cameraPresets/jibb.js +2 -3
- package/{dist/examples/webexDevicesMacros/webexDevice JSSDK → examples/webexDevicesMacros/jssdk}/jibb_WebexXapi.js +0 -0
- package/{dist/examples → examples}/webexDevicesMacros/simplestExample/jibb.js +2 -3
- package/{dist/examples → examples}/webexDevicesMacros/withCameraControl/jibb.js +2 -3
- package/package.json +1 -1
- package/{dist/post-processing.js → post-processing.js} +0 -0
- package/{dist/types → types}/exceptions.js +0 -0
- package/{dist/types → types}/jibb.pb.js +0 -0
- package/{dist/types → types}/proto.js +0 -0
- package/{dist/types → types}/types.js +0 -0
- package/{dist/utils → utils}/cached_variable.js +0 -0
- package/{dist/utils → utils}/future.js +0 -0
- package/{dist/utils → utils}/http/http.axios.js +0 -0
- package/{dist/utils → utils}/http/index.js +0 -0
- package/{dist/utils → utils}/index.js +0 -0
- package/{dist/utils → utils}/logger/index.js +0 -0
- package/{dist/utils → utils}/logger/logger.empty.js +0 -0
- package/{dist/utils → utils}/logger/logger.pino.js +0 -0
- package/{dist/ws → ws}/connection_base.js +0 -0
- package/{dist/ws → ws}/eventbus.js +0 -0
- package/{dist/ws → ws}/index.js +0 -0
- package/{dist/ws → ws}/ipsa.js +0 -0
- package/{dist/ws → ws}/meeting.js +0 -0
- package/{dist/ws → ws}/observable_connection.js +0 -0
- package/{dist/ws → ws}/retry_connection.js +0 -0
- package/.babelrc +0 -31
- package/dist/package.json +0 -69
- package/src/api/admin.js +0 -333
- package/src/api/auth.js +0 -208
- package/src/api/eventbus.js +0 -246
- package/src/api/index.js +0 -26
- package/src/api/meeting.js +0 -421
- package/src/api/recording.js +0 -225
- package/src/api/superadmin.js +0 -84
- package/src/api/user.js +0 -46
- package/src/api/webexbot.js +0 -32
- package/src/api/whiteboard.js +0 -175
- package/src/config.js +0 -12
- package/src/examples/browser/462.jibb.js +0 -1
- package/src/examples/browser/index.html +0 -17
- package/src/examples/browser/jibb.js +0 -2
- package/src/examples/browser/startSession.js +0 -112
- package/src/examples/examples.js +0 -5
- package/src/examples/webexDevicesMacros/cameraPresets/jibb.js +0 -338
- package/src/examples/webexDevicesMacros/simplestExample/jibb.js +0 -212
- package/src/examples/webexDevicesMacros/webexDevice JSSDK/jibb_WebexXapi.js +0 -2
- package/src/examples/webexDevicesMacros/withCameraControl/jibb.js +0 -303
- package/src/index.webex-devices.js +0 -13
- package/src/post-processing.js +0 -39
- package/src/types/exceptions.js +0 -48
- package/src/types/jibb.pb.js +0 -1357
- package/src/types/proto.js +0 -7
- package/src/types/types.js +0 -64
- package/src/utils/cached_variable.js +0 -23
- package/src/utils/future.js +0 -24
- package/src/utils/http/http.axios.js +0 -34
- package/src/utils/http/http.xapi.js +0 -87
- package/src/utils/http/index.js +0 -8
- package/src/utils/index.js +0 -5
- package/src/utils/logger/index.js +0 -11
- package/src/utils/logger/logger.empty.js +0 -25
- package/src/utils/logger/logger.pino.js +0 -15
- package/src/ws/connection_base.js +0 -81
- package/src/ws/eventbus.js +0 -363
- package/src/ws/index.js +0 -15
- package/src/ws/ipsa.js +0 -246
- package/src/ws/meeting.js +0 -170
- package/src/ws/observable_connection.js +0 -84
- package/src/ws/retry_connection.js +0 -82
- package/webpack.config.cjs +0 -144
package/src/api/meeting.js
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import {Config} from "../config.js"
|
|
2
|
-
import {Auth} from "./auth.js"
|
|
3
|
-
import {logger} from "../utils/logger/index.js"
|
|
4
|
-
import {NotFoundError, PermissionDeniedError} from "../types/exceptions.js"
|
|
5
|
-
import {http} from "../utils/http/index.js"
|
|
6
|
-
import {UserClaims, MeetingClaims, MeetingTypes} from "../types/types.js"
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @module meeting
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @async
|
|
17
|
-
* @param {Object} param0
|
|
18
|
-
* @param {string} [param0.title=""] - meeting title.
|
|
19
|
-
* @param {boolean} [param0.isTemporary=false] - meeting won't be saved in dashboard.
|
|
20
|
-
* @param {Number} [param0.capacity=2] - 1 or 2 , number of allowed stream to the meeting.
|
|
21
|
-
* @param {Number} [param0.meetingType=0] - 0 DEFAULT or 1 WHITEBOARD
|
|
22
|
-
* @returns {string} - ID of created meeting
|
|
23
|
-
*/
|
|
24
|
-
export async function createMeeting({title, isTemporary, capacity, meetingType}) {
|
|
25
|
-
let headers = {
|
|
26
|
-
"Content-Type": "application/json",
|
|
27
|
-
Accept: "application/json",
|
|
28
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
29
|
-
}
|
|
30
|
-
let body = {
|
|
31
|
-
title: title || "",
|
|
32
|
-
isTemporary: isTemporary || false,
|
|
33
|
-
capacity: capacity || 2,
|
|
34
|
-
meetingType: meetingType || MeetingTypes.DEFAULT,
|
|
35
|
-
}
|
|
36
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings`, body, headers)
|
|
37
|
-
return response.data.meetingId
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @export export async function function
|
|
43
|
-
* @param {object} param0
|
|
44
|
-
* @param {string} param0.meetingId - meeting ID.
|
|
45
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
46
|
-
* @param {Number} [param0.expiry=3600] - share time expiry in seconds.
|
|
47
|
-
* @param {object} [param0.auxData={}] - object that can be used to include specific data in meeting share like call ID for this share.
|
|
48
|
-
* @returns {string} - shareId
|
|
49
|
-
*/
|
|
50
|
-
export async function createTemporaryShare({meetingId, permission, expiry, auxData}) {
|
|
51
|
-
let headers = {
|
|
52
|
-
"Content-Type": "application/json",
|
|
53
|
-
Accept: "application/json",
|
|
54
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
55
|
-
}
|
|
56
|
-
let body = {
|
|
57
|
-
permission: permission,
|
|
58
|
-
expiry: {
|
|
59
|
-
seconds: expiry || 3600,
|
|
60
|
-
},
|
|
61
|
-
auxilary: auxData || {},
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/${meetingId}/temp-shares`, body, headers)
|
|
65
|
-
return response.data.shareId
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
* @async
|
|
71
|
-
* @param {object} param0
|
|
72
|
-
* @param {string} param0.meetingId
|
|
73
|
-
* @param {string} param0.shareId
|
|
74
|
-
* @returns {string} - token
|
|
75
|
-
*/
|
|
76
|
-
export async function getMeetingTokenFromTempShareId({meetingId, shareId}) {
|
|
77
|
-
let headers = {
|
|
78
|
-
"Content-Type": "application/json",
|
|
79
|
-
Accept: "application/json",
|
|
80
|
-
}
|
|
81
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${meetingId}/temp-shares/${shareId}`, headers)
|
|
82
|
-
return response.data.token
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @async
|
|
88
|
-
* @param {object} param0
|
|
89
|
-
* @param {string} param0.meetingId
|
|
90
|
-
* @param {string} param0.mtoken
|
|
91
|
-
* @returns - http response
|
|
92
|
-
*/
|
|
93
|
-
export async function deleteMeetingImages({meetingId, mtoken}) {
|
|
94
|
-
let headers = {
|
|
95
|
-
"Content-Type": "application/json",
|
|
96
|
-
Accept: "application/json",
|
|
97
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
98
|
-
"x-jibb-meeting-jwt": mtoken,
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/${meetingId}/images`, headers)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
*
|
|
106
|
-
* @async
|
|
107
|
-
* @param {object} param0
|
|
108
|
-
* @param {string} param0.meetingId
|
|
109
|
-
* @param {string} param0.meetingToken
|
|
110
|
-
* @returns {Array} - list of images
|
|
111
|
-
*/
|
|
112
|
-
export async function getMeetingImages({meetingId, meetingToken}) {
|
|
113
|
-
let headers = {
|
|
114
|
-
"Content-Type": "application/json",
|
|
115
|
-
Accept: "application/json",
|
|
116
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
117
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${meetingId}/images`, headers)
|
|
121
|
-
return response.data
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @async
|
|
127
|
-
* @param {object} param0
|
|
128
|
-
* @param {string} param0.meetingId
|
|
129
|
-
* @param {string} param0.meetingToken
|
|
130
|
-
* @param {string} param0.imageId
|
|
131
|
-
* @returns {data} - base64 data
|
|
132
|
-
*/
|
|
133
|
-
export async function getMeetingImage({meetingId, meetingToken, imageId}) {
|
|
134
|
-
let headers = {
|
|
135
|
-
"Content-Type": "application/json",
|
|
136
|
-
Accept: "application/json",
|
|
137
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
138
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${meetingId}/images/${imageId}`, headers)
|
|
142
|
-
return response.data
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
*
|
|
147
|
-
* @async
|
|
148
|
-
* @param {object} param0
|
|
149
|
-
* @param {string} param0.meetingId
|
|
150
|
-
* @param {string} param0.meetingToken
|
|
151
|
-
* @returns - http response
|
|
152
|
-
*/
|
|
153
|
-
export async function startMeeting({meetingId, meetingToken}) {
|
|
154
|
-
let headers = {
|
|
155
|
-
"Content-Type": "application/json",
|
|
156
|
-
Accept: "application/json",
|
|
157
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
try {
|
|
161
|
-
let body = {}
|
|
162
|
-
return await http.post(`${Config.apiBaseURL}/v1/meetings/${meetingId}/actions/start`, body, headers)
|
|
163
|
-
} catch (e) {
|
|
164
|
-
if (e?.response?.status == 404) throw new NotFoundError()
|
|
165
|
-
else throw e
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
*
|
|
171
|
-
* @async
|
|
172
|
-
* @param {object} param0
|
|
173
|
-
* @param {string} param0.meetingId
|
|
174
|
-
* @param {string} param0.meetingToken
|
|
175
|
-
* @returns - http response
|
|
176
|
-
*/
|
|
177
|
-
export async function endMeeting({meetingId, meetingToken}) {
|
|
178
|
-
let headers = {
|
|
179
|
-
"Content-Type": "application/json",
|
|
180
|
-
Accept: "application/json",
|
|
181
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
182
|
-
}
|
|
183
|
-
let body = {}
|
|
184
|
-
return http.post(`${Config.apiBaseURL}/v1/meetings/${meetingId}/actions/end`, body, headers)
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
*
|
|
189
|
-
* @async
|
|
190
|
-
* @param {string} meetingId
|
|
191
|
-
* @returns - http response
|
|
192
|
-
*/
|
|
193
|
-
export async function deleteMeeting(meetingId) {
|
|
194
|
-
let headers = {
|
|
195
|
-
"Content-Type": "application/json",
|
|
196
|
-
Accept: "application/json",
|
|
197
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
198
|
-
}
|
|
199
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/${meetingId}`, headers)
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
*
|
|
204
|
-
* @async
|
|
205
|
-
* @param {object} param0
|
|
206
|
-
* @param {string} param0.meetingId
|
|
207
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
208
|
-
* @param {Number} [param0.expiry=3600] - share time expiry in seconds.
|
|
209
|
-
* @returns {string} - token
|
|
210
|
-
*/
|
|
211
|
-
export async function getMeetingToken({meetingId, permission, expiry = 3600}) {
|
|
212
|
-
let userToken
|
|
213
|
-
|
|
214
|
-
try {
|
|
215
|
-
userToken = await Auth.getUserToken()
|
|
216
|
-
} catch (err) {
|
|
217
|
-
logger.error({
|
|
218
|
-
err,
|
|
219
|
-
})
|
|
220
|
-
throw new PermissionDeniedError("user is not authenticated")
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
try {
|
|
224
|
-
let headers = {
|
|
225
|
-
"Content-Type": "application/json",
|
|
226
|
-
Accept: "application/json",
|
|
227
|
-
"x-jibb-user-jwt": userToken,
|
|
228
|
-
}
|
|
229
|
-
let response = await http.get(
|
|
230
|
-
`${Config.apiBaseURL}/v1/meetings/${meetingId}/token/${permission}?expiry.seconds=${expiry}`,
|
|
231
|
-
|
|
232
|
-
headers
|
|
233
|
-
)
|
|
234
|
-
return response.data.token
|
|
235
|
-
} catch (err) {
|
|
236
|
-
if (err?.response?.status == 404) throw new NotFoundError("meeting not found")
|
|
237
|
-
else throw err
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
*
|
|
243
|
-
* @async
|
|
244
|
-
* @param {*} pagination
|
|
245
|
-
* @returns {Array} - meeting list.
|
|
246
|
-
*/
|
|
247
|
-
export async function getMeetingList(pagination) {
|
|
248
|
-
let headers = {
|
|
249
|
-
"Content-Type": "application/json",
|
|
250
|
-
Accept: "application/json",
|
|
251
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
252
|
-
}
|
|
253
|
-
if (pagination !== undefined) headers["x-jibb-pagination"] = JSON.stringify(pagination)
|
|
254
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings`, headers)
|
|
255
|
-
pagination = response.headers["x-jibb-pagination"]
|
|
256
|
-
pagination = pagination && JSON.parse(pagination)
|
|
257
|
-
|
|
258
|
-
return {
|
|
259
|
-
meetings: response.data.meetings,
|
|
260
|
-
pagination: pagination,
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
*
|
|
266
|
-
* @async
|
|
267
|
-
* @param {string} meetingId
|
|
268
|
-
* @returns {object} - object with meeting details.
|
|
269
|
-
*/
|
|
270
|
-
export async function getMeetingDetails(meetingId) {
|
|
271
|
-
let headers = {
|
|
272
|
-
"Content-Type": "application/json",
|
|
273
|
-
Accept: "application/json",
|
|
274
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${meetingId}`, headers)
|
|
278
|
-
return response.data
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
*
|
|
283
|
-
* @async
|
|
284
|
-
* @param {object} param0
|
|
285
|
-
* @param {string} param0.meetingId
|
|
286
|
-
* @param {string} param0.title
|
|
287
|
-
* @param {Number} param0.capacity
|
|
288
|
-
* @returns - http result
|
|
289
|
-
*/
|
|
290
|
-
export async function updateMeeting({meetingId, title, capacity}) {
|
|
291
|
-
let headers = {
|
|
292
|
-
"Content-Type": "application/json",
|
|
293
|
-
Accept: "application/json",
|
|
294
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
let body = {}
|
|
298
|
-
if (title) {
|
|
299
|
-
body["title"] = title
|
|
300
|
-
}
|
|
301
|
-
if (capacity) {
|
|
302
|
-
body["capacity"] = capacity
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return http.post(`${Config.apiBaseURL}/v1/meetings/${meetingId}`, body, headers)
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
*
|
|
310
|
-
* @async
|
|
311
|
-
* @param {string} meetingToken
|
|
312
|
-
* @returns {Boolean}
|
|
313
|
-
*/
|
|
314
|
-
export async function isMeetingOwner(meetingToken) {
|
|
315
|
-
try {
|
|
316
|
-
let meetingClaims = new MeetingClaims(meetingToken)
|
|
317
|
-
let userClaims = new UserClaims(await Auth.getUserToken())
|
|
318
|
-
return userClaims.email === meetingClaims.owner
|
|
319
|
-
} catch (err) {
|
|
320
|
-
return false
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
*
|
|
326
|
-
* @async
|
|
327
|
-
* @param {object} param0
|
|
328
|
-
* @param {string} param0.email
|
|
329
|
-
* @param {string} param0.meetingId
|
|
330
|
-
* @param {Number} param0.permission - 1 Read or 2 Write.
|
|
331
|
-
* @param {string} param0.meetingToken
|
|
332
|
-
* @returns {string}
|
|
333
|
-
*/
|
|
334
|
-
|
|
335
|
-
export async function createShare({email, meetingId, permission, meetingToken}) {
|
|
336
|
-
let headers = {
|
|
337
|
-
"Content-Type": "application/json",
|
|
338
|
-
Accept: "application/json",
|
|
339
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
340
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
341
|
-
}
|
|
342
|
-
let body = {
|
|
343
|
-
email: email,
|
|
344
|
-
permission: permission,
|
|
345
|
-
}
|
|
346
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/${meetingId}/shares`, body, headers)
|
|
347
|
-
return response.data
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
*
|
|
352
|
-
* @async
|
|
353
|
-
* @param {object} param0
|
|
354
|
-
* @param {string} param0.meetingId
|
|
355
|
-
* @param {string} param0.meetingToken
|
|
356
|
-
* @returns {list} - list of shares of this meeting
|
|
357
|
-
*/
|
|
358
|
-
export async function getListShare({meetingId, meetingToken}) {
|
|
359
|
-
let headers = {
|
|
360
|
-
"Content-Type": "application/json",
|
|
361
|
-
Accept: "application/json",
|
|
362
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
363
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
364
|
-
}
|
|
365
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/${meetingId}/shares`, headers)
|
|
366
|
-
|
|
367
|
-
return response.data.shares
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
*
|
|
372
|
-
* @async
|
|
373
|
-
* @param {object} param0
|
|
374
|
-
* @param {string} param0.meetingId
|
|
375
|
-
* @param {string} param0.userId
|
|
376
|
-
* @param {string} param0.meetingToken
|
|
377
|
-
* @returns - http result
|
|
378
|
-
*/
|
|
379
|
-
|
|
380
|
-
export async function deleteShare({meetingId, userId, meetingToken}) {
|
|
381
|
-
let headers = {
|
|
382
|
-
"Content-Type": "application/json",
|
|
383
|
-
Accept: "application/json",
|
|
384
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
385
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
386
|
-
}
|
|
387
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/${meetingId}/shares/${userId}`, headers)
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
*
|
|
392
|
-
* @async
|
|
393
|
-
* @returns {array} - list of meeting shared with me.
|
|
394
|
-
*/
|
|
395
|
-
export async function getListShareMe() {
|
|
396
|
-
let headers = {
|
|
397
|
-
"Content-Type": "application/json",
|
|
398
|
-
Accept: "application/json",
|
|
399
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
400
|
-
}
|
|
401
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/shares`, headers)
|
|
402
|
-
|
|
403
|
-
return response.data.shares
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
*
|
|
408
|
-
* @param {string} meetingId
|
|
409
|
-
* @returns - http result.
|
|
410
|
-
*/
|
|
411
|
-
export async function deleteShareMe(meetingId) {
|
|
412
|
-
let headers = {
|
|
413
|
-
"Content-Type": "application/json",
|
|
414
|
-
Accept: "application/json",
|
|
415
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
416
|
-
}
|
|
417
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/shares/${meetingId}`, headers)
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
package/src/api/recording.js
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import {Config} from "../config.js";
|
|
2
|
-
import {Auth} from "./auth.js";
|
|
3
|
-
import {http} from "../utils/http/index.js"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @module Recording
|
|
7
|
-
* This is an experimental API.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @async
|
|
14
|
-
* @param {object} param0
|
|
15
|
-
* @param {string} param0.recordingId
|
|
16
|
-
* @param {string} param0.title
|
|
17
|
-
* @returns - http result
|
|
18
|
-
*/
|
|
19
|
-
export async function updateRecording({recordingId, title}) {
|
|
20
|
-
let headers = {
|
|
21
|
-
"Content-Type": "application/json",
|
|
22
|
-
Accept: "application/json",
|
|
23
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
24
|
-
}
|
|
25
|
-
let body = {
|
|
26
|
-
title: title,
|
|
27
|
-
}
|
|
28
|
-
return http.post(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}`, body, headers)
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @async
|
|
33
|
-
* @param {string} recordingId
|
|
34
|
-
* @returns {list}
|
|
35
|
-
*/
|
|
36
|
-
export async function getRecording(recordingId) {
|
|
37
|
-
let headers = {
|
|
38
|
-
"Content-Type": "application/json",
|
|
39
|
-
Accept: "application/json",
|
|
40
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
41
|
-
}
|
|
42
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}`, headers)
|
|
43
|
-
return response.data
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @async
|
|
49
|
-
* @param {*} pagination
|
|
50
|
-
* @returns {}
|
|
51
|
-
*/
|
|
52
|
-
export async function getRecordingList(pagination) {
|
|
53
|
-
let headers = {
|
|
54
|
-
"Content-Type": "application/json",
|
|
55
|
-
Accept: "application/json",
|
|
56
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
57
|
-
}
|
|
58
|
-
if (pagination !== undefined) headers["x-jibb-pagination"] = JSON.stringify(pagination)
|
|
59
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/recordings`, headers)
|
|
60
|
-
pagination = response.headers["x-jibb-pagination"]
|
|
61
|
-
pagination = pagination && JSON.parse(pagination)
|
|
62
|
-
return {
|
|
63
|
-
items: response.data.items,
|
|
64
|
-
pagination: pagination,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @async
|
|
72
|
-
* @param {string} recordingId
|
|
73
|
-
* @returns - http result
|
|
74
|
-
*/
|
|
75
|
-
export async function deleteRecording(recordingId) {
|
|
76
|
-
let headers = {
|
|
77
|
-
"Content-Type": "application/json",
|
|
78
|
-
Accept: "application/json",
|
|
79
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}`, headers)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @async
|
|
88
|
-
* @param {string} recordingId
|
|
89
|
-
* @returns {array}
|
|
90
|
-
*/
|
|
91
|
-
export async function getImageList(recordingId) {
|
|
92
|
-
let headers = {
|
|
93
|
-
"Content-Type": "application/json",
|
|
94
|
-
Accept: "application/json",
|
|
95
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
96
|
-
}
|
|
97
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}/images`, headers)
|
|
98
|
-
return response.data.imageName
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* @async
|
|
102
|
-
* @param {object} param0
|
|
103
|
-
* @param {string} param0.recordingId
|
|
104
|
-
* @param {string} param0.imageName
|
|
105
|
-
* @returns {data}
|
|
106
|
-
*/
|
|
107
|
-
export async function getImage({ recordingId, imageName }) {
|
|
108
|
-
let headers = {
|
|
109
|
-
"Content-Type": "application/json",
|
|
110
|
-
Accept: "image/jpeg",
|
|
111
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
let url = `${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}/images/${imageName}`
|
|
115
|
-
let response = await http.get(url, headers, { responseType: "arraybuffer" })
|
|
116
|
-
return response.data
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
*
|
|
121
|
-
* @async
|
|
122
|
-
* @param {string} recordingId
|
|
123
|
-
* @returns {array}
|
|
124
|
-
*/
|
|
125
|
-
export async function getAllRecordImages(recordingId) {
|
|
126
|
-
let imageList = []
|
|
127
|
-
let imageNameList = await this.getImageList(recordingId)
|
|
128
|
-
|
|
129
|
-
for (const imageName of imageNameList) {
|
|
130
|
-
let headers = {
|
|
131
|
-
"Content-Type": "application/json",
|
|
132
|
-
Accept: "application/json",
|
|
133
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
134
|
-
}
|
|
135
|
-
let response = await http.get(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}/images/${imageName}`, {
|
|
136
|
-
headers,
|
|
137
|
-
})
|
|
138
|
-
imageList.push({ imageName: imageName, data: response.data })
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return imageList
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* @async
|
|
147
|
-
* @param {object} param0
|
|
148
|
-
* @param {string} param0.recordingId
|
|
149
|
-
* @param {string} param0.imageName
|
|
150
|
-
* @returns - http result
|
|
151
|
-
*/
|
|
152
|
-
export async function deleteImage({ recordingId, imageName }) {
|
|
153
|
-
let headers = {
|
|
154
|
-
"Content-Type": "application/json",
|
|
155
|
-
Accept: "application/json",
|
|
156
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return http.delete(`${Config.apiBaseURL}/v1/meetings/recordings/${recordingId}/images/${imageName}`, headers)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
*
|
|
164
|
-
* @async
|
|
165
|
-
* @param {object} options
|
|
166
|
-
* @param {string} options.meetingId
|
|
167
|
-
* @param {string} options.meetingToken
|
|
168
|
-
* @param {string} [options.title="UNTITLED"]
|
|
169
|
-
* @param {number} [options.interval=60]
|
|
170
|
-
* @returns {data} - recording details
|
|
171
|
-
*/
|
|
172
|
-
export async function startRecording(options = { meetingId, meetingToken, title: "UNTITLED", interval: 60 }) {
|
|
173
|
-
let meetingToken = options?.meetingToken
|
|
174
|
-
let title = options?.title || "UNTITLED"
|
|
175
|
-
let interval = options?.interval || 60
|
|
176
|
-
let meetingId = options?.meetingId
|
|
177
|
-
|
|
178
|
-
let headers = {
|
|
179
|
-
"Content-Type": "application/json",
|
|
180
|
-
Accept: "application/json",
|
|
181
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
182
|
-
"x-jibb-meeting-jwt": meetingToken,
|
|
183
|
-
}
|
|
184
|
-
let body = {
|
|
185
|
-
title: title,
|
|
186
|
-
write_interval: interval,
|
|
187
|
-
meeting_id: meetingId,
|
|
188
|
-
}
|
|
189
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/recordings/start`, body, headers)
|
|
190
|
-
return response.data
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
*
|
|
195
|
-
* @async
|
|
196
|
-
* @returns - http result
|
|
197
|
-
*/
|
|
198
|
-
export async function stopRecording() {
|
|
199
|
-
let headers = {
|
|
200
|
-
"Content-Type": "application/json",
|
|
201
|
-
Accept: "application/json",
|
|
202
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
203
|
-
}
|
|
204
|
-
let body = {}
|
|
205
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/recordings/stop`, body, headers)
|
|
206
|
-
return response.data
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
*
|
|
211
|
-
* @async
|
|
212
|
-
* @returns {data}
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
|
-
export async function takeSnapshot() {
|
|
216
|
-
let headers = {
|
|
217
|
-
"Content-Type": "application/json",
|
|
218
|
-
Accept: "application/json",
|
|
219
|
-
"x-jibb-user-jwt": await Auth.getUserToken(),
|
|
220
|
-
}
|
|
221
|
-
let body = {}
|
|
222
|
-
let response = await http.post(`${Config.apiBaseURL}/v1/meetings/recordings/snapshot`, body, headers)
|
|
223
|
-
return response.data
|
|
224
|
-
}
|
|
225
|
-
|