@webex/internal-plugin-conversation 3.0.0-beta.8 → 3.0.0-bnr.0

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.
Files changed (57) hide show
  1. package/README.md +1 -3
  2. package/dist/activities.js +8 -69
  3. package/dist/activities.js.map +1 -1
  4. package/dist/activity-thread-ordering.js +19 -79
  5. package/dist/activity-thread-ordering.js.map +1 -1
  6. package/dist/config.js +1 -7
  7. package/dist/config.js.map +1 -1
  8. package/dist/constants.js +4 -5
  9. package/dist/constants.js.map +1 -1
  10. package/dist/conversation.js +790 -1199
  11. package/dist/conversation.js.map +1 -1
  12. package/dist/convo-error.js +0 -23
  13. package/dist/convo-error.js.map +1 -1
  14. package/dist/decryption-transforms.js +35 -98
  15. package/dist/decryption-transforms.js.map +1 -1
  16. package/dist/encryption-transforms.js +11 -48
  17. package/dist/encryption-transforms.js.map +1 -1
  18. package/dist/index.js +7 -50
  19. package/dist/index.js.map +1 -1
  20. package/dist/internal-plugin-conversation.d.ts +21 -0
  21. package/dist/share-activity.js +40 -106
  22. package/dist/share-activity.js.map +1 -1
  23. package/dist/to-array.js +9 -11
  24. package/dist/to-array.js.map +1 -1
  25. package/dist/tsdoc-metadata.json +11 -0
  26. package/dist/types/activities.d.ts +32 -0
  27. package/dist/types/activity-thread-ordering.d.ts +18 -0
  28. package/dist/types/config.d.ts +19 -0
  29. package/dist/types/constants.d.ts +5 -0
  30. package/dist/types/conversation.d.ts +2 -0
  31. package/dist/types/convo-error.d.ts +10 -0
  32. package/dist/types/decryption-transforms.d.ts +1 -0
  33. package/dist/types/encryption-transforms.d.ts +1 -0
  34. package/dist/types/index.d.ts +3 -0
  35. package/dist/types/share-activity.d.ts +7 -0
  36. package/dist/types/to-array.d.ts +9 -0
  37. package/package.json +15 -15
  38. package/src/activities.js +10 -7
  39. package/src/activity-thread-ordering.js +27 -30
  40. package/src/activity-threading.md +68 -49
  41. package/src/config.js +5 -5
  42. package/src/conversation.js +621 -589
  43. package/src/decryption-transforms.js +103 -62
  44. package/src/encryption-transforms.js +103 -83
  45. package/src/index.js +82 -66
  46. package/src/share-activity.js +64 -55
  47. package/src/to-array.js +2 -2
  48. package/test/integration/spec/create.js +184 -118
  49. package/test/integration/spec/encryption.js +250 -186
  50. package/test/integration/spec/get.js +761 -513
  51. package/test/integration/spec/mercury.js +37 -27
  52. package/test/integration/spec/share.js +292 -229
  53. package/test/integration/spec/verbs.js +628 -441
  54. package/test/unit/spec/conversation.js +265 -163
  55. package/test/unit/spec/decrypt-transforms.js +112 -131
  56. package/test/unit/spec/encryption-transforms.js +24 -18
  57. package/test/unit/spec/share-activity.js +37 -40
@@ -1,67 +1,44 @@
1
1
  "use strict";
2
2
 
3
3
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
4
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
6
  _Object$defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
-
13
9
  exports.InvalidUserCreation = exports.ConversationError = void 0;
14
-
15
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
16
-
17
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
-
19
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
20
-
21
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
22
-
23
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
24
-
25
15
  var _common = require("@webex/common");
26
-
27
16
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
28
-
29
17
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
-
31
18
  /**
32
19
  * General conversation error
33
20
  */
