@webex/plugin-meetings 3.0.0-beta.115 → 3.0.0-beta.117
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/breakouts/breakout.js +23 -6
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +178 -139
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +15 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/meeting/index.js +73 -103
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +3 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +1 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +27 -20
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +463 -426
- package/dist/meeting/util.js.map +1 -1
- package/dist/members/index.js +4 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +75 -45
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +308 -317
- package/dist/members/util.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/meeting/index.d.ts +20 -21
- package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
- package/dist/types/meeting/request.d.ts +16 -8
- package/dist/types/meeting/util.d.ts +75 -1
- package/dist/types/members/request.d.ts +56 -11
- package/dist/types/members/util.d.ts +209 -1
- package/package.json +19 -19
- package/src/breakouts/breakout.ts +26 -4
- package/src/breakouts/index.ts +32 -17
- package/src/constants.ts +1 -0
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/meeting/index.ts +20 -42
- package/src/meeting/locusMediaRequest.ts +6 -0
- package/src/meeting/muteState.ts +1 -1
- package/src/meeting/request.ts +26 -17
- package/src/meeting/util.ts +446 -410
- package/src/members/index.ts +7 -1
- package/src/members/request.ts +61 -21
- package/src/members/util.ts +316 -326
- package/test/unit/spec/breakouts/breakout.ts +26 -7
- package/test/unit/spec/breakouts/index.ts +48 -3
- package/test/unit/spec/meeting/index.js +53 -33
- package/test/unit/spec/meeting/locusMediaRequest.ts +25 -3
- package/test/unit/spec/meeting/muteState.js +5 -2
- package/test/unit/spec/meeting/request.js +215 -42
- package/test/unit/spec/meeting/utils.js +151 -7
- package/test/unit/spec/members/index.js +22 -1
- package/test/unit/spec/members/request.js +167 -35
package/dist/members/util.js
CHANGED
|
@@ -16,327 +16,318 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
16
16
|
var _constants = require("../constants");
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
var MembersUtil = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
19
|
+
var MembersUtil = {
|
|
20
|
+
/**
|
|
21
|
+
* @param {Object} invitee with emailAddress, email or phoneNumber
|
|
22
|
+
* @param {String} locusUrl
|
|
23
|
+
* @param {Boolean} alertIfActive
|
|
24
|
+
* @returns {Object} the format object
|
|
25
|
+
*/
|
|
26
|
+
generateAddMemberOptions: function generateAddMemberOptions(invitee, locusUrl, alertIfActive) {
|
|
27
|
+
return {
|
|
28
|
+
invitee: invitee,
|
|
29
|
+
locusUrl: locusUrl,
|
|
30
|
+
alertIfActive: alertIfActive
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* @param {Array} memberIds
|
|
35
|
+
* @param {String} locusUrl
|
|
36
|
+
* @returns {Object} the format object
|
|
37
|
+
*/
|
|
38
|
+
generateAdmitMemberOptions: function generateAdmitMemberOptions(memberIds, locusUrl) {
|
|
39
|
+
return {
|
|
40
|
+
locusUrl: locusUrl,
|
|
41
|
+
memberIds: memberIds
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* @param {Object} options with {invitee: {emailAddress, email, phoneNumber}, alertIfActive}
|
|
46
|
+
* @returns {Object} with {invitees: [{address}], alertIfActive}
|
|
47
|
+
*/
|
|
48
|
+
getAddMemberBody: function getAddMemberBody(options) {
|
|
49
|
+
return {
|
|
50
|
+
invitees: [{
|
|
51
|
+
address: options.invitee.emailAddress || options.invitee.email || options.invitee.phoneNumber
|
|
52
|
+
}],
|
|
53
|
+
alertIfActive: options.alertIfActive
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* @param {Object} options with {memberIds, authorizingLocusUrl}
|
|
58
|
+
* @returns {Object} admit with {memberIds}
|
|
59
|
+
*/
|
|
60
|
+
getAdmitMemberRequestBody: function getAdmitMemberRequestBody(options) {
|
|
61
|
+
var memberIds = options.memberIds,
|
|
62
|
+
sessionLocusUrls = options.sessionLocusUrls;
|
|
63
|
+
var body = {
|
|
64
|
+
admit: {
|
|
65
|
+
participantIds: memberIds
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (sessionLocusUrls) {
|
|
69
|
+
var authorizingLocusUrl = sessionLocusUrls.authorizingLocusUrl;
|
|
70
|
+
return _objectSpread({
|
|
71
|
+
authorizingLocusUrl: authorizingLocusUrl
|
|
72
|
+
}, body);
|
|
70
73
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
body
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
method: _constants.HTTP_VERBS.PUT,
|
|
107
|
-
uri: format.locusUrl,
|
|
108
|
-
body: body
|
|
109
|
-
};
|
|
110
|
-
return requestParams;
|
|
111
|
-
};
|
|
112
|
-
MembersUtil.isInvalidInvitee = function (invitee) {
|
|
113
|
-
if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
if (invitee.phoneNumber) {
|
|
117
|
-
return !_constants.DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);
|
|
118
|
-
}
|
|
119
|
-
return !_constants.VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);
|
|
120
|
-
};
|
|
121
|
-
MembersUtil.getRemoveMemberRequestParams = function (options) {
|
|
122
|
-
var body = {
|
|
123
|
-
reason: options.reason
|
|
124
|
-
};
|
|
125
|
-
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.LEAVE);
|
|
126
|
-
return {
|
|
127
|
-
method: _constants.HTTP_VERBS.PUT,
|
|
128
|
-
uri: uri,
|
|
129
|
-
body: body
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
MembersUtil.generateTransferHostMemberOptions = function (transfer, moderator, locusUrl) {
|
|
133
|
-
return {
|
|
134
|
-
moderator: moderator,
|
|
135
|
-
locusUrl: locusUrl,
|
|
136
|
-
memberId: transfer
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
MembersUtil.generateRemoveMemberOptions = function (removal, locusUrl) {
|
|
140
|
-
return {
|
|
141
|
-
reason: _constants._FORCED_,
|
|
142
|
-
memberId: removal,
|
|
143
|
-
locusUrl: locusUrl
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
MembersUtil.generateMuteMemberOptions = function (memberId, status, locusUrl, isAudio) {
|
|
147
|
-
return {
|
|
148
|
-
memberId: memberId,
|
|
149
|
-
muted: status,
|
|
150
|
-
locusUrl: locusUrl,
|
|
151
|
-
isAudio: isAudio
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
MembersUtil.generateRaiseHandMemberOptions = function (memberId, status, locusUrl) {
|
|
155
|
-
return {
|
|
156
|
-
memberId: memberId,
|
|
157
|
-
raised: status,
|
|
158
|
-
locusUrl: locusUrl
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @param {String} memberId
|
|
164
|
-
* @param {[ServerRoleShape]} roles
|
|
165
|
-
* @param {String} locusUrl
|
|
166
|
-
* @returns {RoleAssignmentOptions}
|
|
167
|
-
*/
|
|
168
|
-
MembersUtil.generateRoleAssignmentMemberOptions = function (memberId, roles, locusUrl) {
|
|
169
|
-
return {
|
|
170
|
-
memberId: memberId,
|
|
171
|
-
roles: roles,
|
|
172
|
-
locusUrl: locusUrl
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
MembersUtil.generateLowerAllHandsMemberOptions = function (requestingParticipantId, locusUrl) {
|
|
176
|
-
return {
|
|
177
|
-
requestingParticipantId: requestingParticipantId,
|
|
178
|
-
locusUrl: locusUrl
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* @param {String} memberId id of the participant who is receiving request
|
|
184
|
-
* @param {String} requestingParticipantId id of the participant who is sending request (optional)
|
|
185
|
-
* @param {String} alias alias name
|
|
186
|
-
* @param {String} locusUrl url
|
|
187
|
-
* @returns {Object} consists of {memberID: string, requestingParticipantId: string, alias: string, locusUrl: string}
|
|
188
|
-
*/
|
|
189
|
-
MembersUtil.generateEditDisplayNameMemberOptions = function (memberId, requestingParticipantId, alias, locusUrl) {
|
|
190
|
-
return {
|
|
191
|
-
memberId: memberId,
|
|
192
|
-
requestingParticipantId: requestingParticipantId,
|
|
193
|
-
alias: alias,
|
|
194
|
-
locusUrl: locusUrl
|
|
195
|
-
};
|
|
196
|
-
};
|
|
197
|
-
MembersUtil.getMuteMemberRequestParams = function (options) {
|
|
198
|
-
var property = options.isAudio === false ? 'video' : 'audio';
|
|
199
|
-
var body = (0, _defineProperty2.default)({}, property, {
|
|
200
|
-
muted: options.muted
|
|
201
|
-
});
|
|
202
|
-
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
203
|
-
return {
|
|
204
|
-
method: _constants.HTTP_VERBS.PATCH,
|
|
205
|
-
uri: uri,
|
|
206
|
-
body: body
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @param {RoleAssignmentOptions} options
|
|
212
|
-
* @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
|
|
213
|
-
*/
|
|
214
|
-
MembersUtil.getRoleAssignmentMemberRequestParams = function (options) {
|
|
215
|
-
var body = {
|
|
216
|
-
role: {
|
|
217
|
-
roles: []
|
|
74
|
+
return body;
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* @param {Object} format with {memberIds, locusUrl, sessionLocusUrls}
|
|
78
|
+
* @returns {Object} the request parameters (method, uri, body) needed to make a admitMember request
|
|
79
|
+
* if a host/cohost is in a breakout session, the locus url should be the main session locus url
|
|
80
|
+
*/
|
|
81
|
+
getAdmitMemberRequestParams: function getAdmitMemberRequestParams(format) {
|
|
82
|
+
var body = MembersUtil.getAdmitMemberRequestBody(format);
|
|
83
|
+
var locusUrl = format.locusUrl,
|
|
84
|
+
sessionLocusUrls = format.sessionLocusUrls;
|
|
85
|
+
var baseUrl = (sessionLocusUrls === null || sessionLocusUrls === void 0 ? void 0 : sessionLocusUrls.mainLocusUrl) || locusUrl;
|
|
86
|
+
var uri = "".concat(baseUrl, "/").concat(_constants.CONTROLS);
|
|
87
|
+
return {
|
|
88
|
+
method: _constants.HTTP_VERBS.PUT,
|
|
89
|
+
uri: uri,
|
|
90
|
+
body: body
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
/**
|
|
94
|
+
* @param {Object} format with {invitee {emailAddress, email, phoneNumber}, locusUrl, alertIfActive}
|
|
95
|
+
* @returns {Object} the request parameters (method, uri, body) needed to make a addMember request
|
|
96
|
+
*/
|
|
97
|
+
getAddMemberRequestParams: function getAddMemberRequestParams(format) {
|
|
98
|
+
var body = MembersUtil.getAddMemberBody(format);
|
|
99
|
+
var requestParams = {
|
|
100
|
+
method: _constants.HTTP_VERBS.PUT,
|
|
101
|
+
uri: format.locusUrl,
|
|
102
|
+
body: body
|
|
103
|
+
};
|
|
104
|
+
return requestParams;
|
|
105
|
+
},
|
|
106
|
+
isInvalidInvitee: function isInvalidInvitee(invitee) {
|
|
107
|
+
if (!(invitee && (invitee.email || invitee.emailAddress || invitee.phoneNumber))) {
|
|
108
|
+
return true;
|
|
218
109
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
body.role.roles.push({
|
|
222
|
-
type: role.type,
|
|
223
|
-
hasRole: role.hasRole
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
227
|
-
return {
|
|
228
|
-
method: _constants.HTTP_VERBS.PATCH,
|
|
229
|
-
uri: uri,
|
|
230
|
-
body: body
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
MembersUtil.getRaiseHandMemberRequestParams = function (options) {
|
|
234
|
-
var body = {
|
|
235
|
-
hand: {
|
|
236
|
-
raised: options.raised
|
|
110
|
+
if (invitee.phoneNumber) {
|
|
111
|
+
return !_constants.DIALER_REGEX.E164_FORMAT.test(invitee.phoneNumber);
|
|
237
112
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
113
|
+
return !_constants.VALID_EMAIL_ADDRESS.test(invitee.email || invitee.emailAddress);
|
|
114
|
+
},
|
|
115
|
+
getRemoveMemberRequestParams: function getRemoveMemberRequestParams(options) {
|
|
116
|
+
var body = {
|
|
117
|
+
reason: options.reason
|
|
118
|
+
};
|
|
119
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.LEAVE);
|
|
120
|
+
return {
|
|
121
|
+
method: _constants.HTTP_VERBS.PUT,
|
|
122
|
+
uri: uri,
|
|
123
|
+
body: body
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
generateTransferHostMemberOptions: function generateTransferHostMemberOptions(transfer, moderator, locusUrl) {
|
|
127
|
+
return {
|
|
128
|
+
moderator: moderator,
|
|
129
|
+
locusUrl: locusUrl,
|
|
130
|
+
memberId: transfer
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
generateRemoveMemberOptions: function generateRemoveMemberOptions(removal, locusUrl) {
|
|
134
|
+
return {
|
|
135
|
+
reason: _constants._FORCED_,
|
|
136
|
+
memberId: removal,
|
|
137
|
+
locusUrl: locusUrl
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
generateMuteMemberOptions: function generateMuteMemberOptions(memberId, status, locusUrl, isAudio) {
|
|
141
|
+
return {
|
|
142
|
+
memberId: memberId,
|
|
143
|
+
muted: status,
|
|
144
|
+
locusUrl: locusUrl,
|
|
145
|
+
isAudio: isAudio
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
generateRaiseHandMemberOptions: function generateRaiseHandMemberOptions(memberId, status, locusUrl) {
|
|
149
|
+
return {
|
|
150
|
+
memberId: memberId,
|
|
151
|
+
raised: status,
|
|
152
|
+
locusUrl: locusUrl
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* @param {String} memberId
|
|
157
|
+
* @param {[ServerRoleShape]} roles
|
|
158
|
+
* @param {String} locusUrl
|
|
159
|
+
* @returns {RoleAssignmentOptions}
|
|
160
|
+
*/
|
|
161
|
+
generateRoleAssignmentMemberOptions: function generateRoleAssignmentMemberOptions(memberId, roles, locusUrl) {
|
|
162
|
+
return {
|
|
163
|
+
memberId: memberId,
|
|
164
|
+
roles: roles,
|
|
165
|
+
locusUrl: locusUrl
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
generateLowerAllHandsMemberOptions: function generateLowerAllHandsMemberOptions(requestingParticipantId, locusUrl) {
|
|
169
|
+
return {
|
|
170
|
+
requestingParticipantId: requestingParticipantId,
|
|
171
|
+
locusUrl: locusUrl
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* @param {String} memberId id of the participant who is receiving request
|
|
176
|
+
* @param {String} requestingParticipantId id of the participant who is sending request (optional)
|
|
177
|
+
* @param {String} alias alias name
|
|
178
|
+
* @param {String} locusUrl url
|
|
179
|
+
* @returns {Object} consists of {memberID: string, requestingParticipantId: string, alias: string, locusUrl: string}
|
|
180
|
+
*/
|
|
181
|
+
generateEditDisplayNameMemberOptions: function generateEditDisplayNameMemberOptions(memberId, requestingParticipantId, alias, locusUrl) {
|
|
182
|
+
return {
|
|
183
|
+
memberId: memberId,
|
|
184
|
+
requestingParticipantId: requestingParticipantId,
|
|
185
|
+
alias: alias,
|
|
186
|
+
locusUrl: locusUrl
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
getMuteMemberRequestParams: function getMuteMemberRequestParams(options) {
|
|
190
|
+
var property = options.isAudio === false ? 'video' : 'audio';
|
|
191
|
+
var body = (0, _defineProperty2.default)({}, property, {
|
|
192
|
+
muted: options.muted
|
|
193
|
+
});
|
|
194
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
195
|
+
return {
|
|
196
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
197
|
+
uri: uri,
|
|
198
|
+
body: body
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* @param {RoleAssignmentOptions} options
|
|
203
|
+
* @returns {RoleAssignmentRequest} the request parameters (method, uri, body) needed to make a addMember request
|
|
204
|
+
*/
|
|
205
|
+
getRoleAssignmentMemberRequestParams: function getRoleAssignmentMemberRequestParams(options) {
|
|
206
|
+
var body = {
|
|
207
|
+
role: {
|
|
208
|
+
roles: []
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
options.roles.forEach(function (role) {
|
|
212
|
+
body.role.roles.push({
|
|
213
|
+
type: role.type,
|
|
214
|
+
hasRole: role.hasRole
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
218
|
+
return {
|
|
219
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
220
|
+
uri: uri,
|
|
221
|
+
body: body
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
getRaiseHandMemberRequestParams: function getRaiseHandMemberRequestParams(options) {
|
|
225
|
+
var body = {
|
|
226
|
+
hand: {
|
|
227
|
+
raised: options.raised
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
231
|
+
return {
|
|
232
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
233
|
+
uri: uri,
|
|
234
|
+
body: body
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
getLowerAllHandsMemberRequestParams: function getLowerAllHandsMemberRequestParams(options) {
|
|
238
|
+
var body = {
|
|
239
|
+
hand: {
|
|
240
|
+
raised: false
|
|
241
|
+
},
|
|
242
|
+
requestingParticipantId: options.requestingParticipantId
|
|
243
|
+
};
|
|
244
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.CONTROLS);
|
|
245
|
+
return {
|
|
246
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
247
|
+
uri: uri,
|
|
248
|
+
body: body
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
/**
|
|
252
|
+
* @param {Object} options with format of {locusUrl: string, requestingParticipantId: string}
|
|
253
|
+
* @returns {Object} request parameters (method, uri, body) needed to make a editDisplayName request
|
|
254
|
+
*/
|
|
255
|
+
editDisplayNameMemberRequestParams: function editDisplayNameMemberRequestParams(options) {
|
|
256
|
+
var body = {
|
|
257
|
+
aliasValue: options.alias,
|
|
258
|
+
requestingParticipantId: options.requestingParticipantId
|
|
259
|
+
};
|
|
260
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.ALIAS);
|
|
261
|
+
return {
|
|
262
|
+
method: _constants.HTTP_VERBS.POST,
|
|
263
|
+
uri: uri,
|
|
264
|
+
body: body
|
|
265
|
+
};
|
|
266
|
+
},
|
|
267
|
+
getTransferHostToMemberRequestParams: function getTransferHostToMemberRequestParams(options) {
|
|
268
|
+
var body = {
|
|
269
|
+
role: {
|
|
270
|
+
moderator: options.moderator
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
var uri = "".concat(options.locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(options.memberId, "/").concat(_constants.CONTROLS);
|
|
274
|
+
return {
|
|
275
|
+
method: _constants.HTTP_VERBS.PATCH,
|
|
276
|
+
uri: uri,
|
|
277
|
+
body: body
|
|
278
|
+
};
|
|
279
|
+
},
|
|
280
|
+
genderateSendDTMFOptions: function genderateSendDTMFOptions(url, tones, memberId, locusUrl) {
|
|
281
|
+
return {
|
|
282
|
+
url: url,
|
|
310
283
|
tones: tones,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
284
|
+
memberId: memberId,
|
|
285
|
+
locusUrl: locusUrl
|
|
286
|
+
};
|
|
287
|
+
},
|
|
288
|
+
generateSendDTMFRequestParams: function generateSendDTMFRequestParams(_ref) {
|
|
289
|
+
var url = _ref.url,
|
|
290
|
+
tones = _ref.tones,
|
|
291
|
+
memberId = _ref.memberId,
|
|
292
|
+
locusUrl = _ref.locusUrl;
|
|
293
|
+
var body = {
|
|
294
|
+
device: {
|
|
295
|
+
url: url
|
|
296
|
+
},
|
|
297
|
+
memberId: memberId,
|
|
298
|
+
dtmf: {
|
|
299
|
+
correlationId: _uuid.default.v4(),
|
|
300
|
+
tones: tones,
|
|
301
|
+
direction: 'transmit'
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
var uri = "".concat(locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(memberId, "/").concat(_constants.SEND_DTMF_ENDPOINT);
|
|
305
|
+
return {
|
|
306
|
+
method: _constants.HTTP_VERBS.POST,
|
|
307
|
+
uri: uri,
|
|
308
|
+
body: body
|
|
309
|
+
};
|
|
310
|
+
},
|
|
311
|
+
cancelPhoneInviteOptions: function cancelPhoneInviteOptions(invitee, locusUrl) {
|
|
312
|
+
return {
|
|
313
|
+
invitee: invitee,
|
|
314
|
+
locusUrl: locusUrl
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
generateCancelInviteRequestParams: function generateCancelInviteRequestParams(options) {
|
|
318
|
+
var body = {
|
|
319
|
+
actionType: _constants._REMOVE_,
|
|
320
|
+
invitees: [{
|
|
321
|
+
address: options.invitee.phoneNumber
|
|
322
|
+
}]
|
|
323
|
+
};
|
|
324
|
+
var requestParams = {
|
|
325
|
+
method: _constants.HTTP_VERBS.PUT,
|
|
326
|
+
uri: options.locusUrl,
|
|
327
|
+
body: body
|
|
328
|
+
};
|
|
329
|
+
return requestParams;
|
|
330
|
+
}
|
|
340
331
|
};
|
|
341
332
|
var _default = MembersUtil;
|
|
342
333
|
exports.default = _default;
|