@c8y/ng1-modules 1021.0.11 → 1021.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{e.$inject=["gettext","c8yDeviceProtocolUiProvider","c8yViewsProvider"];var o="c8yLwm2m";function e(h,e,t){a.$inject=["c8yBase","c8yInventory","c8yTenant","c8yObjectMappings","$http","$upload"],i.$inject=["$routeParams"];var n={service:o,id:"lwm2m",name:h("LWM2M")},p={path:"/deviceprotocols/".concat(n.id,"/:id"),template:'<c8y-lwm2m-detail id="vm.id"></c8y-lwm2m-detail>',controllerAs:"vm",controller:i};return{initUi:function(){e.register(n),t.when(p.path,p)},$get:a};function i(e){_.assign(this,e)}function a(t,n,e,i,a,o){var r,c=t.url("service/lwm2m-agent/"),s="".concat(c,"objectResourceMappings");return{flow:function(){return["c8yLwm2mUploadStep","c8yLwm2mFinalStep"]},list:function(){return a.get(s,{silentError:!0}).then(t.getResData)},detail:function(e){e=t.getId(e);return n.detail(e).then(t.getResData)},detailPath:function(e){e=m(e);return p.path.replace(/:id$/,e)},upload:function(e){return o.upload({url:"".concat(s,"/ddf"),method:"POST",headers:{Accept:"application/json"},file:e,fileName:e.name.replace(/\s+/g,"_")})},remove:function(e){e=m(e);return n.remove(e)},getName:function(e){var t=i.getName(e),e=i.getObjectId(e);return"".concat(e," ").concat(t)},updateMapping:function(e,t){e="".concat(s,"/").concat(e,"/add");return a.put(e,t)},getPostRegistrationOptions:function(){var e={url:"".concat(c,"postRegistrationOptions"),method:"GET",silentError:!0};return a(e).then(t.getResData)},setPostRegistrationOptions:function(e){e={url:"".concat(c,"postRegistrationOptions"),method:"PUT",data:{commands:e}};return a(e)},helpTexts:{minPeriod:h("The minimum period attribute indicates the minimum time in seconds the LWM2M client MUST wait between two notifications."),maxPeriod:h("The maximum period attribute indicates the maximum time in seconds the LWM2M client MAY wait between two notifications."),greaterThan:h("This greater than attribute defines a threshold high value."),lessThan:h("This less than attribute defines a threshold low value."),step:h("This step attribute defines a minimum change value between two notifications.")},isServiceSubscribed:u,showIf:l,listRowInfoComponent:"c8yDeviceProtocolRowCountResources",getCustomActions:function(){r=r||a.get("".concat(c,"mappingActions/resourceactions")).then(t.getResData).then(d);return r},Validation:{RuleType:{LT:"lt",GT:"gt",EQ:"eq",NEQ:"neq",GTE:"gte",LTE:"lte",AND:"and",OR:"or"},ValueType:{NUMBER:"number",DATE:"date",STRING:"string",REGEX:"regex",OBJECTLINK:"objectLink"},ResourceDataType:{INTEGER:"INTEGER",FLOAT:"FLOAT",STRING:"STRING",BOOLEAN:"BOOLEAN",TIME:"TIME",OBJECTLINK:"OBJECTLINK"},RuleName:{GT:"Greater than",LT:"Lower than",GTE:"Greater or equals than",LTE:"Lower or equals than",EQ:"Equals",NEQ:"Equals not"}}};function u(){return e.isSubscribed({name:"lwm2m-agent",type:"MICROSERVICE"})}function l(){return l._cached=l._cached?l._cached:u()}function m(e){return _.get(e,"id")}function d(e){return _.reduce(e,function(e,t){var n=t.name,t=t.args,t=_.get(t,"length")?t.map(function(e){return"".concat(n,":").concat(e)}):[n];return e.concat(t)},[])}}}angular.module("c8y.lwm2m").provider(o,e)})();
1
+ (()=>{e.$inject=["gettext","c8yDeviceProtocolUiProvider","c8yViewsProvider"];var r="c8yLwm2m";function e(p,e,t){a.$inject=["c8yBase","c8yInventory","c8yTenant","c8yObjectMappings","c8yLwm2mPluginCheckerService","$http","$upload"],i.$inject=["$routeParams"];var n={service:r,id:"lwm2m",name:p("LWM2M")},g={path:"/deviceprotocols/".concat(n.id,"/:id"),template:'<c8y-lwm2m-detail id="vm.id"></c8y-lwm2m-detail>',controllerAs:"vm",controller:i};return{initUi:function(){e.register(n),t.when(g.path,g)},$get:a};function i(e){_.assign(this,e)}function a(n,i,e,a,r,o,t){var c,u=n.url("service/lwm2m-agent/"),s="".concat(u,"objectResourceMappings");return{flow:function(){return["c8yLwm2mUploadStep","c8yLwm2mFinalStep"]},list:function(){return o.get(s,{silentError:!0}).then(n.getResData)},detail:function(e){var t=n.getId(e);return r.isLwm2mPluginInstalled().then(function(e){return e?null:i.detail(t).then(n.getResData)})},detailPath:function(e){e=d(e);return g.path.replace(/:id$/,e)},upload:function(e){return t.upload({url:"".concat(s,"/ddf"),method:"POST",headers:{Accept:"application/json"},file:e,fileName:e.name.replace(/\s+/g,"_")})},remove:function(e){e=d(e);return i.remove(e)},getName:function(e){var t=a.getName(e),e=a.getObjectId(e);return"".concat(e," ").concat(t)},updateMapping:function(e,t){e="".concat(s,"/").concat(e,"/add");return o.put(e,t)},getPostRegistrationOptions:function(){var e={url:"".concat(u,"postRegistrationOptions"),method:"GET",silentError:!0};return o(e).then(n.getResData)},setPostRegistrationOptions:function(e){e={url:"".concat(u,"postRegistrationOptions"),method:"PUT",data:{commands:e}};return o(e)},helpTexts:{minPeriod:p("The minimum period attribute indicates the minimum time in seconds the LWM2M client MUST wait between two notifications."),maxPeriod:p("The maximum period attribute indicates the maximum time in seconds the LWM2M client MAY wait between two notifications."),greaterThan:p("This greater than attribute defines a threshold high value."),lessThan:p("This less than attribute defines a threshold low value."),step:p("This step attribute defines a minimum change value between two notifications.")},isServiceSubscribed:l,showIf:m,listRowInfoComponent:"c8yDeviceProtocolRowCountResources",getCustomActions:function(){c=c||o.get("".concat(u,"mappingActions/resourceactions")).then(n.getResData).then(h);return c},Validation:{RuleType:{LT:"lt",GT:"gt",EQ:"eq",NEQ:"neq",GTE:"gte",LTE:"lte",AND:"and",OR:"or"},ValueType:{NUMBER:"number",DATE:"date",STRING:"string",REGEX:"regex",OBJECTLINK:"objectLink"},ResourceDataType:{INTEGER:"INTEGER",FLOAT:"FLOAT",STRING:"STRING",BOOLEAN:"BOOLEAN",TIME:"TIME",OBJECTLINK:"OBJECTLINK"},RuleName:{GT:"Greater than",LT:"Lower than",GTE:"Greater or equals than",LTE:"Lower or equals than",EQ:"Equals",NEQ:"Equals not"}}};function l(){return e.isSubscribed({name:"lwm2m-agent",type:"MICROSERVICE"})}function m(){return m._cached=m._cached?m._cached:l()}function d(e){return _.get(e,"id")}function h(e){return _.reduce(e,function(e,t){var n=t.name,t=t.args,t=_.get(t,"length")?t.map(function(e){return"".concat(n,":").concat(e)}):[n];return e.concat(t)},[])}}}angular.module("c8y.lwm2m").provider(r,e)})();
@@ -1 +1 @@
1
- (()=>{function e(t,e,n,c){var i=this;function u(){t.detail(i.id).then(s),t.getCustomActions().then(r)}function o(){var e=i.getMappings(),t=Object.values(i.getResources());return!((e?Object.values(e):[]).length<t.length)&&e&&Object.values(e).every(function(e){return!0===e.skipIfEmpty})}function s(e){i.object=e,i.title=t.getName(e),i.skipIfEmptyAll=o()}function r(e){i.customActions=e}function a(){return e.getMappings(i.object)}_.assign(i,{$onChanges:function(e){e.id&&u()},updateMapping:function(e){return t.updateMapping(i.object.id,e).then(u)},getMappings:a,getResources:function(){return e.getResources(i.object)},getMainObject:function(){return e.getMainObject(i.object)},getMappingForResource:function(e){return _.get(a(),e)},setAllResources:function(){var e=i.getResources(),t=i.getMappings(),e=e?Object.values(e):[];t=t||{};e.forEach(function(e){null!=e.id&&(t[e.id]||(t[e.id]={resourceID:e.id}),t[e.id].skipIfEmpty=i.skipIfEmptyAll)}),t&&0<Object.entries(t).length&&i.updateMapping(t).then(function(){return n.success(c("Resource update complete."))})},isIgnoreEmptyValuesMasterToggleOn:o})}e.$inject=["c8yLwm2m","c8yObjectMappings","c8yAlert","gettext"],angular.module("c8y.lwm2m").component("c8yLwm2mDetail",{templateUrl:":::PLUGIN_PATH:::/lwm2mDetail.html",controller:e,controllerAs:"vm",bindings:{id:"<"}})})();
1
+ (()=>{function e(t,e,n,c){var i=this;function u(){t.detail(i.id).then(s),t.getCustomActions().then(r)}function o(){var e=i.getMappings(),t=Object.values(i.getResources());return!((e?Object.values(e):[]).length<t.length)&&e&&Object.values(e).every(function(e){return!0===e.skipIfEmpty})}function s(e){(i.object=e)&&(i.title=t.getName(e),i.skipIfEmptyAll=o())}function r(e){i.customActions=e}function a(){return e.getMappings(i.object)}_.assign(i,{$onChanges:function(e){e.id&&u()},updateMapping:function(e){return t.updateMapping(i.object.id,e).then(u)},getMappings:a,getResources:function(){return e.getResources(i.object)},getMainObject:function(){return e.getMainObject(i.object)},getMappingForResource:function(e){return _.get(a(),e)},setAllResources:function(){var e=i.getResources(),t=i.getMappings(),e=e?Object.values(e):[];t=t||{};e.forEach(function(e){null!=e.id&&(t[e.id]||(t[e.id]={resourceID:e.id}),t[e.id].skipIfEmpty=i.skipIfEmptyAll)}),t&&0<Object.entries(t).length&&i.updateMapping(t).then(function(){return n.success(c("Resource update complete."))})},isIgnoreEmptyValuesMasterToggleOn:o})}e.$inject=["c8yLwm2m","c8yObjectMappings","c8yAlert","gettext"],angular.module("c8y.lwm2m").component("c8yLwm2mDetail",{templateUrl:":::PLUGIN_PATH:::/lwm2mDetail.html",controller:e,controllerAs:"vm",bindings:{id:"<"}})})();
@@ -1,7 +1,7 @@
1
- <c8y-ui-title-set title="vm.title"></c8y-ui-title-set>
2
- <c8y-device-protocol-breadcrumb></c8y-device-protocol-breadcrumb>
1
+ <c8y-ui-title-set ng-if="vm.object" title="vm.title"></c8y-ui-title-set>
2
+ <c8y-device-protocol-breadcrumb ng-if="vm.object"></c8y-device-protocol-breadcrumb>
3
3
 
4
- <div class="row">
4
+ <div class="row" ng-if="vm.object">
5
5
  <div class="col-lg-12 col-lg-max">
6
6
  <div class="card card--fullpage">
7
7
  <div class="card-block bg-level-1 flex-no-shrink p-t-24 p-b-24">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1021.0.11",
3
+ "version": "1021.2.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",