@webex/internal-plugin-conversation 2.59.2 → 2.59.3-next.1
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/.eslintrc.js +6 -6
- package/README.md +47 -47
- package/babel.config.js +3 -3
- package/dist/activities.js +4 -4
- package/dist/activities.js.map +1 -1
- package/dist/activity-thread-ordering.js +34 -34
- package/dist/activity-thread-ordering.js.map +1 -1
- package/dist/config.js +12 -12
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/conversation.js +474 -474
- package/dist/conversation.js.map +1 -1
- package/dist/convo-error.js +4 -4
- package/dist/convo-error.js.map +1 -1
- package/dist/decryption-transforms.js +155 -155
- package/dist/decryption-transforms.js.map +1 -1
- package/dist/encryption-transforms.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/share-activity.js +57 -57
- package/dist/share-activity.js.map +1 -1
- package/dist/to-array.js +7 -7
- package/dist/to-array.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +21 -20
- package/process +1 -1
- package/src/activities.js +157 -157
- package/src/activity-thread-ordering.js +283 -283
- package/src/activity-threading.md +282 -282
- package/src/config.js +37 -37
- package/src/constants.js +3 -3
- package/src/conversation.js +2535 -2535
- package/src/convo-error.js +15 -15
- package/src/decryption-transforms.js +541 -541
- package/src/encryption-transforms.js +345 -345
- package/src/index.js +327 -327
- package/src/share-activity.js +436 -436
- package/src/to-array.js +29 -29
- package/test/integration/spec/create.js +290 -290
- package/test/integration/spec/encryption.js +333 -333
- package/test/integration/spec/get.js +1255 -1255
- package/test/integration/spec/mercury.js +94 -94
- package/test/integration/spec/share.js +537 -537
- package/test/integration/spec/verbs.js +1041 -1041
- package/test/unit/spec/conversation.js +823 -823
- package/test/unit/spec/decrypt-transforms.js +460 -460
- package/test/unit/spec/encryption-transforms.js +93 -93
- package/test/unit/spec/share-activity.js +178 -178
package/dist/convo-error.js
CHANGED
|
@@ -15,8 +15,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
|
|
|
15
15
|
var _common = require("@webex/common");
|
|
16
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); }; }
|
|
17
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; } }
|
|
18
|
-
/**
|
|
19
|
-
* General conversation error
|
|
18
|
+
/**
|
|
19
|
+
* General conversation error
|
|
20
20
|
*/
|
|
21
21
|
var ConversationError = /*#__PURE__*/function (_Exception) {
|
|
22
22
|
(0, _inherits2.default)(ConversationError, _Exception);
|
|
@@ -27,8 +27,8 @@ var ConversationError = /*#__PURE__*/function (_Exception) {
|
|
|
27
27
|
}
|
|
28
28
|
return (0, _createClass2.default)(ConversationError);
|
|
29
29
|
}(_common.Exception);
|
|
30
|
-
/**
|
|
31
|
-
* InvalidUserCreation thrown when failed to create conversation with invalid user
|
|
30
|
+
/**
|
|
31
|
+
* InvalidUserCreation thrown when failed to create conversation with invalid user
|
|
32
32
|
*/
|
|
33
33
|
exports.ConversationError = ConversationError;
|
|
34
34
|
var InvalidUserCreation = /*#__PURE__*/function (_ConversationError) {
|
package/dist/convo-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationError","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","Exception","exports","InvalidUserCreation","_ConversationError","_super2"],"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,IAAAA,OAAA,GAAAC,OAAA;AAAwC,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAExC;AACA;AACA;AAFA,IAGaC,iBAAiB,0BAAAC,UAAA;EAAA,IAAAC,UAAA,CAAAlB,OAAA,EAAAgB,iBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAA1B,YAAA,CAAAuB,iBAAA;EAAA,SAAAA,kBAAA;IAAA,IAAAI,gBAAA,CAAApB,OAAA,QAAAgB,iBAAA;IAAA,OAAAG,MAAA,CAAAb,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAgB,aAAA,CAAArB,OAAA,EAAAgB,iBAAA;AAAA,EAASM,iBAAS;AAEhD;AACA;AACA;AAFAC,OAAA,CAAAP,iBAAA,GAAAA,iBAAA;AAAA,IAGaQ,mBAAmB,0BAAAC,kBAAA;EAAA,IAAAP,UAAA,CAAAlB,OAAA,EAAAwB,mBAAA,EAAAC,kBAAA;EAAA,IAAAC,OAAA,GAAAjC,YAAA,CAAA+B,mBAAA;EAAA,SAAAA,oBAAA;IAAA,IAAAJ,gBAAA,CAAApB,OAAA,QAAAwB,mBAAA;IAAA,OAAAE,OAAA,CAAApB,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAgB,aAAA,CAAArB,OAAA,EAAAwB,mBAAA;AAAA,EAASR,iBAAiB;AAAAO,OAAA,CAAAC,mBAAA,GAAAA,mBAAA"}
|
|
1
|
+
{"version":3,"names":["_common","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","ConversationError","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","Exception","exports","InvalidUserCreation","_ConversationError","_super2"],"sources":["convo-error.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport {Exception} from '@webex/common';\r\n\r\n/**\r\n * General conversation error\r\n */\r\nexport class ConversationError extends Exception {}\r\n\r\n/**\r\n * InvalidUserCreation thrown when failed to create conversation with invalid user\r\n */\r\nexport class InvalidUserCreation extends ConversationError {}\r\n"],"mappings":";;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AAAwC,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAExC;AACA;AACA;AAFA,IAGaC,iBAAiB,0BAAAC,UAAA;EAAA,IAAAC,UAAA,CAAAlB,OAAA,EAAAgB,iBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAA1B,YAAA,CAAAuB,iBAAA;EAAA,SAAAA,kBAAA;IAAA,IAAAI,gBAAA,CAAApB,OAAA,QAAAgB,iBAAA;IAAA,OAAAG,MAAA,CAAAb,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAgB,aAAA,CAAArB,OAAA,EAAAgB,iBAAA;AAAA,EAASM,iBAAS;AAEhD;AACA;AACA;AAFAC,OAAA,CAAAP,iBAAA,GAAAA,iBAAA;AAAA,IAGaQ,mBAAmB,0BAAAC,kBAAA;EAAA,IAAAP,UAAA,CAAAlB,OAAA,EAAAwB,mBAAA,EAAAC,kBAAA;EAAA,IAAAC,OAAA,GAAAjC,YAAA,CAAA+B,mBAAA;EAAA,SAAAA,oBAAA;IAAA,IAAAJ,gBAAA,CAAApB,OAAA,QAAAwB,mBAAA;IAAA,OAAAE,OAAA,CAAApB,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAgB,aAAA,CAAArB,OAAA,EAAAwB,mBAAA;AAAA,EAASR,iBAAiB;AAAAO,OAAA,CAAAC,mBAAA,GAAAA,mBAAA"}
|
|
@@ -19,12 +19,12 @@ var decryptTextProp = (0, _curry2.default)(function (name, ctx, key, object) {
|
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line import/prefer-default-export
|
|
21
21
|
var transforms = (0, _toArray.default)('inbound', {
|
|
22
|
-
/**
|
|
23
|
-
* This function is used recursively to decrypt various properties on conversations, activities, etc
|
|
24
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
25
|
-
* @param {String} key KMS encryption key url
|
|
26
|
-
* @param {Object} object Generic object that you want to decrypt some property on based on the type
|
|
27
|
-
* @returns {Promise} Returns a transform promise
|
|
22
|
+
/**
|
|
23
|
+
* This function is used recursively to decrypt various properties on conversations, activities, etc
|
|
24
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
25
|
+
* @param {String} key KMS encryption key url
|
|
26
|
+
* @param {Object} object Generic object that you want to decrypt some property on based on the type
|
|
27
|
+
* @returns {Promise} Returns a transform promise
|
|
28
28
|
*/
|
|
29
29
|
decryptObject: function decryptObject(ctx, key, object) {
|
|
30
30
|
if (!object) {
|
|
@@ -52,14 +52,14 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
52
52
|
}
|
|
53
53
|
return ctx.transform("decrypt".concat((0, _capitalize2.default)(object.objectType)), key, object);
|
|
54
54
|
},
|
|
55
|
-
/**
|
|
56
|
-
* Decrypt an individual submit object from a cardAction activity
|
|
57
|
-
* (object.objectType === 'submit')
|
|
58
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
59
|
-
* @param {String} key KMS key
|
|
60
|
-
* @param {Object} object An instance of a Webex submit object
|
|
61
|
-
* these objects are returned when a user clicks on a Action.Submit button in a card
|
|
62
|
-
* @returns {Promise} Returns a ctx.transform promise
|
|
55
|
+
/**
|
|
56
|
+
* Decrypt an individual submit object from a cardAction activity
|
|
57
|
+
* (object.objectType === 'submit')
|
|
58
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
59
|
+
* @param {String} key KMS key
|
|
60
|
+
* @param {Object} object An instance of a Webex submit object
|
|
61
|
+
* these objects are returned when a user clicks on a Action.Submit button in a card
|
|
62
|
+
* @returns {Promise} Returns a ctx.transform promise
|
|
63
63
|
*/
|
|
64
64
|
decryptSubmit: function decryptSubmit(ctx, key, object) {
|
|
65
65
|
if (!object.inputs) {
|
|
@@ -75,14 +75,14 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
75
75
|
return _promise.default.resolve(decryptionFailureMessage);
|
|
76
76
|
});
|
|
77
77
|
},
|
|
78
|
-
/**
|
|
79
|
-
* Decrypt an individual reaction2Summary activity (object.objectType === 'reaction2Summary')
|
|
80
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
81
|
-
* @param {String} key KMS key
|
|
82
|
-
* @param {Object} object An instance of a Webex reaction2Summary object
|
|
83
|
-
* these objects are returned by various conversation APIs and over mercury
|
|
84
|
-
* represents an aggregated summary of all reactions to a specific activity
|
|
85
|
-
* @returns {Promise} Returns a ctx.transform promise
|
|
78
|
+
/**
|
|
79
|
+
* Decrypt an individual reaction2Summary activity (object.objectType === 'reaction2Summary')
|
|
80
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
81
|
+
* @param {String} key KMS key
|
|
82
|
+
* @param {Object} object An instance of a Webex reaction2Summary object
|
|
83
|
+
* these objects are returned by various conversation APIs and over mercury
|
|
84
|
+
* represents an aggregated summary of all reactions to a specific activity
|
|
85
|
+
* @returns {Promise} Returns a ctx.transform promise
|
|
86
86
|
*/
|
|
87
87
|
decryptReaction2summary: function decryptReaction2summary(ctx, key, object) {
|
|
88
88
|
if (!object.reactions) {
|
|
@@ -92,16 +92,16 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
92
92
|
return ctx.transform('decryptPropDisplayName', key, reaction);
|
|
93
93
|
}));
|
|
94
94
|
},
|
|
95
|
-
/**
|
|
96
|
-
* Decrypt an individual reaction2SelfSummary activity (object.objectType === 'reaction2SelfSummary')
|
|
97
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
98
|
-
* @param {String} key KMS key
|
|
99
|
-
* @param {Object} object An instance of a Webex reaction2SelfSummary object
|
|
100
|
-
* these objects are returned by various conversation APIs and NOT over mercury
|
|
101
|
-
* they are ONLY received by the self user
|
|
102
|
-
* they represent ONLY the self user's reactions and are used for enforcing
|
|
103
|
-
* limit of times they can react to a specific activity
|
|
104
|
-
* @returns {Promise} Returns a ctx.transform promise
|
|
95
|
+
/**
|
|
96
|
+
* Decrypt an individual reaction2SelfSummary activity (object.objectType === 'reaction2SelfSummary')
|
|
97
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
98
|
+
* @param {String} key KMS key
|
|
99
|
+
* @param {Object} object An instance of a Webex reaction2SelfSummary object
|
|
100
|
+
* these objects are returned by various conversation APIs and NOT over mercury
|
|
101
|
+
* they are ONLY received by the self user
|
|
102
|
+
* they represent ONLY the self user's reactions and are used for enforcing
|
|
103
|
+
* limit of times they can react to a specific activity
|
|
104
|
+
* @returns {Promise} Returns a ctx.transform promise
|
|
105
105
|
*/
|
|
106
106
|
decryptReaction2selfsummary: function decryptReaction2selfsummary(ctx, key, object) {
|
|
107
107
|
if (!object.reactions) {
|
|
@@ -111,23 +111,23 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
111
111
|
return ctx.transform('decryptPropDisplayName', key, reaction);
|
|
112
112
|
}));
|
|
113
113
|
},
|
|
114
|
-
/**
|
|
115
|
-
* Decrypt an individual reaction2 activity (object.objectType === 'reaction2')
|
|
116
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
117
|
-
* @param {String} key KMS key
|
|
118
|
-
* @param {Object} object An instance of a Webex reaction2 object
|
|
119
|
-
* these objects are returned by various conversation APIs and over mercury
|
|
120
|
-
* ONLY self users receive these objects
|
|
121
|
-
* @returns {Promise} Returns a ctx.transform promise
|
|
114
|
+
/**
|
|
115
|
+
* Decrypt an individual reaction2 activity (object.objectType === 'reaction2')
|
|
116
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
117
|
+
* @param {String} key KMS key
|
|
118
|
+
* @param {Object} object An instance of a Webex reaction2 object
|
|
119
|
+
* these objects are returned by various conversation APIs and over mercury
|
|
120
|
+
* ONLY self users receive these objects
|
|
121
|
+
* @returns {Promise} Returns a ctx.transform promise
|
|
122
122
|
*/
|
|
123
123
|
decryptReaction2: function decryptReaction2(ctx, key, object) {
|
|
124
124
|
return ctx.transform('decryptPropDisplayName', key, object);
|
|
125
125
|
},
|
|
126
|
-
/**
|
|
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
|
|
126
|
+
/**
|
|
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
131
|
*/
|
|
132
132
|
decryptThread: function decryptThread(ctx, threadObject) {
|
|
133
133
|
var promises = [];
|
|
@@ -138,12 +138,12 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
138
138
|
}
|
|
139
139
|
return _promise.default.all(promises);
|
|
140
140
|
},
|
|
141
|
-
/**
|
|
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
|
|
141
|
+
/**
|
|
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
147
|
*/
|
|
148
148
|
decryptMeetingcontainer: function decryptMeetingcontainer(ctx, key, meetingContainerActivity) {
|
|
149
149
|
var promises = [];
|
|
@@ -161,14 +161,14 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
161
161
|
}
|
|
162
162
|
return _promise.default.all(promises);
|
|
163
163
|
},
|
|
164
|
-
/**
|
|
165
|
-
* Decrypts a given conversation and it's activities by building an array of promises that call
|
|
166
|
-
* decryptObject, which may then call other decrypt functions
|
|
167
|
-
*
|
|
168
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
169
|
-
* @param {String} key KMS encryption key url (or actual key?)
|
|
170
|
-
* @param {Object} conversation A Webex conversation object
|
|
171
|
-
* @returns {Promise} Returns the result of Promise.all
|
|
164
|
+
/**
|
|
165
|
+
* Decrypts a given conversation and it's activities by building an array of promises that call
|
|
166
|
+
* decryptObject, which may then call other decrypt functions
|
|
167
|
+
*
|
|
168
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
169
|
+
* @param {String} key KMS encryption key url (or actual key?)
|
|
170
|
+
* @param {Object} conversation A Webex conversation object
|
|
171
|
+
* @returns {Promise} Returns the result of Promise.all
|
|
172
172
|
*/
|
|
173
173
|
decryptConversation: function decryptConversation(ctx, key, conversation) {
|
|
174
174
|
var promises = [];
|
|
@@ -199,12 +199,12 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
199
199
|
}
|
|
200
200
|
return _promise.default.all(promises);
|
|
201
201
|
},
|
|
202
|
-
/**
|
|
203
|
-
* Decrypt an individual activity
|
|
204
|
-
* @param {Object} ctx An object containing a webex instance and a transform
|
|
205
|
-
* @param {String} key KMS encryption key url (or actual key?)
|
|
206
|
-
* @param {Object} activity An instance of a Webex activity
|
|
207
|
-
* @returns {Promise} Returns a ctx.transform promise
|
|
202
|
+
/**
|
|
203
|
+
* Decrypt an individual activity
|
|
204
|
+
* @param {Object} ctx An object containing a webex instance and a transform
|
|
205
|
+
* @param {String} key KMS encryption key url (or actual key?)
|
|
206
|
+
* @param {Object} activity An instance of a Webex activity
|
|
207
|
+
* @returns {Promise} Returns a ctx.transform promise
|
|
208
208
|
*/
|
|
209
209
|
decryptActivity: function decryptActivity(ctx, key, activity) {
|
|
210
210
|
if (!activity.encryptionKeyUrl && !(activity.object && activity.object.encryptionKeyUrl)) {
|
|
@@ -223,23 +223,23 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
223
223
|
promises.push(ctx.transform('decryptObject', keyUrl, activity.object));
|
|
224
224
|
return _promise.default.all(promises);
|
|
225
225
|
},
|
|
226
|
-
/**
|
|
227
|
-
* Decrypts a microappInstance (recording) model
|
|
228
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
229
|
-
* @param {String} key KMS key
|
|
230
|
-
* @param {Object} microappInstance A microappInstance which includes several properties of a recording
|
|
231
|
-
* @param {String} microappInstance.model An encrypted string which decrypts to an object
|
|
232
|
-
* @returns {Promise} Returns a context transform
|
|
226
|
+
/**
|
|
227
|
+
* Decrypts a microappInstance (recording) model
|
|
228
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
229
|
+
* @param {String} key KMS key
|
|
230
|
+
* @param {Object} microappInstance A microappInstance which includes several properties of a recording
|
|
231
|
+
* @param {String} microappInstance.model An encrypted string which decrypts to an object
|
|
232
|
+
* @returns {Promise} Returns a context transform
|
|
233
233
|
*/
|
|
234
234
|
decryptMicroappinstance: function decryptMicroappinstance(ctx, key, microappInstance) {
|
|
235
235
|
return ctx.transform('decryptPropModel', key, microappInstance);
|
|
236
236
|
},
|
|
237
|
-
/**
|
|
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
|
|
237
|
+
/**
|
|
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
243
|
*/
|
|
244
244
|
decryptComment: function decryptComment(ctx, key, comment) {
|
|
245
245
|
var promises = [ctx.transform('decryptPropDisplayName', key, comment), ctx.transform('decryptPropContent', key, comment)];
|
|
@@ -250,12 +250,12 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
250
250
|
}
|
|
251
251
|
return _promise.default.all(promises);
|
|
252
252
|
},
|
|
253
|
-
/**
|
|
254
|
-
* Decrypts a content field
|
|
255
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
256
|
-
* @param {String} key KMS key
|
|
257
|
-
* @param {Object} content An object with properties to be decrypted
|
|
258
|
-
* @returns {Promise} A promise that will return when the decryption has finished
|
|
253
|
+
/**
|
|
254
|
+
* Decrypts a content field
|
|
255
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
256
|
+
* @param {String} key KMS key
|
|
257
|
+
* @param {Object} content An object with properties to be decrypted
|
|
258
|
+
* @returns {Promise} A promise that will return when the decryption has finished
|
|
259
259
|
*/
|
|
260
260
|
decryptContent: function decryptContent(ctx, key, content) {
|
|
261
261
|
if (content.contentCategory === 'links') {
|
|
@@ -263,14 +263,14 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
263
263
|
}
|
|
264
264
|
return ctx.transform('decryptContentFiles', key, content);
|
|
265
265
|
},
|
|
266
|
-
/**
|
|
267
|
-
* Decrypts a content field which contains files and possibly links
|
|
268
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
269
|
-
* @param {String} key KMS key
|
|
270
|
-
* @param {Object} content An object with properties to be decrypted
|
|
271
|
-
* @param {Array} content.files An array of files to decrypt by calling decryptObject
|
|
272
|
-
* @param {Array} content.links An array of links to decrypt by calling decryptObject
|
|
273
|
-
* @returns {Promise} A promise that will return when the decryption has finished
|
|
266
|
+
/**
|
|
267
|
+
* Decrypts a content field which contains files and possibly links
|
|
268
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
269
|
+
* @param {String} key KMS key
|
|
270
|
+
* @param {Object} content An object with properties to be decrypted
|
|
271
|
+
* @param {Array} content.files An array of files to decrypt by calling decryptObject
|
|
272
|
+
* @param {Array} content.links An array of links to decrypt by calling decryptObject
|
|
273
|
+
* @returns {Promise} A promise that will return when the decryption has finished
|
|
274
274
|
*/
|
|
275
275
|
decryptContentFiles: function decryptContentFiles(ctx, key, content) {
|
|
276
276
|
if (!content.files || !content.files.items || !(0, _isArray.default)(content.files.items)) {
|
|
@@ -287,13 +287,13 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
287
287
|
}
|
|
288
288
|
return _promise.default.all(promises);
|
|
289
289
|
},
|
|
290
|
-
/**
|
|
291
|
-
* Decrypts a content field which contains links
|
|
292
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
293
|
-
* @param {String} key KMS key
|
|
294
|
-
* @param {Object} content An object with properties to be decrypted
|
|
295
|
-
* @param {Array} content.links An array of links to decrypt by calling decryptObject
|
|
296
|
-
* @returns {Promise} A promise that will return when the decryption has finished
|
|
290
|
+
/**
|
|
291
|
+
* Decrypts a content field which contains links
|
|
292
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
293
|
+
* @param {String} key KMS key
|
|
294
|
+
* @param {Object} content An object with properties to be decrypted
|
|
295
|
+
* @param {Array} content.links An array of links to decrypt by calling decryptObject
|
|
296
|
+
* @returns {Promise} A promise that will return when the decryption has finished
|
|
297
297
|
*/
|
|
298
298
|
decryptContentLinks: function decryptContentLinks(ctx, key, content) {
|
|
299
299
|
if (!content.links || !content.links.items || !(0, _isArray.default)(content.links.items)) {
|
|
@@ -305,12 +305,12 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
305
305
|
promises.push(ctx.transform('decryptComment', key, content));
|
|
306
306
|
return _promise.default.all(promises);
|
|
307
307
|
},
|
|
308
|
-
/**
|
|
309
|
-
* Decrypts what may be a meeting event?
|
|
310
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
311
|
-
* @param {String} key KMS key
|
|
312
|
-
* @param {Object} event An object with a display name and location to be decrypted
|
|
313
|
-
* @returns {Promise} Returns the result of Promise.all
|
|
308
|
+
/**
|
|
309
|
+
* Decrypts what may be a meeting event?
|
|
310
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
311
|
+
* @param {String} key KMS key
|
|
312
|
+
* @param {Object} event An object with a display name and location to be decrypted
|
|
313
|
+
* @returns {Promise} Returns the result of Promise.all
|
|
314
314
|
*/
|
|
315
315
|
decryptEvent: function decryptEvent(ctx, key, event) {
|
|
316
316
|
var promises = [ctx.transform('decryptPropDisplayName', key, event)];
|
|
@@ -319,12 +319,12 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
319
319
|
}
|
|
320
320
|
return _promise.default.all(promises);
|
|
321
321
|
},
|
|
322
|
-
/**
|
|
323
|
-
* Decrypts a file and it's transcodedContents if they exist
|
|
324
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
325
|
-
* @param {String} key KMS key
|
|
326
|
-
* @param {Object} file A file object with file props an optional transcodedCollection to decrypt
|
|
327
|
-
* @returns {Promise} Returns the result of Promise.all
|
|
322
|
+
/**
|
|
323
|
+
* Decrypts a file and it's transcodedContents if they exist
|
|
324
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
325
|
+
* @param {String} key KMS key
|
|
326
|
+
* @param {Object} file A file object with file props an optional transcodedCollection to decrypt
|
|
327
|
+
* @returns {Promise} Returns the result of Promise.all
|
|
328
328
|
*/
|
|
329
329
|
decryptFile: function decryptFile(ctx, key, file) {
|
|
330
330
|
// using object encryption keyUrl for images instead of activity encryptionKeyUrl
|
|
@@ -335,45 +335,45 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
335
335
|
return ctx.transform('decryptObject', key, item);
|
|
336
336
|
})), ctx.transform('decryptPropScr', key, file), ctx.transform('decryptPropDisplayName', key, file), ctx.transform('decryptPropContent', key, file), file.image && ctx.transform('decryptPropScr', key, file.image)]);
|
|
337
337
|
},
|
|
338
|
-
/**
|
|
339
|
-
* Decrypts a file and it's transcodedContents if they exist
|
|
340
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
341
|
-
* @param {String} key KMS key
|
|
342
|
-
* @param {Object} link A link object with a URL to decrypt
|
|
343
|
-
* @returns {Promise} Returns the result of Promise.all
|
|
338
|
+
/**
|
|
339
|
+
* Decrypts a file and it's transcodedContents if they exist
|
|
340
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
341
|
+
* @param {String} key KMS key
|
|
342
|
+
* @param {Object} link A link object with a URL to decrypt
|
|
343
|
+
* @returns {Promise} Returns the result of Promise.all
|
|
344
344
|
*/
|
|
345
345
|
decryptLink: function decryptLink(ctx, key, link) {
|
|
346
346
|
return _promise.default.all([ctx.transform('decryptPropSslr', key, link), ctx.transform('decryptPropDisplayName', key, link)]);
|
|
347
347
|
},
|
|
348
|
-
/**
|
|
349
|
-
* Decrypts transcoded file content. Calls decryptFile
|
|
350
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
351
|
-
* @param {String} key KMS key
|
|
352
|
-
* @param {Object} transcodedContent Transcoded content with a files prop
|
|
353
|
-
* @returns {Promise} Returns the result of Promise.all
|
|
348
|
+
/**
|
|
349
|
+
* Decrypts transcoded file content. Calls decryptFile
|
|
350
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
351
|
+
* @param {String} key KMS key
|
|
352
|
+
* @param {Object} transcodedContent Transcoded content with a files prop
|
|
353
|
+
* @returns {Promise} Returns the result of Promise.all
|
|
354
354
|
*/
|
|
355
355
|
decryptTranscodedContent: function decryptTranscodedContent(ctx, key, transcodedContent) {
|
|
356
356
|
return _promise.default.all(transcodedContent.files.items.map(function (item) {
|
|
357
357
|
return ctx.transform('decryptFile', key, item);
|
|
358
358
|
}));
|
|
359
359
|
},
|
|
360
|
-
/**
|
|
361
|
-
* Decrypts an image uri
|
|
362
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
363
|
-
* @param {String} key KMS key
|
|
364
|
-
* @param {String} imageURI URI of the image to decrypt
|
|
365
|
-
* @returns {Promise} Returns a promise.
|
|
360
|
+
/**
|
|
361
|
+
* Decrypts an image uri
|
|
362
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
363
|
+
* @param {String} key KMS key
|
|
364
|
+
* @param {String} imageURI URI of the image to decrypt
|
|
365
|
+
* @returns {Promise} Returns a promise.
|
|
366
366
|
*/
|
|
367
367
|
decryptImageURI: function decryptImageURI(ctx, key, imageURI) {
|
|
368
368
|
return ctx.transform('decryptPropLocation', key, imageURI);
|
|
369
369
|
},
|
|
370
|
-
/**
|
|
371
|
-
* The heart of most decryption logic ends here. Decrypting text.
|
|
372
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
373
|
-
* @param {String} name Property of an object to be decrypted
|
|
374
|
-
* @param {String} key KMS key
|
|
375
|
-
* @param {Object} object A generic object with text props to be decrypted
|
|
376
|
-
* @returns {Promise} Returns a lonely Promise
|
|
370
|
+
/**
|
|
371
|
+
* The heart of most decryption logic ends here. Decrypting text.
|
|
372
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
373
|
+
* @param {String} name Property of an object to be decrypted
|
|
374
|
+
* @param {String} key KMS key
|
|
375
|
+
* @param {Object} object A generic object with text props to be decrypted
|
|
376
|
+
* @returns {Promise} Returns a lonely Promise
|
|
377
377
|
*/
|
|
378
378
|
decryptTextProp: function decryptTextProp(ctx, name, key, object) {
|
|
379
379
|
if (!object[name]) {
|
|
@@ -394,13 +394,13 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
394
394
|
return _promise.default.resolve(decryptionFailureMessage);
|
|
395
395
|
});
|
|
396
396
|
},
|
|
397
|
-
/**
|
|
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
|
|
397
|
+
/**
|
|
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
404
|
*/
|
|
405
405
|
decryptPropCardItem: function decryptPropCardItem(ctx, index, key, array) {
|
|
406
406
|
if (!(0, _isInteger.default)(index) || !array || !(0, _isArray.default)(array) || index < 0 || index >= array.length || !(array[index] instanceof String || typeof array[index] === 'string')) {
|
|
@@ -416,24 +416,24 @@ var transforms = (0, _toArray.default)('inbound', {
|
|
|
416
416
|
return _promise.default.resolve(decryptionFailureMessage);
|
|
417
417
|
});
|
|
418
418
|
},
|
|
419
|
-
/**
|
|
420
|
-
* Decrypts the src of an object (for images?)
|
|
421
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
422
|
-
* @param {String} key KMS key
|
|
423
|
-
* @param {Object} object An object with a scr property to be decrypted
|
|
424
|
-
* @returns {Promise} Returns a promise
|
|
419
|
+
/**
|
|
420
|
+
* Decrypts the src of an object (for images?)
|
|
421
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
422
|
+
* @param {String} key KMS key
|
|
423
|
+
* @param {Object} object An object with a scr property to be decrypted
|
|
424
|
+
* @returns {Promise} Returns a promise
|
|
425
425
|
*/
|
|
426
426
|
decryptPropScr: function decryptPropScr(ctx, key, object) {
|
|
427
427
|
return ctx.webex.internal.encryption.decryptScr(key, object.scr).then(function (scr) {
|
|
428
428
|
object.scr = scr; // eslint-disable-line no-param-reassign
|
|
429
429
|
});
|
|
430
430
|
},
|
|
431
|
-
/**
|
|
432
|
-
* Decrypts the sslr object
|
|
433
|
-
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
434
|
-
* @param {String} key KMS key
|
|
435
|
-
* @param {Object} object An object with a sslr property to be decrypted
|
|
436
|
-
* @returns {Promise} Returns a promise
|
|
431
|
+
/**
|
|
432
|
+
* Decrypts the sslr object
|
|
433
|
+
* @param {Object} ctx An object containing a webex instance and transform prop
|
|
434
|
+
* @param {String} key KMS key
|
|
435
|
+
* @param {Object} object An object with a sslr property to be decrypted
|
|
436
|
+
* @returns {Promise} Returns a promise
|
|
437
437
|
*/
|
|
438
438
|
decryptPropSslr: function decryptPropSslr(ctx, key, object) {
|
|
439
439
|
return ctx.webex.internal.encryption.decryptScr(key, object.sslr).then(function (sslr) {
|