@webex/internal-plugin-board 3.0.0-beta.15 → 3.0.0-beta.150
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/board.js +28 -105
- package/dist/board.js.map +1 -1
- package/dist/config.js +0 -8
- package/dist/config.js.map +1 -1
- package/dist/index.js +7 -28
- package/dist/index.js.map +1 -1
- package/dist/realtime-channel-collection.js +1 -7
- package/dist/realtime-channel-collection.js.map +1 -1
- package/dist/realtime-channel.js +1 -5
- package/dist/realtime-channel.js.map +1 -1
- package/dist/realtime.js +12 -56
- package/dist/realtime.js.map +1 -1
- package/package.json +14 -14
- package/src/board.js +19 -3
- package/test/integration/spec/board.js +6 -7
- package/test/integration/spec/realtime.js +2 -1
- package/test/unit/spec/board.js +35 -10
package/dist/board.js
CHANGED
|
@@ -1,61 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
4
|
-
|
|
5
4
|
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
|
-
|
|
7
5
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
8
|
-
|
|
9
6
|
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
10
|
-
|
|
11
7
|
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
12
|
-
|
|
13
8
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
14
|
-
|
|
15
9
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
16
|
-
|
|
17
10
|
_Object$defineProperty(exports, "__esModule", {
|
|
18
11
|
value: true
|
|
19
12
|
});
|
|
20
|
-
|
|
21
13
|
exports.default = void 0;
|
|
22
|
-
|
|
23
14
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
24
|
-
|
|
25
15
|
var _deleteProperty = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/reflect/delete-property"));
|
|
26
|
-
|
|
27
16
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
28
|
-
|
|
29
17
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
30
|
-
|
|
31
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
32
|
-
|
|
33
19
|
var _pick2 = _interopRequireDefault(require("lodash/pick"));
|
|
34
|
-
|
|
35
20
|
var _chunk2 = _interopRequireDefault(require("lodash/chunk"));
|
|
36
|
-
|
|
37
21
|
var _defaults2 = _interopRequireDefault(require("lodash/defaults"));
|
|
38
|
-
|
|
39
22
|
var _assign2 = _interopRequireDefault(require("lodash/assign"));
|
|
40
|
-
|
|
41
23
|
var _querystring = _interopRequireDefault(require("querystring"));
|
|
42
|
-
|
|
43
24
|
var _webexCore = require("@webex/webex-core");
|
|
44
|
-
|
|
45
25
|
var _es6PromiseSeries = _interopRequireDefault(require("es6-promise-series"));
|
|
46
|
-
|
|
47
26
|
var _realtime = _interopRequireDefault(require("./realtime"));
|
|
48
|
-
|
|
49
27
|
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; }
|
|
50
|
-
|
|
51
28
|
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; }
|
|
52
|
-
|
|
53
29
|
var Board = _webexCore.WebexPlugin.extend({
|
|
54
30
|
namespace: 'Board',
|
|
55
31
|
children: {
|
|
56
32
|
realtime: _realtime.default
|
|
57
33
|
},
|
|
58
|
-
|
|
59
34
|
/**
|
|
60
35
|
* Adds Content to a Channel
|
|
61
36
|
* If contents length is greater than config.board.numberContentsPerPageForAdd, this method
|
|
@@ -68,16 +43,15 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
68
43
|
*/
|
|
69
44
|
addContent: function addContent(channel, contents) {
|
|
70
45
|
var _this = this;
|
|
71
|
-
|
|
72
46
|
var chunks = [];
|
|
73
|
-
chunks = (0, _chunk2.default)(contents, this.config.numberContentsPerPageForAdd);
|
|
74
|
-
// chunk or else we'll have race conditions among patches
|
|
47
|
+
chunks = (0, _chunk2.default)(contents, this.config.numberContentsPerPageForAdd);
|
|
75
48
|
|
|
49
|
+
// we want the first promise to resolve before continuing with the next
|
|
50
|
+
// chunk or else we'll have race conditions among patches
|
|
76
51
|
return (0, _es6PromiseSeries.default)(chunks.map(function (part) {
|
|
77
52
|
return _this._addContentChunk.bind(_this, channel, part);
|
|
78
53
|
}));
|
|
79
54
|
},
|
|
80
|
-
|
|
81
55
|
/**
|
|
82
56
|
* Adds Image to a Channel
|
|
83
57
|
* Uploads image to webex files and adds SCR + downloadUrl to the persistence
|
|
@@ -90,7 +64,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
90
64
|
*/
|
|
91
65
|
addImage: function addImage(channel, image, metadata) {
|
|
92
66
|
var _this2 = this;
|
|
93
|
-
|
|
94
67
|
return this.webex.internal.board._uploadImage(channel, image).then(function (scr) {
|
|
95
68
|
return _this2.webex.internal.board.addContent(channel, [{
|
|
96
69
|
type: 'FILE',
|
|
@@ -104,7 +77,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
104
77
|
}]);
|
|
105
78
|
});
|
|
106
79
|
},
|
|
107
|
-
|
|
108
80
|
/**
|
|
109
81
|
* Set a snapshot image for a board
|
|
110
82
|
*
|
|
@@ -114,7 +86,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
114
86
|
*/
|
|
115
87
|
setSnapshotImage: function setSnapshotImage(channel, image) {
|
|
116
88
|
var _this3 = this;
|
|
117
|
-
|
|
118
89
|
var imageScr;
|
|
119
90
|
return this.webex.internal.board._uploadImage(channel, image, {
|
|
120
91
|
hiddenSpace: true
|
|
@@ -145,7 +116,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
145
116
|
return res.body;
|
|
146
117
|
});
|
|
147
118
|
},
|
|
148
|
-
|
|
149
119
|
/**
|
|
150
120
|
* Creates a Channel
|
|
151
121
|
* @memberof Board.BoardService
|
|
@@ -163,18 +133,31 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
163
133
|
return res.body;
|
|
164
134
|
});
|
|
165
135
|
},
|
|
166
|
-
|
|
167
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Prepare a create request body to the board services based on the provided
|
|
138
|
+
* conversation and channel.
|
|
139
|
+
*
|
|
140
|
+
* @param {Conversation} conversation - Conversation object.
|
|
141
|
+
* @param {Channel} channel - Channel Object
|
|
142
|
+
* @returns {Object} - Create channel request body.
|
|
143
|
+
*/
|
|
144
|
+
_prepareChannel: function _prepareChannel() {
|
|
145
|
+
var conversation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
146
|
+
var channel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
147
|
+
var results = _objectSpread({
|
|
168
148
|
aclUrlLink: conversation.aclUrl,
|
|
169
149
|
kmsMessage: {
|
|
170
150
|
method: 'create',
|
|
171
151
|
uri: '/resources',
|
|
172
|
-
userIds: [
|
|
152
|
+
userIds: [],
|
|
173
153
|
keyUris: []
|
|
174
154
|
}
|
|
175
155
|
}, channel);
|
|
156
|
+
if (conversation.kmsResourceObjectUrl) {
|
|
157
|
+
results.kmsMessage.userIds.push(conversation.kmsResourceObjectUrl);
|
|
158
|
+
}
|
|
159
|
+
return results;
|
|
176
160
|
},
|
|
177
|
-
|
|
178
161
|
/**
|
|
179
162
|
* Deletes a Channel from a Conversation
|
|
180
163
|
* @memberof Board.BoardService
|
|
@@ -186,7 +169,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
186
169
|
*/
|
|
187
170
|
deleteChannel: function deleteChannel(conversation, channel) {
|
|
188
171
|
var _this4 = this;
|
|
189
|
-
|
|
190
172
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
191
173
|
// remove the ACL link between conversation and board
|
|
192
174
|
// remove conversation auth from board KRO in kms message
|
|
@@ -201,13 +183,10 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
201
183
|
},
|
|
202
184
|
aclLinkOperation: 'DELETE'
|
|
203
185
|
};
|
|
204
|
-
|
|
205
186
|
var promise = _promise.default.resolve();
|
|
206
|
-
|
|
207
187
|
if (options.preventDeleteActiveChannel) {
|
|
208
188
|
promise = this.lockChannelForDeletion(channel);
|
|
209
189
|
}
|
|
210
|
-
|
|
211
190
|
return promise.then(function () {
|
|
212
191
|
return _this4.webex.request({
|
|
213
192
|
method: 'PUT',
|
|
@@ -218,7 +197,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
218
197
|
return res.body;
|
|
219
198
|
});
|
|
220
199
|
},
|
|
221
|
-
|
|
222
200
|
/**
|
|
223
201
|
* Locks and marks a channel for deletion
|
|
224
202
|
* If a channel is being used, it will return 409 - Conflict
|
|
@@ -237,7 +215,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
237
215
|
return res.body;
|
|
238
216
|
});
|
|
239
217
|
},
|
|
240
|
-
|
|
241
218
|
/**
|
|
242
219
|
* Keeps a channel as 'active' to prevent other people from deleting it
|
|
243
220
|
* @param {Board~Channel} channel
|
|
@@ -249,7 +226,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
249
226
|
uri: "".concat(channel.channelUrl, "/keepAlive")
|
|
250
227
|
});
|
|
251
228
|
},
|
|
252
|
-
|
|
253
229
|
/**
|
|
254
230
|
* Decrypts a collection of content objects
|
|
255
231
|
*
|
|
@@ -259,16 +235,13 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
259
235
|
*/
|
|
260
236
|
decryptContents: function decryptContents(contents) {
|
|
261
237
|
var _this5 = this;
|
|
262
|
-
|
|
263
238
|
return _promise.default.all(contents.items.map(function (content) {
|
|
264
239
|
var decryptPromise;
|
|
265
|
-
|
|
266
240
|
if (content.type === 'FILE') {
|
|
267
241
|
decryptPromise = _this5.decryptSingleFileContent(content.encryptionKeyUrl, content);
|
|
268
242
|
} else {
|
|
269
243
|
decryptPromise = _this5.decryptSingleContent(content.encryptionKeyUrl, content.payload);
|
|
270
244
|
}
|
|
271
|
-
|
|
272
245
|
return decryptPromise.then(function (res) {
|
|
273
246
|
(0, _deleteProperty.default)(content, 'payload');
|
|
274
247
|
(0, _deleteProperty.default)(content, 'encryptionKeyUrl');
|
|
@@ -276,7 +249,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
276
249
|
});
|
|
277
250
|
}));
|
|
278
251
|
},
|
|
279
|
-
|
|
280
252
|
/**
|
|
281
253
|
* Decryts a single STRING content object
|
|
282
254
|
* @memberof Board.BoardService
|
|
@@ -289,7 +261,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
289
261
|
return JSON.parse(res);
|
|
290
262
|
});
|
|
291
263
|
},
|
|
292
|
-
|
|
293
264
|
/**
|
|
294
265
|
* Decryts a single FILE content object
|
|
295
266
|
* @memberof Board.BoardService
|
|
@@ -299,36 +270,28 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
299
270
|
*/
|
|
300
271
|
decryptSingleFileContent: function decryptSingleFileContent(encryptionKeyUrl, encryptedContent) {
|
|
301
272
|
var _this6 = this;
|
|
302
|
-
|
|
303
273
|
var metadata;
|
|
304
|
-
|
|
305
274
|
if (encryptedContent.payload) {
|
|
306
275
|
metadata = encryptedContent.payload;
|
|
307
276
|
}
|
|
308
|
-
|
|
309
277
|
return this.webex.internal.encryption.decryptScr(encryptionKeyUrl, encryptedContent.file.scr).then(function (scr) {
|
|
310
278
|
encryptedContent.file.scr = scr;
|
|
311
|
-
|
|
312
279
|
if (metadata) {
|
|
313
280
|
return _this6.webex.internal.encryption.decryptText(encryptionKeyUrl, metadata);
|
|
314
281
|
}
|
|
315
|
-
|
|
316
282
|
return '';
|
|
317
283
|
}).then(function (decryptedMetadata) {
|
|
318
284
|
try {
|
|
319
285
|
encryptedContent.metadata = JSON.parse(decryptedMetadata);
|
|
320
|
-
|
|
321
286
|
if (encryptedContent.metadata.displayName) {
|
|
322
287
|
encryptedContent.displayName = encryptedContent.metadata.displayName;
|
|
323
288
|
}
|
|
324
289
|
} catch (error) {
|
|
325
290
|
encryptedContent.metadata = {};
|
|
326
291
|
}
|
|
327
|
-
|
|
328
292
|
return encryptedContent;
|
|
329
293
|
});
|
|
330
294
|
},
|
|
331
|
-
|
|
332
295
|
/**
|
|
333
296
|
* Deletes all Content from a Channel
|
|
334
297
|
* @memberof Board.BoardService
|
|
@@ -343,9 +306,10 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
343
306
|
return res.body;
|
|
344
307
|
});
|
|
345
308
|
},
|
|
346
|
-
|
|
347
309
|
/**
|
|
348
310
|
* Deletes Contents from a Channel except the ones listed in contentsToKeep
|
|
311
|
+
*
|
|
312
|
+
* THIS API HAS CHANGED!!! SEE SPARK-412694. NEEDS UPDATING.
|
|
349
313
|
* @memberof Board.BoardService
|
|
350
314
|
* @param {Board~Channel} channel
|
|
351
315
|
* @param {Array<Board~Content>} contentsToKeep Array of board objects (curves, text, and images) with valid contentId (received from server)
|
|
@@ -366,7 +330,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
366
330
|
return res.body;
|
|
367
331
|
});
|
|
368
332
|
},
|
|
369
|
-
|
|
370
333
|
/**
|
|
371
334
|
* Encrypts a collection of content
|
|
372
335
|
* @memberof Board.BoardService
|
|
@@ -376,18 +339,17 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
376
339
|
*/
|
|
377
340
|
encryptContents: function encryptContents(encryptionKeyUrl, contents) {
|
|
378
341
|
var _this7 = this;
|
|
379
|
-
|
|
380
342
|
return _promise.default.all(contents.map(function (content) {
|
|
381
343
|
var encryptionPromise;
|
|
382
|
-
var contentType = 'STRING';
|
|
344
|
+
var contentType = 'STRING';
|
|
383
345
|
|
|
346
|
+
// the existence of an scr will determine if the content is a FILE.
|
|
384
347
|
if (content.file) {
|
|
385
348
|
contentType = 'FILE';
|
|
386
349
|
encryptionPromise = _this7.encryptSingleFileContent(encryptionKeyUrl, content);
|
|
387
350
|
} else {
|
|
388
351
|
encryptionPromise = _this7.encryptSingleContent(encryptionKeyUrl, content);
|
|
389
352
|
}
|
|
390
|
-
|
|
391
353
|
return encryptionPromise.then(function (res) {
|
|
392
354
|
return (0, _assign2.default)({
|
|
393
355
|
device: _this7.webex.internal.device.deviceType,
|
|
@@ -397,7 +359,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
397
359
|
});
|
|
398
360
|
}));
|
|
399
361
|
},
|
|
400
|
-
|
|
401
362
|
/**
|
|
402
363
|
* Encrypts a single STRING content object
|
|
403
364
|
* @memberof Board.BoardService
|
|
@@ -413,7 +374,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
413
374
|
};
|
|
414
375
|
});
|
|
415
376
|
},
|
|
416
|
-
|
|
417
377
|
/**
|
|
418
378
|
* Encrypts a single FILE content object
|
|
419
379
|
* @memberof Board.BoardService
|
|
@@ -423,22 +383,18 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
423
383
|
*/
|
|
424
384
|
encryptSingleFileContent: function encryptSingleFileContent(encryptionKeyUrl, content) {
|
|
425
385
|
var _this8 = this;
|
|
426
|
-
|
|
427
386
|
return this.webex.internal.encryption.encryptScr(encryptionKeyUrl, content.file.scr).then(function (encryptedScr) {
|
|
428
387
|
content.file.scr = encryptedScr;
|
|
429
|
-
|
|
430
388
|
if (content.displayName) {
|
|
431
389
|
content.metadata = (0, _assign2.default)(content.metadata, {
|
|
432
390
|
displayName: content.displayName
|
|
433
391
|
});
|
|
434
392
|
}
|
|
435
|
-
|
|
436
393
|
if (content.metadata) {
|
|
437
394
|
return _this8.webex.internal.encryption.encryptText(encryptionKeyUrl, (0, _stringify.default)(content.metadata)).then(function (encryptedMetadata) {
|
|
438
395
|
content.metadata = encryptedMetadata;
|
|
439
396
|
});
|
|
440
397
|
}
|
|
441
|
-
|
|
442
398
|
return content;
|
|
443
399
|
}).then(function () {
|
|
444
400
|
return {
|
|
@@ -448,7 +404,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
448
404
|
};
|
|
449
405
|
});
|
|
450
406
|
},
|
|
451
|
-
|
|
452
407
|
/**
|
|
453
408
|
* Retrieves contents from a specified channel
|
|
454
409
|
* @memberof Board.BoardService
|
|
@@ -459,7 +414,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
459
414
|
*/
|
|
460
415
|
getContents: function getContents(channel, options) {
|
|
461
416
|
var _this9 = this;
|
|
462
|
-
|
|
463
417
|
options = options || {};
|
|
464
418
|
var params = {
|
|
465
419
|
uri: "".concat(channel.channelUrl, "/contents"),
|
|
@@ -472,7 +426,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
472
426
|
return new _webexCore.Page(res, _this9.webex);
|
|
473
427
|
});
|
|
474
428
|
},
|
|
475
|
-
|
|
476
429
|
/**
|
|
477
430
|
* Gets a Channel
|
|
478
431
|
* @memberof Board.BoardService
|
|
@@ -487,7 +440,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
487
440
|
return res.body;
|
|
488
441
|
});
|
|
489
442
|
},
|
|
490
|
-
|
|
491
443
|
/**
|
|
492
444
|
* Gets Channels
|
|
493
445
|
* @memberof Board.BoardService
|
|
@@ -499,13 +451,10 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
499
451
|
*/
|
|
500
452
|
getChannels: function getChannels(conversation, options) {
|
|
501
453
|
var _this10 = this;
|
|
502
|
-
|
|
503
454
|
options = options || {};
|
|
504
|
-
|
|
505
455
|
if (!conversation) {
|
|
506
456
|
return _promise.default.reject(new Error('`conversation` is required'));
|
|
507
457
|
}
|
|
508
|
-
|
|
509
458
|
var params = {
|
|
510
459
|
api: 'board',
|
|
511
460
|
resource: '/channels',
|
|
@@ -518,7 +467,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
518
467
|
return new _webexCore.Page(res, _this10.webex);
|
|
519
468
|
});
|
|
520
469
|
},
|
|
521
|
-
|
|
522
470
|
/**
|
|
523
471
|
* Pings persistence
|
|
524
472
|
* @memberof Board.BoardService
|
|
@@ -535,20 +483,17 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
535
483
|
},
|
|
536
484
|
processActivityEvent: function processActivityEvent(message) {
|
|
537
485
|
var decryptionPromise;
|
|
538
|
-
|
|
539
486
|
if (message.contentType === 'FILE') {
|
|
540
487
|
decryptionPromise = this.decryptSingleFileContent(message.envelope.encryptionKeyUrl, message.payload);
|
|
541
488
|
} else {
|
|
542
489
|
decryptionPromise = this.decryptSingleContent(message.envelope.encryptionKeyUrl, message.payload);
|
|
543
490
|
}
|
|
544
|
-
|
|
545
491
|
return decryptionPromise.then(function (decryptedData) {
|
|
546
492
|
// call the event handlers
|
|
547
493
|
message.payload = decryptedData;
|
|
548
494
|
return message;
|
|
549
495
|
});
|
|
550
496
|
},
|
|
551
|
-
|
|
552
497
|
/**
|
|
553
498
|
* Registers with Mercury
|
|
554
499
|
* @memberof Board.BoardService
|
|
@@ -565,7 +510,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
565
510
|
return res.body;
|
|
566
511
|
});
|
|
567
512
|
},
|
|
568
|
-
|
|
569
513
|
/**
|
|
570
514
|
* Registers with Mercury for sharing web socket
|
|
571
515
|
* @memberof Board.BoardService
|
|
@@ -574,16 +518,13 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
574
518
|
*/
|
|
575
519
|
registerToShareMercury: function registerToShareMercury(channel) {
|
|
576
520
|
var _this11 = this;
|
|
577
|
-
|
|
578
521
|
return this.webex.internal.feature.getFeature('developer', 'web-shared-mercury').then(function (isSharingMercuryFeatureEnabled) {
|
|
579
522
|
if (!_this11.webex.internal.mercury.localClusterServiceUrls) {
|
|
580
523
|
return _promise.default.reject(new Error('`localClusterServiceUrls` is not defined, make sure mercury is connected'));
|
|
581
524
|
}
|
|
582
|
-
|
|
583
525
|
if (!isSharingMercuryFeatureEnabled) {
|
|
584
526
|
return _promise.default.reject(new Error('`web-shared-mercury` is not enabled'));
|
|
585
527
|
}
|
|
586
|
-
|
|
587
528
|
var webSocketUrl = _this11.webex.internal.device.webSocketUrl;
|
|
588
529
|
var mercuryConnectionServiceClusterUrl = _this11.webex.internal.mercury.localClusterServiceUrls.mercuryConnectionServiceClusterUrl;
|
|
589
530
|
var data = {
|
|
@@ -600,7 +541,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
600
541
|
return res.body;
|
|
601
542
|
});
|
|
602
543
|
},
|
|
603
|
-
|
|
604
544
|
/**
|
|
605
545
|
* Remove board binding from existing mercury connection
|
|
606
546
|
* @memberof Board.BoardService
|
|
@@ -625,7 +565,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
625
565
|
},
|
|
626
566
|
_addContentChunk: function _addContentChunk(channel, contentChunk) {
|
|
627
567
|
var _this12 = this;
|
|
628
|
-
|
|
629
568
|
return this.webex.internal.board.encryptContents(channel.defaultEncryptionKeyUrl, contentChunk).then(function (res) {
|
|
630
569
|
return _this12.webex.request({
|
|
631
570
|
method: 'POST',
|
|
@@ -636,7 +575,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
636
575
|
return res.body;
|
|
637
576
|
});
|
|
638
577
|
},
|
|
639
|
-
|
|
640
578
|
/**
|
|
641
579
|
* Encrypts and uploads image to WebexFiles
|
|
642
580
|
* @memberof Board.BoardService
|
|
@@ -649,17 +587,15 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
649
587
|
*/
|
|
650
588
|
_uploadImage: function _uploadImage(channel, file, options) {
|
|
651
589
|
var _this13 = this;
|
|
652
|
-
|
|
653
590
|
options = options || {};
|
|
654
591
|
return this.webex.internal.encryption.encryptBinary(file).then(function (_ref) {
|
|
655
592
|
var scr = _ref.scr,
|
|
656
|
-
|
|
593
|
+
cdata = _ref.cdata;
|
|
657
594
|
return _promise.default.all([scr, _this13._uploadImageToWebexFiles(channel, cdata, options.hiddenSpace)]);
|
|
658
595
|
}).then(function (_ref2) {
|
|
659
596
|
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
597
|
+
scr = _ref3[0],
|
|
598
|
+
res = _ref3[1];
|
|
663
599
|
return (0, _assign2.default)(scr, {
|
|
664
600
|
loc: res.downloadUrl
|
|
665
601
|
});
|
|
@@ -667,11 +603,9 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
667
603
|
},
|
|
668
604
|
_getSpaceUrl: function _getSpaceUrl(channel, hiddenSpace) {
|
|
669
605
|
var requestUri = "".concat(channel.channelUrl, "/spaces/open");
|
|
670
|
-
|
|
671
606
|
if (hiddenSpace) {
|
|
672
607
|
requestUri = "".concat(channel.channelUrl, "/spaces/hidden");
|
|
673
608
|
}
|
|
674
|
-
|
|
675
609
|
return this.webex.request({
|
|
676
610
|
method: 'PUT',
|
|
677
611
|
uri: requestUri
|
|
@@ -681,7 +615,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
681
615
|
},
|
|
682
616
|
_uploadImageToWebexFiles: function _uploadImageToWebexFiles(channel, file, hiddenSpace) {
|
|
683
617
|
var _this14 = this;
|
|
684
|
-
|
|
685
618
|
var fileSize = file.length || file.size || file.byteLength;
|
|
686
619
|
return this._getSpaceUrl(channel, hiddenSpace).then(function (spaceUrl) {
|
|
687
620
|
return _this14.webex.upload({
|
|
@@ -711,7 +644,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
711
644
|
});
|
|
712
645
|
});
|
|
713
646
|
},
|
|
714
|
-
|
|
715
647
|
/** Authorize transcoder (for sharing whiteboard to mobile)
|
|
716
648
|
*
|
|
717
649
|
* @param {Board~Channel} board
|
|
@@ -720,11 +652,9 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
720
652
|
*/
|
|
721
653
|
authorizeMediaInjector: function authorizeMediaInjector(board) {
|
|
722
654
|
var _this15 = this;
|
|
723
|
-
|
|
724
655
|
if (!board) {
|
|
725
656
|
_promise.default.reject(new Error('#authorizeMediaInjector --> cannot authorize transcoder without board'));
|
|
726
657
|
}
|
|
727
|
-
|
|
728
658
|
return this.webex.internal.encryption.kms.prepareRequest({
|
|
729
659
|
method: 'create',
|
|
730
660
|
uri: '/authorizations',
|
|
@@ -744,7 +674,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
744
674
|
if ((decryptedKmsMessage === null || decryptedKmsMessage === void 0 ? void 0 : decryptedKmsMessage.authorizations.length) > 0) {
|
|
745
675
|
return decryptedKmsMessage.authorizations[0].bearer;
|
|
746
676
|
}
|
|
747
|
-
|
|
748
677
|
return undefined;
|
|
749
678
|
}).catch(function (err) {
|
|
750
679
|
return (
|
|
@@ -755,7 +684,6 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
755
684
|
);
|
|
756
685
|
});
|
|
757
686
|
},
|
|
758
|
-
|
|
759
687
|
/** Unauthorize transcoder (for stopping whiteboard share to mobile)
|
|
760
688
|
*
|
|
761
689
|
* @param {Board~Channel} board
|
|
@@ -764,11 +692,9 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
764
692
|
*/
|
|
765
693
|
unauthorizeMediaInjector: function unauthorizeMediaInjector(board) {
|
|
766
694
|
var _this16 = this;
|
|
767
|
-
|
|
768
695
|
if (!board) {
|
|
769
696
|
_promise.default.reject(new Error('#unauthorizeMediaInjector --> cannot unauthorize transcoder without board'));
|
|
770
697
|
}
|
|
771
|
-
|
|
772
698
|
return this.webex.internal.encryption.kms.listAuthorizations({
|
|
773
699
|
kroUri: board.kmsResourceUrl
|
|
774
700
|
}).then(function (authorizations) {
|
|
@@ -791,19 +717,16 @@ var Board = _webexCore.WebexPlugin.extend({
|
|
|
791
717
|
);
|
|
792
718
|
});
|
|
793
719
|
});
|
|
794
|
-
|
|
795
720
|
if (promises.length > 0) {
|
|
796
721
|
return _promise.default.all(promises).then(function (responses) {
|
|
797
722
|
return responses;
|
|
798
723
|
});
|
|
799
724
|
}
|
|
800
|
-
|
|
801
725
|
return _promise.default.resolve([]);
|
|
802
726
|
});
|
|
803
727
|
},
|
|
804
|
-
version: "3.0.0-beta.
|
|
728
|
+
version: "3.0.0-beta.150"
|
|
805
729
|
});
|
|
806
|
-
|
|
807
730
|
var _default = Board;
|
|
808
731
|
exports.default = _default;
|
|
809
732
|
//# sourceMappingURL=board.js.map
|