@c8y/ng1-modules 1018.265.0 → 1018.267.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/NOTICES +28 -28
- package/app-logs/app-logs.service.js +1 -1
- package/assetPropertyWidget/main.controller.js +1 -1
- package/cell-id-information-activator/cell-id-information-activator.config.js +1 -1
- package/core/core/services/alarms.js +1 -1
- package/core/core/services/application.js +1 -1
- package/core/core/services/base.js +1 -1
- package/core/core/services/dynamicGroups.js +1 -1
- package/core/core/services/groups.js +1 -1
- package/core/core/services/inventory.js +1 -1
- package/core/core/services/kpi.js +1 -1
- package/core/core/services/settings.js +1 -1
- package/core/core/services/tenant.js +1 -1
- package/core/core/services/user.js +1 -1
- package/core/core/services/util.js +1 -1
- package/core/ui/configurable-device-list-columns/configurable-columns.service.js +1 -1
- package/core/ui/configurable-device-list-columns/modal-columns-configure.component.js +1 -1
- package/core/ui/controllers/deviceList.js +1 -1
- package/core/ui/csvExporter/csvExporter.controller.js +1 -1
- package/core/ui/directives/alarmList.js +1 -1
- package/core/ui/directives/map2.js +1 -1
- package/core/ui/properties/lastDeviceMessage.computedProperty.js +1 -1
- package/device-protocol-actility/actility-device.provider.js +1 -1
- package/device-protocol-canbus/canbus-device.provider.js +1 -1
- package/device-protocol-canopen/canopen-device.provider.js +1 -1
- package/device-protocol-deviceDatabase4/device-type-protocol-base.provider.js +1 -1
- package/device-protocol-lora/lora-device.provider.js +1 -1
- package/device-protocol-lpwan/lpwan-device.provider.js +1 -1
- package/device-protocol-modbus/modbus-device.provider.js +1 -1
- package/device-protocol-opcua/opcua-device.provider.js +1 -1
- package/device-protocol-profibus/profibus-device.provider.js +1 -1
- package/device-protocol-sigfox/sigfox-device.provider.js +1 -1
- package/device-protocol-snmp/snmp-device.provider.js +1 -1
- package/deviceDatabase4/device-database.service.js +1 -1
- package/deviceSelector/controllers/deviceSelectorComboCtrl.js +1 -1
- package/devicemanagement-alarmList/controllers/alarmList.js +1 -1
- package/devicemanagement-eventList/controllers/eventList.js +1 -1
- package/enterpriseEdition/customBranding/brandingConfigurationUi.provider.js +1 -1
- package/eventList/eventList.controller.js +1 -1
- package/groupsHierarchy/controllers/groupsListCtrl.js +1 -1
- package/kpi/controllers/pieChart.js +1 -1
- package/modbusWidget4/modbus-widget.service.js +1 -1
- package/package.json +1 -1
- package/remoteAccess/remoteAccess.service.js +1 -1
- package/remoteAccess/remoteAccessSettings/remoteAccessSettings.component.js +1 -1
- package/scada/mapping.directive.js +1 -1
- package/tenantStatistics/tenant-statistics.component.js +1 -1
- package/userRoles/inventoryRolesTab/inventoryRolesTab.component.js +1 -1
package/NOTICES
CHANGED
|
@@ -677,6 +677,32 @@ SOFTWARE.
|
|
|
677
677
|
|
|
678
678
|
-----
|
|
679
679
|
|
|
680
|
+
The following software may be included in this product: @cspotcode/source-map-support, source-map-support. A copy of the source code may be downloaded from https://github.com/cspotcode/node-source-map-support (@cspotcode/source-map-support), https://github.com/evanw/node-source-map-support (source-map-support). This software contains the following license and notice below:
|
|
681
|
+
|
|
682
|
+
The MIT License (MIT)
|
|
683
|
+
|
|
684
|
+
Copyright (c) 2014 Evan Wallace
|
|
685
|
+
|
|
686
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
687
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
688
|
+
in the Software without restriction, including without limitation the rights
|
|
689
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
690
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
691
|
+
furnished to do so, subject to the following conditions:
|
|
692
|
+
|
|
693
|
+
The above copyright notice and this permission notice shall be included in all
|
|
694
|
+
copies or substantial portions of the Software.
|
|
695
|
+
|
|
696
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
697
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
698
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
699
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
700
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
701
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
702
|
+
SOFTWARE.
|
|
703
|
+
|
|
704
|
+
-----
|
|
705
|
+
|
|
680
706
|
The following software may be included in this product: @cypress/request, aws-sign2, forever-agent, oauth-sign, request, tunnel-agent. A copy of the source code may be downloaded from https://github.com/cypress-io/request.git (@cypress/request), https://github.com/mikeal/aws-sign (aws-sign2), https://github.com/mikeal/forever-agent (forever-agent), https://github.com/mikeal/oauth-sign (oauth-sign), https://github.com/request/request.git (request), https://github.com/mikeal/tunnel-agent (tunnel-agent). This software contains the following license and notice below:
|
|
681
707
|
|
|
682
708
|
Apache License
|
|
@@ -37486,32 +37512,6 @@ THE SOFTWARE.
|
|
|
37486
37512
|
|
|
37487
37513
|
-----
|
|
37488
37514
|
|
|
37489
|
-
The following software may be included in this product: source-map-support. A copy of the source code may be downloaded from https://github.com/evanw/node-source-map-support. This software contains the following license and notice below:
|
|
37490
|
-
|
|
37491
|
-
The MIT License (MIT)
|
|
37492
|
-
|
|
37493
|
-
Copyright (c) 2014 Evan Wallace
|
|
37494
|
-
|
|
37495
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
37496
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
37497
|
-
in the Software without restriction, including without limitation the rights
|
|
37498
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
37499
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
37500
|
-
furnished to do so, subject to the following conditions:
|
|
37501
|
-
|
|
37502
|
-
The above copyright notice and this permission notice shall be included in all
|
|
37503
|
-
copies or substantial portions of the Software.
|
|
37504
|
-
|
|
37505
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37506
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
37507
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
37508
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37509
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37510
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37511
|
-
SOFTWARE.
|
|
37512
|
-
|
|
37513
|
-
-----
|
|
37514
|
-
|
|
37515
37515
|
The following software may be included in this product: source-map-url. A copy of the source code may be downloaded from https://github.com/lydell/source-map-url.git. This software contains the following license and notice below:
|
|
37516
37516
|
|
|
37517
37517
|
The MIT License (MIT)
|
|
@@ -38296,7 +38296,7 @@ The following software may be included in this product: three. A copy of the sou
|
|
|
38296
38296
|
|
|
38297
38297
|
The MIT License
|
|
38298
38298
|
|
|
38299
|
-
Copyright © 2010-
|
|
38299
|
+
Copyright © 2010-2023 three.js authors
|
|
38300
38300
|
|
|
38301
38301
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
38302
38302
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -39666,7 +39666,7 @@ SOFTWARE.
|
|
|
39666
39666
|
|
|
39667
39667
|
-----
|
|
39668
39668
|
|
|
39669
|
-
The following software may be included in this product: v8-compile-cache. A copy of the source code may be downloaded from https://github.com/zertosh/v8-compile-cache.git. This software contains the following license and notice below:
|
|
39669
|
+
The following software may be included in this product: v8-compile-cache, v8-compile-cache-lib. A copy of the source code may be downloaded from https://github.com/zertosh/v8-compile-cache.git (v8-compile-cache), https://github.com/cspotcode/v8-compile-cache-lib.git (v8-compile-cache-lib). This software contains the following license and notice below:
|
|
39670
39670
|
|
|
39671
39671
|
The MIT License (MIT)
|
|
39672
39672
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(o),!0).forEach(function(t){_defineProperty(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function _defineProperty(t,e,o){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0===o)return("string"===e?String:Number)(t);var r=o.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(c,i,u,r,n,a){var s="application/applications",l="application/vnd.com.nsn.cumulocity.applicationLogs+json;charset=UTF-8;ver=0.9";return{downloadAndSaveAs:function(t,o,r,n){return e(t,o,r,n).then(function(t){var e=t.logs;_.isEmpty(e)?a.info(p(r,n)):function(t,e){var o="".concat(t,".log"),r=new Blob([e],{type:"text/plain"});window.saveAs(r,o)}(o,e)})},shouldShowLogsTab:function(t){var e="c8y_Application_".concat(t),o=new Date;return r.list({type:e,nocache:o.getTime()}).then(function(t){var e;if(_.isEqual(_.get(t,"length"),1)){var o=_.head(t),r=_.get(o,"c8y_SupportedLogs"),n=_.get(o,"c8y_Status.instances");e=_.some(r,function(t){return"syslog"===t})&&!_.isEmpty(n)}return e})},getAllLogs:e,getLogs:f,formatDateChosenByUser:function(t){var e=moment(t).format("YYYY-MM-DDTHH:mm:ss.SSS");return moment("".concat(e,"Z")).toISOString()},getWarningMessageForMissingLogs:p};function e(r,n,e,a){var i=[];return f(r,n,{dateFrom:e,dateTo:a}).then(function t(e){var o=m(e.dateTo);return i.push(e.logs),moment(o).isValid()&&e.truncated&&e.dateFrom!==e.dateTo?f(r,n,{dateFrom:o,dateTo:a}).then(t):c.resolve(i)}).then(function(t){return function(t,e,o){var r=o.join("");return{dateFrom:t,dateTo:e,logs:r}}(e,a,t)})}function f(t,e){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length?arguments[3]:void 0,n=u.url("".concat(s,"/").concat(t,"/logs/").concat(e)),a=_objectSpread({headers:{Accept:l},params:o},r);return o.dateFrom&&(o.dateFrom=m(o.dateFrom)),o.dateTo&&(o.dateTo=m(o.dateTo)),i.get(n,a).then(u.getResData)}function m(t){return moment(t).format(u.dateFullFormatWithMs)}function p(t,e){var o;return!t&&e&&(o=n.getString("No logs available before {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateTo:e})),t&&e&&(o=n.getString("No logs available in time range {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}} - {{dateTo | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t,dateTo:e})),t&&!e&&(o=n.getString("No logs available after {{dateFrom | absoluteDateTimeFormat:'LL, LTS':'+0000'}}.",{dateFrom:t})),t||e||(o=n.getString("No logs available.")),o}}t.$inject=["$q","$http","c8yBase","c8yInventory","gettextCatalog","c8yAlert"],angular.module("c8y.appLogs").factory("c8yApplicationLogs",t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,c,a=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}!function(){function e(n,e,t,r,o,i,c,a,u,l){var f=_.memoize(function(){return e.all({configProperties:function(){var e=P("properties",[]);return _.filter(e,"__active").map(function(e){return angular.copy(e)})}(),discoveredProperties:function(){if(P("allowDisplayAndEditKnownProperties",!1))return o.list().then(function(e){return _.filter(e,d)}).then(function(e){return _.filter(e,b)});return[]}()}).then(function(e){var t=e.configProperties,r=e.discoveredProperties;return _(t).concat(r).uniqBy(function(e){return"".concat(_.get(e,"id"),"_").concat(_.get(e,"config._id"))}).reject(j).value()})});function s(){f.cache.clear(),n.$emit("stopRealtime"),function(){var e=n.child.config.device.id;return r.detailRealtime(e,n,void 0,{withChildren:!0}).then(function(e){n.managedObject=e})}().then(y).then(p).then(h)}function y(){return f().then(function(e){i.attach(n.managedObject,e)})}function p(){return f().then(function(e){return o.getSchema(e)}).then(function(e){n.schema=e})}function d(e){return 1===e.keyPath.length}function b(e){return _.has(n.managedObject,e.keyPath[0])}function h(){m(!0)}function m(t){return e.all({properties:f(),options:function(e){var t={};e&&(t.readonly=e,t.feedback=!1,t.disableSuccessState=!0,t.disableErrorState=!0);return t}(t)}).then(function(e){var t=e.properties,r=e.options;return o.getForm(t,r)}).then(function(e){n.form=e,n.editable=!t})}function g(e){!function(e){_.forEach(e,function(e){var t=_slicedToArray(e.keyPath,1),r=t[0];_.isUndefined(n.managedObject[r])&&(n.managedObject[r]=null)})}(e),f.cache.clear(),p().then(function(){return m(!1)})}function v(){t.getContext().id===n.child.config.device.id&&a.changeTitle({title:_.get(n,"managedObject.name")||""},{skipTitleTranslation:!0})}function P(e,t){return _.get(n.child.config.options,e,t)}function j(e){var t=P("hiddenPropertiesKeyPaths",[]);return!!_.includes(t,e.keyPath[0])}n.$watch("child.config.options",s),_.assign(n,{startEdit:function(){n.managedObject=_.cloneDeep(n.managedObject),y(),m(!1)},canAddProperties:function(){return P("allowDisplayAndEditKnownProperties",!1)},addProperties:function(){var e={includeTree:!1,includeTreeChildren:!1,showComputed:!1,showRootPropertiesOnly:!0,managedObject:n.managedObject,hideExistingInMO:!0};return l.openSelector(e).then(g)},save:function(){return f().then(function(e){return _.reject(e,{computed:!0})}).then(function(e){return _objectSpread({id:n.managedObject.id},_.pick(n.managedObject,_.map(e,"keyPath[0]")))}).then(r.save).then(v).then(function(){return c.success(u("Changes saved."))}).then(s)},cancelEdit:function(){s()}})}e.$inject=["$scope","$q","c8yUiUtil","c8yInventory","c8yPropertiesLibrary","c8yComputedProperties","c8yAlert","c8yTitle","gettext","SchemaPropertiesSvc"],angular.module("c8y.parts.assetPropertyWidget").controller("assetPropertyWidgetCtrl",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var o=r.call(t,e||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(t,e){var r={path:"/device/:deviceId/*",actionBar:!0};t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Activate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,r=t.activated;return e&&!r})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.activate(t.deviceId)}]})),t.addUrlAction(_objectSpread(_objectSpread({},r),{},{text:e("Deactivate Cell ID information"),showIf:["$q","$routeParams","cellIdInformationActivator",function(t,e,r){return t.all({shown:r.shouldShowActivator(),activated:r.isActivatedFor(e.deviceId)}).then(function(t){var e=t.shown,r=t.activated;return e&&r})}],action:["$routeParams","cellIdInformationActivator",function(t,e){e.deactivate(t.deviceId)}]}))}t.$inject=["c8yActionsProvider","gettext"],angular.module("c8y.cellIdInformationActivator").config(t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var n=r.call(t,e||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(o,a,u,i,n,t,e,c){var s=a.cleanFields,f="alarm/alarms",l="".concat(f,"/reports"),m={headers:a.contentHeaders("alarm")},r={WARNING:e("WARNING"),MINOR:e("MINOR"),MAJOR:e("MAJOR"),CRITICAL:e("CRITICAL")},y=[r.CRITICAL,r.MAJOR,r.MINOR,r.WARNING],p=_.keys(r),g={ACTIVE:e("ACTIVE"),ACKNOWLEDGED:e("ACKNOWLEDGED"),CLEARED:e("CLEARED")},v=_.keys(g),d=["id"],h=["id","self","creationTime","type","time","count","history","firstOccurence","firstOccurrenceTime"],b={},E="status",O={type:e("Type"),text:e("Text")};function D(t){var e=t.id||t;return a.url("".concat(f,"/").concat(e))}function C(t){var e=a.url(f),r=a.timeOrderFilter(a.pageSizeNoTotalFilter(t)),n={params:r},i=a.cleanListCallback("alarms",C,r);return o.get(e,n).then(i)}function w(t){var e=a.url(f),r=s(t,d);return o.post(e,r,m)}function A(t){var e=D(t),r=s(t,h);return o.put(e,r,m)}function N(e,t){return t?r(t):n.list({source:e.id,pageSize:1e3}).then(r);function r(t){var n="--";return e.status!==g.ACKNOWLEDGED||_.isEmpty(t)||(n=_.last(t).user),t.forEach(function(t){var e=t.changes||[],r=!1;if(e.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return!(r=!0)}),r)return n=t.user||n,!1}),n}}function T(t,e){function r(t){var e=t||[],n=e.length?e[e.length-1].creationTime:void 0;return e.forEach(function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.ACKNOWLEDGED)return n=e.creationTime,!(r=!0)}),r)return!1}),n}return e?r(e):n.list({source:t.id,pageSize:1e3}).then(r)}function L(t,e){var r=S(t,e);return r.humanize?r.humanize():r.then(function(t){return t.humanize?t.humanize():""})}function S(u,t){function e(t){var e=t||[],r=u.creationTime,n=e.length?e[e.length-1].creationTime:void 0,i="";if(_.forEach(e,function(e){var t=e.changes||[],r=!1;if(t.forEach(function(t){if(t.attribute===E&&t.newValue===g.CLEARED)return n=e.creationTime,!(r=!0)}),r)return!1}),r&&n){var o=moment(r),a=moment(n);i=moment.duration(o.diff(a))}return i}return t?e(t):n.list({source:u.id,pageSize:1e3}).then(e)}function R(t,e){var r=[l,t];return e.id&&r.push(e.id),a.url(r.join("/"))}function j(t){var r=_.memoize(t,function(t,e){return[t.id,t.status,t.count,e&&e.length].join(":")});return function(t,e){return r(t,e)}}function I(t,e){var r=i.when(N(t,e)),n=i.when(T(t,e));return i.all([r,n]).then(function(t){return c.getString("ACKNOWLEDGED`alarm` by: {{ackBy}} {{ackTimeFromNow}}",{ackBy:t[0],ackTimeFromNow:moment(t[1]).fromNow()})})}function P(t,e){return i.when(L(t,e)).then(function(t){return c.getString("CLEARED`alarm`: was active for {{alarmDuration}}",{alarmDuration:t})})}function K(t){return i.when(c.getString("ACTIVE`alarm`: triggered {{alarmTimeFromNow}}",{alarmTimeFromNow:moment(t.time).fromNow()}))}b[r.WARNING]="circle",b[r.MINOR]="high-priority",b[r.MAJOR]="warning",b[r.CRITICAL]="exclamation-circle",b[g.CLEARED]="c8y-alert-idle",b[g.ACKNOWLEDGED]="bell-slash",b[g.ACTIVE]="bell";var k={list:C,listByStatus:function(t,e){var r=_.compact(_.map(t,function(t,e){return t?e:void 0})),n=_.map(r,function(t){return C(_objectSpread(_objectSpread({},e),{},{status:t}))});return i.all(n).then(a.combineLists)},listByDevices:function(t,e){return i.all(_.map(t,function(t){return e.source=t,C(e)})).then(a.combineLists)},getSeverityCount:function(t,e){return _.filter(t,{severity:e}).length},detail:function(t){var e=D(t);return o.get(e)},update:A,updateBulk:function(t,e){var r=a.url(f);return o.put(r,e,{params:t})},create:w,save:function(t){return t.id?A(t):w(t)},acknowledgedBy:j(N),ackTime:j(T),alarmDuration:j(L),alarmDurationDiff:j(S),severity:r,severityList:p,getHighestSeverityFromAlarmsStatus:function(e){var t=_.map(y,function(t){return{severity:t,count:_.get(e,_.toLower(t),0)}}),r=_.find(t,function(t){return 0<t.count});return _.get(r,"severity",null)},status:g,statusList:v,statusText:j(function(t,e){var r;switch((t.status||"").toUpperCase()){case g.ACKNOWLEDGED:r=I;break;case g.CLEARED:r=P;break;case g.ACTIVE:r=K}return r&&r(t,e)}),icon:function(t){var e=(_.isObjectLike(t)?t.severity:t).toUpperCase();return b[e]},reports:{downtimeDuration:function(t){var e=a.timeOrderFilter(t),r=R("downtimeDuration",e),n={params:e};return o.get(r,n)},downtimeDurationAggregation:function(t){var e=a.timeOrderFilter(t),r=R("downtimeDuration/aggregation",e),n={params:e};return o.get(r,n)}},getDisplayCount:function(t){var e=a.url("".concat(f,"/count")),r={params:t};return o.get(e,r).then(a.getResData).then(function(t){return 99<t?"99+":t})},createCounter:function(t){var e=_.get(t,"source"),r="/alarms/".concat(e||"*"),n=new u.Counter(C,r);if(t){var i=[u.defaultPropertyMaps.date,u.defaultPropertyMaps.source];if(t.type){var o=t.type;i.push([function(t){return o===t.type}])}delete t.type,n.filter(t,i)}return n}};return t.enhanceWithKeysUtil({target:k,reservedKeys:["history","id","severity","self","source","creationTime","time","text","firstOccurrence","count","firstOccurrenceTime","status"],standardKeys:O})}t.$inject=["$http","c8yBase","c8yCounter","$q","c8yAudits","c8yUtil","gettext","gettextCatalog"],angular.module("c8y.core").factory("c8yAlarms",t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.forEach(function(t){_defineProperty(n,t,e[t])})}return n}function _defineProperty(t,n,e){return(n=_toPropertyKey(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function _toPropertyKey(t){var n=_toPrimitive(t,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(t,n){if("object"!==_typeof(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return("string"===n?String:Number)(t);var r=e.call(t,n||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(c,u,e,p,o,t,l,s,n,f,r,g,h,d,i,m){var v,a=i("humanizeAppName"),y="application/",S="".concat(y,"applications"),b={headers:f.contentHeaders("application",!0)},E=this,A={HOSTED:"cloud",EXTERNAL:"external-link",SMARTAPP:"puzzle-piece",MICROSERVICE:"microchip",APAMA_CEP_RULE:"file-code-o"},P=["HOSTED","EXTERNAL"],x=["HOSTED","EXTERNAL"],D={HOSTED:d("Hosted application"),EXTERNAL:d("External application"),MICROSERVICE:d("Microservice"),APAMA_CEP_RULE:d("Apama CEP rule")},O=f.createEnum([{name:"UP",label:d("Up"),value:"Up",icon:"check-circle text-success"},{name:"DOWN",label:d("Down"),value:"Down",icon:"warning status critical"},{name:"UNHEALTHY",label:d("Unhealthy"),value:"Unhealth",icon:"exclamation-circle status major"},{name:"UNHEALTHY",label:d("Unhealthy"),value:"Unhealthy",icon:"exclamation-circle status major"}]),C=1e3,w=10;try{v=n.get("gettextCatalog")}catch(t){v={getString:_.identity}}function R(c,o){return r.current().then(function(t){var n=t.tenant,e=f.pageSizeFilter(o),r={params:e},i="".concat(f.url(c),"/").concat(n),a=f.cleanListCallback("applications",angular.bind(E,R,c),e);return u.get(i,r).then(a).then(rt).then(L)})}function j(t){var n=t.desired,e=t.active;return{active:e,unhealthy:function(t,n){return _.isNumber(n)?t-n:t}(n,e),desired:n}}function M(c,o){return r.current().then(function(t){var n=c||t,e=f.pageSizeFilter(o),r={params:_.defaults(e,{noPaging:!0,dropOverwrittenApps:!0})},i=f.url("".concat(y,"applicationsByUser/").concat(encodeURIComponent(n.id))),a=f.cleanListCallback("applications",angular.bind(E,M,n),e);return u.get(i,r).then(a).then(rt).then(L)})}function L(t){var n=_.sortBy(t,[function(t){return a(t)}]);return _.assign(n,_.pick(t,["statistics","paging"])),n}function T(t){return R("".concat(y,"applicationsByTenant"),t)}function U(t){var n=f.url("".concat(S,"/").concat(t.contextPath,"/manifest")),e={params:f.pageSizeNoTotalFilter()};return u.get(n,e).then(function(t){return _.map(t.data.imports,k)})}function N(t){var n=N.cache,e=t.id||t,r=f.url("".concat(S,"/").concat(e,"/binaries/plugins")),i={params:f.pageSizeNoTotalFilter()};function a(){delete n[e]}return n[e]||(n[e]=l(_.noop,2e3).then(function(){return u.get(r,i).then(f.getResData).finally(a)})),n[e]}function k(t){return{id:t.id,contextPath:t.rootContextPath,directoryName:t.directoryName,manifest:t}}function I(t){var n=t.id||t;return f.url("".concat(S,"/").concat(n))}function B(t){var n=I(t);return u.get(n)}function F(n,t){var e=I(n),r=function(t){var n=_.cloneDeep(t);return delete n.type,n}(n),i=_.defaults(t||{},b),a=u.put(e,r,i).finally(function(){o.localStorage.setItem("refresh",n.contextPath)});return a.then(function(t){c.$emit("c8yApplication:update",{app:n,res:t})}),a}function H(n,t){var e=f.url(S),r=_.defaults(t||{},b),i=u.post(e,n,r);return i.then(function(t){return c.$emit("c8yApplication:create",{app:n,res:t})}).catch(function(){s.error("Could not emit c8yApplication:create for:",{app:n})}),i}function $(t,n){return t.id?F(t,n):H(t,n)}function z(i){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=2<arguments.length?arguments[2]:void 0,n=3<arguments.length?arguments[3]:void 0,c=w,o=n||p.defer(),u=t||0,e=0===u?"":"-".concat(u);return $(function(t,n){var e=function(t){return"".concat(t).concat(n)};return _objectSpread({},t,{name:e(t.name),key:e(t.key),contextPath:e(t.contextPath)})}(i,e),_objectSpread({silentError:!0},a)).then(function(t){o.resolve(f.getResData(t))},function(t){if(409===t.status&&u<c)z(i,a,u+1,o);else{var n=_.get(t,"data.message")||_.get(t,"data.details.exceptionMessage"),e=n?v.getString(n):d("Could not create application."),r=t.data;o.reject({errorMessage:e,errorDetails:r})}}),o.promise}function q(r){var t=B(r).then(f.getResData);return p.all({appDetails:t,appPlugins:t.then(N).then(K),appManifest:t.then(J),appIndex:t.then(W)}).then(function(t){t.appDetails;var n=t.appPlugins,e=t.appManifest,r=t.appIndex,i=function(n,t){return _(t.imports).map(function(t){return _.find(n,{pluginName:t})}).compact().concat(n).uniq().value()}(n,e);return p.all({newAppManifest:function(t,n){var e=_.cloneDeep(n);return e.imports=_.map(t,"pluginName"),e}(i,e),newAppIndex:function(t,n,e){var r=e;return r=function(t,n,e){var r=e,i=_(n).map(function(t){var n=_.get(t,"pluginPackage.css",[]);return!!(n=n.length?n:_.get(t,"pluginPackage.less",[])).length&&"".concat(t.pluginName,"/style.css")}).filter(_.identity).value(),a=_.flattenDeep(["\x3c!--MODULES_CSS--\x3e",_.map(i.slice(0,1),function(t){return'<link rel="stylesheet" href="'.concat(t,'"></link>')}),"\x3c!--/MODULES_CSS--\x3e"]).join("\n"),c=_.flattenDeep(["\x3c!--MODULES_CSS_DEFER--\x3e","<script>",["[",'"'.concat(i.slice(1).join('", "'),'"'),"].forEach(function(f){loadCSS(f)})"].join(""),"<\/script>","\x3c!--/MODULES_CSS_DEFER--\x3e"]).join("\n");return r=(r=r.replace(new RegExp("\x3c!--MODULES_CSS--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_CSS--\x3e","gm"),a)).replace(new RegExp("\x3c!--MODULES_CSS_DEFER--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_CSS_DEFER--\x3e","gm"),c)}(0,n,r),r=function(t,n,e){var r=_.flattenDeep(["\x3c!--MODULES_JS--\x3e",_(n).map(function(t){var n=_.get(t,"pluginPackage.js",[]);return!!n.length&&"".concat(t.pluginName,"/main.js")}).filter(_.identity).map(function(t){return'<script defer src="'.concat(t,'"><\/script>')}).value(),"\x3c!--/MODULES_JS--\x3e"]).join("\n");return e.replace(new RegExp("\x3c!--MODULES_JS--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_JS--\x3e","gm"),r)}(0,n,r),r=function(t,n,e){var r=['C8Y_NG_MODULES=["',_.uniq(_.flattenDeep(_.map(n,function(t){return _.get(t,"pluginPackage.ngModules",[])}))).join('","'),'"];'].join("");return e.replace(new RegExp("C8Y_NG_MODULES=\\[(.|\\n|\\r)*?\\];","gm"),r)}(0,n,r)}(0,i,r)})}).then(function(t){var n=t.newAppManifest,e=t.newAppIndex;return Y(r,[{path:"cumulocity.json",file:new Blob([JSON.stringify(n)],{type:"application/json"})},{path:"index.html",file:new Blob([e],{type:"text/html"})}])})}function K(t){var n=[],e=_.sortBy(t,function(t){return-1*_.get(t,"pluginPackage.priority",0)});return _.forEach(e,function(t){!function e(t,r,i){var n=V(r,_.get(t,"pluginPackage.contextPath"));if(n)return;var a=_.get(t,"pluginPackage.imports",[]);_.forEach(a,function(t){var n=V(i,t);n?e(n,r,i):s.error("Plugin with context path ".concat(t," is missing."))});r.push(t)}(t,n,e)}),n}function V(t,n){var e=function(t){var n=t;(function(t){return/^core\//.test(t)||/^administration\//.test(t)||/^devicemanagement\//.test(t)||/^cockpit\//.test(t)||/^platformadmin\//.test(t)||/^fieldbus4\//.test(t)||/^fieldbus3\//.test(t)||/^fieldbus2\//.test(t)||/^fieldbus\//.test(t)||/^demoboard\//.test(t)||/^vendme_plugins\//.test(t)})(n)&&(n=n.replace(/\//g,"_"));return n}(n);return _.find(t,function(t){return t&&t.pluginPackage&&t.pluginPackage.contextPath===e})}function J(t){var n="".concat(X(t),"/cumulocity.json");return u.get(n).then(f.getResData)}function W(t){var n="".concat(X(t),"/index.html");return u.get(n).then(f.getResData)}function X(t){return f.url("apps/".concat(t.contextPath))}function Y(t,n){var e="".concat(I(t),"/binaries/files"),r=new FormData;return _.forEach(n,function(t){r.append(t.path,new File([t.file],t.path))}),u.post(e,r,{transformRequest:_.identity,headers:{"Content-Type":void 0}})}function G(){var t=o.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return t&&t[2]}function Q(){var t=o.location.pathname.match(/\/apps\/(public\/([^/]+)|([^/]+))/);return t&&-1!==t[1].indexOf("public")}function Z(){var e=G(),r=!!Q();function n(t){var n="MARKET"===t.availability;return t.contextPath===e&&(!r||n)}return M(null,{dropOverwrittenApps:!1}).then(function(t){return _.find(t,n)})}function tt(n){return g.list({type:"c8y_SmartAppApplication"}).then(function(t){return _.find(t,{appId:n.id})||null})}function nt(t){var n;return(t?p.resolve(t):Z()).then(function(t){return n=t}).then(tt).then(function(t){return n.config=t,n})}function et(t){return _(t).uniq("id").filter(function(t){var n=t.manifest,e=!1;return n&&(e=n.noAppSwitcher),!e&&_.includes(["HOSTED","EXTERNAL"],t.type)}).value()}function rt(t){var n=_.reject(t,function(t){return"management"===t.name&&"management"===t.owner.tenant.id});return _.assign(n,_.pick(t,_.filter(_.keys(t),function(t){return _.isNaN(_.toNumber(t))}))),n}function it(t,n){var e=_.isString(n)?function(n){return function(t){return t.name===n||t.contextPath===n||t.key===n}}(n):n;return _.some(t,e)}function at(t){return"HOSTED"===t.type}function ct(){if(ct.cache)return ct.cache;function n(t){return{url:t,noAppKey:!0}}return u(n([f.url(S),(Q()?"public/":"")+G(),"manifest"].join("/"))).then(function(t){return u(n([f.url(S),t.data.application.id].join("/")))}).then(f.getResData).then(function(t){return ct.cache=p.when(t)})}return N.cache={},f.getFlag("test")&&(ct.cache=p.when({name:"app",manifest:{}})),{list:T,listByUser:M,listByTenant:T,listByOwner:function(t){return R("".concat(y,"applicationsByOwner"),t)},listPlugins:function(){var t=f.url("".concat(y,"plugins")),n={params:{pageSize:C}};return u.get(t,n).then(function(t){return _.uniqBy(t.data.plugins,"id")})},listPluginsByTenant:function(){return T().then(function(t){var n=_.uniqBy(t,"id"),e=[];return _.forEach(n,function(t){at(t)&&e.push(U(t))}),p.all(e).then(_.flattenDeep).then(function(t){return _.uniqBy(t,"id")})})},listPluginsByApplication:U,listPluginsByPaasApp:N,listByVisibleLinks:function(){return M().then(et).then(function(t){return p.when(t)})},listApplications:function t(n){var e=f.url("".concat(S)),r={params:f.pageSizeFilter(n)},i=f.cleanListCallback("applications",t,n);return u.get(e,r).then(i).then(L)},getApplicationMO:function(t){var n="c8y_Application_".concat(t);return g.list({type:n}).then(function(t){return _.head(t)})},getApplicationMOs:function(t){var n=t||{},e=n.tenantId,r=n.filters,i=void 0===r?{}:r,a={type:"c8y_Application_*"};return e&&(a=m.addAndFilter(a,{__has:"c8y_Subscriptions.".concat(e)})),g.listQuery(a,i,!0)},getInstanceCounts:j,getSubscriptionsList:function(t){var n=_.get(t,"c8y_Subscriptions");return _.reduce(n,function(t,n,e){var r=_.get(n,"details"),i=_.get(n,"status"),a=j(r);return t.concat(_objectSpread({},a,{tenantName:e,status:i}))},[])},getApplicationStatusForTenant:function(t,n){return _.get(t,["c8y_Subscriptions",n])},status:O,isAvailable:function(n){return M().then(function(t){return it(t,n)})},areAllAvailable:function(t){return M().then(function(n){return _.every(t,function(t){return it(n,t)})})},isAnyAvailable:function(t){return M().then(function(n){return _.some(t,function(t){return it(n,t)})})},detail:B,update:F,create:H,remove:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=I(e),r=nt(_.isObjectLike(e)?e:{id:e}).then(function(t){return!_.get(t,"config.id")||g.remove(t.config)}),i=u.delete(n,{params:t}),a=p.all({cfg:r,res:i});return a.then(function(t){var n=t.res;c.$emit("c8yApplication:delete",{app:e,res:n})}),a},save:$,trySave:z,clone:function(t,n){var e="".concat(I(t),"/clone");return u.post(e).then(f.getResData).then(function(t){return _.isObjectLike(n)?(_.assign(t,n),z(t).then(f.getResData)):t})},getHref:function(t){return at(t)?function(t){var n=e.port();return n=80===n||443===n?"":":".concat(n),"".concat(e.protocol(),"://").concat(e.host()).concat(n,"/apps/").concat(t.public?"public/":"").concat(t.contextPath)}(t):t.externalUrl},isHosted:function(t){return"HOSTED"===t.type},isApamaCepRule:function(t){return"APAMA_CEP_RULE"===_.get(t,"type")},isMicroserviceWithManifest:function(n){return g.list({type:"c8y_microservice_manifest_".concat(n.id)}).then(function(t){return"MICROSERVICE"===n.type&&0<t.length})},canOpenInBrowser:function(t){return(_.isObjectLike(t)?p.resolve(t):B(t).then(f.getResData)).then(function(t){var n=!t.name.match(/feature-/),e=_.includes(P,t.type);return n&&e})},canAddPlugin:function(t){return console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications."),(_.isObjectLike(t)?p.resolve(t):B(t).then(function(t){return t.data})).then(function(t){return!_.isEmpty(t.manifest)&&_.includes(x,_.get(t,"type"))})},icon:function(t){var n=_.isString(t)?t:t.type;return t.manifest&&"MICROSERVICE"!==n&&(n="SMARTAPP"),A[n]},typeLabel:function(t){var n=_.isString(t)?t:t.type;return D[n]},getCurrent:Z,getConfig:nt,pollRefreshMessages:function(){t(function(){!function(t){o.localStorage.getItem("refresh")===G()&&(o.localStorage.setItem("refresh",void 0),t||o.location.reload())}()},1e3,0,!1)},getCurrentContextPath:G,updateManifest:function(t,e){return B(t).then(function(t){var n=t.data;return n.manifest=e,n}).then(F)},listArchives:function(t,n){var e="".concat(I(t),"/binaries"),r={params:f.pageSizeNoTotalFilter(n),silentError:!0};return u.get(e,r).then(f.getResData)},uploadArchive:function(t,n){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r={url:"".concat(I(t),"/binaries"),method:"POST",headers:{Content:"multipart/form-data",Accept:"application/json"},file:n,fileName:function(t){return t.replace(/\s+/g,"_")}(n.name)};return _.assign(r,e),h.upload(r)},deleteArchive:function(t,n){var e=n.id||n,r=[I(t),"binaries",e].join("/");return u.delete(r)},setActiveArchive:function(t,n){return $({id:t.id,activeVersionId:n.id})},addPaasAppPlugin:function(t,n){console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications.");var e=function(t){var n=t.name.split(".");return n.pop(),n.join(".")}(n),r="".concat(I(t),"/binaries/plugins/").concat(e),i=h.upload({url:r,method:"POST",headers:{Content:"multipart/form-data",Accept:"application/json"},file:n}),a=i.then(_.partial(q,t));return a.progress=i.progress,a},removePaasAppPlugin:function(t,n){console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications.");var e=n.pluginName||n,r="".concat(I(t),"/binaries/plugins/").concat(e);return u.delete(r).then(_.partial(q,t))},uploadPaasAppFiles:Y,getPaasAppManifest:J,refreshPaasApp:q,refreshHostedApp:function(t){var n="".concat(I(t),"/refresh");return u.post(n)},isPaasApp:function(t){return J(t).then(function(t){return t._webpaas},function(){return!1})},parseAppName:function(t){var n=t&&t.toLowerCase();return"devicemanagement"===n?"Device management":"digital-twin-manager"===n?"Digital twin manager":t||"Cumulocity"},currentAppCached:ct,sortApps:L,isAppOnTheList:it}}t.$inject=["$rootScope","$http","$location","$q","$window","$interval","$timeout","$log","$injector","c8yBase","c8yUser","c8yInventory","$upload","gettext","$filter","c8yQueriesUtil"],angular.module("c8y.core").factory("c8yApplication",t)}();
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var r=n.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function t(c,u,n,p,o,t,s,l,e,f,r,g,d,h,i,m){var v,a=i("humanizeAppName"),y="application/",S="".concat(y,"applications"),b={headers:f.contentHeaders("application",!0)},E=this,A={HOSTED:"cloud",EXTERNAL:"external-link",SMARTAPP:"puzzle-piece",MICROSERVICE:"microchip",APAMA_CEP_RULE:"file-code-o"},P=["HOSTED","EXTERNAL"],x=["HOSTED","EXTERNAL"],O={HOSTED:h("Hosted application"),EXTERNAL:h("External application"),MICROSERVICE:h("Microservice"),APAMA_CEP_RULE:h("Apama CEP rule")},D=f.createEnum([{name:"UP",label:h("Up"),value:"Up",icon:"check-circle text-success"},{name:"DOWN",label:h("Down"),value:"Down",icon:"warning status critical"},{name:"UNHEALTHY",label:h("Unhealthy"),value:"Unhealth",icon:"exclamation-circle status major"},{name:"UNHEALTHY",label:h("Unhealthy"),value:"Unhealthy",icon:"exclamation-circle status major"}]),w=1e3,j=10;try{v=e.get("gettextCatalog")}catch(t){v={getString:_.identity}}function C(c,o){return r.current().then(function(t){var e=t.tenant,n=f.pageSizeFilter(o),r={params:n},i="".concat(f.url(c),"/").concat(e),a=f.cleanListCallback("applications",angular.bind(E,C,c),n);return u.get(i,r).then(a).then(rt).then(L)})}function R(t){var e=t.desired,n=t.active;return{active:n,unhealthy:function(t,e){return _.isNumber(e)?t-e:t}(e,n),desired:e}}function M(c,o){return r.current().then(function(t){var e=c||t,n=f.pageSizeFilter(o),r={params:_.defaults(n,{noPaging:!0,dropOverwrittenApps:!0})},i=f.url("".concat(y,"applicationsByUser/").concat(encodeURIComponent(e.id))),a=f.cleanListCallback("applications",angular.bind(E,M,e),n);return u.get(i,r).then(a).then(rt).then(L)})}function L(t){var e=_.sortBy(t,[function(t){return a(t)}]);return _.assign(e,_.pick(t,["statistics","paging"])),e}function T(t){return C("".concat(y,"applicationsByTenant"),t)}function U(t){var e=f.url("".concat(S,"/").concat(t.contextPath,"/manifest")),n={params:f.pageSizeNoTotalFilter()};return u.get(e,n).then(function(t){return _.map(t.data.imports,k)})}function N(t){var e=N.cache,n=t.id||t,r=f.url("".concat(S,"/").concat(n,"/binaries/plugins")),i={params:f.pageSizeNoTotalFilter()};function a(){delete e[n]}return e[n]||(e[n]=s(_.noop,2e3).then(function(){return u.get(r,i).then(f.getResData).finally(a)})),e[n]}function k(t){return{id:t.id,contextPath:t.rootContextPath,directoryName:t.directoryName,manifest:t}}function I(t){var e=t.id||t;return f.url("".concat(S,"/").concat(e))}function B(t){var e=I(t);return u.get(e)}function F(e,t){var n=I(e),r=function(t){var e=_.cloneDeep(t);return delete e.type,e}(e),i=_.defaults(t||{},b),a=u.put(n,r,i).finally(function(){o.localStorage.setItem("refresh",e.contextPath)});return a.then(function(t){c.$emit("c8yApplication:update",{app:e,res:t})}),a}function H(e,t){var n=f.url(S),r=_.defaults(t||{},b),i=u.post(n,e,r);return i.then(function(t){return c.$emit("c8yApplication:create",{app:e,res:t})}).catch(function(){l.error("Could not emit c8yApplication:create for:",{app:e})}),i}function $(t,e){return t.id?F(t,e):H(t,e)}function z(i){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=2<arguments.length?arguments[2]:void 0,e=3<arguments.length?arguments[3]:void 0,c=j,o=e||p.defer(),u=t||0,n=0===u?"":"-".concat(u);return $(function(t,e){var n=function(t){return"".concat(t).concat(e)};return _objectSpread(_objectSpread({},t),{},{name:n(t.name),key:n(t.key),contextPath:n(t.contextPath)})}(i,n),_objectSpread({silentError:!0},a)).then(function(t){o.resolve(f.getResData(t))},function(t){if(409===t.status&&u<c)z(i,a,u+1,o);else{var e=_.get(t,"data.message")||_.get(t,"data.details.exceptionMessage"),n=e?v.getString(e):h("Could not create application."),r=t.data;o.reject({errorMessage:n,errorDetails:r})}}),o.promise}function K(r){var t=B(r).then(f.getResData);return p.all({appDetails:t,appPlugins:t.then(N).then(q),appManifest:t.then(J),appIndex:t.then(W)}).then(function(t){t.appDetails;var e=t.appPlugins,n=t.appManifest,r=t.appIndex,i=function(e,t){return _(t.imports).map(function(t){return _.find(e,{pluginName:t})}).compact().concat(e).uniq().value()}(e,n);return p.all({newAppManifest:function(t,e){var n=_.cloneDeep(e);return n.imports=_.map(t,"pluginName"),n}(i,n),newAppIndex:function(t,e,n){var r=n;return r=function(t,e,n){var r=n,i=_(e).map(function(t){var e=_.get(t,"pluginPackage.css",[]);return!!(e=e.length?e:_.get(t,"pluginPackage.less",[])).length&&"".concat(t.pluginName,"/style.css")}).filter(_.identity).value(),a=_.flattenDeep(["\x3c!--MODULES_CSS--\x3e",_.map(i.slice(0,1),function(t){return'<link rel="stylesheet" href="'.concat(t,'"></link>')}),"\x3c!--/MODULES_CSS--\x3e"]).join("\n"),c=_.flattenDeep(["\x3c!--MODULES_CSS_DEFER--\x3e","<script>",["[",'"'.concat(i.slice(1).join('", "'),'"'),"].forEach(function(f){loadCSS(f)})"].join(""),"<\/script>","\x3c!--/MODULES_CSS_DEFER--\x3e"]).join("\n");return r=(r=r.replace(new RegExp("\x3c!--MODULES_CSS--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_CSS--\x3e","gm"),a)).replace(new RegExp("\x3c!--MODULES_CSS_DEFER--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_CSS_DEFER--\x3e","gm"),c)}(0,e,r),r=function(t,e,n){var r=_.flattenDeep(["\x3c!--MODULES_JS--\x3e",_(e).map(function(t){var e=_.get(t,"pluginPackage.js",[]);return!!e.length&&"".concat(t.pluginName,"/main.js")}).filter(_.identity).map(function(t){return'<script defer src="'.concat(t,'"><\/script>')}).value(),"\x3c!--/MODULES_JS--\x3e"]).join("\n");return n.replace(new RegExp("\x3c!--MODULES_JS--\x3e(.|\\n|\\r)*\x3c!--\\/MODULES_JS--\x3e","gm"),r)}(0,e,r),r=function(t,e,n){var r=['C8Y_NG_MODULES=["',_.uniq(_.flattenDeep(_.map(e,function(t){return _.get(t,"pluginPackage.ngModules",[])}))).join('","'),'"];'].join("");return n.replace(new RegExp("C8Y_NG_MODULES=\\[(.|\\n|\\r)*?\\];","gm"),r)}(0,e,r)}(0,i,r)})}).then(function(t){var e=t.newAppManifest,n=t.newAppIndex;return Y(r,[{path:"cumulocity.json",file:new Blob([JSON.stringify(e)],{type:"application/json"})},{path:"index.html",file:new Blob([n],{type:"text/html"})}])})}function q(t){var e=[],n=_.sortBy(t,function(t){return-1*_.get(t,"pluginPackage.priority",0)});return _.forEach(n,function(t){!function n(t,r,i){var e=V(r,_.get(t,"pluginPackage.contextPath"));if(e)return;var a=_.get(t,"pluginPackage.imports",[]);_.forEach(a,function(t){var e=V(i,t);e?n(e,r,i):l.error("Plugin with context path ".concat(t," is missing."))});r.push(t)}(t,e,n)}),e}function V(t,e){var n=function(t){var e=t;(function(t){return/^core\//.test(t)||/^administration\//.test(t)||/^devicemanagement\//.test(t)||/^cockpit\//.test(t)||/^platformadmin\//.test(t)||/^fieldbus4\//.test(t)||/^fieldbus3\//.test(t)||/^fieldbus2\//.test(t)||/^fieldbus\//.test(t)||/^demoboard\//.test(t)||/^vendme_plugins\//.test(t)})(e)&&(e=e.replace(/\//g,"_"));return e}(e);return _.find(t,function(t){return t&&t.pluginPackage&&t.pluginPackage.contextPath===n})}function J(t){var e="".concat(X(t),"/cumulocity.json");return u.get(e).then(f.getResData)}function W(t){var e="".concat(X(t),"/index.html");return u.get(e).then(f.getResData)}function X(t){return f.url("apps/".concat(t.contextPath))}function Y(t,e){var n="".concat(I(t),"/binaries/files"),r=new FormData;return _.forEach(e,function(t){r.append(t.path,new File([t.file],t.path))}),u.post(n,r,{transformRequest:_.identity,headers:{"Content-Type":void 0}})}function G(){var t=o.location.pathname.match(/\/apps\/(public\/){0,1}(.+?)(\/|\?|#|$)/);return t&&t[2]}function Q(){var t=o.location.pathname.match(/\/apps\/(public\/([^/]+)|([^/]+))/);return t&&-1!==t[1].indexOf("public")}function Z(){var n=G(),r=!!Q();function e(t){var e="MARKET"===t.availability;return t.contextPath===n&&(!r||e)}return M(null,{dropOverwrittenApps:!1}).then(function(t){return _.find(t,e)})}function tt(e){return g.list({type:"c8y_SmartAppApplication"}).then(function(t){return _.find(t,{appId:e.id})||null})}function et(t){var e;return(t?p.resolve(t):Z()).then(function(t){return e=t}).then(tt).then(function(t){return e.config=t,e})}function nt(t){return _(t).uniq("id").filter(function(t){var e=t.manifest,n=!1;return e&&(n=e.noAppSwitcher),!n&&_.includes(["HOSTED","EXTERNAL"],t.type)}).value()}function rt(t){var e=_.reject(t,function(t){return"management"===t.name&&"management"===t.owner.tenant.id});return _.assign(e,_.pick(t,_.filter(_.keys(t),function(t){return _.isNaN(_.toNumber(t))}))),e}function it(t,e){var n=_.isString(e)?function(e){return function(t){return t.name===e||t.contextPath===e||t.key===e}}(e):e;return _.some(t,n)}function at(t){return"HOSTED"===t.type}function ct(){if(ct.cache)return ct.cache;function e(t){return{url:t,noAppKey:!0}}return u(e([f.url(S),(Q()?"public/":"")+G(),"manifest"].join("/"))).then(function(t){return u(e([f.url(S),t.data.application.id].join("/")))}).then(f.getResData).then(function(t){return ct.cache=p.when(t)})}return N.cache={},f.getFlag("test")&&(ct.cache=p.when({name:"app",manifest:{}})),{list:T,listByUser:M,listByTenant:T,listByOwner:function(t){return C("".concat(y,"applicationsByOwner"),t)},listPlugins:function(){var t=f.url("".concat(y,"plugins")),e={params:{pageSize:w}};return u.get(t,e).then(function(t){return _.uniqBy(t.data.plugins,"id")})},listPluginsByTenant:function(){return T().then(function(t){var e=_.uniqBy(t,"id"),n=[];return _.forEach(e,function(t){at(t)&&n.push(U(t))}),p.all(n).then(_.flattenDeep).then(function(t){return _.uniqBy(t,"id")})})},listPluginsByApplication:U,listPluginsByPaasApp:N,listByVisibleLinks:function(){return M().then(nt).then(function(t){return p.when(t)})},listApplications:function t(e){var n=f.url("".concat(S)),r={params:f.pageSizeFilter(e)},i=f.cleanListCallback("applications",t,e);return u.get(n,r).then(i).then(L)},getApplicationMO:function(t){var e="c8y_Application_".concat(t);return g.list({type:e}).then(function(t){return _.head(t)})},getApplicationMOs:function(t){var e=t||{},n=e.tenantId,r=e.filters,i=void 0===r?{}:r,a={type:"c8y_Application_*"};return n&&(a=m.addAndFilter(a,{__has:"c8y_Subscriptions.".concat(n)})),g.listQuery(a,i,!0)},getInstanceCounts:R,getSubscriptionsList:function(t){var e=_.get(t,"c8y_Subscriptions");return _.reduce(e,function(t,e,n){var r=_.get(e,"details"),i=_.get(e,"status"),a=R(r);return t.concat(_objectSpread(_objectSpread({},a),{},{tenantName:n,status:i}))},[])},getApplicationStatusForTenant:function(t,e){return _.get(t,["c8y_Subscriptions",e])},status:D,isAvailable:function(e){return M().then(function(t){return it(t,e)})},areAllAvailable:function(t){return M().then(function(e){return _.every(t,function(t){return it(e,t)})})},isAnyAvailable:function(t){return M().then(function(e){return _.some(t,function(t){return it(e,t)})})},detail:B,update:F,create:H,remove:function(n){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=I(n),r=et(_.isObjectLike(n)?n:{id:n}).then(function(t){return!_.get(t,"config.id")||g.remove(t.config)}),i=u.delete(e,{params:t}),a=p.all({cfg:r,res:i});return a.then(function(t){var e=t.res;c.$emit("c8yApplication:delete",{app:n,res:e})}),a},save:$,trySave:z,clone:function(t,e){var n="".concat(I(t),"/clone");return u.post(n).then(f.getResData).then(function(t){return _.isObjectLike(e)?(_.assign(t,e),z(t).then(f.getResData)):t})},getHref:function(t){return at(t)?function(t){var e=n.port();return e=80===e||443===e?"":":".concat(e),"".concat(n.protocol(),"://").concat(n.host()).concat(e,"/apps/").concat(t.public?"public/":"").concat(t.contextPath)}(t):t.externalUrl},isHosted:function(t){return"HOSTED"===t.type},isApamaCepRule:function(t){return"APAMA_CEP_RULE"===_.get(t,"type")},isMicroserviceWithManifest:function(e){return g.list({type:"c8y_microservice_manifest_".concat(e.id)}).then(function(t){return"MICROSERVICE"===e.type&&0<t.length})},canOpenInBrowser:function(t){return(_.isObjectLike(t)?p.resolve(t):B(t).then(f.getResData)).then(function(t){var e=!t.name.match(/feature-/),n=_.includes(P,t.type);return e&&n})},canAddPlugin:function(t){return console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications."),(_.isObjectLike(t)?p.resolve(t):B(t).then(function(t){return t.data})).then(function(t){return!_.isEmpty(t.manifest)&&_.includes(x,_.get(t,"type"))})},icon:function(t){var e=_.isString(t)?t:t.type;return t.manifest&&"MICROSERVICE"!==e&&(e="SMARTAPP"),A[e]},typeLabel:function(t){var e=_.isString(t)?t:t.type;return O[e]},getCurrent:Z,getConfig:et,pollRefreshMessages:function(){t(function(){!function(t){o.localStorage.getItem("refresh")===G()&&(o.localStorage.setItem("refresh",void 0),t||o.location.reload())}()},1e3,0,!1)},getCurrentContextPath:G,updateManifest:function(t,n){return B(t).then(function(t){var e=t.data;return e.manifest=n,e}).then(F)},listArchives:function(t,e){var n="".concat(I(t),"/binaries"),r={params:f.pageSizeNoTotalFilter(e),silentError:!0};return u.get(n,r).then(f.getResData)},uploadArchive:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r={url:"".concat(I(t),"/binaries"),method:"POST",headers:{Content:"multipart/form-data",Accept:"application/json"},file:e,fileName:function(t){return t.replace(/\s+/g,"_")}(e.name)};return _.assign(r,n),d.upload(r)},deleteArchive:function(t,e){var n=e.id||e,r=[I(t),"binaries",n].join("/");return u.delete(r)},setActiveArchive:function(t,e){return $({id:t.id,activeVersionId:e.id})},addPaasAppPlugin:function(t,e){console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications.");var n=function(t){var e=t.name.split(".");return e.pop(),e.join(".")}(e),r="".concat(I(t),"/binaries/plugins/").concat(n),i=d.upload({url:r,method:"POST",headers:{Content:"multipart/form-data",Accept:"application/json"},file:e}),a=i.then(_.partial(K,t));return a.progress=i.progress,a},removePaasAppPlugin:function(t,e){console.warning("This method is now deprecated. Consider using Web SDK to customize and extend applications.");var n=e.pluginName||e,r="".concat(I(t),"/binaries/plugins/").concat(n);return u.delete(r).then(_.partial(K,t))},uploadPaasAppFiles:Y,getPaasAppManifest:J,refreshPaasApp:K,refreshHostedApp:function(t){var e="".concat(I(t),"/refresh");return u.post(e)},isPaasApp:function(t){return J(t).then(function(t){return t._webpaas},function(){return!1})},parseAppName:function(t){var e=t&&t.toLowerCase();return"devicemanagement"===e?"Device management":"digital-twin-manager"===e?"Digital twin manager":t||"Cumulocity"},currentAppCached:ct,sortApps:L,isAppOnTheList:it}}t.$inject=["$rootScope","$http","$location","$q","$window","$interval","$timeout","$log","$injector","c8yBase","c8yUser","c8yInventory","$upload","gettext","$filter","c8yQueriesUtil"],angular.module("c8y.core").factory("c8yApplication",t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _defineProperty(t,e,n){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);var r=n.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){e.$inject=["$window","$q","$injector","$location","$interpolate","c8yConfig","info","c8yUtil","gettext","gettextCatalog"],window.c8y=window.c8y||{};var t=window.c8y;function F(t){return((window.C8Y_APP||{}).core_path||"/apps/core/")+t}function k(t){return((window.C8Y_APP||{}).data_path||(window.C8Y_PAAS?"/apps/core/c8ydata/":"/apps/c8ydata/"))+t}function z(t){var e=!0;try{_.forEach(t,function(t){angular.module(t)})}catch(t){e=!1}return e}function e(t,a,e,n,i,c,u,r,o,s){var f="application/vnd.com.nsn.cumulocity.",l=u.pageSize||100,g="YYYY-MM-DDTHH:mm:ssZ";function p(t){return"".concat(f+t,"+json")}function d(i){var o=["refresh","next"];return function n(t){var e=i(t),r=t.paging,a=t.statistics;return r&&(_.forEach(o,function(t){if(r[t]){var e=r[t];r[t]=function(){return e().then(n)}}}),e.paging=r,e.statistics=a),e}}function m(t,e){var n={};return e&&e.split("?")[1].split("&").forEach(function(t){var e=t.split("=");n[e[0]]=decodeURIComponent(e[1])}),n[t]}function y(t,e){var n=t.statistics,r=t[1===e?"next":"prev"],a=m("currentPage",r);return{currentPage:parseInt(a,10),pageSize:n.pageSize,startkey:m("startkey",r),startkey_docid:m("startkey_docid",r)}}function v(t){var e=t.statistics||{},n={currentPage:1,pageSize:e.pageSize,startkey:null,startkey_docid:null};return _.isUndefined(t.totalPages)||(n.pageSize=e.pageSize),n}function P(t){var e=function(t){return _.flattenDeep(t)}(t),n=S(t),r=function(e){var t={statistics:S(e),blind:_.some(e,"paging.blind"),more:_.some(e,"paging.more")};t.more&&(t.next=function(){var t=_.map(e,function(t){return _.result(t,"paging.next",[])});return a.all(t).then(P)});return t}(t);return e.paging=r,e.statistics=n,e}function S(t){var e=_.map(t,function(t){return _.get(t,"statistics.currentPage",1)}),n=_.map(t,function(t){return _.get(t,"statistics.pageSize",t.length)}),r=_.map(t,function(t){return _.get(t,"statistics.totalPages",1)});return{currentPage:_.max(e),pageSize:_.sum(n),totalPages:_.max(r)}}function b(t,e){return _.omit(t,e)}function h(t){var e;if(_.isObjectLike(t)&&(e=t.id),(_.isNumber(t)||_.isString(t)&&t.match(/^\d+$/))&&(e=String(t)),_.isUndefined(e))throw new Error("id cannot be found");return e}function w(t){return u[t]}function O(n){var t=(u.appConfig||{}).manifest,e=window.C8Y_APP&&window.C8Y_APP.C8Y_INSTANCE_OPTIONS,r=window.C8Y_INSTANCE_OPTIONS,a=_.merge({},t,e,r),i=_.defaultsDeep(a,c.defaultAppOptions),o=i[n];return o||(o=_.find(i,function(t,e){return _.camelCase(n)===_.camelCase(e)})),i[n]}var j={url:function(t){return(u.baseUrl||"/")+t},absoluteUrl:function(t){return"".concat(n.protocol(),"://").concat(n.host(),":").concat(n.port())+"/".concat(_.isString(t)?t:"").replace(/\/+/g,"/")},getStaticLink:function(t,e){var n=O("staticLinks"),r=_.get(n,t,"");return r?a.resolve(i(r)(e)):a.reject("Static link was not found")},getStaticLinkTemplate:function(t){var e=O("staticLinks"),n=_.get(e,t,"");return n?a.resolve(n):a.reject("Static link template was not found")},deleteProperties:function(t,e){return b(t,e)},mimeType:p,contentHeaders:function(t,e){return{"Content-Type":p(t),Accept:e?p(_.isString(e)?e:t):void 0}},pageSizeFilter:function(t){return _.assign({withTotalPages:!0,pageSize:l},t)},pageSizeNoTotalFilter:function(t){return _.assign({pageSize:l},t)},timeOrderFilter:function(t){return _.assign({dateFrom:"1970-01-01",dateTo:moment().add(1,"day").format(g)},t)},lastWeekFilter:function(t){return _.assign({dateFrom:moment().subtract(1,"week").format(g),dateTo:moment().add(1,"day").format(g)},t)},todayFilter:function(t){return _.assign({dateFrom:moment().subtract(1,"day").format(g),dateTo:moment().add(1,"day").format(g)},t)},fromThisMonthStartFilter:function(t){return _.assign({dateFrom:moment().startOf("month").format(g)},t)},monthFilter:function(t,e){var n=moment().subtract(e||0,"months");return _.assign({dateFrom:n.startOf("month").format(g),dateTo:n.endOf("month").format(g)},t)},createListFilter:function(e){return d(function(t){return t.filter(e)})},createListMapper:function(e){return d(function(t){return t.map(e)})},cleanListCallback:function(r,a,i){return function(t){var e=t.data||{},n=e[r]||[];return n.statistics=e.statistics,i.withTotalPages||n.length!==parseInt(i.pageSize,10)||(n.statistics.totalPages=1/0,e.statistics.totalPages=n.statistics.totalPages),n.paging=function(t,e,n,r){var a=t.statistics,i=!_.isUndefined(t.prev),o=!_.isUndefined(t.next),c={};return i&&(c.prev=function(){return e(_objectSpread(_objectSpread({},n),y(t,-1)))}),o&&(c.next=function(){return e(_objectSpread(_objectSpread({},n),y(t,1)))},_.isUndefined(a.totalPages)||(c.more=(a.totalPages-a.currentPage)*a.pageSize)),c.refresh=function(){return e(_.assign(_.cloneDeep(n),v(t)))},c.changePage=function(t){return e(_objectSpread(_objectSpread({},n),{},{currentPage:t,pageSize:a.pageSize}))},c.statistics=a,c.blind=r,c}(e,a,i,!i.withTotalPages),n}},createPaging:function(t,e){var n=t.statistics,r=t.prev&&y(t,-1),a=t.next&&y(t,1),i=v(t),o=void 0===n.totalPages?void 0:(n.totalPages-n.currentPage)*n.pageSize;return{noPreFetch:!0,refresh:function(){return e(i)},changePage:function(t){return e({pageSize:n.pageSize,currentPage:t})},next:a&&function(){return e(a)},prev:r&&function(){return e(r)},loading:!1,more:o,stats:n}},combineLists:P,removeFromList:function(t,e){var n=t.indexOf(e);0<=n&&t.splice(n,1)},cleanFields:b,dateFormat:"YYYY-MM-DD",dateFullFormat:g,dateFullFormatWithMs:"YYYY-MM-DDTHH:mm:ss.SSSZ",invalid:function(t,e,n){var r=t&&t[e],a=r&&r[n],i=a&&a.$touched,o=a&&a.$invalid;return!0===i&&!0===o},invalidFormOrField:function(t){return t.$dirty&&t.$invalid},validationHints:function(n,r){var a=[];return n&&n.$error&&_.forEach(n.$error,function(t,e){t&&!_.isUndefined(r[e])&&(_.isObjectLike(r[e])&&r[e][n.$name]?a.push(r[e][n.$name]):a.push(r[e]))}),_.map(a,function(t){return s.getString(t)}).join(" ")},getCount:function(t,e){return e.pageSize=1,e.withTotalPages=!0,t(e).then(function(t){return t.statistics.totalPages})},humanizeFragment:function(t){return String(t||"").replace(/c8y_/,"").replace(/([A-Z])/g," $1").replace(/^\s*/,"").replace(/\s*$/,"")},getResData:function(t){return _.get(t,"data",t)},getResErrorMessage:function(t){return _.head(_.compact(_.at(t,["data.message","data.error"])))||o("An error occurred.")},createEnum:function(t){var n={},r=0;return n.values=_.constant(_.map(t,function(t){var e={};return _.isObjectLike(t)?_.defaults(e,t,{name:t.name,value:t.name,label:t.name}):_.defaults(e,{name:t,value:t,label:t}),_.assign(e,{ordinal:r}),r+=1,n[e.name]=e})),n},createLocalId:function(t,e){var n=e||"id";if(!_.isObjectLike(t))throw new Error("mo is not an object");return _.isUndefined(t[n])&&(t[n]=String(Math.random()).substr(2)),t},hasId:function(t){var e=!0;try{h(t)}catch(t){e=!1}return e},getId:h,checkIfModulesExist:z,coreFilePath:F,dataFilePath:k,appOption:O,getPluginService:function(t){return e.has(t)?e.get(t):void 0},getFlag:w,getRuntimeOption:w,getParamFromUrl:m,PAGESIZE:l,MAX_PAGESIZE:2e3};return r.enhanceWithLatestFactoryUtil(j,a)}_.assign(t,{coreFilePath:F,dataFilePath:k,checkIfModulesExist:z}),angular.module("c8y.core").factory("c8yBase",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,u,a=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(l)throw o}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(u,a,c,o,l,y,f,e){var t="c8y_DynamicGroup",r="c8y_IsDynamicGroup",s="c8y_UIDeviceColumnsMeta",p="c8y_UIDeviceFilterConfig",d="c8y_DeviceQueryString",n="c8y_DeviceGroup",i="c8y_DeviceSubgroup",m="c8y_IsDeviceGroup",g="smartgroup",b="".concat("service/smartgroup","/smartgroups");return{spawnEmpty:function(){return _defineProperty({type:t},r,{})},createWithUI:function(e){var t=e.columns,r=e.columnsConfig,n=e.configurableColumns;return o({templateUrl:":::PLUGIN_PATH:::/ui/views/addDynamicGroupModal.html",controller:"addDynamicGroupModalController",resolve:{columns:function(){return _.cloneDeep(t)},columnsConfig:function(){return _.cloneDeep(r)},configurableColumns:function(){return _.cloneDeep(n)}}})},create:function(e){var t,r=e.dynamicGroup,n=e.columns,o=e.columnsConfig,i=e.configurableColumns,u=_objectSpread(_objectSpread({},r),{},(_defineProperty(t={},p,o),_defineProperty(t,d,y.buildQuery(f.getQuery(n,o))),_defineProperty(t,s,_.map(i,"meta")),t));return C().then(function(e){return e?v(u):l.create(u)}).then(c.getResData)},getGroupList:function(){return l.list({fragmentType:r})},getGroupItems:P,getConfigurableColumnsMeta:function(e){return j(e).then(function(e){return _.get(e,s)})},saveConfigurableColumnsMeta:function(e,t){return l.save(_defineProperty({id:_.get(e,"id",e)},s,_.map(t,"meta")))},getColumnsConfig:function(e){return j(e).then(function(e){return _.get(e,p)})},saveColumnsConfig:function(e,t,r){var n,i=(_defineProperty(n={id:_.get(e,"id",e)},p,r),_defineProperty(n,d,y.buildQuery(f.getQuery(t,r))),n);return u.all([C(),j(i)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1],o=_objectSpread(_objectSpread({},n),i);return!r||!D(o)&&_.get(o,"id")?l.save(o):function(e){return c.hasId(e)?function(e){return a.put(c.url("".concat(b,"/").concat(e.id)),_.pick(e,[p,d]))}(e):v(e)}(o)}).then(c.getResData)},isSmartGroupV2:D,isDynamicGroup:S,isDynamicGroupForId:function(e){return _.isUndefined(e)?u.resolve(!1):l.detailCached(e).then(c.getResData).then(function(e){return S(e)})},addChildCountProperty:function(t,e){return u.all(_.map(t,function(t){return S(t)?h(t,e).then(function(e){return t.childCount=e,t}):u.resolve(t)})).then(function(e){return e.statistics=t.statistics,e.paging=t.paging,e})},getChildCount:h,getType:function(){return t},remove:function(e){return u.all([C(),j(e)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r&&D(n)?function(e){return a.delete(c.url("".concat(b,"/").concat(e.id))).then(c.getResData)}(n):l.remove(n)}).then(c.getResData)}};function v(e){return a.post(c.url(b),e)}function h(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!S(e))throw new Error("c8yDynamicGroups.fetchChildCount() can only be called with dynamic groups");var r=_objectSpread({},t);return delete r.onlyRoots,P(e,_objectSpread(_objectSpread({},r),{},{pageSize:1,withTotalPages:!0,withChildren:!1,withParents:!1})).then(function(e){var t=e.statistics.totalPages;return void 0===t?0:t})}function P(e,o){return u.all([C(),j(e)]).then(function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];return r&&D(n)?l.listQuery({__bygroupid:n.id},_objectSpread({withParents:!0},o),!1):l.list(_objectSpread({q:_.get(n,d)},o))})}function j(e){return S(e)?u.resolve(e):l.detail(e).then(c.getResData)}function S(e){return _.has(e,r)||_.get(e,"type")===t}function C(){return e.isAvailable({name:g})}function D(e){var t=_.get(e,"type");return _.has(e,r)&&_.has(e,m)&&(t===n||t===i)}}e.$inject=["$q","$http","c8yBase","c8yModal","c8yInventory","c8yQueriesUtil","c8yFilteringSortingInventoryQueries","c8yApplication"],angular.module("c8y.core").factory("c8yDynamicGroups",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(e,u,r,n,o,i,p){var y={c8y_BrokerSourceInactive:{icon:"c8y-group-remote-inactive",iconOpen:"c8y-group-remote-inactive"},c8y_BrokerSource:{icon:"c8y-group-remote",iconOpen:"c8y-group-remote-open"},c8y_DeviceGroup:{icon:"c8y-group",iconOpen:"c8y-group-open"},c8y_DynamicGroup:{icon:"c8y-group-smart",iconOpen:"c8y-group-smart-open"},other:{icon:"circle",iconClass:"statusUnknown"}};return{getGroupItems:c,getItemsCount:function(e){return n.children(e,"childAssets",{skipDetail:!0,params:{pageSize:1,withTotalPages:!0,withChildren:!1}}).then(function(e){var t=e.data.statistics.totalPages;return t})},getGroupAssetsAndDevices:function(n){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=r.createListFilter(function(e){var t=e.id,r=_.map(_.get(n,"childAdditions.references"),_.property("managedObject.id"));return!_.includes(r,t)});return c(n,e).then(t)},getGroupTypeItems:function(t){return o.getLookup().then(function(e){return[e[t]]}).then(s)},getTopLevelGroups:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=e||!1;return t.onlyRoots=!0,i.mustHaveAllRoles(["ROLE_INVENTORY_READ"]).then(function(){return o.get().then(_.property("groups")).then(function(e){return r?function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};e.push({type:p.getType()});var r=s(e,t);return t.skipChildCount||(r=r.then(function(e){return p.addChildCountProperty(e,t)})),r}(e,t):s(e,t)})},a)},isGroup:f,getGroupInfo:t,getIconSpecs:function(e){return t(e).iconSpecs},getIconSpecsForType:function(e){return _.get(y,e,{})}};function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return n.listQuery(function(e){return{__bygroupid:r.getId(e)}}(e),_objectSpread({withParents:!0},t),!0)}function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r={__filter:{__and:[{__not:{__has:"c8y_IsDynamicGroup.invisible"}},{type:{__in:_.map(e,"type")}}]}};return n.listQuery(r,t,!0)}function a(){return n.list({fragmentType:"c8y_IsDeviceGroup",pageSize:1e3,onlyRoots:!0})}function f(e){return!!e.c8y_IsDeviceGroup||"c8y_DeviceGroup"===e.type}function t(e){var t,r=f(e),n=u.get("c8yDevices").isDevice(e),o=p.isDynamicGroup(e),i=u.get("c8yDeviceGroup"),c=i.hasBrokerSource(e);return r?t=c?i.isBrokerSourceActive(e)?"c8y_BrokerSource":"c8y_BrokerSourceInactive":p.isDynamicGroup(e)?"c8y_DynamicGroup":"c8y_DeviceGroup":o?t="c8y_DynamicGroup":n||(t="other"),{isGroup:r,isDynamicGroup:o,hasBrokerSource:c,iconSpecs:_.get(y,t,{})}}}e.$inject=["$q","$injector","c8yBase","c8yInventory","c8yGroupTypesConfig","c8yPermissions","c8yDynamicGroups"],angular.module("c8y.core").factory("c8yGroups",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return u}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?Object(arguments[e]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})),r.forEach(function(e){_defineProperty(t,e,n[e])})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(a,v,o,s,g,r,m,u){var c="inventory/managedObjects",n="\\/inventory\\/managedObjects\\/(\\d+)",d={headers:g.contentHeaders("managedObject","managedObject")},l={headers:g.contentHeaders("managedObjectReference")},f=["lastUpdated","assetParents","deviceParents","additionParents","childAssets","childDevices","childAdditions","c8y_ActiveAlarmsStatus","c8y_Availability"];function h(e){var t=e&&(e.id||e);return t&&g.url("".concat(c,"/").concat(t))}function p(e,t){return"".concat(h(e),"/").concat(t)}function y(e,t){var n=g.url(c),r=g.pageSizeFilter(function(e){var t=e||{};return t.text&&(t=_.pick(t,["text","pageSize","currentPage","skipChildrenNames","fragmentType","withParents","q","query"])),t}(e)),i=_objectSpread({params:r},t),o=g.cleanListCallback("managedObjects",y,r,!0);return a.get(n,i).then(o)}function b(e,t,n){var r=h(e),i=t||{},o=_.defaults({params:i},n);return r?a.get(r,o):v.reject("Managed object not valid")}function A(e,t,n){return b(e,t,n)}function i(e){var t=_.get(e,"assetParents.references"),n=_.get(e,"deviceParents.references"),r=_.get(e,"additionParents.references");return _.union(t,n,r).map(function(e){return e.managedObject})}function t(e){var t=g.url(c),n=_.cloneDeep(d),r=g.cleanFields(e,f);return a.post(t,r,n)}function S(e,t,n){var r=p(t,n),i=_.omit(e,["id"]),o=_.assign({},d,{Accept:"application/json"});return z(t),a.post(r,i,o)}function j(e){var t=new RegExp(n);return e.headers("Location").match(t)[1]}function w(t){var e=h(t),n=_.cloneDeep(d),r=g.cleanFields(t,f),i=a.put(e,r,n);return i.then(function(e){o.$emit("c8yInventory:update",{mo:e.data,res:e}),o.$emit("c8yInventory:update:".concat(t.id),{mo:e.data,res:e})}),z(t),i}function O(e,t){return!!C(e,t)}function C(e,t){return _.get(e,[t,"references","length"])}function P(e,t,n){var r=p(e,t),i=n||{},o=v.resolve(0);return i.skipDetail||(o=A(e).then(function(e){return e.data[t].references.length})),o.then(function(e){return _.get(i,"params.pageSize")||(i.params=i.params||{},i.params.pageSize=e),a.get(r,i)})}function D(e){return _.map(e.data.references,_.property("managedObject"))}function I(e,t,n){var r=p(e,n),i={managedObject:t},o=_.cloneDeep(l);return z(e),a.post(r,i,o)}function T(e,n,r,i){return b(e,{withParents:!0}).then(function(e){var t="data.".concat(n,"Parents.references");return _.map(_.get(e,t),_.property("managedObject.id"))}).then(function(e){var t=[],n={ids:e.join(",")};return e.length&&(t=y(n),(r||i)&&(t=t.then(k(r,i)))),t})}function k(t,n){return function(e){return _.filter(e,function(e){return t&&e.type===t||n&&!_.isUndefined(e[n])})}}function E(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o=_.camelCase(["child",_.lowerCase(t),"id"]),a=_objectSpread({withParents:!0},i);return a[o]=e.id||e,y(a).then(function(e){return n||r?k(n,r)(e):e})}function $(e,t,n){var r=function(e,t,n){var r=t.id||t;return"".concat(p(e,n),"/").concat(r)}(e,t,n);return z(e),a.delete(r)}function z(e){var t=g.getId(e),n=M.cache.__data__;L(n.string,t),L(n.hash,t)}function L(t,n){if(0<t.size){var e=Object.keys(t.__data__);_.forEach(e,function(e){(e===n.toString()||e.startsWith("".concat(n,"_")))&&t.delete(e)})}}function R(e){var t="".concat(h(e),"/supportedMeasurements");return a.get(t).then(_.property("data.c8y_SupportedMeasurements"))}function U(n){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,t=n&&(n.id||n),r=s.get("c8yMeasurements"),i=e<a,u=o.filter(function(e){return!e.unit});if(i||0===u.length)return v.resolve(o);var c=_.assign(g.timeOrderFilter(),{revert:!0,source:t,pageSize:2e3,dateTo:void 0,withTotalPages:!0,currentPage:a});return r.list(c).then(function(r){for(var e=function(){var e=u[i],t=_.property([e.fragment,e.series,"unit"]),n=_.find(r,function(e){return t(e)});n&&(e.unit=t(n))},i=0;i<u.length;i++)e();var t=r.statistics.totalPages;return U(n,o,t,a+1)})}function F(e){return(_.get(e,"owner")?v.when(e):b(e).then(g.getResData)).then(_.property("owner"))}var x=_.memoize(F,function(e){return g.getId(e)}),M=_.memoize(A,function(e,t){return function(e,t){var n=g.getId(e);t&&(n="".concat(n,"_").concat(JSON.stringify(t)));return n}(e,t)});function H(e){return g.url("inventory/managedObjects/".concat(e,"/user"))}return{list:y,listQuery:function(e,t,n,r){var i=g.pageSizeFilter(t);return i[n?"query":"q"]=u.buildQuery(e),y(i,r)},listAll:function(e){var o=[];return y(_objectSpread({pageSize:g.MAX_PAGESIZE},e)).then(function e(t){o.push.apply(o,_toConsumableArray(t));var n=t.statistics.pageSize,r=t.paging.next,i=t.length>=n;return r&&i?t.paging.next().then(e):v.resolve(o)})},detail:b,detailCached:M,detailRealtime:function(e,t,r,n,i){var o,a,u,c=e.id||e,s=_.isObjectLike(e)?v.when(e):b(c,n,i).then(g.getResData),d="/managedobjects/".concat(c),l=m.realtimeActions().UPDATE;function f(n){return o?_.assign(o,n):o=n,_.forEach(o,function(e,t){void 0===n[t]&&delete o[t]}),_.isFunction(r)&&r(o),o}if(t)a=t.$id,m.addListener(a,d,l,function(e,t){f(t)}),m.start(a,d),t.$on("stopRealtime",function(){m.stop(a,d)}),t.$on("$destroy",function(){m.removeSubscriber(a,d)}),u=s.then(function(e){return f(e)});else{var h=u=b(c).then(function(e){return f(e.data)}),p={ops:l,channel:d,onUpdate:function(e,t){f(t)}},y=m.watch(p);h.stop=_.bind(y.stop,y)}return u},create:t,createChild:S,createConfirm:function(e){return t(e).then(j).then(b)},update:w,save:function(e){return e.id?w(e):t(e)},remove:function(e,t){var n=h(e);if(!n)throw new Error("No managed object id provided!");var r=i(e);return _.forEach(r,function(e){z(e)}),z(e),a.delete(n,{params:_.isObjectLike(t)?t:{}})},extractParents:i,hasChildAssets:function(e){return O(e,"childAssets")},hasChildDevices:function(e){return O(e,"childDevices")},hasChildAdditions:function(e){return O(e,"childAdditions")},getChildAssetsCount:function(e){return C(e,"childAssets")},getChildDevicesCount:function(e){return C(e,"childDevices")},getChildAdditionsCount:function(e){return C(e,"childAdditions")},children:P,onChildren:D,childAssets:function(e,t){return P(e,"childAssets",t).then(D)},childDevices:function(e,t){return P(e,"childDevices",t).then(D)},childAdditions:function(e,t){return P(e,"childAdditions",t).then(D)},addChildAsset:function(e,t){return I(e,t,"childAssets")},addChildDevice:function(e,t){return I(e,t,"childDevices")},addChildAddition:function(e,t){return I(e,t,"childAdditions")},createChildAsset:function(e,t){return S(e,t,"childAssets")},createChildDevice:function(e,t){return S(e,t,"childDevices")},createChildAddition:function(e,t){return S(e,t,"childAdditions")},removeChildAsset:function(e,t){return $(e,t,"childAssets")},removeChildDevice:function(e,t){return $(e,t,"childDevices")},removeChildAddition:function(e,t){return $(e,t,"childAdditions")},parentsAsset:function(e,t,n){return T(e,"asset",t,n)},parentsDevice:function(e,t,n){return T(e,"device",t,n)},parentsAddition:function(e,t,n){return T(e,"addition",t,n)},directParentAssets:function(e,t,n,r){return E(e,"asset",t,n,r)},directParentDevices:function(e,t,n,r){return E(e,"device",t,n,r)},directParentAdditions:function(e,t,n,r){return E(e,"addition",t,n,r)},getCount:function(e){return g.getCount(y,e||{})},getFragments:function(e){var t=_.union(f,["id","type","name","owner","self"]);return _.keys(g.cleanFields(e,t))},getSupportedMeasurements:R,getSupportedSeries:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return function(e){return v.all([R(e),function(e){var t="".concat(h(e),"/supportedSeries");return a.get(t).then(_.property("data.c8y_SupportedSeries"))}(e)]).then(function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1],i=_.sortBy(n,"length").reverse();return _(r).map(function(t){var e=_.find(i,function(e){return 0===t.indexOf(e)}),n=t.replace("".concat(e,"."),"");return{fragment:e,series:n}}).filter(_.property("fragment")).value()})}(t).then(function(e){return function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;return t.withUnits?U(e,n):v.resolve(n)}(t,n,e)})},addUnits:U,isOwner:function(e,t){var n={user:t?v.when(t):r.current(),owner:F(e)};return v.all(n).then(function(e){return e.user.userName===e.owner})},isOwnerCached:function(e,t){var n={user:t?v.when(t):r.current(),owner:x(e)};return v.all(n).then(function(e){return e.user.userName===e.owner})},getOwner:F,getOwnerObject:function(e,t){var n=H(g.getId(e));return a.get(n,t).then(g.getResData).catch(function(t){return F(e).then(function(e){return v.reject({notFound:404===t.status,accessDenied:403===t.status,serviceUser:r.isServiceUser(e)})})})},getOwnerCached:x,setOwnerEnabled:function(e,t){var n=g.getId(e);return a.put(H(n),{enabled:!!t}).then(g.getResData)},addGlobalFlag:function(e,t){return e.c8y_Global=t?{}:null,e},updateManagedObject:function(t,e){var n=_.keys(e),r=_.keys(t).filter(function(e){return!_.includes(n,e)});return _.forEach(r,function(e){return _.unset(t,e)}),_.assign(t,e)}}}e.$inject=["$http","$q","$rootScope","$injector","c8yBase","c8yUser","c8yRealtime","c8yQueriesUtil"],angular.module("c8y.core").factory("c8yInventory",e)}();
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,c=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);u=!0);}catch(e){s=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(a,v,o,s,g,r,m,c){var u="inventory/managedObjects",n="\\/inventory\\/managedObjects\\/(\\d+)",d={headers:g.contentHeaders("managedObject","managedObject")},l={headers:g.contentHeaders("managedObjectReference")},f=["lastUpdated","assetParents","deviceParents","additionParents","childAssets","childDevices","childAdditions","c8y_ActiveAlarmsStatus","c8y_Availability"];function p(e){var t=e&&(e.id||e);return t&&g.url("".concat(u,"/").concat(t))}function h(e,t){return"".concat(p(e),"/").concat(t)}function y(e,t){var n=g.url(u),r=g.pageSizeFilter(function(e){var t=e||{};return t.text&&(t=_.pick(t,["text","pageSize","currentPage","skipChildrenNames","fragmentType","withParents","q","query"])),t}(e)),i=_objectSpread({params:r},t),o=g.cleanListCallback("managedObjects",y,r,!0);return a.get(n,i).then(o)}function b(e,t,n){var r=p(e),i=t||{},o=_.defaults({params:i},n);return r?a.get(r,o):v.reject("Managed object not valid")}function A(e,t,n){return b(e,t,n)}function i(e){var t=_.get(e,"assetParents.references"),n=_.get(e,"deviceParents.references"),r=_.get(e,"additionParents.references");return _.union(t,n,r).map(function(e){return e.managedObject})}function t(e){var t=g.url(u),n=_.cloneDeep(d),r=g.cleanFields(e,f);return a.post(t,r,n)}function j(e,t,n){var r=h(t,n),i=_.omit(e,["id"]),o=_.assign({},d,{Accept:"application/json"});return z(t),a.post(r,i,o)}function O(e){var t=new RegExp(n);return e.headers("Location").match(t)[1]}function S(t){var e=p(t),n=_.cloneDeep(d),r=g.cleanFields(t,f),i=a.put(e,r,n);return i.then(function(e){o.$emit("c8yInventory:update",{mo:e.data,res:e}),o.$emit("c8yInventory:update:".concat(t.id),{mo:e.data,res:e})}),z(t),i}function w(e,t){return!!P(e,t)}function P(e,t){return _.get(e,[t,"references","length"])}function C(e,t,n){var r=h(e,t),i=n||{},o=v.resolve(0);return i.skipDetail||(o=A(e).then(function(e){return e.data[t].references.length})),o.then(function(e){return _.get(i,"params.pageSize")||(i.params=i.params||{},i.params.pageSize=e),a.get(r,i)})}function D(e){return _.map(e.data.references,_.property("managedObject"))}function I(e,t,n){var r=h(e,n),i={managedObject:t},o=_.cloneDeep(l);return z(e),a.post(r,i,o)}function T(e,n,r,i){return b(e,{withParents:!0}).then(function(e){var t="data.".concat(n,"Parents.references");return _.map(_.get(e,t),_.property("managedObject.id"))}).then(function(e){var t=[],n={ids:e.join(",")};return e.length&&(t=y(n),(r||i)&&(t=t.then(k(r,i)))),t})}function k(t,n){return function(e){return _.filter(e,function(e){return t&&e.type===t||n&&!_.isUndefined(e[n])})}}function E(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},o=_.camelCase(["child",_.lowerCase(t),"id"]),a=_objectSpread({withParents:!0},i);return a[o]=e.id||e,y(a).then(function(e){return n||r?k(n,r)(e):e})}function $(e,t,n){var r=function(e,t,n){var r=t.id||t;return"".concat(h(e,n),"/").concat(r)}(e,t,n);return z(e),a.delete(r)}function z(e){var t=g.getId(e),n=M.cache.__data__;L(n.string,t),L(n.hash,t)}function L(t,n){if(0<t.size){var e=Object.keys(t.__data__);_.forEach(e,function(e){(e===n.toString()||e.startsWith("".concat(n,"_")))&&t.delete(e)})}}function R(e){var t="".concat(p(e),"/supportedMeasurements");return a.get(t).then(_.property("data.c8y_SupportedMeasurements"))}function U(n){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,t=n&&(n.id||n),r=s.get("c8yMeasurements"),i=e<a,c=o.filter(function(e){return!e.unit});if(i||0===c.length)return v.resolve(o);var u=_.assign(g.timeOrderFilter(),{revert:!0,source:t,pageSize:2e3,dateTo:void 0,withTotalPages:!0,currentPage:a});return r.list(u).then(function(r){for(var e=function(){var e=c[i],t=_.property([e.fragment,e.series,"unit"]),n=_.find(r,function(e){return t(e)});n&&(e.unit=t(n))},i=0;i<c.length;i++)e();var t=r.statistics.totalPages;return U(n,o,t,a+1)})}function F(e){return(_.get(e,"owner")?v.when(e):b(e).then(g.getResData)).then(_.property("owner"))}var x=_.memoize(F,function(e){return g.getId(e)}),M=_.memoize(A,function(e,t){return function(e,t){var n=g.getId(e);t&&(n="".concat(n,"_").concat(JSON.stringify(t)));return n}(e,t)});function H(e){return g.url("inventory/managedObjects/".concat(e,"/user"))}return{list:y,listQuery:function(e,t,n,r){var i=g.pageSizeFilter(t);return i[n?"query":"q"]=c.buildQuery(e),y(i,r)},listAll:function(e){var o=[];return y(_objectSpread({pageSize:g.MAX_PAGESIZE},e)).then(function e(t){o.push.apply(o,_toConsumableArray(t));var n=t.statistics.pageSize,r=t.paging.next,i=t.length>=n;return r&&i?t.paging.next().then(e):v.resolve(o)})},detail:b,detailCached:M,detailRealtime:function(e,t,r,n,i){var o,a,c,u=e.id||e,s=_.isObjectLike(e)?v.when(e):b(u,n,i).then(g.getResData),d="/managedobjects/".concat(u),l=m.realtimeActions().UPDATE;function f(n){return o?_.assign(o,n):o=n,_.forEach(o,function(e,t){void 0===n[t]&&delete o[t]}),_.isFunction(r)&&r(o),o}if(t)a=t.$id,m.addListener(a,d,l,function(e,t){f(t)}),m.start(a,d),t.$on("stopRealtime",function(){m.stop(a,d)}),t.$on("$destroy",function(){m.removeSubscriber(a,d)}),c=s.then(function(e){return f(e)});else{var p=c=b(u).then(function(e){return f(e.data)}),h={ops:l,channel:d,onUpdate:function(e,t){f(t)}},y=m.watch(h);p.stop=_.bind(y.stop,y)}return c},create:t,createChild:j,createConfirm:function(e){return t(e).then(O).then(b)},update:S,save:function(e){return e.id?S(e):t(e)},remove:function(e,t){var n=p(e);if(!n)throw new Error("No managed object id provided!");var r=i(e);return _.forEach(r,function(e){z(e)}),z(e),a.delete(n,{params:_.isObjectLike(t)?t:{}})},extractParents:i,hasChildAssets:function(e){return w(e,"childAssets")},hasChildDevices:function(e){return w(e,"childDevices")},hasChildAdditions:function(e){return w(e,"childAdditions")},getChildAssetsCount:function(e){return P(e,"childAssets")},getChildDevicesCount:function(e){return P(e,"childDevices")},getChildAdditionsCount:function(e){return P(e,"childAdditions")},children:C,onChildren:D,childAssets:function(e,t){return C(e,"childAssets",t).then(D)},childDevices:function(e,t){return C(e,"childDevices",t).then(D)},childAdditions:function(e,t){return C(e,"childAdditions",t).then(D)},addChildAsset:function(e,t){return I(e,t,"childAssets")},addChildDevice:function(e,t){return I(e,t,"childDevices")},addChildAddition:function(e,t){return I(e,t,"childAdditions")},createChildAsset:function(e,t){return j(e,t,"childAssets")},createChildDevice:function(e,t){return j(e,t,"childDevices")},createChildAddition:function(e,t){return j(e,t,"childAdditions")},removeChildAsset:function(e,t){return $(e,t,"childAssets")},removeChildDevice:function(e,t){return $(e,t,"childDevices")},removeChildAddition:function(e,t){return $(e,t,"childAdditions")},parentsAsset:function(e,t,n){return T(e,"asset",t,n)},parentsDevice:function(e,t,n){return T(e,"device",t,n)},parentsAddition:function(e,t,n){return T(e,"addition",t,n)},directParentAssets:function(e,t,n,r){return E(e,"asset",t,n,r)},directParentDevices:function(e,t,n,r){return E(e,"device",t,n,r)},directParentAdditions:function(e,t,n,r){return E(e,"addition",t,n,r)},getCount:function(e){return g.getCount(y,e||{})},getFragments:function(e){var t=_.union(f,["id","type","name","owner","self"]);return _.keys(g.cleanFields(e,t))},getSupportedMeasurements:R,getSupportedSeries:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return function(e){return v.all([R(e),function(e){var t="".concat(p(e),"/supportedSeries");return a.get(t).then(_.property("data.c8y_SupportedSeries"))}(e)]).then(function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1],i=_.sortBy(n,"length").reverse();return _(r).map(function(t){var e=_.find(i,function(e){return 0===t.indexOf(e)}),n=t.replace("".concat(e,"."),"");return{fragment:e,series:n}}).filter(_.property("fragment")).value()})}(t).then(function(e){return function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;return t.withUnits?U(e,n):v.resolve(n)}(t,n,e)})},addUnits:U,isOwner:function(e,t){var n={user:t?v.when(t):r.current(),owner:F(e)};return v.all(n).then(function(e){return e.user.userName===e.owner})},isOwnerCached:function(e,t){var n={user:t?v.when(t):r.current(),owner:x(e)};return v.all(n).then(function(e){return e.user.userName===e.owner})},getOwner:F,getOwnerObject:function(e,t){var n=H(g.getId(e));return a.get(n,t).then(g.getResData).catch(function(t){return F(e).then(function(e){return v.reject({notFound:404===t.status,accessDenied:403===t.status,serviceUser:r.isServiceUser(e)})})})},getOwnerCached:x,setOwnerEnabled:function(e,t){var n=g.getId(e);return a.put(H(n),{enabled:!!t}).then(g.getResData)},addGlobalFlag:function(e,t){return e.c8y_Global=t?{}:null,e},updateManagedObject:function(t,e){var n=_.keys(e),r=_.keys(t).filter(function(e){return!_.includes(n,e)});return _.forEach(r,function(e){return _.unset(t,e)}),_.assign(t,e)}}}e.$inject=["$http","$q","$rootScope","$injector","c8yBase","c8yUser","c8yRealtime","c8yQueriesUtil"],angular.module("c8y.core").factory("c8yInventory",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(r,e,c,n,i,t,u){var o="c8y_Kpi",a=["target","min","max","yellowRangeMin","yellowRangeMax","redRangeMin","redRangeMax"];function f(){return n.list({fragmentType:o,pageSize:u.MAX_PAGESIZE})}return{list:f,listByIds:function(t){return f().then(function(e){return t&&t.length?_.filter(e,function(e){return-1<t.indexOf(e.id)}):e})},detail:function(e){return n.detail(e).then(function(e){var t=e.data.c8y_Kpi;return _.forEach(a,function(e){_.isUndefined(t[e])||(t[e]=parseFloat(t[e]),Number.isNaN(Number(t[e]))&&delete t[e])}),e})},remove:n.remove,save:function(e){var t=_.cloneDeep(e);return delete t._measurement,t.c8y_Global={},n.save(t)},listKpiForDevice:function(e){var t=e.id||e;return n.getSupportedSeries(t).then(function(e){return r.all({kpis:function(e){var o=u.url("inventory/managedObjects/".concat(e,"/kpis"));return function e(t){var r=_.assign({pageSize:u.MAX_PAGESIZE},t),n={params:r},i=u.cleanListCallback("managedObjects",e,r);return c.get(o,n).then(i)}()}(t),series:e})}).then(function(e){var r=e.kpis,t=e.series;return{matchKpi:_.filter(r,function(e){return _.find(t,{fragment:e.c8y_Kpi.fragment,series:e.c8y_Kpi.series})}),nonKpiSeries:_.filter(t,function(t){return!_.find(r,function(e){return e.c8y_Kpi.fragment===t.fragment&&e.c8y_Kpi.series===t.series})})}})},getMeasurement:function(e,t){var r=e.c8y_Kpi||e,n=_objectSpread(_objectSpread({},u.timeOrderFilter()),{},{source:t,valueFragmentType:r.fragment,valueFragmentSeries:r.series,pageSize:1,revert:!0});return i.list(n).then(_.head).then(function(e){return function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return _objectSpread({kpi:e,time:t.time,source:t.source},_.get(t,e.fragment,{}))}(r,e)})}}}e.$inject=["$q","$log","$http","c8yInventory","c8yMeasurements","c8yUser","c8yBase"],angular.module("c8y.core").factory("c8yKpi",e)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var
|
|
1
|
+
"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);var n=r.call(t,e||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}!function(){function t(i,u,l,t){var c="tenant/options",o="tenant/security-options",a="tenant/system/options",p={headers:l.contentHeaders("option")},n={};return{list:s,listAll:function(t){var i=[],c=f(t);return s(_objectSpread({pageSize:l.MAX_PAGESIZE},t)).then(c).then(function t(e){var r;i.push.apply(i,_toConsumableArray(e));var n=e.statistics.pageSize,o=e.paging.next,a=e.length>=n;r=o&&a?e.paging.next().then(c).then(t):u.resolve(i);return r})},listAllBy:function(t,e){var r="".concat(c,"/").concat(t),n=l.url(r),o=_.set({},"params",e);return i.get(n,o).then(l.getResData).then(function(t){return _.map(t,function(t,e){return{key:e,value:t}})})},detail:r,detailValue:e,updateOption:function(t){var e=y(t),r=_.cloneDeep(t),n=_.cloneDeep(p);return i.put(e,r,n)},createOption:function(t){var e=l.url(c),r=_.cloneDeep(t),n=_.cloneDeep(p);return i.post(e,r,n)},deleteOption:function(t){var e=y(t);return i.delete(e)},getSystemOption:g,getSystemOptionValue:d,getSupportUrl:function(){return u.all([e({category:"configuration",key:"system.support.url"},null,null).then(function(t){return _.isNull(t)?void 0:t}),d({category:"support",key:"url"},null).then(function(t){return _.isNull(t)?void 0:t}),l.appOption("support_url"),"https://support.cumulocity.com/hc/en-us/requests/new"]).then(function(t){return _.find(t,function(t){return!_.isUndefined(t)})})},parseOptionRawValue:b,setUserPasswordValidationParams:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:8,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:32;Object.defineProperty(window.c8yConfig.validation.password,"message",{get:function(){return t.getString("Password must have at least {{ min }} characters and no more than {{ max }} and can only contain letters, numbers and following symbols: {{ symbols }}",{min:e,max:r,symbols:"`~!@#$%^&*()_|+-=?;:'\",.<>{}[]\\/"})}}),Object.defineProperty(window.c8yConfig.validation.password,"pattern",{get:function(){var t="".concat(e,"_").concat(r);return n[t]||(n[t]=new RegExp("^[a-zA-Z0-9`~!@#$%^&*()_|+\\-=?;:'\",.<>{}\\[\\]\\\\/]{".concat(e,",").concat(r,"}$"))),n[t]}})}};function y(t){return l.url("".concat(c,"/").concat(encodeURIComponent(t.category)).concat(t.key?"/".concat(encodeURIComponent(t.key)):""))}function s(t){var e=l.url(c),r=l.pageSizeFilter(t),n={params:r},o=l.cleanListCallback("options",s,r),a=f(t);return i.get(e,n).then(o).then(a)}function f(e){return l.createListFilter(function(t){return!e||!e.category||e.category===t.category})}function r(t,e){var r="password"===t.category?function(t){return l.url("".concat(o,"/").concat(encodeURIComponent(t.category)).concat(t.key?"/".concat(encodeURIComponent(t.key)):""))}(t):y(t),n=_.merge({silentError:!0},e);return i.get(r,n)}function e(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return r(t,2<arguments.length?arguments[2]:void 0).then(_.partialRight(m,e),_.partial(_.identity,e))}function g(t,e){var r=function(t){var e=encodeURIComponent(t.category),r=encodeURIComponent(t.key);return l.url("".concat(a,"/").concat(e).concat(t.key?"/".concat(r):""))}(t),n=_.merge({silentError:!0},e);return i.get(r,n)}function d(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return g(t,2<arguments.length?arguments[2]:void 0).then(_.partialRight(m,e),_.partial(_.identity,e))}function m(t,e){return b(_.get(t,"data.value"),e)}function b(e,r){var n;try{n=JSON.parse(e)}catch(t){n=_.isUndefined(e)?r:e}return n}}t.$inject=["$http","$q","c8yBase","gettextCatalog"],angular.module("c8y.core").factory("c8ySettings",t)}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _typeof(
|
|
1
|
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(e){_defineProperty(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){function e(c,u,l,e,r){var t,n="tenant/",p="".concat(n,"tenants"),o="".concat(n,"currentTenant"),a="management",i=1e3,s=["applications","ownedApplications","adminName"],f=["allowCreateTenants"],y=["adminPass"],b=l.cleanFields;return{list:function e(t){var n=l.pageSizeFilter(_objectSpread(_objectSpread({},t),{},{pageSize:i,currentPage:_.get(t,"currentPage")}));var r={params:n};var o=l.url(p);var a=l.cleanListCallback("tenants",e,n);return c.get(o,r).then(a)},save:function(e){var t=_.cloneDeep(e),n=!t.applications,r=n?"post":"put",o=t.allowCreateTenants;t.adminPass||(t=b(t,y));t=b(t,n?f:s);var a=l.url(p)+(n?"":"/".concat(t.id)),i={headers:l.contentHeaders("tenant",!0)};return t=b(t,["id"]),u.resolve(t).then(function(e){return c[r](a,e,i)}).then(function(e){var t=u.resolve(e);return n&&o&&(t=t.then(function(e){return function(e,t,n,r){var o=e.data.id,a="".concat(t,"/").concat(o);return c.put(a,{allowCreateTenants:r},n)}(e,a,i,o)}).then(function(){return e})),t})},remove:function(e){var t=d(e);return c.delete(t)},detail:function(e){var t=d(e);return c.get(t)},addApplication:function(e,t,n){var r=t.id||t,o=v(e),a={application:{id:r,self:t.self}},i=_objectSpread({headers:l.contentHeaders("applicationReference",!0)},n);return c.post(o,a,i)},removeApplication:function(e,t,n){var r=t.id||t,o="".concat(v(e),"/").concat(r);return c.delete(o,n)},isCurrentUserTopTenant:function(){return e.current().then(function(e){return m(e.tenant)})},isParentTopTenant:function(e){return m(e.parent)},isTopTenant:m,current:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];t&&!e||(t=c.get(l.url(o),{silentError:!0}).then(l.getResData,function(e){return 404===e.status?u.when({allowsCreateSubtenant:!0}):u.reject(e)}));return t},isEnterpriseEditionTenant:function(){var t={name:"feature-branding"},n=[{name:"sslmanagement"},{name:"feature-user-hierarchy"},{name:"feature-broker"}];return r.areAllAvailable([{name:"branding"}].concat(n)).then(function(e){return e||r.areAllAvailable([t].concat(n))})},isSubscribed:function(t){return this.current().then(function(e){return _.get(e,"applications.references",[]).map(function(e){return e.application})}).then(function(e){return r.isAppOnTheList(e,t)})}};function d(e){var t=e.id||e;return l.url("".concat(p,"/").concat(t))}function v(e){return"".concat(d(e),"/applications")}function m(e){return e===a}}e.$inject=["$http","$q","c8yBase","c8yUser","c8yApplication"],angular.module("c8y.core").factory("c8yTenant",e)}();
|