@webex/internal-plugin-feature 2.16.0 → 2.19.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.
- package/dist/feature.js +1 -1
- package/dist/feature.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/feature.js
CHANGED
|
@@ -155,7 +155,7 @@ var Feature = _webexCore.WebexPlugin.extend({
|
|
|
155
155
|
this.listenToAndRun(this.webex, 'change:internal.device.features.entitlement', this.trigger.bind(this, 'change:entitlement'));
|
|
156
156
|
this.listenToAndRun(this.webex, 'change:internal.device.features.user', this.trigger.bind(this, 'change:user'));
|
|
157
157
|
},
|
|
158
|
-
version: "2.
|
|
158
|
+
version: "2.19.0"
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
var _default = Feature;
|
package/dist/feature.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Feature","WebexPlugin","extend","namespace","getFeature","keyType","key","options","reject","Error","feature","webex","internal","device","features","get","resolve","full","serialize","value","handleFeatureUpdate","envelope","data","featureToggle","type","toLowerCase","add","merge","listen","listenTo","mercury","setFeature","request","method","api","resource","userId","body","mutable","val","then","res","setBundledFeatures","featureList","forEach","item","partitionedToggles","featureToggles","user","developer","initialize","args","prototype","listenToAndRun","trigger","bind"],"sources":["feature.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-device';\nimport {partition} from 'lodash';\nimport {WebexPlugin} from '@webex/webex-core';\n\nconst Feature = WebexPlugin.extend({\n namespace: 'Feature',\n\n /**\n * Returns the value of the requested feature toggle.\n * @param {string} keyType <developer|user|entitlement>\n * @param {string} key\n * @param {Object} options\n * @param {boolean} options.full to get full feature record including metadata.\n * @returns {string|boolean|number|FeatureModel|null}\n */\n getFeature(keyType, key, options) {\n if (keyType !== 'developer' && keyType !== 'user' && keyType !== 'entitlement') {\n return Promise.reject(new Error('Invalid feature keyType provided. Only `developer`, `user`, and `entitlement` feature toggles are permitted.'));\n }\n\n options = options || {};\n\n const feature = this.webex.internal.device.features[keyType].get(key);\n\n if (!feature) {\n return Promise.resolve(null);\n }\n\n if (options.full) {\n return Promise.resolve(feature.serialize());\n }\n\n return Promise.resolve(feature.value);\n },\n\n /**\n * Handles a feature toggle update from the server.\n * @param {Object} envelope\n * @returns {undefined}\n */\n handleFeatureUpdate(envelope) {\n if (envelope && envelope.data) {\n const feature = envelope.data.featureToggle;\n const keyType = feature.type.toLowerCase();\n\n if (keyType === 'user' || keyType === 'developer') {\n this.webex.internal.device.features[keyType].add([feature], {merge: true});\n }\n }\n },\n\n /**\n * Register to listen for incoming feature events\n * @instance\n * @returns {undefined}\n */\n listen() {\n this.listenTo(this.webex.internal.mercury, 'event:featureToggle_update', this.handleFeatureUpdate);\n },\n\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {string} keyType <developer|user>\n * @param {string} key\n * @param {string} value\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint's response.\n */\n setFeature(keyType, key, value) {\n // Limit only to developer feature toggles for now.\n if (keyType !== 'developer' && keyType !== 'user') {\n return Promise.reject(new Error('Only `developer` and `user` feature toggles can be set.'));\n }\n\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: `features/users/${this.webex.internal.device.userId}/${keyType}`,\n body: {\n key,\n mutable: true,\n val: value\n }\n })\n .then((res) => this.webex.internal.device.features[keyType].add(res.body, {merge: true}));\n },\n\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {array} featureList\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint`s response.\n */\n setBundledFeatures(featureList) {\n featureList.forEach((item) => {\n item.mutable = item.mutable || 'true';\n if (item.type !== 'USER' && item.type !== 'DEV') {\n item.type = 'USER';\n }\n });\n\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: `features/users/${this.webex.internal.device.userId}/toggles`,\n body: featureList\n })\n .then((res) => {\n const partitionedToggles = partition(res.body.featureToggles, {type: 'USER'});\n\n this.webex.internal.device.features.user.add(partitionedToggles[0], {merge: true});\n this.webex.internal.device.features.developer.add(partitionedToggles[1], {merge: true});\n });\n },\n\n initialize(...args) {\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n this.listenToAndRun(this.webex, 'change:internal.device.features.developer', this.trigger.bind(this, 'change:developer'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.entitlement', this.trigger.bind(this, 'change:entitlement'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.user', this.trigger.bind(this, 'change:user'));\n }\n});\n\nexport default Feature;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AANA;AACA;AACA;AAMA,IAAMA,OAAO,GAAGC,
|
|
1
|
+
{"version":3,"names":["Feature","WebexPlugin","extend","namespace","getFeature","keyType","key","options","reject","Error","feature","webex","internal","device","features","get","resolve","full","serialize","value","handleFeatureUpdate","envelope","data","featureToggle","type","toLowerCase","add","merge","listen","listenTo","mercury","setFeature","request","method","api","resource","userId","body","mutable","val","then","res","setBundledFeatures","featureList","forEach","item","partitionedToggles","featureToggles","user","developer","initialize","args","prototype","listenToAndRun","trigger","bind"],"sources":["feature.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-device';\nimport {partition} from 'lodash';\nimport {WebexPlugin} from '@webex/webex-core';\n\nconst Feature = WebexPlugin.extend({\n namespace: 'Feature',\n\n /**\n * Returns the value of the requested feature toggle.\n * @param {string} keyType <developer|user|entitlement>\n * @param {string} key\n * @param {Object} options\n * @param {boolean} options.full to get full feature record including metadata.\n * @returns {string|boolean|number|FeatureModel|null}\n */\n getFeature(keyType, key, options) {\n if (keyType !== 'developer' && keyType !== 'user' && keyType !== 'entitlement') {\n return Promise.reject(new Error('Invalid feature keyType provided. Only `developer`, `user`, and `entitlement` feature toggles are permitted.'));\n }\n\n options = options || {};\n\n const feature = this.webex.internal.device.features[keyType].get(key);\n\n if (!feature) {\n return Promise.resolve(null);\n }\n\n if (options.full) {\n return Promise.resolve(feature.serialize());\n }\n\n return Promise.resolve(feature.value);\n },\n\n /**\n * Handles a feature toggle update from the server.\n * @param {Object} envelope\n * @returns {undefined}\n */\n handleFeatureUpdate(envelope) {\n if (envelope && envelope.data) {\n const feature = envelope.data.featureToggle;\n const keyType = feature.type.toLowerCase();\n\n if (keyType === 'user' || keyType === 'developer') {\n this.webex.internal.device.features[keyType].add([feature], {merge: true});\n }\n }\n },\n\n /**\n * Register to listen for incoming feature events\n * @instance\n * @returns {undefined}\n */\n listen() {\n this.listenTo(this.webex.internal.mercury, 'event:featureToggle_update', this.handleFeatureUpdate);\n },\n\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {string} keyType <developer|user>\n * @param {string} key\n * @param {string} value\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint's response.\n */\n setFeature(keyType, key, value) {\n // Limit only to developer feature toggles for now.\n if (keyType !== 'developer' && keyType !== 'user') {\n return Promise.reject(new Error('Only `developer` and `user` feature toggles can be set.'));\n }\n\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: `features/users/${this.webex.internal.device.userId}/${keyType}`,\n body: {\n key,\n mutable: true,\n val: value\n }\n })\n .then((res) => this.webex.internal.device.features[keyType].add(res.body, {merge: true}));\n },\n\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {array} featureList\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint`s response.\n */\n setBundledFeatures(featureList) {\n featureList.forEach((item) => {\n item.mutable = item.mutable || 'true';\n if (item.type !== 'USER' && item.type !== 'DEV') {\n item.type = 'USER';\n }\n });\n\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: `features/users/${this.webex.internal.device.userId}/toggles`,\n body: featureList\n })\n .then((res) => {\n const partitionedToggles = partition(res.body.featureToggles, {type: 'USER'});\n\n this.webex.internal.device.features.user.add(partitionedToggles[0], {merge: true});\n this.webex.internal.device.features.developer.add(partitionedToggles[1], {merge: true});\n });\n },\n\n initialize(...args) {\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n\n this.listenToAndRun(this.webex, 'change:internal.device.features.developer', this.trigger.bind(this, 'change:developer'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.entitlement', this.trigger.bind(this, 'change:entitlement'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.user', this.trigger.bind(this, 'change:user'));\n }\n});\n\nexport default Feature;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AANA;AACA;AACA;AAMA,IAAMA,OAAO,GAAGC,sBAAA,CAAYC,MAAZ,CAAmB;EACjCC,SAAS,EAAE,SADsB;;EAGjC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,UAXiC,sBAWtBC,OAXsB,EAWbC,GAXa,EAWRC,OAXQ,EAWC;IAChC,IAAIF,OAAO,KAAK,WAAZ,IAA2BA,OAAO,KAAK,MAAvC,IAAiDA,OAAO,KAAK,aAAjE,EAAgF;MAC9E,OAAO,iBAAQG,MAAR,CAAe,IAAIC,KAAJ,CAAU,8GAAV,CAAf,CAAP;IACD;;IAEDF,OAAO,GAAGA,OAAO,IAAI,EAArB;IAEA,IAAMG,OAAO,GAAG,KAAKC,KAAL,CAAWC,QAAX,CAAoBC,MAApB,CAA2BC,QAA3B,CAAoCT,OAApC,EAA6CU,GAA7C,CAAiDT,GAAjD,CAAhB;;IAEA,IAAI,CAACI,OAAL,EAAc;MACZ,OAAO,iBAAQM,OAAR,CAAgB,IAAhB,CAAP;IACD;;IAED,IAAIT,OAAO,CAACU,IAAZ,EAAkB;MAChB,OAAO,iBAAQD,OAAR,CAAgBN,OAAO,CAACQ,SAAR,EAAhB,CAAP;IACD;;IAED,OAAO,iBAAQF,OAAR,CAAgBN,OAAO,CAACS,KAAxB,CAAP;EACD,CA7BgC;;EA+BjC;AACF;AACA;AACA;AACA;EACEC,mBApCiC,+BAoCbC,QApCa,EAoCH;IAC5B,IAAIA,QAAQ,I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AXI,CAAP;EAYD,CA3GgC;EA6GjCuB,UA7GiC,wBA6Gb;IAAA,kCAANC,IAAM;MAANA,IAAM;IAAA;;IAClB,oBAAclD,sBAAA,CAAYmD,SAAZ,CAAsBF,UAApC,EAAgD,IAAhD,EAAsDC,IAAtD;IAEA,KAAKE,cAAL,CAAoB,KAAK1C,KAAzB,EAAgC,2CAAhC,EAA6E,KAAK2C,OAAL,CAAaC,IAAb,CAAkB,IAAlB,EAAwB,kBAAxB,CAA7E;IACA,KAAKF,cAAL,CAAoB,KAAK1C,KAAzB,EAAgC,6CAAhC,EAA+E,KAAK2C,OAAL,CAAaC,IAAb,CAAkB,IAAlB,EAAwB,oBAAxB,CAA/E;IACA,KAAKF,cAAL,CAAoB,KAAK1C,KAAzB,EAAgC,sCAAhC,EAAwE,KAAK2C,OAAL,CAAaC,IAAb,CAAkB,IAAlB,EAAwB,aAAxB,CAAxE;EACD,CAnHgC;EAAA;AAAA,CAAnB,CAAhB;;eAsHevD,O"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Feature","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport '@webex/internal-plugin-mercury';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Feature from './feature';\nimport config from './config';\n\nregisterInternalPlugin('feature', Feature, {\n config\n});\n\nexport {default} from './feature';\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA;;AAEA;;AAEA;;AACA;;AARA;AACA;AACA;AAQA,
|
|
1
|
+
{"version":3,"names":["registerInternalPlugin","Feature","config"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport '@webex/internal-plugin-mercury';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Feature from './feature';\nimport config from './config';\n\nregisterInternalPlugin('feature', Feature, {\n config\n});\n\nexport {default} from './feature';\n"],"mappings":";;;;;;;;;;;;;;;;;AAGA;;AAEA;;AAEA;;AACA;;AARA;AACA;AACA;AAQA,IAAAA,iCAAA,EAAuB,SAAvB,EAAkCC,gBAAlC,EAA2C;EACzCC,MAAM,EAANA;AADyC,CAA3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-feature",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aimee <aimma@cisco.com>",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
20
|
-
"@webex/internal-plugin-mercury": "2.
|
|
21
|
-
"@webex/webex-core": "2.
|
|
20
|
+
"@webex/internal-plugin-mercury": "2.19.0",
|
|
21
|
+
"@webex/webex-core": "2.19.0",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
|
-
"@webex/internal-plugin-device": "2.
|
|
23
|
+
"@webex/internal-plugin-device": "2.19.0",
|
|
24
24
|
"envify": "^4.1.0"
|
|
25
25
|
}
|
|
26
26
|
}
|