34
21
  var ConversationError = /*#__PURE__*/function (_Exception) {
35
22
  (0, _inherits2.default)(ConversationError, _Exception);
36
-
37
23
  var _super = _createSuper(ConversationError);
38
-
39
24
  function ConversationError() {
40
25
  (0, _classCallCheck2.default)(this, ConversationError);
41
26
  return _super.apply(this, arguments);
42
27
  }
43
-
44
28
  return (0, _createClass2.default)(ConversationError);
45
29
  }(_common.Exception);
46
30
  /**
47
31
  * InvalidUserCreation thrown when failed to create conversation with invalid user
48
32
  */
49
-
50
-
51
33
  exports.ConversationError = ConversationError;
52
-
53
34
  var InvalidUserCreation = /*#__PURE__*/function (_ConversationError) {
54
35
  (0, _inherits2.default)(InvalidUserCreation, _ConversationError);
55
-
56
36
  var _super2 = _createSuper(InvalidUserCreation);
57
-
58
37
  function InvalidUserCreation() {
59
38
  (0, _classCallCheck2.default)(this, InvalidUserCreation);
60
39
  return _super2.apply(this, arguments);
61
40
  }
62
-
63
41
  return (0, _createClass2.default)(InvalidUserCreation);
64
42
  }(ConversationError);
65
-
66
43
  exports.InvalidUserCreation = InvalidUserCreation;
67
44
  //# sourceMappingURL=convo-error.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ConversationError","Exception","InvalidUserCreation"],"sources":["convo-error.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Exception} from '@webex/common';\n\n/**\n * General conversation error\n */\nexport class ConversationError extends Exception {}\n\n/**\n * InvalidUserCreation thrown when failed to create conversation with invalid user\n */\nexport class InvalidUserCreation extends ConversationError {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;;;AAEA;AACA;AACA;IACaA,iB;;;;;;;;;;;EAA0BC,iB;AAEvC;AACA;AACA;;;;;IACaC,mB;;;;;;;;;;;EAA4BF,iB"}
1
+ {"version":3,"names":["ConversationError","Exception","InvalidUserCreation"],"sources":["convo-error.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Exception} from '@webex/common';\n\n/**\n * General conversation error\n */\nexport class ConversationError extends Exception {}\n\n/**\n * InvalidUserCreation thrown when failed to create conversation with invalid user\n */\nexport class InvalidUserCreation extends ConversationError {}\n"],"mappings":";;;;;;;;;;;;;;AAIA;AAAwC;AAAA;AAExC;AACA;AACA;AAFA,IAGaA,iBAAiB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,EAASC,iBAAS;AAEhD;AACA;AACA;AAFA;AAAA,IAGaC,mBAAmB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,EAASF,iBAAiB;AAAA"}
@@ -1,33 +1,23 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
-
7
5
  _Object$defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
-
11
8
  exports.transforms = void 0;
12
-
13
9
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
14
-
15
10
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
16
-
17
11
  var _isInteger = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-integer"));
18
-
19
12
  var _curry2 = _interopRequireDefault(require("lodash/curry"));
20
-
21
13
  var _capitalize2 = _interopRequireDefault(require("lodash/capitalize"));
22
-
23
14
  var _camelCase2 = _interopRequireDefault(require("lodash/camelCase"));
24
-
25
15
  var _toArray = _interopRequireDefault(require("./to-array"));
26
-
27
16
  var decryptTextProp = (0, _curry2.default)(function (name, ctx, key, object) {
28
17
  return ctx.transform('decryptTextProp', name, key, object);
29
- }); // eslint-disable-next-line import/prefer-default-export
18
+ });
30
19
 
