ngx-nearit-api
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs/operators"),require("rxjs"),require("lodash"),require("queueing-subject/lib"),require("rxjs-websockets/lib"),require("@auth0/angular-jwt"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-nearit-api",["exports","@angular/core","@angular/common/http","rxjs/operators","rxjs","lodash","queueing-subject/lib","rxjs-websockets/lib","@auth0/angular-jwt","@angular/common"],e):e(t["ngx-nearit-api"]={},t.ng.core,t.ng.common.http,t.rxjs.operators,t.rxjs,t.lodash,t.lib,t.websocketConnect,t.angularJwt,t.ng.common)}(this,function(t,n,r,a,i,o,s,u,e,p){"use strict";u=u&&u.hasOwnProperty("default")?u["default"]:u;var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function R(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}var d=function(){function l(){}return l.toJsonModel=function(t,e){var r={};if(t&&(r.id=t.id,r.type=t.type,this.populateJsonAttributes(r,t),t.relationships&&(r.relationships=this.populateJsonRelationships(t.relationships)),t.meta&&(r.meta=this.populateJsonMeta(t.meta)),e)){r.included={},r.included=this.populateInclude(r,t,e,{})}return r},l.toJsonArrayModel=function(t,e,r){var n,i,o=[];try{for(var a=R(t),s=a.next();!s.done;s=a.next()){var u=s.value;o.push(l.toJsonModel(u,e))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a["return"])&&i.call(a)}finally{if(n)throw n.error}}if(r){var p={};return p.meta=this.populateJsonMeta(r),p.array=o,p}return o},l.toJsonApiModel=function(t){var e,r,n={data:{attributes:{}}};for(var i in n.data.id=t.id,n.data.type=t.type,t)this.notAttributeType(i)||(n.data.attributes[i]=t[i]);if(t.relationships){n.data.relationships={};try{for(var o=R(Object.keys(t.relationships)),a=o.next();!a.done;a=o.next()){i=a.value;n.data.relationships[i]=t.relationships[i]}}catch(s){e={error:s}}finally{try{a&&!a.done&&(r=o["return"])&&r.call(o)}finally{if(e)throw e.error}}}return n},l.populateJsonAttributes=function(t,e){var r,n;if(e&&e.attributes)try{for(var i=R(Object.keys(e.attributes)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e.attributes[a]}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}},l.populateJsonRelationships=function(t){var e,r,n={};try{for(var i=R(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]=t[a]}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return n},l.populateJsonMeta=function(t){var e,r,n={};try{for(var i=R(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]=t[a]}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return n},l.populateInclude=function(f,d,h,y){var t,e,r=function(t){var e,r,n=d.relationships[t].data;if(f.included[t]={},!n)return"continue";if(Array.isArray(n)){var i=[],o=function(e){var t={},r=h.find(function(t){return t.id===e.id});if(!r)return"continue";if(t.id=r.id,g.populateJsonAttributes(t,r),r.meta&&(t.meta=g.populateJsonMeta(r.meta)),r.relationships&&!y[e.id]){y[e.id]=e.id;var n=g.populateInclude({included:{}},r,h,y);t.included=n,t.relationships=g.populateJsonRelationships(r.relationships)}i.push(t)};try{for(var a=R(n),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=a["return"])&&r.call(a)}finally{if(e)throw e.error}}f.included[t]=i}else if("parent"===t)f.included[t].id=n.id;else{var u={},p=h.find(function(t){return t.id===n.id});if(p){if(u.id=p.id,g.populateJsonAttributes(u,p),p.meta&&(u.meta=g.populateJsonMeta(p.meta)),p.relationships&&!y[n.id]){y[n.id]=n.id;var c=g.populateInclude({included:{}},p,h,y);u.included=c,u.relationships=g.populateJsonRelationships(p.relationships)}f.included[t]=u}}},g=this;try{for(var n=R(Object.keys(d.relationships)),i=n.next();!i.done;i=n.next()){r(i.value)}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}return f.included},l.createFilter=function(t){var e,r,n,i,o,a,s,u,p,c,l,f,d={};t.sort&&(d.sort=t.sort),t.include&&(d.include=t.include),t.polyglot&&(d.polyglot=t.polyglot);var h=t.filter;for(var y in h)if(h[y]instanceof Object)try{for(var g=R(Object.keys(h[y])),v=g.next();!v.done;v=g.next()){var j=v.value;d["filter["+y+"]["+j+"]"]=h[y][j]}}catch(k){e={error:k}}finally{try{v&&!v.done&&(r=g["return"])&&r.call(g)}finally{if(e)throw e.error}}else d["filter["+y+"]"]=h[y];if(t.filterMultipleFields&&(d.filter=t.filterMultipleFields),t.startsWith)try{for(var A=R(Object.keys(t.startsWith)),m=A.next();!m.done;m=A.next()){d["filter["+(y=m.value)+"][starts_with]"]=t.startsWith[y]}}catch(S){n={error:S}}finally{try{m&&!m.done&&(i=A["return"])&&i.call(A)}finally{if(n)throw n.error}}if(t.starts)try{for(var I=R(Object.keys(t.starts)),b=I.next();!b.done;b=I.next()){d["filter["+(y=b.value)+"][start]"]=t.starts[y]}}catch(x){o={error:x}}finally{try{b&&!b.done&&(a=I["return"])&&a.call(I)}finally{if(o)throw o.error}}if(t.ends)try{for(var _=R(Object.keys(t.ends)),C=_.next();!C.done;C=_.next()){d["filter["+(y=C.value)+"][end]"]=t.ends[y]}}catch(T){s={error:T}}finally{try{C&&!C.done&&(u=_["return"])&&u.call(_)}finally{if(s)throw s.error}}if(t.contains)try{for(var E=R(Object.keys(t.contains)),w=E.next();!w.done;w=E.next()){d["filter["+(y=w.value)+"][contains]"]=t.contains[y]}}catch(O){p={error:O}}finally{try{w&&!w.done&&(c=E["return"])&&c.call(E)}finally{if(p)throw p.error}}if(t.page)try{for(var U=R(Object.keys(t.page)),P=U.next();!P.done;P=U.next()){d["page["+(y=P.value)+"]"]=t.page[y]}}catch(M){l={error:M}}finally{try{P&&!P.done&&(f=U["return"])&&f.call(U)}finally{if(l)throw l.error}}return t.search&&(d.search=t.search),t.app_id&&(d.app_id=t.app_id),t.price&&(d.price=t.price),d},l.notAttributeType=function(t){return"relationships"===t||"meta"===t||"included"===t||"id"===t||"type"===t},l.addRelationship=function(t,e){var r=e.key,n=e.type,i=e.data,o=f({},t);if(o.relationships||(o.relationships={}),Array.isArray(i)){if(0===i.length)return;o.relationships[r]={data:[]};for(var a=0;a<i.length;a++){var s=i[a];null!=s&&""!==s&&o.relationships[r].data.push({id:s,type:n})}}else o.relationships[r]={data:{id:i,type:n}};return o},l.cleanRelationships=function(t){return t&&t.relationships&&delete t.relationships,t},l}(),h=function(){function t(t){this.http=t}return t.prototype._get=function(t,e,r){return r&&r.params&&(r.params=d.createFilter(r.params)),e&&(t=t+"/"+e),this.http.get(t,r).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._getAll=function(t,e){return e&&e.params&&(e.params=d.createFilter(e.params)),this.http.get(t,e).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonArrayModel(o.get(t,"data",[]))}))},t.prototype._post=function(t,e,r){return this.http.post(t,d.toJsonApiModel(e)).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._put=function(t,e,r,n){return this.http.put(t+"/"+e,d.toJsonApiModel(r)).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._delete=function(t,e,r){return this.http["delete"](t+"/"+e,r).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){if(t&&t.data)return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:r.HttpClient}]},t}(),y=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/accounts"}return t.prototype.create=function(t,e,r){var n=this.setupRelationships(t,e);return this.jsonApiClient._post(this.resourceUrl,n,r)},t.prototype.readAll=function(t){return this.jsonApiClient._getAll(this.resourceUrl,t)},t.prototype.read=function(t,e){return this.jsonApiClient._get(this.resourceUrl,t,e)},t.prototype.update=function(t,e,r,n){var i=this.setupRelationships(e,r);return this.jsonApiClient._put(this.resourceUrl,t,i,n)},t.prototype["delete"]=function(t,e){return this.jsonApiClient._delete(this.resourceUrl,t,e)},t.prototype.setupRelationships=function(t,e){return t=d.addRelationship(t,{key:"parent",type:"accounts",data:e}),delete(t=d.addRelationship(t,{key:"apps",type:"apps",data:t.apps})).apps,t},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(),g=function(){function t(t,e,r){this.jsonApiClient=t,this._resourceUrl=e,this._config=r,this.config=r,this.resourceUrl=r.baseUrl+e}return t.prototype.create=function(t,e){return this.jsonApiClient._post(this.resourceUrl,t,e)},t.prototype.readAll=function(t){return this.jsonApiClient._getAll(this.resourceUrl,t)},t.prototype.read=function(t,e){return this.jsonApiClient._get(this.resourceUrl,t,e)},t.prototype.update=function(t,e,r){return this.jsonApiClient._put(this.resourceUrl,t,e,r)},t.prototype["delete"]=function(t,e){return this.jsonApiClient._delete(this.resourceUrl,t,e)},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},null,{type:undefined}]},t}(),v=function(r){function t(t,e){return r.call(this,t,"/apps",e)||this}return l(t,r),t.prototype.getStats=function(t){return this.jsonApiClient._get(this.resourceUrl+"/"+t+"/stats")},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(g),j=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceURL=e.baseUrl}return t.prototype.login=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth",t,e)},t.prototype.signup=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/signup",t,e)},t.prototype.impersonate=function(t,e){return this.jsonApiClient._get(this.resourceURL+"/masks/as",t,e)},t.prototype.deImpersonate=function(t){return this.jsonApiClient._get(this.resourceURL+"/masks/up","",t)},t.prototype.sendRecoveryEmail=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth/new_password",{type:"authorization",email:t},e)},t.prototype.validateChangePasswordToken=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth/exchange_token",{type:"authorization",token:t},e)},t.prototype.updatePassword=function(e,r,t){var n,i=this,o=this.resourceURL+"/accounts";return this.jsonApiClient._get(o,e,t).pipe(a.flatMap(function(t){return n=f({},t,{password:r}),i.jsonApiClient._put(o,e,n)}),a.map(function(){return n}))},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(),A=function(r){function t(t,e){return r.call(this,t,"/plugins/geopolis/beacons",e)||this}return l(t,r),t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),m=function(){function t(){}return t.RECIPE_FIRED="RECIPE_FIRED",t.INSTALLATION_CREATEDì="INSTALLATION_CREATED",t.UPLOAD_PROCESSED="UPLOAD_PROCESSED",t.IMAGE_PROCESSED="IMAGE_PROCESSED",t.TEST_DEVICE_ENROLLED="TEST_DEVICE_ENROLLED",t.TEST_DEVICE_UNENROLLED="TEST_DEVICE_UNENROLLED",t.TEST_PUSH_SENT="TEST_PUSH_SENT",t}(),I=function(){function t(t){this.config=t,this.wssUrl=t.wssUrl}return t.prototype.init=function(t,e){var r=u(this.wssUrl+"/apps/"+e+"?jwt="+t,new s.QueueingSubject);this.messages=r.messages,this.connectionStatus=r.connectionStatus},t.prototype.register=function(){return this.messages.pipe(a.retryWhen(function(t){return t?t.delay(1e3):null}),a.map(function(t){return t?JSON.parse(t):t}))},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),b=function(){function t(t,e,r){this.jsonApiClient=t,this.ws=e,this.config=r,this.resourceUrl=r.baseUrl+"/media/images"}return t.prototype.create=function(t,e){return this.jsonApiClient._post(this.resourceUrl,t,e)},t.prototype.upload=function(t,e,r){var n=this;return i.of({name:r.name,image:r.base64,app_id:e,creator_id:t}).pipe(a.flatMap(function(t){return n.create(t)}),a.flatMap(function(t){return n.currentImgId=t.id,n.ws.register()}),a.filter(function(t){return t&&t.event===m.IMAGE_PROCESSED&&t.data.id===n.currentImgId}),a.first(),a.map(function(t){return o.get(t,"data.attributes.image.url")}),a.finalize(function(){return n.currentImgId=null}))},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:I},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject(I),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),_=function(r){function t(t,e){return r.call(this,t,"/installations",e)||this}return l(t,r),t.prototype.sendTestInvitation=function(t,e){return this.jsonApiClient._post(this.config.baseUrl+"/apps/"+t+"/send_test_invitation?email="+e,{})},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),C=function(r){function t(t,e){return r.call(this,t,"/profiles",e)||this}return l(t,r),t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),E=function(r){function t(t,e){return r.call(this,t,"/plugins/push-machine/configurations",e)||this}return l(t,r),t.prototype.convertP12=function(t){return this.jsonApiClient._post(this.config.baseUrl+"/certificates/p12toPEM",t)},t.prototype.sendTestPush=function(t,e){var r=this.config.baseUrl+"/plugins/push-machine/pushes/send_push_test?app_id="+t+"&installation_ids="+e;return this.jsonApiClient._post(r,{})},t.prototype.getTestPushReport=function(t){var e=this.config.baseUrl+"/plugins/push-machine/pushes/test/stats?app_id="+t;return this.jsonApiClient._getAll(e)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),w=function(){function t(t,e){this.jsonApiClient=t,this.config=e}return t.prototype.readBillingDetails=function(t){var e=this,r=(new M).byAppId(t).build();return this.jsonApiClient._get(this.config.baseUrl+"/recipes/stats",null,{params:r}).pipe(a.map(function(t){return{active:e.getFirstVal(t.active),limit:e.getFirstVal(t.limits)}}))},t.prototype.getFirstVal=function(t){return t[Object.keys(t)[0]]},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),U=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/plugins/thehitman/actions/custom_trigger/bundles"}return t.prototype.create=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._post(this.resourceUrl,e,n)},t.prototype.read=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._get(this.resourceUrl,e,n)},t.prototype.readAll=function(t,e){var r=this.setHeaders(t,e);return this.jsonApiClient._getAll(this.resourceUrl,r)},t.prototype["delete"]=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._delete(this.resourceUrl,e,n)},t.prototype.setHeaders=function(t,e){return f({},e,{headers:{"X-Near-App-Id":t}})},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),P=function(){function t(t,e){this.jsonApiClient=t,this.config=e}return t.prototype.read=function(t,e,r){return this.jsonApiClient._get(this.config.baseUrl+"/usage/profiles/apps/"+t+"?month="+e+"&year="+r)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),k=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/plugins/congrego/configurations"}return t.prototype.update=function(t,e,r){var n=this,i={mappings:{},id:t,type:"configurations"};return e.map(function(t){i.mappings[t.id]={kind:t.kind,label:t.label,choices:t.choices,allowed:t.allowed}}),this.jsonApiClient._put(this.resourceUrl,t,i,r).pipe(a.map(function(t){return n.toMappingList(t)}))},t.prototype.read=function(t,e){var r=this;return this.jsonApiClient._get(this.resourceUrl,t,e).pipe(a.map(function(t){return r.toMappingList(t)}))},t.prototype.toMappingList=function(e){var r=[];return Object.keys(e.mappings).forEach(function(t){r.push({id:t,label:e.mappings[t].label,kind:e.mappings[t].kind,choices:e.mappings[t].choices,allowed:e.mappings[t].allowed})}),r},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),S=function(){function t(){}return t.root="root",t.impersonate="impersonate",t.owner="agent",t.developer="app-manager",t.marketer="marketer",t.cashier="cashier",t}(),x=function(){function e(){}return e.getIcon=function(t){switch(t){case e.BOOLEAN:return"type_booleano";case e.DATE:return"calendar_medium";case e.NUMERIC:return"type_number_small";case e.TEXT:return"text_small";case e.LIST:case e.MULTI:return"type_enumeration_small";default:return"icon_not_found"}},e.asArray=function(){return[e.LIST,e.MULTI,e.BOOLEAN,e.DATE,e.NUMERIC,e.TEXT]},e.BOOLEAN="boolean",e.DATE="date",e.NUMERIC="numeric",e.TEXT="text",e.LIST="list",e.MULTI="multi",e}(),T=function(){function t(){}return t.prototype.hasAuthorization=function(t,e){var r,n;try{for(var i=R(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.role===S[a])return!0;if(S[a]===S.impersonate&&t.impersonate)return!0}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return!1},t.prototype.decodeJwt=function(t){return(new e.JwtHelperService).decodeToken(t)},t.prototype.jwtToNrtAccount=function(t){var e=this.decodeJwt(t),r={token:t,id:e.data.account.id,role:e.data.account.role_key};return o.has(e,"data.super_account.role_key")?r.impersonate=e.data.super_account.role_key:delete r.impersonate,r},t.prototype.gotUserInfo=function(t){return null!=t.email},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),O=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[[y,{provide:"nrtApiConfig",useValue:t}],[T,{provide:"nrtApiConfig",useValue:t}],[v,{provide:"nrtApiConfig",useValue:t}],[j,{provide:"nrtApiConfig",useValue:t}],[A,{provide:"nrtApiConfig",useValue:t}],[b,{provide:"nrtApiConfig",useValue:t}],[_,{provide:"nrtApiConfig",useValue:t}],[h,{provide:"nrtApiConfig",useValue:t}],[C,{provide:"nrtApiConfig",useValue:t}],[E,{provide:"nrtApiConfig",useValue:t}],[k,{provide:"nrtApiConfig",useValue:t}]]}},e.decorators=[{type:n.NgModule,args:[{imports:[p.CommonModule,r.HttpClientModule]}]}],e}(),M=function(){function t(){this.operationFilter={}}return t.prototype.build=function(){return this.operationFilter},t.prototype.pageable=function(t){return this.operationFilter.page=t,this},t.prototype.search=function(t){return this.operationFilter.search=t,this},t.prototype.sortBy=function(t){return this.operationFilter.sort=t,this},t.prototype.include=function(t){return this.operationFilter.include=t,this},t.prototype.byCustomFilter=function(t,e){return this.operationFilter.filter||(this.operationFilter.filter={}),this.operationFilter.filter[t]=e,this},t.prototype.byAppId=function(t){return this.operationFilter=f({},this.operationFilter,{filter:{app_id:t}}),this},t}();t.NrtApiModule=O,t.AccountProviderService=y,t.AppProviderService=v,t.AuthProviderService=j,t.BeaconProviderService=A,t.ImageProviderService=b,t.InstallationProviderService=_,t.ProfileProviderService=C,t.PushConfigurationProviderService=E,t.RecipeProviderService=w,t.InAppEventProviderService=U,t.UsageProviderService=P,t.UserDataMappingProviderService=k,t.NrtRole=S,t.NrtUserDataMappingType=x,t.NrtWsEvents=m,t.NrtWsService=I,t.NrtFilterBuilder=M,t.AccountUtilsService=T,t.ɵg=h,t.ɵa=y,t.ɵb=v,t.ɵc=j,t.ɵd=A,t.ɵe=b,t.ɵf=_,t.ɵh=C,t.ɵk=k,t.ɵj=g,t.ɵi=E,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs/operators"),require("rxjs"),require("lodash"),require("queueing-subject/lib"),require("rxjs-websockets/lib"),require("@auth0/angular-jwt"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-nearit-api",["exports","@angular/core","@angular/common/http","rxjs/operators","rxjs","lodash","queueing-subject/lib","rxjs-websockets/lib","@auth0/angular-jwt","@angular/common"],e):e(t["ngx-nearit-api"]={},t.ng.core,t.ng.common.http,t.rxjs.operators,t.rxjs,t.lodash,t.lib,t.websocketConnect,t.angularJwt,t.ng.common)}(this,function(t,n,r,a,i,o,s,u,e,p){"use strict";u=u&&u.hasOwnProperty("default")?u["default"]:u;var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function l(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function R(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}var d=function(){function l(){}return l.toJsonModel=function(t,e){var r={};if(t&&(r.id=t.id,r.type=t.type,this.populateJsonAttributes(r,t),t.relationships&&(r.relationships=this.populateJsonRelationships(t.relationships)),t.meta&&(r.meta=this.populateJsonMeta(t.meta)),e)){r.included={},r.included=this.populateInclude(r,t,e,{})}return r},l.toJsonArrayModel=function(t,e,r){var n,i,o=[];try{for(var a=R(t),s=a.next();!s.done;s=a.next()){var u=s.value;o.push(l.toJsonModel(u,e))}}catch(c){n={error:c}}finally{try{s&&!s.done&&(i=a["return"])&&i.call(a)}finally{if(n)throw n.error}}if(r){var p={};return p.meta=this.populateJsonMeta(r),p.array=o,p}return o},l.toJsonApiModel=function(t){var e,r,n={data:{attributes:{}}};for(var i in n.data.id=t.id,n.data.type=t.type,t)this.notAttributeType(i)||(n.data.attributes[i]=t[i]);if(t.relationships){n.data.relationships={};try{for(var o=R(Object.keys(t.relationships)),a=o.next();!a.done;a=o.next()){i=a.value;n.data.relationships[i]=t.relationships[i]}}catch(s){e={error:s}}finally{try{a&&!a.done&&(r=o["return"])&&r.call(o)}finally{if(e)throw e.error}}}return n},l.populateJsonAttributes=function(t,e){var r,n;if(e&&e.attributes)try{for(var i=R(Object.keys(e.attributes)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e.attributes[a]}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}},l.populateJsonRelationships=function(t){var e,r,n={};try{for(var i=R(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]=t[a]}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return n},l.populateJsonMeta=function(t){var e,r,n={};try{for(var i=R(Object.keys(t)),o=i.next();!o.done;o=i.next()){var a=o.value;n[a]=t[a]}}catch(s){e={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(e)throw e.error}}return n},l.populateInclude=function(f,d,h,y){var t,e,r=function(t){var e,r,n=d.relationships[t].data;if(f.included[t]={},!n)return"continue";if(Array.isArray(n)){var i=[],o=function(e){var t={},r=h.find(function(t){return t.id===e.id});if(!r)return"continue";if(t.id=r.id,g.populateJsonAttributes(t,r),r.meta&&(t.meta=g.populateJsonMeta(r.meta)),r.relationships&&!y[e.id]){y[e.id]=e.id;var n=g.populateInclude({included:{}},r,h,y);t.included=n,t.relationships=g.populateJsonRelationships(r.relationships)}i.push(t)};try{for(var a=R(n),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=a["return"])&&r.call(a)}finally{if(e)throw e.error}}f.included[t]=i}else if("parent"===t)f.included[t].id=n.id;else{var u={},p=h.find(function(t){return t.id===n.id});if(p){if(u.id=p.id,g.populateJsonAttributes(u,p),p.meta&&(u.meta=g.populateJsonMeta(p.meta)),p.relationships&&!y[n.id]){y[n.id]=n.id;var c=g.populateInclude({included:{}},p,h,y);u.included=c,u.relationships=g.populateJsonRelationships(p.relationships)}f.included[t]=u}}},g=this;try{for(var n=R(Object.keys(d.relationships)),i=n.next();!i.done;i=n.next()){r(i.value)}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}return f.included},l.createFilter=function(t){var e,r,n,i,o,a,s,u,p,c,l,f,d={};t.sort&&(d.sort=t.sort),t.include&&(d.include=t.include),t.polyglot&&(d.polyglot=t.polyglot);var h=t.filter;for(var y in h)if(h[y]instanceof Object)try{for(var g=R(Object.keys(h[y])),v=g.next();!v.done;v=g.next()){var j=v.value;d["filter["+y+"]["+j+"]"]=h[y][j]}}catch(k){e={error:k}}finally{try{v&&!v.done&&(r=g["return"])&&r.call(g)}finally{if(e)throw e.error}}else d["filter["+y+"]"]=h[y];if(t.filterMultipleFields&&(d.filter=t.filterMultipleFields),t.startsWith)try{for(var A=R(Object.keys(t.startsWith)),m=A.next();!m.done;m=A.next()){d["filter["+(y=m.value)+"][starts_with]"]=t.startsWith[y]}}catch(S){n={error:S}}finally{try{m&&!m.done&&(i=A["return"])&&i.call(A)}finally{if(n)throw n.error}}if(t.starts)try{for(var I=R(Object.keys(t.starts)),b=I.next();!b.done;b=I.next()){d["filter["+(y=b.value)+"][start]"]=t.starts[y]}}catch(x){o={error:x}}finally{try{b&&!b.done&&(a=I["return"])&&a.call(I)}finally{if(o)throw o.error}}if(t.ends)try{for(var _=R(Object.keys(t.ends)),C=_.next();!C.done;C=_.next()){d["filter["+(y=C.value)+"][end]"]=t.ends[y]}}catch(O){s={error:O}}finally{try{C&&!C.done&&(u=_["return"])&&u.call(_)}finally{if(s)throw s.error}}if(t.contains)try{for(var E=R(Object.keys(t.contains)),w=E.next();!w.done;w=E.next()){d["filter["+(y=w.value)+"][contains]"]=t.contains[y]}}catch(T){p={error:T}}finally{try{w&&!w.done&&(c=E["return"])&&c.call(E)}finally{if(p)throw p.error}}if(t.page)try{for(var U=R(Object.keys(t.page)),P=U.next();!P.done;P=U.next()){d["page["+(y=P.value)+"]"]=t.page[y]}}catch(M){l={error:M}}finally{try{P&&!P.done&&(f=U["return"])&&f.call(U)}finally{if(l)throw l.error}}return t.search&&(d.search=t.search),t.app_id&&(d.app_id=t.app_id),t.price&&(d.price=t.price),d},l.notAttributeType=function(t){return"relationships"===t||"meta"===t||"included"===t||"id"===t||"type"===t},l.addRelationship=function(t,e){var r=e.key,n=e.type,i=e.data,o=f({},t);if(o.relationships||(o.relationships={}),Array.isArray(i)){if(0===i.length)return;o.relationships[r]={data:[]};for(var a=0;a<i.length;a++){var s=i[a];null!=s&&""!==s&&o.relationships[r].data.push({id:s,type:n})}}else o.relationships[r]={data:{id:i,type:n}};return o},l.cleanRelationships=function(t){return t&&t.relationships&&delete t.relationships,t},l}(),h=function(){function t(t){this.http=t}return t.prototype._get=function(t,e,r){return r&&r.params&&(r.params=d.createFilter(r.params)),e&&(t=t+"/"+e),this.http.get(t,r).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._getAll=function(t,e){return e&&e.params&&(e.params=d.createFilter(e.params)),this.http.get(t,e).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonArrayModel(o.get(t,"data",[]))}))},t.prototype._post=function(t,e,r){return this.http.post(t,d.toJsonApiModel(e)).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._put=function(t,e,r,n){return this.http.put(t+"/"+e,d.toJsonApiModel(r)).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.prototype._delete=function(t,e,r){return this.http["delete"](t+"/"+e,r).pipe(a.retry(2),a.catchError(function(t){return i.throwError(t)}),a.map(function(t){if(t&&t.data)return d.toJsonModel(o.get(t,"data",{}),o.get(t,"included",null))}))},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:r.HttpClient}]},t}(),y=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/accounts"}return t.prototype.create=function(t,e,r){var n=this.setupRelationships(t,e);return this.jsonApiClient._post(this.resourceUrl,n,r)},t.prototype.readAll=function(t){return this.jsonApiClient._getAll(this.resourceUrl,t)},t.prototype.read=function(t,e){return this.jsonApiClient._get(this.resourceUrl,t,e)},t.prototype.update=function(t,e,r,n){var i=this.setupRelationships(e,r);return this.jsonApiClient._put(this.resourceUrl,t,i,n)},t.prototype["delete"]=function(t,e){return this.jsonApiClient._delete(this.resourceUrl,t,e)},t.prototype.setupRelationships=function(t,e){return t=d.addRelationship(t,{key:"parent",type:"accounts",data:e}),delete(t=d.addRelationship(t,{key:"apps",type:"apps",data:t.apps})).apps,t},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(),g=function(){function t(t,e,r){this.jsonApiClient=t,this._resourceUrl=e,this._config=r,this.config=r,this.resourceUrl=r.baseUrl+e}return t.prototype.create=function(t,e){return this.jsonApiClient._post(this.resourceUrl,t,e)},t.prototype.readAll=function(t){return this.jsonApiClient._getAll(this.resourceUrl,t)},t.prototype.read=function(t,e){return this.jsonApiClient._get(this.resourceUrl,t,e)},t.prototype.update=function(t,e,r){return this.jsonApiClient._put(this.resourceUrl,t,e,r)},t.prototype["delete"]=function(t,e){return this.jsonApiClient._delete(this.resourceUrl,t,e)},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},null,{type:undefined}]},t}(),v=function(r){function t(t,e){return r.call(this,t,"/apps",e)||this}return l(t,r),t.prototype.getStats=function(t){return this.jsonApiClient._get(this.resourceUrl+"/"+t+"/stats")},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(g),j=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceURL=e.baseUrl}return t.prototype.login=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth",t,e)},t.prototype.signup=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/signup",t,e)},t.prototype.impersonate=function(t,e){return this.jsonApiClient._get(this.resourceURL+"/masks/as",t,e)},t.prototype.deImpersonate=function(t){return this.jsonApiClient._get(this.resourceURL+"/masks/up","",t)},t.prototype.sendRecoveryEmail=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth/new_password",{type:"authorization",email:t},e)},t.prototype.validateChangePasswordToken=function(t,e){return this.jsonApiClient._post(this.resourceURL+"/auth/exchange_token",{type:"authorization",token:t},e)},t.prototype.updatePassword=function(e,r,t){var n,i=this,o=this.resourceURL+"/accounts";return this.jsonApiClient._get(o,e,t).pipe(a.flatMap(function(t){return n=f({},t,{password:r}),i.jsonApiClient._put(o,e,n)}),a.map(function(){return n}))},t.decorators=[{type:n.Injectable}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t}(),A=function(r){function t(t,e){return r.call(this,t,"/plugins/geopolis/beacons",e)||this}return l(t,r),t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),m=function(){function t(){}return t.RECIPE_FIRED="RECIPE_FIRED",t.INSTALLATION_CREATEDì="INSTALLATION_CREATED",t.UPLOAD_PROCESSED="UPLOAD_PROCESSED",t.IMAGE_PROCESSED="IMAGE_PROCESSED",t.TEST_DEVICE_ENROLLED="TEST_DEVICE_ENROLLED",t.TEST_DEVICE_UNENROLLED="TEST_DEVICE_UNENROLLED",t.TEST_PUSH_SENT="TEST_PUSH_SENT",t}(),I=function(){function t(t){this.config=t,this.wssUrl=t.wssUrl}return t.prototype.init=function(t,e){var r=u(this.wssUrl+"/apps/"+e+"?jwt="+t,new s.QueueingSubject);this.messages=r.messages,this.connectionStatus=r.connectionStatus},t.prototype.register=function(){return this.messages.pipe(a.retryWhen(function(t){return t?t.delay(1e3):null}),a.map(function(t){return t?JSON.parse(t):t}))},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),b=function(){function t(t,e,r){this.jsonApiClient=t,this.ws=e,this.config=r,this.resourceUrl=r.baseUrl+"/media/images"}return t.prototype.create=function(t,e){return this.jsonApiClient._post(this.resourceUrl,t,e)},t.prototype.upload=function(t,e,r){var n=this;return i.of({name:r.name,image:r.base64,app_id:e,creator_id:t}).pipe(a.flatMap(function(t){return n.create(t)}),a.flatMap(function(t){return n.currentImgId=t.id,n.ws.register()}),a.filter(function(t){return t&&t.event===m.IMAGE_PROCESSED&&t.data.id===n.currentImgId}),a.first(),a.map(function(t){return o.get(t,"data.attributes.image.url")}),a.finalize(function(){return n.currentImgId=null}))},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:I},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject(I),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),_=function(r){function t(t,e){return r.call(this,t,"/installations",e)||this}return l(t,r),t.prototype.sendTestInvitation=function(t,e){return this.jsonApiClient._post(this.config.baseUrl+"/apps/"+t+"/send_test_invitation?email="+e,{})},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),C=function(r){function t(t,e){return r.call(this,t,"/profiles",e)||this}return l(t,r),t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),E=function(r){function t(t,e){return r.call(this,t,"/plugins/push-machine/configurations",e)||this}return l(t,r),t.prototype.convertP12=function(t){return this.jsonApiClient._post(this.config.baseUrl+"/certificates/p12toPEM",t)},t.prototype.sendTestPush=function(t,e){var r=this.config.baseUrl+"/plugins/push-machine/pushes/send_push_test?app_id="+t+"&installation_ids="+e;return this.jsonApiClient._post(r,{})},t.prototype.getTestPushReport=function(t){var e=this.config.baseUrl+"/plugins/push-machine/pushes/test/stats?app_id="+t;return this.jsonApiClient._getAll(e)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(g),w=function(){function t(t,e){this.jsonApiClient=t,this.config=e}return t.prototype.readBillingDetails=function(t){var e=this,r=(new M).byAppId(t).build();return this.jsonApiClient._get(this.config.baseUrl+"/recipes/stats",null,{params:r}).pipe(a.map(function(t){return{active:e.getFirstVal(t.active),limit:e.getFirstVal(t.limits)}}))},t.prototype.readAllBillingDetails=function(){return this.jsonApiClient._get(this.config.baseUrl+"/recipes/stats").pipe(a.map(function(t){var r=t.active,e=t.limits,n=[];return Object.keys(e).forEach(function(t){n.push({id:t,limit:e[t]})}),Object.keys(r).forEach(function(e){var t=n.findIndex(function(t){return t.id===e});t&&(n[t].active=r[e])}),n}))},t.prototype.getFirstVal=function(t){return t[Object.keys(t)[0]]},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),U=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/plugins/thehitman/actions/custom_trigger/bundles"}return t.prototype.create=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._post(this.resourceUrl,e,n)},t.prototype.read=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._get(this.resourceUrl,e,n)},t.prototype.readAll=function(t,e){var r=this.setHeaders(t,e);return this.jsonApiClient._getAll(this.resourceUrl,r)},t.prototype["delete"]=function(t,e,r){var n=this.setHeaders(t,r);return this.jsonApiClient._delete(this.resourceUrl,e,n)},t.prototype.setHeaders=function(t,e){return f({},e,{headers:{"X-Near-App-Id":t}})},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),P=function(){function t(t,e){this.jsonApiClient=t,this.config=e}return t.prototype.read=function(t,e,r){return this.jsonApiClient._get(this.config.baseUrl+"/usage/profiles/apps/"+t+"?month="+e+"&year="+r)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),k=function(){function t(t,e){this.jsonApiClient=t,this.config=e,this.resourceUrl=e.baseUrl+"/plugins/congrego/configurations"}return t.prototype.update=function(t,e,r){var n=this,i={mappings:{},id:t,type:"configurations"};return e.map(function(t){i.mappings[t.id]={kind:t.kind,label:t.label,choices:t.choices,allowed:t.allowed}}),this.jsonApiClient._put(this.resourceUrl,t,i,r).pipe(a.map(function(t){return n.toMappingList(t)}))},t.prototype.read=function(t,e){var r=this;return this.jsonApiClient._get(this.resourceUrl,t,e).pipe(a.map(function(t){return r.toMappingList(t)}))},t.prototype.toMappingList=function(e){var r=[];return Object.keys(e.mappings).forEach(function(t){r.push({id:t,label:e.mappings[t].label,kind:e.mappings[t].kind,choices:e.mappings[t].choices,allowed:e.mappings[t].allowed})}),r},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:h},{type:undefined,decorators:[{type:n.Inject,args:["nrtApiConfig"]}]}]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t(n.inject(h),n.inject("nrtApiConfig"))},token:t,providedIn:"root"}),t}(),S=function(){function t(){}return t.root="root",t.impersonate="impersonate",t.owner="agent",t.developer="app-manager",t.marketer="marketer",t.cashier="cashier",t}(),x=function(){function e(){}return e.getIcon=function(t){switch(t){case e.BOOLEAN:return"type_booleano";case e.DATE:return"calendar_medium";case e.NUMERIC:return"type_number_small";case e.TEXT:return"text_small";case e.LIST:case e.MULTI:return"type_enumeration_small";default:return"icon_not_found"}},e.asArray=function(){return[e.LIST,e.MULTI,e.BOOLEAN,e.DATE,e.NUMERIC,e.TEXT]},e.BOOLEAN="boolean",e.DATE="date",e.NUMERIC="numeric",e.TEXT="text",e.LIST="list",e.MULTI="multi",e}(),O=function(){function t(){}return t.prototype.hasAuthorization=function(t,e){var r,n;try{for(var i=R(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.role===S[a])return!0;if(S[a]===S.impersonate&&t.impersonate)return!0}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return!1},t.prototype.decodeJwt=function(t){return(new e.JwtHelperService).decodeToken(t)},t.prototype.jwtToNrtAccount=function(t){var e=this.decodeJwt(t),r={token:t,id:e.data.account.id,role:e.data.account.role_key};return o.has(e,"data.super_account.role_key")?r.impersonate=e.data.super_account.role_key:delete r.impersonate,r},t.prototype.gotUserInfo=function(t){return null!=t.email},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=n.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),T=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[[y,{provide:"nrtApiConfig",useValue:t}],[O,{provide:"nrtApiConfig",useValue:t}],[v,{provide:"nrtApiConfig",useValue:t}],[j,{provide:"nrtApiConfig",useValue:t}],[A,{provide:"nrtApiConfig",useValue:t}],[b,{provide:"nrtApiConfig",useValue:t}],[_,{provide:"nrtApiConfig",useValue:t}],[h,{provide:"nrtApiConfig",useValue:t}],[C,{provide:"nrtApiConfig",useValue:t}],[E,{provide:"nrtApiConfig",useValue:t}],[k,{provide:"nrtApiConfig",useValue:t}]]}},e.decorators=[{type:n.NgModule,args:[{imports:[p.CommonModule,r.HttpClientModule]}]}],e}(),M=function(){function t(){this.operationFilter={}}return t.prototype.build=function(){return this.operationFilter},t.prototype.pageable=function(t){return this.operationFilter.page=t,this},t.prototype.search=function(t){return this.operationFilter.search=t,this},t.prototype.sortBy=function(t){return this.operationFilter.sort=t,this},t.prototype.include=function(t){return this.operationFilter.include=t,this},t.prototype.byCustomFilter=function(t,e){return this.operationFilter.filter||(this.operationFilter.filter={}),this.operationFilter.filter[t]=e,this},t.prototype.byAppId=function(t){return this.operationFilter=f({},this.operationFilter,{filter:{app_id:t}}),this},t}();t.NrtApiModule=T,t.AccountProviderService=y,t.AppProviderService=v,t.AuthProviderService=j,t.BeaconProviderService=A,t.ImageProviderService=b,t.InstallationProviderService=_,t.ProfileProviderService=C,t.PushConfigurationProviderService=E,t.RecipeProviderService=w,t.InAppEventProviderService=U,t.UsageProviderService=P,t.UserDataMappingProviderService=k,t.NrtRole=S,t.NrtUserDataMappingType=x,t.NrtWsEvents=m,t.NrtWsService=I,t.NrtFilterBuilder=M,t.AccountUtilsService=O,t.ɵg=h,t.ɵa=y,t.ɵb=v,t.ɵc=j,t.ɵd=A,t.ɵe=b,t.ɵf=_,t.ɵh=C,t.ɵk=k,t.ɵj=g,t.ɵi=E,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-nearit-api.umd.min.js.map |
@@ -10,2 +10,4 @@ /** | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
NrtRecipeLimit.prototype.id; | ||
/** @type {?} */ | ||
@@ -16,2 +18,2 @@ NrtRecipeLimit.prototype.active; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXJlY2lwZS1saW1pdC5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1uZWFyaXQtYXBpLyIsInNvdXJjZXMiOlsibGliL21vZGVscy9ucnQtcmVjaXBlLWxpbWl0Lm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSxvQ0FHQzs7O0lBRkcsZ0NBQWU7O0lBQ2YsK0JBQWMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE5ydFJlY2lwZUxpbWl0IHtcbiAgICBhY3RpdmU6IG51bWJlcjtcbiAgICBsaW1pdDogbnVtYmVyO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXJlY2lwZS1saW1pdC5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1uZWFyaXQtYXBpLyIsInNvdXJjZXMiOlsibGliL21vZGVscy9ucnQtcmVjaXBlLWxpbWl0Lm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSxvQ0FJQzs7O0lBSEcsNEJBQVk7O0lBQ1osZ0NBQWU7O0lBQ2YsK0JBQWMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE5ydFJlY2lwZUxpbWl0IHtcbiAgICBpZD86IHN0cmluZztcbiAgICBhY3RpdmU6IG51bWJlcjtcbiAgICBsaW1pdDogbnVtYmVyO1xufVxuIl19 |
@@ -10,9 +10,9 @@ /** | ||
if (false) { | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.count; | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.from; | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.to; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXVzYWdlLm1vZGVsLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LW5lYXJpdC1hcGkvIiwic291cmNlcyI6WyJsaWIvbW9kZWxzL25ydC11c2FnZS5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUEsOEJBSUM7OztJQUhHLHlCQUFjOztJQUNkLHdCQUFXOztJQUNYLHNCQUFTIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBOcnRVc2FnZSB7XG4gICAgY291bnQ6IG51bWJlcjtcbiAgICBmcm9tOiBEYXRlO1xuICAgIHRvOiBEYXRlO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXVzYWdlLm1vZGVsLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LW5lYXJpdC1hcGkvIiwic291cmNlcyI6WyJsaWIvbW9kZWxzL25ydC11c2FnZS5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUEsOEJBSUM7OztJQUhHLHlCQUFlOztJQUNmLHdCQUFZOztJQUNaLHNCQUFVIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBOcnRVc2FnZSB7XG4gICAgY291bnQ/OiBudW1iZXI7XG4gICAgZnJvbT86IERhdGU7XG4gICAgdG8/OiBEYXRlO1xufVxuIl19 |
@@ -34,2 +34,26 @@ /** | ||
/** | ||
* @return {?} | ||
*/ | ||
readAllBillingDetails() { | ||
return this.jsonApiClient._get(`${this.config.baseUrl}/recipes/stats`) | ||
.pipe(map(({ active, limits }) => { | ||
/** @type {?} */ | ||
const recipeStats = []; | ||
Object.keys(limits).forEach(key => { | ||
recipeStats.push({ | ||
id: key, | ||
limit: limits[key] | ||
}); | ||
}); | ||
Object.keys(active).forEach(key => { | ||
/** @type {?} */ | ||
const found = recipeStats.findIndex(item => item.id === key); | ||
if (found) { | ||
recipeStats[found].active = active[key]; | ||
} | ||
}); | ||
return recipeStats; | ||
})); | ||
} | ||
/** | ||
* @private | ||
@@ -68,2 +92,2 @@ * @param {?} obj | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVjaXBlLXByb3ZpZGVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtbmVhcml0LWFwaS8iLCJzb3VyY2VzIjpbImxpYi9wcm92aWRlcnMvcmVjaXBlLXByb3ZpZGVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBQzNFLE9BQU8sRUFBZ0IsZ0JBQWdCLEVBQWtCLE1BQU0sa0JBQWtCLENBQUM7QUFFbEYsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDOzs7QUFNckMsTUFBTSxPQUFPLHFCQUFxQjs7Ozs7SUFFOUIsWUFBb0IsYUFBbUMsRUFDWCxNQUFvQjtRQUQ1QyxrQkFBYSxHQUFiLGFBQWEsQ0FBc0I7UUFDWCxXQUFNLEdBQU4sTUFBTSxDQUFjO0lBQUcsQ0FBQzs7Ozs7SUFFcEUsa0JBQWtCLENBQUMsS0FBYTs7Y0FDdEIsTUFBTSxHQUFHLElBQUksZ0JBQWdCLEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUMsS0FBSyxFQUFFO1FBQzVELE9BQU8sSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQzFCLEdBQUcsSUFBSSxDQ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gICAgICAgIGtleSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjaXBlU3RhdHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBrZXksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0OiBsaW1pdHNba2V5XVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhhY3RpdmUpLmZvckVhY2goXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGZvdW5kID0gcmVjaXBlU3RhdHMuZmluZEluZGV4KCBpdGVtID0+IGl0ZW0uaWQgPT09IGtleSApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmb3VuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNpcGVTdGF0c1tmb3VuZF0uYWN0aXZlID0gYWN0aXZlW2tleV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVjaXBlU3RhdHM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgKSk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBnZXRGaXJzdFZhbChvYmo6IGFueSkge1xuICAgICAgICBjb25zdCBpbmRleCA9IE9iamVjdC5rZXlzKG9iailbMF07XG4gICAgICAgIHJldHVybiBvYmpbaW5kZXhdO1xuICAgIH1cblxufVxuIl19 |
@@ -10,2 +10,4 @@ /** | ||
if (false) { | ||
/** @type {?|undefined} */ | ||
NrtRecipeLimit.prototype.id; | ||
/** @type {?} */ | ||
@@ -16,2 +18,2 @@ NrtRecipeLimit.prototype.active; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXJlY2lwZS1saW1pdC5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1uZWFyaXQtYXBpLyIsInNvdXJjZXMiOlsibGliL21vZGVscy9ucnQtcmVjaXBlLWxpbWl0Lm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSxvQ0FHQzs7O0lBRkcsZ0NBQWU7O0lBQ2YsK0JBQWMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE5ydFJlY2lwZUxpbWl0IHtcbiAgICBhY3RpdmU6IG51bWJlcjtcbiAgICBsaW1pdDogbnVtYmVyO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXJlY2lwZS1saW1pdC5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1uZWFyaXQtYXBpLyIsInNvdXJjZXMiOlsibGliL21vZGVscy9ucnQtcmVjaXBlLWxpbWl0Lm1vZGVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQSxvQ0FJQzs7O0lBSEcsNEJBQVk7O0lBQ1osZ0NBQWU7O0lBQ2YsK0JBQWMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE5ydFJlY2lwZUxpbWl0IHtcbiAgICBpZD86IHN0cmluZztcbiAgICBhY3RpdmU6IG51bWJlcjtcbiAgICBsaW1pdDogbnVtYmVyO1xufVxuIl19 |
@@ -10,9 +10,9 @@ /** | ||
if (false) { | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.count; | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.from; | ||
/** @type {?} */ | ||
/** @type {?|undefined} */ | ||
NrtUsage.prototype.to; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXVzYWdlLm1vZGVsLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LW5lYXJpdC1hcGkvIiwic291cmNlcyI6WyJsaWIvbW9kZWxzL25ydC11c2FnZS5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUEsOEJBSUM7OztJQUhHLHlCQUFjOztJQUNkLHdCQUFXOztJQUNYLHNCQUFTIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBOcnRVc2FnZSB7XG4gICAgY291bnQ6IG51bWJlcjtcbiAgICBmcm9tOiBEYXRlO1xuICAgIHRvOiBEYXRlO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnJ0LXVzYWdlLm1vZGVsLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmd4LW5lYXJpdC1hcGkvIiwic291cmNlcyI6WyJsaWIvbW9kZWxzL25ydC11c2FnZS5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUEsOEJBSUM7OztJQUhHLHlCQUFlOztJQUNmLHdCQUFZOztJQUNaLHNCQUFVIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBOcnRVc2FnZSB7XG4gICAgY291bnQ/OiBudW1iZXI7XG4gICAgZnJvbT86IERhdGU7XG4gICAgdG8/OiBEYXRlO1xufVxuIl19 |
@@ -35,2 +35,30 @@ /** | ||
/** | ||
* @return {?} | ||
*/ | ||
RecipeProviderService.prototype.readAllBillingDetails = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
return this.jsonApiClient._get(this.config.baseUrl + "/recipes/stats") | ||
.pipe(map(function (_a) { | ||
var active = _a.active, limits = _a.limits; | ||
/** @type {?} */ | ||
var recipeStats = []; | ||
Object.keys(limits).forEach(function (key) { | ||
recipeStats.push({ | ||
id: key, | ||
limit: limits[key] | ||
}); | ||
}); | ||
Object.keys(active).forEach(function (key) { | ||
/** @type {?} */ | ||
var found = recipeStats.findIndex(function (item) { return item.id === key; }); | ||
if (found) { | ||
recipeStats[found].active = active[key]; | ||
} | ||
}); | ||
return recipeStats; | ||
})); | ||
}; | ||
/** | ||
* @private | ||
@@ -76,2 +104,2 @@ * @param {?} obj | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVjaXBlLXByb3ZpZGVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtbmVhcml0LWFwaS8iLCJzb3VyY2VzIjpbImxpYi9wcm92aWRlcnMvcmVjaXBlLXByb3ZpZGVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBQzNFLE9BQU8sRUFBZ0IsZ0JBQWdCLEVBQWtCLE1BQU0sa0JBQWtCLENBQUM7QUFFbEYsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDOzs7QUFHckM7SUFLSSwrQkFBb0IsYUFBbUMsRUFDWCxNQUFvQjtRQUQ1QyxrQkFBYSxHQUFiLGFBQWEsQ0FBc0I7UUFDWCxXQUFNLEdBQU4sTUFBTSxDQUFjO0lBQUcsQ0FBQzs7Ozs7SUFFcEUsa0RBQWtCOzs7O0lBQWxCLFVBQW1CLEtBQWE7UUFBaEMsaUJBVUM7O1lBVFMsTUFBTSxHQUFHLElBQUksZ0JBQWdCLEVBQUUsQ0FBQyxPQUFPLENBQ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cbiAgICAgICAgICAgIGAke3RoaXMuY29uZmlnLmJhc2VVcmx9L3JlY2lwZXMvc3RhdHNgKVxuICAgICAgICAgICAgLnBpcGUobWFwKFxuICAgICAgICAgICAgICAgICh7IGFjdGl2ZSwgbGltaXRzIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVjaXBlU3RhdHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmtleXMobGltaXRzKS5mb3JFYWNoKFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWNpcGVTdGF0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGtleSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXQ6IGxpbWl0c1trZXldXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKGFjdGl2ZSkuZm9yRWFjaChcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZm91bmQgPSByZWNpcGVTdGF0cy5maW5kSW5kZXgoIGl0ZW0gPT4gaXRlbS5pZCA9PT0ga2V5ICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvdW5kKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY2lwZVN0YXRzW2ZvdW5kXS5hY3RpdmUgPSBhY3RpdmVba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZWNpcGVTdGF0cztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApKTtcbiAgICB9XG5cbiAgICBwcml2YXRlIGdldEZpcnN0VmFsKG9iajogYW55KSB7XG4gICAgICAgIGNvbnN0IGluZGV4ID0gT2JqZWN0LmtleXMob2JqKVswXTtcbiAgICAgICAgcmV0dXJuIG9ialtpbmRleF07XG4gICAgfVxuXG59XG4iXX0= |
export interface NrtRecipeLimit { | ||
id?: string; | ||
active: number; | ||
limit: number; | ||
} |
export interface NrtUsage { | ||
count: number; | ||
from: Date; | ||
to: Date; | ||
count?: number; | ||
from?: Date; | ||
to?: Date; | ||
} |
@@ -9,3 +9,4 @@ import { JsonApiClientService } from '../json-api/json-api-client.service'; | ||
readBillingDetails(appId: string): Observable<NrtRecipeLimit>; | ||
readAllBillingDetails(): Observable<NrtRecipeLimit[]>; | ||
private getFirstVal; | ||
} |
{ | ||
"name": "ngx-nearit-api", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"homepage": "https://www.nearit.com", | ||
@@ -5,0 +5,0 @@ "author": "Claudio Suardi", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1321658
12287