@webex/plugin-meetings 3.0.0-beta.155 → 3.0.0-beta.156
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.
|
@@ -69,6 +69,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
|
|
|
69
69
|
this.breakoutRequest = new _request.default({
|
|
70
70
|
webex: this.webex
|
|
71
71
|
});
|
|
72
|
+
this.breakoutRosterLocus = null;
|
|
72
73
|
},
|
|
73
74
|
/**
|
|
74
75
|
* Joins the breakout session
|
|
@@ -160,6 +161,20 @@ var Breakout = _webexCore.WebexPlugin.extend({
|
|
|
160
161
|
parent: this.webex
|
|
161
162
|
});
|
|
162
163
|
},
|
|
164
|
+
/**
|
|
165
|
+
* check sequence and determine whether to update the new roster or not
|
|
166
|
+
* @param {Object} locus Locus object
|
|
167
|
+
* @returns {Boolean}
|
|
168
|
+
*/
|
|
169
|
+
isNeedHandleRoster: function isNeedHandleRoster(locus) {
|
|
170
|
+
var _this$breakoutRosterL, _this$breakoutRosterL2, _this$breakoutRosterL3, _locus$sequence, _locus$sequence$entri;
|
|
171
|
+
if (!((_this$breakoutRosterL = this.breakoutRosterLocus) !== null && _this$breakoutRosterL !== void 0 && (_this$breakoutRosterL2 = _this$breakoutRosterL.sequence) !== null && _this$breakoutRosterL2 !== void 0 && (_this$breakoutRosterL3 = _this$breakoutRosterL2.entries) !== null && _this$breakoutRosterL3 !== void 0 && _this$breakoutRosterL3.length) || !(locus !== null && locus !== void 0 && (_locus$sequence = locus.sequence) !== null && _locus$sequence !== void 0 && (_locus$sequence$entri = _locus$sequence.entries) !== null && _locus$sequence$entri !== void 0 && _locus$sequence$entri.length)) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
var prevSequence = this.breakoutRosterLocus.sequence.entries[0];
|
|
175
|
+
var currentSequence = locus.sequence.entries[0];
|
|
176
|
+
return currentSequence > prevSequence;
|
|
177
|
+
},
|
|
163
178
|
/**
|
|
164
179
|
* Parses the participants from the locus object
|
|
165
180
|
* @param {Object} locus Locus object
|
|
@@ -169,6 +184,10 @@ var Breakout = _webexCore.WebexPlugin.extend({
|
|
|
169
184
|
if (!this.members) {
|
|
170
185
|
this.initMembers();
|
|
171
186
|
}
|
|
187
|
+
if (!this.isNeedHandleRoster(locus)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.breakoutRosterLocus = locus;
|
|
172
191
|
this.members.locusParticipantsUpdate(locus);
|
|
173
192
|
},
|
|
174
193
|
/**
|
|
@@ -186,7 +205,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
|
|
|
186
205
|
sessionId: this.sessionId
|
|
187
206
|
});
|
|
188
207
|
},
|
|
189
|
-
version: "3.0.0-beta.
|
|
208
|
+
version: "3.0.0-beta.156"
|
|
190
209
|
});
|
|
191
210
|
var _default = Breakout;
|
|
192
211
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Breakout","WebexPlugin","extend","idAttribute","namespace","MEETINGS","breakoutRequest","BreakoutRequest","props","active","allowed","assigned","assignedCurrent","requested","current","name","sessionId","sessionType","groupId","url","requestedLastModifiedTime","derived","isMain","cache","deps","fn","initialize","webex","join","breakoutMoveId","uuid","v4","deviceUrl","internal","device","meetingId","collection","parent","meeting","meetings","getMeetingByType","_ID_","breakoutEvent","onBreakoutMoveRequest","currentSession","request","method","HTTP_VERBS","POST","uri","body","result","onBreakoutMoveResponse","leave","Error","mainSession","breakouts","filter","breakout","askForHelp","initMembers","members","Members","
|
|
1
|
+
{"version":3,"names":["Breakout","WebexPlugin","extend","idAttribute","namespace","MEETINGS","breakoutRequest","BreakoutRequest","props","active","allowed","assigned","assignedCurrent","requested","current","name","sessionId","sessionType","groupId","url","requestedLastModifiedTime","derived","isMain","cache","deps","fn","initialize","webex","breakoutRosterLocus","join","breakoutMoveId","uuid","v4","deviceUrl","internal","device","meetingId","collection","parent","meeting","meetings","getMeetingByType","_ID_","breakoutEvent","onBreakoutMoveRequest","currentSession","request","method","HTTP_VERBS","POST","uri","body","result","onBreakoutMoveResponse","leave","Error","mainSession","breakouts","filter","breakout","askForHelp","initMembers","members","Members","isNeedHandleRoster","locus","sequence","entries","length","prevSequence","currentSequence","parseRoster","locusParticipantsUpdate","broadcast","message","options"],"sources":["breakout.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport uuid from 'uuid';\nimport {_ID_, HTTP_VERBS, MEETINGS} from '../constants';\nimport Members from '../members';\nimport BreakoutRequest from './request';\nimport breakoutEvent from './events';\n/**\n * @class\n */\nconst Breakout = WebexPlugin.extend({\n idAttribute: 'sessionId',\n\n namespace: MEETINGS,\n\n breakoutRequest: BreakoutRequest,\n props: {\n active: ['boolean', false, false], // this session is active\n allowed: ['boolean', false, false], // allowed to join this session\n assigned: ['boolean', false, false], // assigned to this session, but not necessarily joined yet\n assignedCurrent: ['boolean', false, false], // assigned AND current session\n requested: ['boolean', false, false], // requested by the host to join this session\n current: ['boolean', false, false], // the current joined session\n name: 'string',\n sessionId: 'string',\n sessionType: 'string',\n groupId: 'string',\n url: 'string', // where to send requests to\n requestedLastModifiedTime: 'string',\n },\n\n derived: {\n isMain: {\n cache: false, // fix issue: sometimes the derived will not change even if the deps changed\n deps: ['sessionType'],\n /**\n * If the breakout has no name, assume it is the main session\n * @returns {boolean}\n */\n fn() {\n return this.sessionType === 'MAIN';\n },\n },\n },\n /**\n * initializer for the Breakout class\n * @returns {void}\n */\n initialize() {\n // @ts-ignore\n this.breakoutRequest = new BreakoutRequest({webex: this.webex});\n this.breakoutRosterLocus = null;\n },\n\n /**\n * Joins the breakout session\n * @returns {Promise}\n */\n async join() {\n const breakoutMoveId = uuid.v4();\n const deviceUrl = this.webex.internal.device.url;\n const {meetingId} = this.collection.parent;\n const meeting = this.webex.meetings.getMeetingByType(_ID_, meetingId);\n breakoutEvent.onBreakoutMoveRequest({currentSession: this, meeting, breakoutMoveId});\n const result = await this.request({\n method: HTTP_VERBS.POST,\n uri: `${this.url}/move`,\n body: {\n breakoutMoveId,\n deviceUrl,\n groupId: this.groupId,\n sessionId: this.sessionId,\n },\n });\n breakoutEvent.onBreakoutMoveResponse({currentSession: this, meeting, breakoutMoveId});\n\n return result;\n },\n\n /**\n * Leaves the breakout session to return to the main session\n * @returns {Promise}\n * @throws {Error} if an attempt is made to leave the main session or if the main session cannot be found\n */\n leave() {\n if (this.isMain) {\n throw new Error('Cannot leave the main session');\n }\n\n const mainSession = this.parent.breakouts.filter((breakout) => breakout.isMain)[0];\n\n if (!mainSession) {\n throw new Error('Cannot leave, no main session found');\n }\n\n return mainSession.join();\n },\n\n /**\n * Sends a help request for the current breakout\n * @returns {Promise}\n */\n askForHelp() {\n return this.request({\n method: HTTP_VERBS.POST,\n uri: `${this.url}/help`,\n body: {\n groupId: this.groupId,\n sessionId: this.sessionId,\n },\n });\n },\n\n /**\n * inits the members object\n * @returns {void}\n */\n initMembers() {\n const {meetingId} = this.collection.parent;\n const meeting = this.webex.meetings.getMeetingByType(_ID_, meetingId);\n this.members = new Members(\n {\n meeting,\n },\n {parent: this.webex}\n );\n },\n\n /**\n * check sequence and determine whether to update the new roster or not\n * @param {Object} locus Locus object\n * @returns {Boolean}\n */\n isNeedHandleRoster(locus: any) {\n if (!this.breakoutRosterLocus?.sequence?.entries?.length || !locus?.sequence?.entries?.length) {\n return true;\n }\n const prevSequence = this.breakoutRosterLocus.sequence.entries[0];\n const currentSequence = locus.sequence.entries[0];\n\n return currentSequence > prevSequence;\n },\n /**\n * Parses the participants from the locus object\n * @param {Object} locus Locus object\n * @returns {void}\n */\n parseRoster(locus) {\n if (!this.members) {\n this.initMembers();\n }\n if (!this.isNeedHandleRoster(locus)) {\n return;\n }\n this.breakoutRosterLocus = locus;\n this.members.locusParticipantsUpdate(locus);\n },\n\n /**\n * Broadcast message to this breakout session's participants\n * @param {String} message\n * @param {Object} options\n * @returns {Promise}\n */\n broadcast(message, options) {\n return this.breakoutRequest.broadcast({\n url: this.url,\n message,\n options,\n groupId: this.groupId,\n sessionId: this.sessionId,\n });\n },\n});\n\nexport default Breakout;\n"],"mappings":";;;;;;;;;;AAIA;AAEA;AACA;AACA;AACA;AACA;AAVA;AACA;AACA;;AASA;AACA;AACA;AACA,IAAMA,QAAQ,GAAGC,sBAAW,CAACC,MAAM,CAAC;EAClCC,WAAW,EAAE,WAAW;EAExBC,SAAS,EAAEC,mBAAQ;EAEnBC,eAAe,EAAEC,gBAAe;EAChCC,KAAK,EAAE;IACLC,MAAM,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IACnCC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IACpCC,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IACrCC,eAAe,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IAC5CC,SAAS,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IACtCC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE;IACpCC,IAAI,EAAE,QAAQ;IACdC,SAAS,EAAE,QAAQ;IACnBC,WAAW,EAAE,QAAQ;IACrBC,OAAO,EAAE,QAAQ;IACjBC,GAAG,EAAE,QAAQ;IAAE;IACfC,yBAAyB,EAAE;EAC7B,CAAC;EAEDC,OAAO,EAAE;IACPC,MAAM,EAAE;MACNC,KAAK,EAAE,KAAK;MAAE;MACdC,IAAI,EAAE,CAAC,aAAa,CAAC;MACrB;AACN;AACA;AACA;MACMC,EAAE,gBAAG;QACH,OAAO,IAAI,CAACR,WAAW,KAAK,MAAM;MACpC;IACF;EACF,CAAC;EACD;AACF;AACA;AACA;EACES,UAAU,wBAAG;IACX;IACA,IAAI,CAACpB,eAAe,GAAG,IAAIC,gBAAe,C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IACb;IACA,IAAMC,YAAY,GAAG,IAAI,CAACzC,mBAAmB,CAACsC,QAAQ,CAACC,OAAO,CAAC,CAAC,CAAC;IACjE,IAAMG,eAAe,GAAGL,KAAK,CAACC,QAAQ,CAACC,OAAO,CAAC,CAAC,CAAC;IAEjD,OAAOG,eAAe,GAAGD,YAAY;EACvC,CAAC;EACD;AACF;AACA;AACA;AACA;EACEE,WAAW,uBAACN,KAAK,EAAE;IACjB,IAAI,CAAC,IAAI,CAACH,OAAO,EAAE;MACjB,IAAI,CAACD,WAAW,EAAE;IACpB;IACA,IAAI,CAAC,IAAI,CAACG,kBAAkB,CAACC,KAAK,CAAC,EAAE;MACnC;IACF;IACA,IAAI,CAACrC,mBAAmB,GAAGqC,KAAK;IAChC,IAAI,CAACH,OAAO,CAACU,uBAAuB,CAACP,KAAK,CAAC;EAC7C,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEQ,SAAS,qBAACC,OAAO,EAAEC,OAAO,EAAE;IAC1B,OAAO,IAAI,CAACrE,eAAe,CAACmE,SAAS,CAAC;MACpCtD,GAAG,EAAE,IAAI,CAACA,GAAG;MACbuD,OAAO,EAAPA,OAAO;MACPC,OAAO,EAAPA,OAAO;MACPzD,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBF,SAAS,EAAE,IAAI,CAACA;IAClB,CAAC,CAAC;EACJ,CAAC;EAAA;AACH,CAAC,CAAC;AAAC,eAEYhB,QAAQ;AAAA"}
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1039,7 +1039,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1039
1039
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1040
1040
|
}
|
|
1041
1041
|
},
|
|
1042
|
-
version: "3.0.0-beta.
|
|
1042
|
+
version: "3.0.0-beta.156"
|
|
1043
1043
|
});
|
|
1044
1044
|
var _default = Breakouts;
|
|
1045
1045
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.156",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.156",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.156",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.156",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.156",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.156",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.156",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.156",
|
|
50
50
|
"@webex/internal-media-core": "1.38.5",
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/media-helpers": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
60
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
61
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.156",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.156",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.156",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.156",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.156",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.156",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.156",
|
|
58
|
+
"@webex/media-helpers": "3.0.0-beta.156",
|
|
59
|
+
"@webex/plugin-people": "3.0.0-beta.156",
|
|
60
|
+
"@webex/plugin-rooms": "3.0.0-beta.156",
|
|
61
|
+
"@webex/webex-core": "3.0.0-beta.156",
|
|
62
62
|
"ampersand-collection": "^2.0.2",
|
|
63
63
|
"bowser": "^2.11.0",
|
|
64
64
|
"btoa": "^1.2.1",
|
|
@@ -46,7 +46,6 @@ const Breakout = WebexPlugin.extend({
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
|
-
|
|
50
49
|
/**
|
|
51
50
|
* initializer for the Breakout class
|
|
52
51
|
* @returns {void}
|
|
@@ -54,6 +53,7 @@ const Breakout = WebexPlugin.extend({
|
|
|
54
53
|
initialize() {
|
|
55
54
|
// @ts-ignore
|
|
56
55
|
this.breakoutRequest = new BreakoutRequest({webex: this.webex});
|
|
56
|
+
this.breakoutRosterLocus = null;
|
|
57
57
|
},
|
|
58
58
|
|
|
59
59
|
/**
|
|
@@ -130,6 +130,20 @@ const Breakout = WebexPlugin.extend({
|
|
|
130
130
|
);
|
|
131
131
|
},
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* check sequence and determine whether to update the new roster or not
|
|
135
|
+
* @param {Object} locus Locus object
|
|
136
|
+
* @returns {Boolean}
|
|
137
|
+
*/
|
|
138
|
+
isNeedHandleRoster(locus: any) {
|
|
139
|
+
if (!this.breakoutRosterLocus?.sequence?.entries?.length || !locus?.sequence?.entries?.length) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
const prevSequence = this.breakoutRosterLocus.sequence.entries[0];
|
|
143
|
+
const currentSequence = locus.sequence.entries[0];
|
|
144
|
+
|
|
145
|
+
return currentSequence > prevSequence;
|
|
146
|
+
},
|
|
133
147
|
/**
|
|
134
148
|
* Parses the participants from the locus object
|
|
135
149
|
* @param {Object} locus Locus object
|
|
@@ -139,7 +153,10 @@ const Breakout = WebexPlugin.extend({
|
|
|
139
153
|
if (!this.members) {
|
|
140
154
|
this.initMembers();
|
|
141
155
|
}
|
|
142
|
-
|
|
156
|
+
if (!this.isNeedHandleRoster(locus)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.breakoutRosterLocus = locus;
|
|
143
160
|
this.members.locusParticipantsUpdate(locus);
|
|
144
161
|
},
|
|
145
162
|
|
|
@@ -186,6 +186,26 @@ describe('plugin-meetings', () => {
|
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
|
|
189
|
+
describe('#isNeedHandleRoster', () => {
|
|
190
|
+
it('return true if no sequence in locus/breakoutRosterLocus', () => {
|
|
191
|
+
breakout.breakoutRosterLocus = null;
|
|
192
|
+
assert.equal(breakout.isNeedHandleRoster(), true);
|
|
193
|
+
|
|
194
|
+
breakout.breakoutRosterLocus = {sequence: {entries: [123]}};
|
|
195
|
+
assert.equal(breakout.isNeedHandleRoster(null), true);
|
|
196
|
+
|
|
197
|
+
assert.equal(breakout.isNeedHandleRoster({sequence: {entries: []}}), true);
|
|
198
|
+
});
|
|
199
|
+
it('return true if the locus sequence is bigger than last one', () => {
|
|
200
|
+
breakout.breakoutRosterLocus = {sequence: {entries: [123]}};
|
|
201
|
+
assert.equal(breakout.isNeedHandleRoster({sequence: {entries: [124]}}), true);
|
|
202
|
+
});
|
|
203
|
+
it('return false if the locus sequence is smaller than last one', () => {
|
|
204
|
+
breakout.breakoutRosterLocus = {sequence: {entries: [123]}};
|
|
205
|
+
assert.equal(breakout.isNeedHandleRoster({sequence: {entries: [122]}}), false);
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
189
209
|
describe('#parseRoster', () => {
|
|
190
210
|
it('calls locusParticipantsUpdate', () => {
|
|
191
211
|
breakout.members = {
|
|
@@ -197,7 +217,17 @@ describe('plugin-meetings', () => {
|
|
|
197
217
|
|
|
198
218
|
assert.calledOnceWithExactly(breakout.members.locusParticipantsUpdate, locusData);
|
|
199
219
|
assert.equal(result, undefined);
|
|
200
|
-
})
|
|
220
|
+
});
|
|
221
|
+
it('not call locusParticipantsUpdate if sequence is expired', () => {
|
|
222
|
+
breakout.members = {
|
|
223
|
+
locusParticipantsUpdate: sinon.stub(),
|
|
224
|
+
};
|
|
225
|
+
breakout.isNeedHandleRoster = sinon.stub().returns(false);
|
|
226
|
+
const locusData = {some: 'data'};
|
|
227
|
+
breakout.parseRoster(locusData);
|
|
228
|
+
|
|
229
|
+
assert.notCalled(breakout.members.locusParticipantsUpdate);
|
|
230
|
+
});
|
|
201
231
|
})
|
|
202
232
|
});
|
|
203
233
|
});
|