20
+ // eslint-disable-next-line import/prefer-default-export
31
21
  var transforms = (0, _toArray.default)('inbound', {
32
22
  /**
33
23
  * This function is used recursively to decrypt various properties on conversations, activities, etc
@@ -39,34 +29,29 @@ var transforms = (0, _toArray.default)('inbound', {
39
29
  decryptObject: function decryptObject(ctx, key, object) {
40
30
  if (!object) {
41
31
  object = key; // eslint-disable-line no-param-reassign
42
-
43
32
  key = undefined; // eslint-disable-line no-param-reassign
44
33
  }
45
34
 
46
35
  if (!object) {
47
36
  return _promise.default.resolve();
48
37
  }
49
-
50
38
  if (!object.objectType) {
51
39
  return _promise.default.resolve();
52
40
  }
53
-
54
41
  if (!key && object.encryptionKeyUrl) {
55
42
  key = object.encryptionKeyUrl; // eslint-disable-line no-param-reassign
56
- } // Transcoded content was not showing up on the activities since the
43
+ }
44
+
45
+ // Transcoded content was not showing up on the activities since the
57
46
  // decryptFile was not being called. Calling decryptFile for
58
47
  // transcodedContent fixes the issue.
59
-
60
-
61
48
  if (object.objectType === 'transcodedContent') {
62
49
  return _promise.default.all(object.files.items.map(function (item) {
63
50
  return ctx.transform('decryptFile', key, item);
64
51
  }));
65
52
  }
66
-
67
53
  return ctx.transform("decrypt".concat((0, _capitalize2.default)(object.objectType)), key, object);
68
54
  },
69
-
70
55
  /**
71
56
  * Decrypt an individual submit object from a cardAction activity
72
57
  * (object.objectType === 'submit')
@@ -80,7 +65,6 @@ var transforms = (0, _toArray.default)('inbound', {
80
65
  if (!object.inputs) {
81
66
  return _promise.default.resolve();
82
67
  }
83
-
84
68
  var decryptionFailureMessage = ctx.webex.internal.conversation.config.decryptionFailureMessage;
85
69
  return ctx.transform('decryptPropCardItem', 0, key, [object.inputs]).then(function (inputs) {
86
70
  object.inputs = JSON.parse(inputs[0]); // eslint-disable-line no-param-reassign
@@ -91,7 +75,6 @@ var transforms = (0, _toArray.default)('inbound', {
91
75
  return _promise.default.resolve(decryptionFailureMessage);
92
76
  });
93
77
  },
94
-
95
78
  /**
96
79
  * Decrypt an individual reaction2Summary activity (object.objectType === 'reaction2Summary')
97
80
  * @param {Object} ctx An object containing a webex instance and a transform
@@ -105,12 +88,10 @@ var transforms = (0, _toArray.default)('inbound', {
105
88
  if (!object.reactions) {
106
89
  return _promise.default.resolve();
107
90
  }
108
-
109
91
  return _promise.default.all(object.reactions.map(function (reaction) {
110
92
  return ctx.transform('decryptPropDisplayName', key, reaction);
111
93
  }));
112
94
  },
113
-
114
95
  /**
115
96
  * Decrypt an individual reaction2SelfSummary activity (object.objectType === 'reaction2SelfSummary')
116
97
  * @param {Object} ctx An object containing a webex instance and a transform
@@ -126,12 +107,10 @@ var transforms = (0, _toArray.default)('inbound', {
126
107
  if (!object.reactions) {
127
108
  return _promise.default.resolve();
128
109
  }
129
-
130
110
  return _promise.default.all(object.reactions.map(function (reaction) {
131
111
  return ctx.transform('decryptPropDisplayName', key, reaction);
132
112
  }));
133
113
  },
134
-
135
114
  /**
136
115
  * Decrypt an individual reaction2 activity (object.objectType === 'reaction2')
137
116
  * @param {Object} ctx An object containing a webex instance and a transform
@@ -144,40 +123,34 @@ var transforms = (0, _toArray.default)('inbound', {
144
123
  decryptReaction2: function decryptReaction2(ctx, key, object) {
145
124
  return ctx.transform('decryptPropDisplayName', key, object);
146
125
  },
147
-
148
126
  /**
149
- * Decrypt an individual threadObject
150
- * @param {Object} ctx An object containing a webex instance and a transform
151
- * @param {Object} threadObject An instance of a Webex threadObject (the objects returned by the /conversation/api/v1/threads api)
152
- * @returns {Promise} Returns a ctx.transform promise
153
- */
127
+ * Decrypt an individual threadObject
128
+ * @param {Object} ctx An object containing a webex instance and a transform
129
+ * @param {Object} threadObject An instance of a Webex threadObject (the objects returned by the /conversation/api/v1/threads api)
130
+ * @returns {Promise} Returns a ctx.transform promise
131
+ */
154
132
  decryptThread: function decryptThread(ctx, threadObject) {
155
133
  var promises = [];
156
-
157
134
  if (threadObject.childActivities && (0, _isArray.default)(threadObject.childActivities)) {
158
135
  promises = threadObject.childActivities.map(function (child) {
159
136
  return ctx.transform('decryptObject', null, child);
160
137
  });
161
138
  }
162
-
163
139
  return _promise.default.all(promises);
164
140
  },
165
-
166
141
  /**
167
- * Decrypt an individual meeting container activity
168
- * @param {Object} ctx An object containing a webex instance and a transform
169
- * @param {object} key KMS encryption key url
170
- * @param {Object} meetingContainerActivity An instance of a Webex meeting container activity
171
- * @returns {Promise} Returns a ctx.transform promise
172
- */
142
+ * Decrypt an individual meeting container activity
143
+ * @param {Object} ctx An object containing a webex instance and a transform
144
+ * @param {object} key KMS encryption key url
145
+ * @param {Object} meetingContainerActivity An instance of a Webex meeting container activity
146
+ * @returns {Promise} Returns a ctx.transform promise
147
+ */
173
148
  decryptMeetingcontainer: function decryptMeetingcontainer(ctx, key, meetingContainerActivity) {
174
149
  var promises = [];
175
-
176
150
  if (meetingContainerActivity.displayName) {
177
151
  var usableKey = meetingContainerActivity.encryptionKeyUrl || key;
178
152
  promises.push(ctx.transform('decryptPropDisplayName', usableKey, meetingContainerActivity));
179
153
  }
180
-
181
154
  if (meetingContainerActivity.extensions) {
182
155
  var itemsToDecrypt = meetingContainerActivity.extensions.items.filter(function (item) {
183
156
  return item.data.objectType === 'recording';
@@ -186,10 +159,8 @@ var transforms = (0, _toArray.default)('inbound', {
186
159
  promises.push(ctx.transform('decryptPropTopic', itemToDecrypt.encryptionKeyUrl, itemToDecrypt.data));
187
160
  });
188
161
  }
189
-
190
162
  return _promise.default.all(promises);
191
163
  },
192
-
193
164
  /**
194
165
  * Decrypts a given conversation and it's activities by building an array of promises that call
195
166
  * decryptObject, which may then call other decrypt functions
@@ -201,42 +172,33 @@ var transforms = (0, _toArray.default)('inbound', {
201
172
  */
202
173
  decryptConversation: function decryptConversation(ctx, key, conversation) {
203
174
  var promises = [];
204
-
205
175
  if (conversation.activities.items) {
206
176
  promises.push(_promise.default.all(conversation.activities.items.map(function (item) {
207
177
  return ctx.transform('decryptObject', null, item);
208
178
  })));
209
179
  }
210
-
211
180
  var usableKey = conversation.encryptionKeyUrl || key;
212
181
  var decryptionFailureMessage = ctx.webex.internal.conversation.config.decryptionFailureMessage;
213
-
214
182
  if (usableKey) {
215
183
  promises.push(ctx.transform('decryptPropDisplayName', usableKey, conversation).catch(function (error) {
216
184
  ctx.webex.logger.warn('plugin-conversation: failed to decrypt display name of ', conversation.url, error);
217
-
218
185
  _promise.default.resolve(decryptionFailureMessage);
219
186
  }));
220
187
  promises.push(ctx.transform('decryptPropContent', usableKey, conversation));
221
188
  }
222
-
223
189
  if (conversation.avatarEncryptionKeyUrl) {
224
190
  promises.push(ctx.transform('decryptObject', conversation.avatarEncryptionKeyUrl, conversation.avatar));
225
- } // TODO (holsted 04/06/19): This was deprecated in favor of .previousValue below. I wanted to remove this entirely
191
+ }
192
+ // TODO (holsted 04/06/19): This was deprecated in favor of .previousValue below. I wanted to remove this entirely
226
193
  // but I wasn't sure if some open source use cases may be reading from cached conversations or not so leaving it for now.
227
-
228
-
229
194
  if (conversation.previous) {
230
195
  promises.push(ctx.transform('decryptPropDisplayName', usableKey, conversation.previous));
231
196
  }
232
-
233
197
  if (conversation.previousValue) {
234
198
  promises.push(ctx.transform('decryptPropDisplayName', usableKey, conversation.previousValue));
235
199
  }
236
-
237
200
  return _promise.default.all(promises);
238
201
  },
239
-
240
202
  /**
241
203
  * Decrypt an individual activity
242
204
  * @param {Object} ctx An object containing a webex instance and a transform
@@ -248,20 +210,19 @@ var transforms = (0, _toArray.default)('inbound', {
248
210
  if (!activity.encryptionKeyUrl && !(activity.object && activity.object.encryptionKeyUrl)) {
249
211
  return _promise.default.resolve(activity);
250
212
  }
251
-
252
213
  var keyUrl = activity.encryptionKeyUrl || activity.object.encryptionKeyUrl || key;
253
- var promises = []; // iterate and recursively decrypt over children objects
214
+ var promises = [];
215
+
216
+ // iterate and recursively decrypt over children objects
254
217
 
255
218
  if (activity.children && (0, _isArray.default)(activity.children)) {
256
219
  promises = activity.children.map(function (child) {
257
220
  return ctx.transform('decryptObject', keyUrl, child.activity);
258
221
  });
259
222
  }
260
-
261
223
  promises.push(ctx.transform('decryptObject', keyUrl, activity.object));
262
224
  return _promise.default.all(promises);
263
225
  },
264
-
265
226
  /**
266
227
  * Decrypts a microappInstance (recording) model
267
228
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -273,26 +234,22 @@ var transforms = (0, _toArray.default)('inbound', {
273
234
  decryptMicroappinstance: function decryptMicroappinstance(ctx, key, microappInstance) {
274
235
  return ctx.transform('decryptPropModel', key, microappInstance);
275
236
  },
276
-
277
237
  /**
278
- * Decrypts a comment...
279
- * @param {Object} ctx An object containing a webex instance and transform prop
280
- * @param {String} key KMS key
281
- * @param {Object} comment A comment object with a displayName and content (encrypted)
282
- * @returns {Promise} Returns the results of Promise.all on two transforms
283
- */
238
+ * Decrypts a comment...
239
+ * @param {Object} ctx An object containing a webex instance and transform prop
240
+ * @param {String} key KMS key
241
+ * @param {Object} comment A comment object with a displayName and content (encrypted)
242
+ * @returns {Promise} Returns the results of Promise.all on two transforms
243
+ */
284
244
  decryptComment: function decryptComment(ctx, key, comment) {
285
245
  var promises = [ctx.transform('decryptPropDisplayName', key, comment), ctx.transform('decryptPropContent', key, comment)];
286
-
287
246
  if (comment.cards && (0, _isArray.default)(comment.cards)) {
288
247
  comment.cards.map(function (item, index) {
289
248
  return promises.push(ctx.transform('decryptPropCardItem', index, key, comment.cards));
290
249
  });
291
250
  }
292
-
293
251
  return _promise.default.all(promises);
294
252
  },
295
-
296
253
  /**
297
254
  * Decrypts a content field
298
255
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -304,10 +261,8 @@ var transforms = (0, _toArray.default)('inbound', {
304
261
  if (content.contentCategory === 'links') {
305
262
  return ctx.transform('decryptContentLinks', key, content);
306
263
  }
307
-
308
264
  return ctx.transform('decryptContentFiles', key, content);
309
265
  },
310
-
311
266
  /**
312
267
  * Decrypts a content field which contains files and possibly links
313
268
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -321,21 +276,17 @@ var transforms = (0, _toArray.default)('inbound', {
321
276
  if (!content.files || !content.files.items || !(0, _isArray.default)(content.files.items)) {
322
277
  return _promise.default.resolve();
323
278
  }
324
-
325
279
  var promises = content.files.items.map(function (item) {
326
280
  return ctx.transform('decryptObject', key, item);
327
281
  });
328
282
  promises.push(ctx.transform('decryptComment', key, content));
329
-
330
283
  if (content.links && content.links.items && (0, _isArray.default)(content.links.items)) {
331
284
  content.links.items.forEach(function (item) {
332
285
  return promises.push(ctx.transform('decryptObject', key, item));
333
286
  });
334
287
  }
335
-
336
288
  return _promise.default.all(promises);
337
289
  },
338
-
339
290
  /**
340
291
  * Decrypts a content field which contains links
341
292
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -348,14 +299,12 @@ var transforms = (0, _toArray.default)('inbound', {
348
299
  if (!content.links || !content.links.items || !(0, _isArray.default)(content.links.items)) {
349
300
  return _promise.default.resolve();
350
301
  }
351
-
352
302
  var promises = content.links.items.map(function (item) {
353
303
  return ctx.transform('decryptObject', key, item);
354
304
  });
355
305
  promises.push(ctx.transform('decryptComment', key, content));
356
306
  return _promise.default.all(promises);
357
307
  },
358
-
359
308
  /**
360
309
  * Decrypts what may be a meeting event?
361
310
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -365,14 +314,11 @@ var transforms = (0, _toArray.default)('inbound', {
365
314
  */
366
315
  decryptEvent: function decryptEvent(ctx, key, event) {
367
316
  var promises = [ctx.transform('decryptPropDisplayName', key, event)];
368
-
369
317
  if (event.location && event.location.split('.').length === 5) {
370
318
  promises.push(ctx.transform('decryptPropLocation', key, event));
371
319
  }
372
-
373
320
  return _promise.default.all(promises);
374
321
  },
375
-
376
322
  /**
377
323
  * Decrypts a file and it's transcodedContents if they exist
378
324
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -385,12 +331,10 @@ var transforms = (0, _toArray.default)('inbound', {
385
331
  if (file.encryptionKeyUrl && file.encryptionKeyUrl !== key) {
386
332
  key = file.encryptionKeyUrl;
387
333
  }
388
-
389
334
  return _promise.default.all([file.transcodedCollection && _promise.default.all(file.transcodedCollection.items.map(function (item) {
390
335
  return ctx.transform('decryptObject', key, item);
391
336
  })), ctx.transform('decryptPropScr', key, file), ctx.transform('decryptPropDisplayName', key, file), ctx.transform('decryptPropContent', key, file), file.image && ctx.transform('decryptPropScr', key, file.image)]);
392
337
  },
393
-
394
338
  /**
395
339
  * Decrypts a file and it's transcodedContents if they exist
396
340
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -401,7 +345,6 @@ var transforms = (0, _toArray.default)('inbound', {
401
345
  decryptLink: function decryptLink(ctx, key, link) {
402
346
  return _promise.default.all([ctx.transform('decryptPropSslr', key, link), ctx.transform('decryptPropDisplayName', key, link)]);
403
347
  },
404
-
405
348
  /**
406
349
  * Decrypts transcoded file content. Calls decryptFile
407
350
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -414,7 +357,6 @@ var transforms = (0, _toArray.default)('inbound', {
414
357
  return ctx.transform('decryptFile', key, item);
415
358
  }));
416
359
  },
417
-
418
360
  /**
419
361
  * Decrypts an image uri
420
362
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -425,7 +367,6 @@ var transforms = (0, _toArray.default)('inbound', {
425
367
  decryptImageURI: function decryptImageURI(ctx, key, imageURI) {
426
368
  return ctx.transform('decryptPropLocation', key, imageURI);
427
369
  },
428
-
429
370
  /**
430
371
  * The heart of most decryption logic ends here. Decrypting text.
431
372
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -438,7 +379,6 @@ var transforms = (0, _toArray.default)('inbound', {
438
379
  if (!object[name]) {
439
380
  return _promise.default.resolve();
440
381
  }
441
-
442
382
  var decryptionFailureMessage = ctx.webex.internal.conversation.config.decryptionFailureMessage;
443
383
  return ctx.webex.internal.encryption.decryptText(key, object[name]).then(function (plaintext) {
444
384
  if (ctx.webex.config.conversation.keepEncryptedProperties) {
@@ -454,20 +394,18 @@ var transforms = (0, _toArray.default)('inbound', {
454
394
  return _promise.default.resolve(decryptionFailureMessage);
455
395
  });
456
396
  },
457
-
458
397
  /**
459
- * Decrypting an element in an Array.
460
- * @param {Object} ctx An object containing a webex instance and transform prop
461
- * @param {Integer} index Property of an object to be decrypted
462
- * @param {String} key KMS key
463
- * @param {Array} array An array of Strings to be decrypted
464
- * @returns {Promise} Returns a lonely Promise
465
- */
398
+ * Decrypting an element in an Array.
399
+ * @param {Object} ctx An object containing a webex instance and transform prop
400
+ * @param {Integer} index Property of an object to be decrypted
401
+ * @param {String} key KMS key
402
+ * @param {Array} array An array of Strings to be decrypted
403
+ * @returns {Promise} Returns a lonely Promise
404
+ */
466
405
  decryptPropCardItem: function decryptPropCardItem(ctx, index, key, array) {
467
406
  if (!(0, _isInteger.default)(index) || !array || !(0, _isArray.default)(array) || index < 0 || index >= array.length || !(array[index] instanceof String || typeof array[index] === 'string')) {
468
407
  return _promise.default.resolve();
469
408
  }
470
-
471
409
  var decryptionFailureMessage = ctx.webex.internal.conversation.config.decryptionFailureMessage;
472
410
  return ctx.webex.internal.encryption.decryptText(key, array[index]).then(function (plaintext) {
473
411
  array[index] = plaintext; // eslint-disable-line no-param-reassign
@@ -478,7 +416,6 @@ var transforms = (0, _toArray.default)('inbound', {
478
416
  return _promise.default.resolve(decryptionFailureMessage);
479
417
  });
480
418
  },
481
-
482
419
  /**
483
420
  * Decrypts the src of an object (for images?)
484
421
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -491,7 +428,6 @@ var transforms = (0, _toArray.default)('inbound', {
491
428
  object.scr = scr; // eslint-disable-line no-param-reassign
492
429
  });
493
430
  },
494
-
495
431
  /**
496
432
  * Decrypts the sslr object
497
433
  * @param {Object} ctx An object containing a webex instance and transform prop
@@ -504,6 +440,7 @@ var transforms = (0, _toArray.default)('inbound', {
504
440
  object.sslr = sslr; // eslint-disable-line no-param-reassign
505
441
  });
506
442
  },
443
+
507
444
  decryptPropDisplayName: decryptTextProp('displayName'),
508
445
  decryptPropContent: decryptTextProp('content'),
509
446
  decryptPropModel: decryptTextProp('model'),