@webex/plugin-meetings 3.8.0-next.59 → 3.8.0-next.60
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 +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/in-meeting-actions.js +3 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1 -0
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/util.js +3 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/members/index.js +23 -0
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +21 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +15 -0
- package/dist/members/util.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
- package/dist/types/meeting/util.d.ts +1 -0
- package/dist/types/members/index.d.ts +8 -0
- package/dist/types/members/request.d.ts +19 -0
- package/dist/types/members/util.d.ts +13 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +3 -3
- package/src/constants.ts +1 -0
- package/src/meeting/in-meeting-actions.ts +4 -0
- package/src/meeting/index.ts +1 -0
- package/src/meeting/util.ts +2 -0
- package/src/members/index.ts +25 -0
- package/src/members/request.ts +26 -0
- package/src/members/util.ts +16 -0
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
- package/test/unit/spec/meeting/index.js +3 -0
- package/test/unit/spec/meeting/utils.js +8 -4
- package/test/unit/spec/members/index.js +103 -26
- package/test/unit/spec/members/request.js +45 -22
- package/test/unit/spec/members/utils.js +33 -0
@@ -53,6 +53,25 @@ export default class MembersRequest extends StatelessWebexPlugin {
|
|
53
53
|
* @returns {Promise}
|
54
54
|
*/
|
55
55
|
assignRolesMember(options: any): Promise<any>;
|
56
|
+
/**
|
57
|
+
* Sends a request to move a meeting member into the lobby.
|
58
|
+
* *
|
59
|
+
* @param {Object} options - Request options.
|
60
|
+
* @param {string} options.locusUrl - The locus URL for the meeting.
|
61
|
+
* @param {string} options.memberId - The ID of the member to move.
|
62
|
+
* @param {Object} body - The request payload.
|
63
|
+
* @param {Object} body.moveToLobby - Container for move‐to‐lobby data.
|
64
|
+
* @param {string[]} body.moveToLobby.participantIds - Array of participant IDs to move.
|
65
|
+
* @returns {Promise} - Resolves with the locus‐delta response.
|
66
|
+
*/
|
67
|
+
moveToLobbyMember(options: {
|
68
|
+
locusUrl: string;
|
69
|
+
memberId: string;
|
70
|
+
}, body: {
|
71
|
+
moveToLobby: {
|
72
|
+
participantIds: string[];
|
73
|
+
};
|
74
|
+
}): Promise<any>;
|
56
75
|
/**
|
57
76
|
* Sends a request to raise or lower a member's hand
|
58
77
|
* @param {Object} options
|
@@ -124,6 +124,19 @@ declare const MembersUtil: {
|
|
124
124
|
};
|
125
125
|
};
|
126
126
|
};
|
127
|
+
getMoveMemberToLobbyRequestBody: (memberId: string) => {
|
128
|
+
moveToLobby: {
|
129
|
+
participantIds: string[];
|
130
|
+
};
|
131
|
+
};
|
132
|
+
getMoveMemberToLobbyRequestParams: (options: {
|
133
|
+
memberId: string;
|
134
|
+
locusUrl: string;
|
135
|
+
}, body: any) => {
|
136
|
+
method: string;
|
137
|
+
uri: string;
|
138
|
+
body: any;
|
139
|
+
};
|
127
140
|
/**
|
128
141
|
* @param {ServerRoleShape} role
|
129
142
|
* @returns {ServerRoleShape} the role shape to be added to the body
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
"@webex/eslint-config-legacy": "0.0.0",
|
44
44
|
"@webex/jest-config-legacy": "0.0.0",
|
45
45
|
"@webex/legacy-tools": "0.0.0",
|
46
|
-
"@webex/plugin-meetings": "3.8.0-next.
|
46
|
+
"@webex/plugin-meetings": "3.8.0-next.60",
|
47
47
|
"@webex/plugin-rooms": "3.8.0-next.21",
|
48
48
|
"@webex/test-helper-chai": "3.8.0-next.17",
|
49
49
|
"@webex/test-helper-mocha": "3.8.0-next.17",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@webex/internal-plugin-metrics": "3.8.0-next.17",
|
72
72
|
"@webex/internal-plugin-support": "3.8.0-next.21",
|
73
73
|
"@webex/internal-plugin-user": "3.8.0-next.17",
|
74
|
-
"@webex/internal-plugin-voicea": "3.8.0-next.
|
74
|
+
"@webex/internal-plugin-voicea": "3.8.0-next.60",
|
75
75
|
"@webex/media-helpers": "3.8.0-next.21",
|
76
76
|
"@webex/plugin-people": "3.8.0-next.19",
|
77
77
|
"@webex/plugin-rooms": "3.8.0-next.21",
|
@@ -92,5 +92,5 @@
|
|
92
92
|
"//": [
|
93
93
|
"TODO: upgrade jwt-decode when moving to node 18"
|
94
94
|
],
|
95
|
-
"version": "3.8.0-next.
|
95
|
+
"version": "3.8.0-next.60"
|
96
96
|
}
|
package/src/constants.ts
CHANGED
@@ -978,6 +978,7 @@ export const DISPLAY_HINTS = {
|
|
978
978
|
PRESENTER_CONTROL: 'PRESENTER_CONTROL',
|
979
979
|
CAN_RENAME_SELF_AND_OBSERVED: 'CAN_RENAME_SELF_AND_OBSERVED',
|
980
980
|
CAN_RENAME_OTHERS: 'CAN_RENAME_OTHERS',
|
981
|
+
MOVE_TO_LOBBY: 'MOVE_TO_LOBBY',
|
981
982
|
|
982
983
|
// breakout session
|
983
984
|
BREAKOUT_MANAGEMENT: 'BREAKOUT_MANAGEMENT',
|
@@ -104,6 +104,7 @@ interface IInMeetingActions {
|
|
104
104
|
canDisableAnnotation?: boolean;
|
105
105
|
canEnableRemoteDesktopControl?: boolean;
|
106
106
|
canDisableRemoteDesktopControl?: boolean;
|
107
|
+
canMoveToLobby?: boolean;
|
107
108
|
}
|
108
109
|
|
109
110
|
/**
|
@@ -300,6 +301,8 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
300
301
|
|
301
302
|
canDisableRemoteDesktopControl = null;
|
302
303
|
|
304
|
+
canMoveToLobby = null;
|
305
|
+
|
303
306
|
/**
|
304
307
|
* Returns all meeting action options
|
305
308
|
* @returns {Object}
|
@@ -399,6 +402,7 @@ export default class InMeetingActions implements IInMeetingActions {
|
|
399
402
|
canDisableAnnotation: this.canDisableAnnotation,
|
400
403
|
canEnableRemoteDesktopControl: this.canEnableRemoteDesktopControl,
|
401
404
|
canDisableRemoteDesktopControl: this.canDisableRemoteDesktopControl,
|
405
|
+
canMoveToLobby: this.canMoveToLobby,
|
402
406
|
});
|
403
407
|
|
404
408
|
/**
|
package/src/meeting/index.ts
CHANGED
@@ -4126,6 +4126,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
4126
4126
|
this.userDisplayHints
|
4127
4127
|
),
|
4128
4128
|
canUserRenameOthers: MeetingUtil.canUserRenameOthers(this.userDisplayHints),
|
4129
|
+
canMoveToLobby: MeetingUtil.canMoveToLobby(this.userDisplayHints),
|
4129
4130
|
canMuteAll: ControlsOptionsUtil.hasHints({
|
4130
4131
|
requiredHints: [DISPLAY_HINTS.MUTE_ALL],
|
4131
4132
|
displayHints: this.userDisplayHints,
|
package/src/meeting/util.ts
CHANGED
@@ -583,6 +583,8 @@ const MeetingUtil = {
|
|
583
583
|
displayHints.includes(DISPLAY_HINTS.SHARE_WHITEBOARD) &&
|
584
584
|
!!policies[SELF_POLICY.SUPPORT_WHITEBOARD],
|
585
585
|
|
586
|
+
canMoveToLobby: (displayHints) => displayHints.includes(DISPLAY_HINTS.MOVE_TO_LOBBY),
|
587
|
+
|
586
588
|
/**
|
587
589
|
* Adds the current locus sequence information to a request body
|
588
590
|
* @param {Object} meeting The meeting object
|
package/src/members/index.ts
CHANGED
@@ -886,6 +886,31 @@ export default class Members extends StatelessWebexPlugin {
|
|
886
886
|
});
|
887
887
|
}
|
888
888
|
|
889
|
+
/**
|
890
|
+
* Moves a meeting member into the lobby.
|
891
|
+
* @param {String} memberId -- The ID of the member to move.
|
892
|
+
* @returns {Promise} -- Resolves with the lobby‐move response.
|
893
|
+
* @public
|
894
|
+
* @memberof Members
|
895
|
+
*/
|
896
|
+
public moveToLobby(memberId: string) {
|
897
|
+
if (!this.locusUrl) {
|
898
|
+
return Promise.reject(
|
899
|
+
new ParameterError(
|
900
|
+
'The associated locus url for this meetings members object must be defined.'
|
901
|
+
)
|
902
|
+
);
|
903
|
+
}
|
904
|
+
if (!memberId) {
|
905
|
+
return Promise.reject(
|
906
|
+
new ParameterError('The member id must be defined to move the member to lobby.')
|
907
|
+
);
|
908
|
+
}
|
909
|
+
const body = MembersUtil.getMoveMemberToLobbyRequestBody(memberId);
|
910
|
+
|
911
|
+
return this.membersRequest.moveToLobbyMember({locusUrl: this.locusUrl, memberId}, body);
|
912
|
+
}
|
913
|
+
|
889
914
|
/**
|
890
915
|
* Raise or lower the hand of a member in a meeting
|
891
916
|
* @param {String} memberId
|
package/src/members/request.ts
CHANGED
@@ -129,6 +129,32 @@ export default class MembersRequest extends StatelessWebexPlugin {
|
|
129
129
|
return this.locusDeltaRequest(requestParams);
|
130
130
|
}
|
131
131
|
|
132
|
+
/**
|
133
|
+
* Sends a request to move a meeting member into the lobby.
|
134
|
+
* *
|
135
|
+
* @param {Object} options - Request options.
|
136
|
+
* @param {string} options.locusUrl - The locus URL for the meeting.
|
137
|
+
* @param {string} options.memberId - The ID of the member to move.
|
138
|
+
* @param {Object} body - The request payload.
|
139
|
+
* @param {Object} body.moveToLobby - Container for move‐to‐lobby data.
|
140
|
+
* @param {string[]} body.moveToLobby.participantIds - Array of participant IDs to move.
|
141
|
+
* @returns {Promise} - Resolves with the locus‐delta response.
|
142
|
+
*/
|
143
|
+
moveToLobbyMember(
|
144
|
+
options: {locusUrl: string; memberId: string},
|
145
|
+
body: {moveToLobby: {participantIds: string[]}}
|
146
|
+
) {
|
147
|
+
if (!options || !options.locusUrl || !options.memberId) {
|
148
|
+
throw new ParameterError(
|
149
|
+
'memberId must be defined, and the associated locus url for this meeting object must be defined.'
|
150
|
+
);
|
151
|
+
}
|
152
|
+
|
153
|
+
const requestParams = MembersUtil.getMoveMemberToLobbyRequestParams(options, body);
|
154
|
+
|
155
|
+
return this.locusDeltaRequest(requestParams);
|
156
|
+
}
|
157
|
+
|
132
158
|
/**
|
133
159
|
* Sends a request to raise or lower a member's hand
|
134
160
|
* @param {Object} options
|
package/src/members/util.ts
CHANGED
@@ -203,6 +203,22 @@ const MembersUtil = {
|
|
203
203
|
};
|
204
204
|
},
|
205
205
|
|
206
|
+
getMoveMemberToLobbyRequestBody: (memberId: string) => ({
|
207
|
+
moveToLobby: {
|
208
|
+
participantIds: [memberId],
|
209
|
+
},
|
210
|
+
}),
|
211
|
+
|
212
|
+
getMoveMemberToLobbyRequestParams: (options: {memberId: string; locusUrl: string}, body) => {
|
213
|
+
const uri = `${options.locusUrl}/${PARTICIPANT}/${options.memberId}/${CONTROLS}`;
|
214
|
+
|
215
|
+
return {
|
216
|
+
method: HTTP_VERBS.PATCH,
|
217
|
+
uri,
|
218
|
+
body,
|
219
|
+
};
|
220
|
+
},
|
221
|
+
|
206
222
|
/**
|
207
223
|
* @param {ServerRoleShape} role
|
208
224
|
* @returns {ServerRoleShape} the role shape to be added to the body
|
@@ -99,6 +99,7 @@ describe('plugin-meetings', () => {
|
|
99
99
|
canDisableAnnotation: null,
|
100
100
|
canEnableRemoteDesktopControl: null,
|
101
101
|
canDisableRemoteDesktopControl: null,
|
102
|
+
canMoveToLobby: null,
|
102
103
|
|
103
104
|
...expected,
|
104
105
|
};
|
@@ -204,6 +205,7 @@ describe('plugin-meetings', () => {
|
|
204
205
|
'canDisableAnnotation',
|
205
206
|
'canEnableRemoteDesktopControl',
|
206
207
|
'canDisableRemoteDesktopControl',
|
208
|
+
'canMoveToLobby',
|
207
209
|
].forEach((key) => {
|
208
210
|
it(`get and set for ${key} work as expected`, () => {
|
209
211
|
const inMeetingActions = new InMeetingActions();
|
@@ -10866,6 +10866,7 @@ describe('plugin-meetings', () => {
|
|
10866
10866
|
let canUserRenameSelfAndObservedSpy;
|
10867
10867
|
let canUserRenameOthersSpy;
|
10868
10868
|
let canShareWhiteBoardSpy;
|
10869
|
+
let canMoveToLobbySpy;
|
10869
10870
|
// Due to import tree issues, hasHints must be stubed within the scope of the `it`.
|
10870
10871
|
|
10871
10872
|
beforeEach(() => {
|
@@ -10896,6 +10897,7 @@ describe('plugin-meetings', () => {
|
|
10896
10897
|
);
|
10897
10898
|
canUserRenameOthersSpy = sinon.spy(MeetingUtil, 'canUserRenameOthers');
|
10898
10899
|
canShareWhiteBoardSpy = sinon.spy(MeetingUtil, 'canShareWhiteBoard');
|
10900
|
+
canMoveToLobbySpy = sinon.spy(MeetingUtil, 'canMoveToLobby');
|
10899
10901
|
});
|
10900
10902
|
|
10901
10903
|
afterEach(() => {
|
@@ -11437,6 +11439,7 @@ describe('plugin-meetings', () => {
|
|
11437
11439
|
assert.calledWith(requiresPostMeetingDataConsentPromptSpy, userDisplayHints);
|
11438
11440
|
assert.calledWith(canUserRenameOthersSpy, userDisplayHints);
|
11439
11441
|
assert.calledWith(canShareWhiteBoardSpy, userDisplayHints, selfUserPolicies);
|
11442
|
+
assert.calledWith(canMoveToLobbySpy, userDisplayHints);
|
11440
11443
|
|
11441
11444
|
assert.calledWith(ControlsOptionsUtil.hasHints, {
|
11442
11445
|
requiredHints: [DISPLAY_HINTS.MUTE_ALL],
|
@@ -789,10 +789,14 @@ describe('plugin-meetings', () => {
|
|
789
789
|
}),
|
790
790
|
false
|
791
791
|
);
|
792
|
-
assert.deepEqual(
|
793
|
-
|
794
|
-
|
795
|
-
|
792
|
+
assert.deepEqual(MeetingUtil.canShareWhiteBoard(['SHARE_WHITEBOARD'], undefined), false);
|
793
|
+
});
|
794
|
+
});
|
795
|
+
|
796
|
+
describe('canMoveToLobby', () => {
|
797
|
+
it('works as expected', () => {
|
798
|
+
assert.deepEqual(MeetingUtil.canMoveToLobby(['MOVE_TO_LOBBY']), true);
|
799
|
+
assert.deepEqual(MeetingUtil.canMoveToLobby([]), false);
|
796
800
|
});
|
797
801
|
});
|
798
802
|
|
@@ -120,9 +120,9 @@ describe('plugin-meetings', () => {
|
|
120
120
|
meeting = {
|
121
121
|
request: sinon.mock().returns(Promise.resolve()),
|
122
122
|
locusInfo: {
|
123
|
-
sequence: {}
|
124
|
-
}
|
125
|
-
}
|
123
|
+
sequence: {},
|
124
|
+
},
|
125
|
+
};
|
126
126
|
|
127
127
|
createMembers = (options) => new Members({locusUrl: options.url, meeting}, {parent: webex});
|
128
128
|
});
|
@@ -349,7 +349,7 @@ describe('plugin-meetings', () => {
|
|
349
349
|
{type: 'COHOST', hasRole: true},
|
350
350
|
];
|
351
351
|
|
352
|
-
const resolvedValue =
|
352
|
+
const resolvedValue = 'it worked';
|
353
353
|
|
354
354
|
const genericMessage = 'Generic error from the API';
|
355
355
|
|
@@ -364,9 +364,13 @@ describe('plugin-meetings', () => {
|
|
364
364
|
};
|
365
365
|
|
366
366
|
if (errorCode) {
|
367
|
-
spies.assignRolesMember = sandbox
|
367
|
+
spies.assignRolesMember = sandbox
|
368
|
+
.stub(members.membersRequest, 'assignRolesMember')
|
369
|
+
.rejects({body: {errorCode}, message: genericMessage});
|
368
370
|
} else {
|
369
|
-
spies.assignRolesMember = sandbox
|
371
|
+
spies.assignRolesMember = sandbox
|
372
|
+
.stub(members.membersRequest, 'assignRolesMember')
|
373
|
+
.resolves(resolvedValue);
|
370
374
|
}
|
371
375
|
|
372
376
|
return {members, spies};
|
@@ -378,7 +382,15 @@ describe('plugin-meetings', () => {
|
|
378
382
|
assert.notCalled(spies.assignRolesMember);
|
379
383
|
};
|
380
384
|
|
381
|
-
const checkError = async (
|
385
|
+
const checkError = async (
|
386
|
+
error,
|
387
|
+
expectedMemberId,
|
388
|
+
expectedRoles,
|
389
|
+
expectedLocusUrl,
|
390
|
+
resultPromise,
|
391
|
+
expectedMessage,
|
392
|
+
spies
|
393
|
+
) => {
|
382
394
|
await assert.isRejected(resultPromise, error, expectedMessage);
|
383
395
|
assert.calledOnceWithExactly(
|
384
396
|
spies.generateRoleAssignmentMemberOptions,
|
@@ -423,7 +435,7 @@ describe('plugin-meetings', () => {
|
|
423
435
|
await checkInvalid(
|
424
436
|
resultPromise,
|
425
437
|
'The member id must be defined to assign the roles to a member.',
|
426
|
-
spies
|
438
|
+
spies
|
427
439
|
);
|
428
440
|
});
|
429
441
|
|
@@ -435,7 +447,7 @@ describe('plugin-meetings', () => {
|
|
435
447
|
await checkInvalid(
|
436
448
|
resultPromise,
|
437
449
|
'The associated locus url for this meetings members object must be defined.',
|
438
|
-
spies
|
450
|
+
spies
|
439
451
|
);
|
440
452
|
});
|
441
453
|
|
@@ -452,7 +464,7 @@ describe('plugin-meetings', () => {
|
|
452
464
|
url1,
|
453
465
|
resultPromise,
|
454
466
|
'Non converged meetings, PSTN or SIP users in converged meetings are not supported currently.',
|
455
|
-
spies
|
467
|
+
spies
|
456
468
|
);
|
457
469
|
});
|
458
470
|
|
@@ -469,7 +481,7 @@ describe('plugin-meetings', () => {
|
|
469
481
|
url1,
|
470
482
|
resultPromise,
|
471
483
|
'Reclaim Host Role Not Allowed For Other Participants. Participants cannot claim host role in PMR meeting, space instant meeting or escalated instant meeting. However, the original host still can reclaim host role when it manually makes another participant to be the host.',
|
472
|
-
spies
|
484
|
+
spies
|
473
485
|
);
|
474
486
|
});
|
475
487
|
|
@@ -486,7 +498,7 @@ describe('plugin-meetings', () => {
|
|
486
498
|
url1,
|
487
499
|
resultPromise,
|
488
500
|
'Host Key Not Specified Or Matched. The original host can reclaim the host role without entering the host key. However, any other person who claims the host role must enter the host key to get it.',
|
489
|
-
spies
|
501
|
+
spies
|
490
502
|
);
|
491
503
|
});
|
492
504
|
|
@@ -503,7 +515,7 @@ describe('plugin-meetings', () => {
|
|
503
515
|
url1,
|
504
516
|
resultPromise,
|
505
517
|
'Participant Having Host Role Already. Participant who sends request to reclaim host role has already a host role.',
|
506
|
-
spies
|
518
|
+
spies
|
507
519
|
);
|
508
520
|
});
|
509
521
|
|
@@ -520,7 +532,7 @@ describe('plugin-meetings', () => {
|
|
520
532
|
url1,
|
521
533
|
resultPromise,
|
522
534
|
genericMessage,
|
523
|
-
spies
|
535
|
+
spies
|
524
536
|
);
|
525
537
|
});
|
526
538
|
|
@@ -530,13 +542,7 @@ describe('plugin-meetings', () => {
|
|
530
542
|
|
531
543
|
const resultPromise = members.assignRoles(memberId, fakeRoles);
|
532
544
|
|
533
|
-
await checkValid(
|
534
|
-
resultPromise,
|
535
|
-
spies,
|
536
|
-
memberId,
|
537
|
-
fakeRoles,
|
538
|
-
url1,
|
539
|
-
);
|
545
|
+
await checkValid(resultPromise, spies, memberId, fakeRoles, url1);
|
540
546
|
});
|
541
547
|
});
|
542
548
|
|
@@ -661,19 +667,19 @@ describe('plugin-meetings', () => {
|
|
661
667
|
spies,
|
662
668
|
expectedRequestingMemberId,
|
663
669
|
expectedLocusUrl,
|
664
|
-
expectedRoles
|
670
|
+
expectedRoles
|
665
671
|
) => {
|
666
672
|
await assert.isFulfilled(resultPromise);
|
667
673
|
assert.calledOnceWithExactly(
|
668
674
|
spies.generateLowerAllHandsMemberOptions,
|
669
675
|
expectedRequestingMemberId,
|
670
676
|
expectedLocusUrl,
|
671
|
-
expectedRoles
|
677
|
+
expectedRoles
|
672
678
|
);
|
673
679
|
assert.calledOnceWithExactly(spies.lowerAllHandsMember, {
|
674
680
|
requestingParticipantId: expectedRequestingMemberId,
|
675
681
|
locusUrl: expectedLocusUrl,
|
676
|
-
...(expectedRoles !== undefined && {
|
682
|
+
...(expectedRoles !== undefined && {roles: expectedRoles}),
|
677
683
|
});
|
678
684
|
assert.strictEqual(resultPromise, spies.lowerAllHandsMember.getCall(0).returnValue);
|
679
685
|
};
|
@@ -714,7 +720,7 @@ describe('plugin-meetings', () => {
|
|
714
720
|
it('should make the correct request when called with valid requestingMemberId and roles', async () => {
|
715
721
|
const requestingMemberId = 'test-member-id';
|
716
722
|
const roles = ['panelist', 'attendee'];
|
717
|
-
const {
|
723
|
+
const {members, spies} = setup('test-locus-url');
|
718
724
|
|
719
725
|
const resultPromise = members.lowerAllHands(requestingMemberId, roles);
|
720
726
|
|
@@ -724,7 +730,7 @@ describe('plugin-meetings', () => {
|
|
724
730
|
it('should handle an empty roles array correctly', async () => {
|
725
731
|
const requestingMemberId = 'test-member-id';
|
726
732
|
const roles = [];
|
727
|
-
const {
|
733
|
+
const {members, spies} = setup('test-locus-url');
|
728
734
|
|
729
735
|
const resultPromise = members.lowerAllHands(requestingMemberId, roles);
|
730
736
|
|
@@ -977,5 +983,76 @@ describe('plugin-meetings', () => {
|
|
977
983
|
);
|
978
984
|
});
|
979
985
|
});
|
986
|
+
|
987
|
+
describe('#moveToLobby', () => {
|
988
|
+
const setup = (locusUrl) => {
|
989
|
+
const members = createMembers({url: locusUrl});
|
990
|
+
|
991
|
+
const spies = {
|
992
|
+
getMoveMemberToLobbyRequestBody: sandbox.spy(
|
993
|
+
MembersUtil,
|
994
|
+
'getMoveMemberToLobbyRequestBody'
|
995
|
+
),
|
996
|
+
moveToLobbyMember: sandbox.spy(members.membersRequest, 'moveToLobbyMember'),
|
997
|
+
};
|
998
|
+
|
999
|
+
return {members, spies};
|
1000
|
+
};
|
1001
|
+
|
1002
|
+
const checkInvalid = async (resultPromise, expectedMessage, spies) => {
|
1003
|
+
await assert.isRejected(resultPromise, ParameterError, expectedMessage);
|
1004
|
+
assert.notCalled(spies.getMoveMemberToLobbyRequestBody);
|
1005
|
+
assert.notCalled(spies.moveToLobbyMember);
|
1006
|
+
};
|
1007
|
+
|
1008
|
+
const checkValid = async (resultPromise, spies, expectedMemberId, expectedLocusUrl) => {
|
1009
|
+
await assert.isFulfilled(resultPromise);
|
1010
|
+
assert.calledOnceWithExactly(spies.getMoveMemberToLobbyRequestBody, expectedMemberId);
|
1011
|
+
assert.calledOnceWithExactly(
|
1012
|
+
spies.moveToLobbyMember,
|
1013
|
+
{
|
1014
|
+
locusUrl: expectedLocusUrl,
|
1015
|
+
memberId: expectedMemberId,
|
1016
|
+
},
|
1017
|
+
{
|
1018
|
+
moveToLobby: {participantIds: [expectedMemberId]},
|
1019
|
+
}
|
1020
|
+
);
|
1021
|
+
assert.strictEqual(resultPromise, spies.moveToLobbyMember.getCall(0).returnValue);
|
1022
|
+
};
|
1023
|
+
|
1024
|
+
it('should not make a request if there is no member id', async () => {
|
1025
|
+
const {members, spies} = setup(url1);
|
1026
|
+
|
1027
|
+
const resultPromise = members.moveToLobby();
|
1028
|
+
|
1029
|
+
await checkInvalid(
|
1030
|
+
resultPromise,
|
1031
|
+
'The member id must be defined to move the member to lobby.',
|
1032
|
+
spies
|
1033
|
+
);
|
1034
|
+
});
|
1035
|
+
|
1036
|
+
it('should not make a request if there is no locus url', async () => {
|
1037
|
+
const {members, spies} = setup();
|
1038
|
+
|
1039
|
+
const resultPromise = members.moveToLobby(uuid.v4());
|
1040
|
+
|
1041
|
+
await checkInvalid(
|
1042
|
+
resultPromise,
|
1043
|
+
'The associated locus url for this meetings members object must be defined.',
|
1044
|
+
spies
|
1045
|
+
);
|
1046
|
+
});
|
1047
|
+
|
1048
|
+
it('should make the correct request when called with valid memberId and locusUrl', async () => {
|
1049
|
+
const memberId = uuid.v4();
|
1050
|
+
const {members, spies} = setup(url1);
|
1051
|
+
|
1052
|
+
const resultPromise = members.moveToLobby(memberId);
|
1053
|
+
|
1054
|
+
await checkValid(resultPromise, spies, memberId, url1);
|
1055
|
+
});
|
1056
|
+
});
|
980
1057
|
});
|
981
1058
|
});
|
@@ -9,7 +9,7 @@ import Meetings from '@webex/plugin-meetings';
|
|
9
9
|
import MembersRequest from '@webex/plugin-meetings/src/members/request';
|
10
10
|
import membersUtil from '@webex/plugin-meetings/src/members/util';
|
11
11
|
import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
|
12
|
-
import {
|
12
|
+
import {merge} from 'lodash';
|
13
13
|
|
14
14
|
const {assert} = chai;
|
15
15
|
|
@@ -65,10 +65,7 @@ describe('plugin-meetings', () => {
|
|
65
65
|
|
66
66
|
const checkRequest = (expectedParams) => {
|
67
67
|
assert.calledOnceWithExactly(locusDeltaRequestSpy, expectedParams);
|
68
|
-
assert.calledOnceWithExactly(
|
69
|
-
membersRequest.request,
|
70
|
-
merge(expectedParams, {body: {sequence}})
|
71
|
-
);
|
68
|
+
assert.calledOnceWithExactly(membersRequest.request, merge(expectedParams, {body: {sequence}}));
|
72
69
|
};
|
73
70
|
|
74
71
|
describe('members request library', () => {
|
@@ -98,8 +95,8 @@ describe('plugin-meetings', () => {
|
|
98
95
|
},
|
99
96
|
device: {
|
100
97
|
url,
|
101
|
-
}
|
102
|
-
}
|
98
|
+
},
|
99
|
+
},
|
103
100
|
});
|
104
101
|
});
|
105
102
|
});
|
@@ -120,9 +117,9 @@ describe('plugin-meetings', () => {
|
|
120
117
|
uri: url1,
|
121
118
|
body: {
|
122
119
|
alertIfActive: undefined,
|
123
|
-
invitees: [{address: '+18578675309'}]
|
124
|
-
}
|
125
|
-
})
|
120
|
+
invitees: [{address: '+18578675309'}],
|
121
|
+
},
|
122
|
+
});
|
126
123
|
});
|
127
124
|
});
|
128
125
|
|
@@ -133,16 +130,16 @@ describe('plugin-meetings', () => {
|
|
133
130
|
memberIds: ['1', '2'],
|
134
131
|
};
|
135
132
|
|
136
|
-
await membersRequest.admitMember(options)
|
133
|
+
await membersRequest.admitMember(options);
|
137
134
|
|
138
135
|
checkRequest({
|
139
136
|
method: 'PUT',
|
140
137
|
uri: 'https://example.com/12345/controls',
|
141
138
|
body: {
|
142
139
|
admit: {
|
143
|
-
participantIds: options.memberIds
|
144
|
-
}
|
145
|
-
}
|
140
|
+
participantIds: options.memberIds,
|
141
|
+
},
|
142
|
+
},
|
146
143
|
});
|
147
144
|
});
|
148
145
|
});
|
@@ -160,7 +157,7 @@ describe('plugin-meetings', () => {
|
|
160
157
|
method: 'PUT',
|
161
158
|
uri: 'https://example.com/12345/participant/member1/leave',
|
162
159
|
body: {
|
163
|
-
reason: undefined
|
160
|
+
reason: undefined,
|
164
161
|
},
|
165
162
|
});
|
166
163
|
});
|
@@ -247,9 +244,9 @@ describe('plugin-meetings', () => {
|
|
247
244
|
uri: `${locusUrl}/participant/${memberId}/controls`,
|
248
245
|
body: {
|
249
246
|
role: {
|
250
|
-
roles
|
251
|
-
}
|
252
|
-
}
|
247
|
+
roles,
|
248
|
+
},
|
249
|
+
},
|
253
250
|
});
|
254
251
|
});
|
255
252
|
});
|
@@ -272,9 +269,9 @@ describe('plugin-meetings', () => {
|
|
272
269
|
uri: `${locusUrl}/participant/${memberId}/controls`,
|
273
270
|
body: {
|
274
271
|
hand: {
|
275
|
-
raised: true
|
276
|
-
}
|
277
|
-
}
|
272
|
+
raised: true,
|
273
|
+
},
|
274
|
+
},
|
278
275
|
});
|
279
276
|
});
|
280
277
|
});
|
@@ -406,7 +403,33 @@ describe('plugin-meetings', () => {
|
|
406
403
|
body: {
|
407
404
|
aliasValue,
|
408
405
|
requestingParticipantId,
|
409
|
-
}
|
406
|
+
},
|
407
|
+
});
|
408
|
+
});
|
409
|
+
});
|
410
|
+
|
411
|
+
describe('#moveToLobby', () => {
|
412
|
+
it('sends a moveToLobbyMember PATCH to the locus endpoint', async () => {
|
413
|
+
const locusUrl = url1;
|
414
|
+
const memberId = 'test1';
|
415
|
+
const options = {
|
416
|
+
locusUrl: locusUrl,
|
417
|
+
memberId,
|
418
|
+
};
|
419
|
+
const body = {
|
420
|
+
moveToLobby: {participantIds: [memberId]},
|
421
|
+
};
|
422
|
+
|
423
|
+
const getRequestParamsSpy = sandbox.spy(membersUtil, 'getMoveMemberToLobbyRequestParams');
|
424
|
+
|
425
|
+
await membersRequest.moveToLobbyMember(options, body);
|
426
|
+
|
427
|
+
assert.calledOnceWithExactly(getRequestParamsSpy, options, body);
|
428
|
+
|
429
|
+
checkRequest({
|
430
|
+
method: 'PATCH',
|
431
|
+
uri: `${locusUrl}/participant/${memberId}/controls`,
|
432
|
+
body: {moveToLobby: {participantIds: [memberId]}},
|
410
433
|
});
|
411
434
|
});
|
412
435
|
});
|