New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@forlabs/api-bridge

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forlabs/api-bridge - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

bundles/forlabs-api-bridge.umd.min.js

@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@decahedron/entity"),require("@decahedron/entity/dist/src/support/storage"),require("@decahedron/entity/dist/src/support/StringHelper"),require("pluralize"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common/http"),require("@angular/router")):"function"==typeof define&&define.amd?define("@forlabs/api-bridge",["exports","@decahedron/entity","@decahedron/entity/dist/src/support/storage","@decahedron/entity/dist/src/support/StringHelper","pluralize","@angular/core","rxjs","rxjs/operators","@angular/common/http","@angular/router"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).forlabs=e.forlabs||{},e.forlabs["api-bridge"]={}),e.entity,e.storage,e.StringHelper,e.pluralize,e.ng.core,e.rxjs,e.rxjs.operators,e.ng.common.http,e.ng.router)}(this,(function(e,t,r,n,o,i,a,s,u,c){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function l(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}Object.create;function h(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}Object.create;var v=function(e,t,r){this.target=e,this.propertyName=t,this.normalizer=r};var y=function(e){return null!==e?new Date(e):null},g=function(e){return function(t){return"string"==typeof t?t:e.getUriById(t.id,!0)}},b={parseDate:y,objectToUri:g},m=function(){function e(){this.normalizerMetadatas=[]}return e.prototype.addNormalizerMetadata=function(e){this.normalizerMetadatas.push(e)},e.prototype.findNormalizerMetadata=function(e,t){var r=this.normalizerMetadatas.find((function(r){return r.target===e&&r.propertyName===t})),n=this.normalizerMetadatas.find((function(r){return e.prototype instanceof r.target&&r.propertyName===t}));return r||n},e}();var S=new m,E=function(e){function i(){var t=e.apply(this,d(arguments))||this;return t.id=null,t}return l(i,e),i.getIdFromUri=function(e){return e.split("/").pop()},i.getEntityName=function(){throw new Error("getEntityName not implemented")},i.getBaseUri=function(){return"/"+o.plural(this.getEntityName())},i.getUriById=function(e,t){return void 0===t&&(t=!1),(t?"/api":"")+this.getBaseUri()+"/"+e},i.jsonParse2=function(e,o){var i,a;try{for(var s=h(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,p=r.defaultMetadataStorage.findTypeMetadata(e.constructor,c),l=o[c],f=null==p?void 0:p.propertyName;if(!p||null===l||"object"!=typeof l||l instanceof Array)if(p&&l instanceof Array&&l.length>0&&"object"==typeof l[0])e[f]=t.EntityBuilder.buildMany(p.type,l);else if(p)e[f]=l;else{f=t.EntityBuilder.enableCamelConversion?n.StringHelper.toCamel(c):c,e.hasOwnProperty(c)&&(e[f]=l);var d=r.defaultMetadataStorage.findCallback(e.constructor,c);d&&d.condition(e[c])&&(e[c]=d.callback())}else e[f]=t.EntityBuilder.buildOne(p.type,l)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return e},i.normalizeJsonData=function(e){var t,r;try{for(var n=h(Object.keys(e)),o=n.next();!o.done;o=n.next()){var i=o.value,a=S.findNormalizerMetadata(e.constructor,i),s=e[i];a&&(e[i]=a.normalizer(s))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e},i.prototype.fromJson=function(e){var t=i.jsonParse2(this,e);return i.normalizeJsonData(t)},i}(t.Entity);var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(E);var T="full",j="collection",C=function(e){this.parameters=e,this.lock=null};var O="old",U="being_refreshed",I="fresh",x=function(){function e(e){this.maxCacheAge=e,this.cacheExpirationStatuses={}}return e.prototype.resetCacheExpiration=function(e,t,r){this.get(e,t,r).date=new Date},e.prototype.getCacheStatus=function(e,t,r){if(this.getCachedObservable(e,t,r)instanceof a.Observable)return U;var n=this.get(e,t,r).date;return void 0===n?O:(Date.now()-n.valueOf())/1e3<=this.getMaxAge(e,t,r)?I:O},e.prototype.getCachedObservable=function(e,t,r){return this.get(e,t,r).lock},e.prototype.setObservable=function(e,t,r,n){this.get(t,r,n).lock=e},e.prototype.unlock=function(e,t,r){this.get(e,t,r).lock=null},e.prototype.get=function(e,t,r){void 0===this.cacheExpirationStatuses[e]&&(this.cacheExpirationStatuses[e]={}),void 0===this.cacheExpirationStatuses[e][t]&&(this.cacheExpirationStatuses[e][t]=[]);var n=this.cacheExpirationStatuses[e][t].filter((function(e){return e.parameters===r}));n.length;var o=n[0];return void 0===o&&(o=new C(r),this.cacheExpirationStatuses[e][t].push(o)),o},e.prototype.getMaxAge=function(e,t,r){return this.maxCacheAge,this.maxCacheAge},e}();var w=function(){function e(e){this.injector=e,this.dataStore={},this.maxCacheAge=60,this._dataStore$=new a.BehaviorSubject({}),this.dataStore$=this._dataStore$.asObservable(),this.collection$=this.dataStore$.pipe(s.map((function(e){return Object.values(e)}))),this.onInit(),this.createCacheExpirationTracker()}return e.prototype.find=function(e){return this._dataStore$.pipe(s.map((function(t){return t[e]})))},e.prototype.delete=function(e){this.dataStore[e]&&(delete this.dataStore[e],console.log("Deleted "+e+" from data store"),this._dataStore$.next(Object.assign({},this.dataStore)))},e.prototype.onInit=function(){},e.prototype.createCacheExpirationTracker=function(){this.cacheExpirationTracker=new x(this.maxCacheAge)},e.prototype.getCachedObservable=function(e,t,r){return void 0===r&&(r=null),this.cacheExpirationTracker.getCachedObservable(e,t,r)},e.prototype.setObservable=function(e,t,r,n){var o=this;void 0===n&&(n=null);var i=e.pipe(s.tap((function(){return o.cacheExpirationTracker.unlock(t,r,n)})));return this.cacheExpirationTracker.setObservable(i,t,r,n),i},e.prototype.updateDataStore=function(e){var t,r=this;Array.isArray(e)?(t={},e.forEach((function(e){t[r.getItemId(e)]=e}))):t=e,Object.entries(t).forEach((function(e){var t=f(e,2),n=t[0],o=t[1];r.dataStore[n]=o})),console.log("Datastore updated for data service ("+Object.values(t).length+" element(s) updated)",this),this._dataStore$.next(Object.assign({},this.dataStore))},e.prototype.wrapObservable=function(e,t,r,n){var o=this,i=this.getCachedObservable(t,r,n);if(null!==i)return i;var a=e.pipe(s.map((function(e){var i=e.collection,a=e.passthrough;return void 0!==i&&void 0!==a||(i=e,a=e),o.updateDataStore(i),o.cacheExpirationTracker.resetCacheExpiration(t,r,n),void 0!==a?a:i})));return this.setObservable(a,t,r)},e}();w.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[{type:i.Injector}]},w.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new w(i.ɵɵinject(i.INJECTOR))},token:w,providedIn:"root"});var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.loadAll=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),(this.cacheExpirationTracker.getCacheStatus(j,"loadAll",e)===O||t)&&this.wrapObservable(this.getLoadAllObservable(e),j,"loadAll",e).subscribe(),this.collection$},t.prototype.load=function(e,t){if(void 0===t&&(t=!1),this.cacheExpirationTracker.getCacheStatus(T,"load",e)===O||t){var r=this.getLoadObservable(e).pipe(s.map((function(e){return{collection:[e],passthrough:e}})));this.wrapObservable(r,T,"load",e).subscribe()}return this.find(e)},t.prototype.getItemId=function(e){return e.id},t.prototype.getLoadObservable=function(e){throw new Error("Not implemented")},t.prototype.getLoadAllObservable=function(e){throw void 0===e&&(e=null),new Error("Not implemented")},t}(w);A.decorators=[{type:i.Injectable}];var _=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.isRefreshing=!1,t}return l(t,e),t.prototype.init=function(e){this.user$=new a.BehaviorSubject(void 0),this.apiService=e,this.hasUserToken()?this.loadCurrentUser(!0).subscribe():this.user$.next(null)},t.prototype.getUserToken=function(){return this.userToken},t.prototype.hasUserToken=function(){return"string"==typeof this.getUserToken()},t.prototype.setUserTokens=function(e,t){void 0===t&&(t=null),localStorage.setItem("userToken",e),this.userToken=e,null!==t&&(localStorage.setItem("refreshToken",t),this.refreshToken=t)},t.prototype.removeUserTokens=function(){localStorage.removeItem("userToken"),localStorage.removeItem("refreshToken"),this.userToken=void 0,this.refreshToken=void 0},t.prototype.loadCurrentUser=function(e){var t=this;void 0===e&&(e=!1);var r="currentUser";if(this.cacheExpirationTracker.getCacheStatus(T,"load",r)===O||e){var n=this.apiService.getCurrentUser().pipe(s.map((function(e){return t.user$.next(e),{collection:[e],passthrough:e}})));this.wrapObservable(n,T,"load",r).subscribe()}return this.getCurrentUser()},t.prototype.getCurrentUser=function(){return this.convertObservableToBehaviorSubject(this.user$,void 0)},t.prototype.hasCurrentUser=function(){var e=this.getCurrentUser().pipe(s.filter((function(e){return void 0!==e})),s.map((function(e){return null!==e})));return this.convertObservableToBehaviorSubject(e,void 0)},t.prototype.refreshUserToken=function(){var e=this,t={refresh_token:this.refreshToken};return this.apiService.post("/token/refresh",t).pipe(s.map((function(t){var r=t.token,n=t.refresh_token;return e.setUserTokens(r,n),!0})))},t.prototype.login=function(e,t){var r=this,n={username:e,password:t};return this.apiService.post(this.apiLoginUrl,n,{errorPassthrough:!1}).pipe(s.concatMap((function(e){var t=e.token,n=e.refresh_token;return r.setUserTokens(t,n),r.loadCurrentUser(!0).pipe(s.filter((function(e){return null!==e})),s.first())})))},t.prototype.logout=function(){var e=this;return a.of(null).pipe(s.map((function(){e.removeUserTokens(),e.user$.next(null)})))},t.prototype.patch=function(e,t){console.log("todo")},t.prototype.getRolesCurrentUser=function(){return this.user$.pipe(s.map((function(e){if(e)return e.getRoles()})))},t.prototype.isGranted=function(e){return this.getRolesCurrentUser().pipe(s.map((function(t){if(t)return t.includes(e)})))},t.prototype.onInit=function(){this.userToken=localStorage.getItem("userToken"),this.refreshToken=localStorage.getItem("refreshToken")},t.prototype.convertObservableToBehaviorSubject=function(e,t){var r=new a.BehaviorSubject(t);return e.subscribe({complete:function(){return r.complete()},error:function(e){return r.error(e)},next:function(e){return r.next(e)}}),r},t}(A);_.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],_.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new _(i.ɵɵinject(i.INJECTOR))},token:_,providedIn:"root"});var P=function(){function e(e){this.currentUserService=e}return e.prototype.intercept=function(e,r){var n=this;return r.handle(e).pipe(s.tap((function(e){if(e instanceof u.HttpResponse&&e.hasOwnProperty("body")){var r=e.body.currentUser;if(!r)return;var o=t.EntityBuilder.buildOne(k,r);n.currentUserService.user$.next(o),delete e.body.currentUser}})))},e}();P.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],P.ctorParameters=function(){return[{type:_}]},P.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new P(i.ɵɵinject(_))},token:P,providedIn:"root"});var H=function(e){function t(t,r){var n=e.call(this,{fromObject:r})||this;return n.interceptorConfig=t,n}return l(t,e),t}(u.HttpParams);var N=function(){function e(e,t){this.httpClient=e,this.router=t,this.apiUrl=this.getApiUrl()}return e.checkOptions=function(e){return e&&(e.errorPassthrough||e.dontSetContentTypeHeader)&&(e.params instanceof H?(e.params.interceptorConfig.errorPassthrough=!0,e.params.interceptorConfig.dontSetContentTypeHeader=!0):e.params=new H({errorPassthrough:null==e?void 0:e.errorPassthrough,dontSetContentTypeHeader:null==e?void 0:e.dontSetContentTypeHeader},e.params)),e},e.prototype.getEntityCollection=function(e,r){return this.get(null!=r?r:e.getBaseUri()).pipe(s.map((function(r){return t.EntityBuilder.buildMany(e,r)})))},e.prototype.getEntity=function(e,r,n){return this.get(null!=n?n:e.getUriById(r)).pipe(s.map((function(r){return t.EntityBuilder.buildOne(e,r)})))},e.prototype.putEntity=function(e,t,r,n){return this.put(null!=n?n:e.getUriById(r),t)},e.prototype.postEntity=function(e,t,r,n){return this.post(null!=n?n:e.getUriById(r),t)},e.prototype.deleteEntity=function(e,t,r){return this.delete(null!=r?r:e.getUriById(t))},e.prototype.get=function(t,r){return r=e.checkOptions(r),this.httpClient.get(this.apiUrl+t,r)},e.prototype.post=function(t,r,n){return n=e.checkOptions(n),this.httpClient.post(this.apiUrl+t,r,n)},e.prototype.put=function(t,r,n){return n=e.checkOptions(n),this.httpClient.put(this.apiUrl+t,n)},e.prototype.delete=function(t,r){return r=e.checkOptions(r),this.httpClient.delete(this.apiUrl+t,r).pipe(s.delay(2e3))},e.prototype.patch=function(t,r,n,o){return o&&(r=Object.keys(r).filter((function(e){return o.indexOf(e)>=0})).reduce((function(e,t){var n;return Object.assign(e,((n={})[t]=r[t],n))}),{})),void 0===n&&(n={headers:new u.HttpHeaders({"Content-Type":"application/merge-patch+json"})}),n=e.checkOptions(n),this.httpClient.patch(this.apiUrl+t,r,n)},e}();N.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],N.ctorParameters=function(){return[{type:u.HttpClient},{type:c.Router}]},N.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new N(i.ɵɵinject(u.HttpClient),i.ɵɵinject(c.Router))},token:N,providedIn:"root"});var B=function(){this.message$=new a.Subject};B.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],B.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new B},token:B,providedIn:"root"});var M=function(){function e(e){this.currentUserService=e,this.isLoading=!1}return e.prototype.intercept=function(e,t){return t.handle(this.clonedRequestsWithProperHeaders(e))},e.prototype.clonedRequestsWithProperHeaders=function(e){var t=e.headers,r=e.params instanceof H?e.params.interceptorConfig:{};return this.currentUserService.hasUserToken()&&(/\/\/[^/]+\/api\/(authentication|refresh)_token$/.exec(e.url)||(t=t.set("Authorization","Bearer "+this.currentUserService.getUserToken()))),"OPTIONS"===e.method||e.headers.has("Content-Type")||(null==r?void 0:r.dontSetContentTypeHeader)||(t=t.set("Content-Type","application/json")),t=t.set("Accept","application/json"),e.clone({headers:t})},e}();M.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],M.ctorParameters=function(){return[{type:_}]},M.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new M(i.ɵɵinject(_))},token:M,providedIn:"root"});var R="02a35cd6-8a6e-11eb-8dcd-0242ac130003",z=function(){function e(e,t,r,n){this.currentUserService=e,this.router=t,this.httpRequestInterceptor=r,this.errorEventService=n,this.refreshSubject=new a.Subject}return e.prototype.intercept=function(e,t){var r=this;return t.handle(e).pipe(s.catchError((function(n,o){var i,c,p,l;if(!(n instanceof u.HttpErrorResponse))return a.throwError(n);if(e.params instanceof H&&e.params.interceptorConfig.errorPassthrough)return a.throwError(n);var h=null===(i=n.error)||void 0===i?void 0:i.uuid,f=null!==(l=null!==(p=null===(c=n.error)||void 0===c?void 0:c.message)&&void 0!==p?p:n.message)&&void 0!==l?l:n.toString();switch(r.errorEventService.message$.next({message:f,error:n}),!0){case h===R:return r.refreshUserToken().pipe(s.switchMap((function(n){return n?t.handle(r.httpRequestInterceptor.clonedRequestsWithProperHeaders(e)):r.currentUserService.logout()})));case 401===n.status:return r.currentUserService.logout();case 403===n.status:default:return a.throwError(n)}})))},e.prototype.refreshUserToken=function(){var e=this;return 0===this.refreshSubject.observers.length&&(this.refreshSubject.subscribe({complete:function(){return e.refreshSubject=new a.Subject}}),this.currentUserService.refreshUserToken().subscribe(this.refreshSubject)),this.refreshSubject},e.prototype.isExpiredTokenError=function(e){var t;return 401===e.status&&"Expired JWT Token"===(null===(t=e)||void 0===t?void 0:t.error.message)},e}();z.decorators=[{type:i.Injectable}],z.ctorParameters=function(){return[{type:_},{type:c.Router},{type:M},{type:B}]},e.AbstractApiService=N,e.AbstractCurrentUserService=_,e.AbstractDataService=w,e.AbstractEntity=E,e.AbstractEntitydataService=A,e.AbstractUser=k,e.CACHE_STATUS_BEING_REFRESHED=U,e.CACHE_STATUS_FRESH=I,e.CACHE_STATUS_OLD=O,e.CacheExpirationTracker=x,e.CurrentUserInterceptor=P,e.ErrorEventService=B,e.ErrorInterceptor=z,e.HttpRequestInterceptor=M,e.InterceptorHttpParams=H,e.LOAD_TYPE_COLLECTION=j,e.LOAD_TYPE_FULL=T,e.LOAD_TYPE_UNSPECIFIED="unspecified",e.NORMALIZERS=b,e.Normalizer=function(e){return function(t,r){var n=new v(t,r,e);S.addNormalizerMetadata(n)}},e.NormalizerMetadata=v,e.NormalizerMetadataStorage=m,e.defaultNormalizerMetadataStorage=S,Object.defineProperty(e,"__esModule",{value:!0})}));
***************************************************************************** */var p=function(e,t){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function l(e,t){function r(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}Object.create;function h(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}Object.create;var v=function(e,t,r){this.target=e,this.propertyName=t,this.normalizer=r};var y=function(e){return null!==e?new Date(e):null},g=function(e){return function(t){return"string"==typeof t?t:e.getUriById(t.id,!0)}},b={parseDate:y,objectToUri:g},m=function(){function e(){this.normalizerMetadatas=[]}return e.prototype.addNormalizerMetadata=function(e){this.normalizerMetadatas.push(e)},e.prototype.findNormalizerMetadata=function(e,t){var r=this.normalizerMetadatas.find((function(r){return r.target===e&&r.propertyName===t})),n=this.normalizerMetadatas.find((function(r){return e.prototype instanceof r.target&&r.propertyName===t}));return r||n},e}();var S=new m,E=function(e){function i(){var t=e.apply(this,d(arguments))||this;return t.id=null,t}return l(i,e),i.getIdFromUri=function(e){return e.split("/").pop()},i.getEntityName=function(){throw new Error("getEntityName not implemented")},i.getBaseUri=function(){return"/"+o.plural(this.getEntityName())},i.getUriById=function(e,t){return void 0===t&&(t=!1),(t?"/api":"")+this.getBaseUri()+"/"+e},i.jsonParse2=function(e,o){var i,a;try{for(var s=h(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,p=r.defaultMetadataStorage.findTypeMetadata(e.constructor,c),l=o[c],f=null==p?void 0:p.propertyName;if(!p||null===l||"object"!=typeof l||l instanceof Array)if(p&&l instanceof Array&&l.length>0&&"object"==typeof l[0])e[f]=t.EntityBuilder.buildMany(p.type,l);else if(p)e[f]=l;else{f=t.EntityBuilder.enableCamelConversion?n.StringHelper.toCamel(c):c,e.hasOwnProperty(c)&&(e[f]=l);var d=r.defaultMetadataStorage.findCallback(e.constructor,c);d&&d.condition(e[c])&&(e[c]=d.callback())}else e[f]=t.EntityBuilder.buildOne(p.type,l)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return e},i.normalizeJsonData=function(e){var t,r;try{for(var n=h(Object.keys(e)),o=n.next();!o.done;o=n.next()){var i=o.value,a=S.findNormalizerMetadata(e.constructor,i),s=e[i];a&&(e[i]=a.normalizer(s))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e},i.prototype.fromJson=function(e){var t=i.jsonParse2(this,e);return i.normalizeJsonData(t)},i}(t.Entity);var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(E);var T="full",j="collection",C=function(e){this.parameters=e,this.lock=null};var O="old",U="being_refreshed",I="fresh",x=function(){function e(e){this.maxCacheAge=e,this.cacheExpirationStatuses={}}return e.prototype.resetCacheExpiration=function(e,t,r){this.get(e,t,r).date=new Date},e.prototype.getCacheStatus=function(e,t,r){if(this.getCachedObservable(e,t,r)instanceof a.Observable)return U;var n=this.get(e,t,r).date;return void 0===n?O:(Date.now()-n.valueOf())/1e3<=this.getMaxAge(e,t,r)?I:O},e.prototype.getCachedObservable=function(e,t,r){return this.get(e,t,r).lock},e.prototype.setObservable=function(e,t,r,n){this.get(t,r,n).lock=e},e.prototype.unlock=function(e,t,r){this.get(e,t,r).lock=null},e.prototype.get=function(e,t,r){void 0===this.cacheExpirationStatuses[e]&&(this.cacheExpirationStatuses[e]={}),void 0===this.cacheExpirationStatuses[e][t]&&(this.cacheExpirationStatuses[e][t]=[]);var n=this.cacheExpirationStatuses[e][t].filter((function(e){return e.parameters===r}));n.length;var o=n[0];return void 0===o&&(o=new C(r),this.cacheExpirationStatuses[e][t].push(o)),o},e.prototype.getMaxAge=function(e,t,r){return this.maxCacheAge,this.maxCacheAge},e}();var w=function(){function e(e){this.injector=e,this.dataStore={},this.maxCacheAge=60,this._dataStore$=new a.BehaviorSubject({}),this.dataStore$=this._dataStore$.asObservable(),this.collection$=this.dataStore$.pipe(s.map((function(e){return Object.values(e)}))),this.onInit(),this.createCacheExpirationTracker()}return e.prototype.find=function(e){return this._dataStore$.pipe(s.map((function(t){return t[e]})))},e.prototype.delete=function(e){this.dataStore[e]&&(delete this.dataStore[e],console.log("Deleted "+e+" from data store"),this._dataStore$.next(Object.assign({},this.dataStore)))},e.prototype.onInit=function(){},e.prototype.createCacheExpirationTracker=function(){this.cacheExpirationTracker=new x(this.maxCacheAge)},e.prototype.getCachedObservable=function(e,t,r){return void 0===r&&(r=null),this.cacheExpirationTracker.getCachedObservable(e,t,r)},e.prototype.setObservable=function(e,t,r,n){var o=this;void 0===n&&(n=null);var i=e.pipe(s.tap((function(){return o.cacheExpirationTracker.unlock(t,r,n)})));return this.cacheExpirationTracker.setObservable(i,t,r,n),i},e.prototype.updateDataStore=function(e){var t,r=this;Array.isArray(e)?(t={},e.forEach((function(e){t[r.getItemId(e)]=e}))):t=e,Object.entries(t).forEach((function(e){var t=f(e,2),n=t[0],o=t[1];r.dataStore[n]=o})),console.log("Datastore updated for data service ("+Object.values(t).length+" element(s) updated)",this),this._dataStore$.next(Object.assign({},this.dataStore))},e.prototype.wrapObservable=function(e,t,r,n){var o=this,i=this.getCachedObservable(t,r,n);if(null!==i)return i;var a=e.pipe(s.map((function(e){var i=e.collection,a=e.passthrough;return void 0!==i&&void 0!==a||(i=e,a=e),o.updateDataStore(i),o.cacheExpirationTracker.resetCacheExpiration(t,r,n),void 0!==a?a:i})));return this.setObservable(a,t,r)},e}();w.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[{type:i.Injector}]},w.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new w(i.ɵɵinject(i.INJECTOR))},token:w,providedIn:"root"});var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.loadAll=function(e,t){return void 0===e&&(e=null),void 0===t&&(t=!1),(this.cacheExpirationTracker.getCacheStatus(j,"loadAll",e)===O||t)&&this.wrapObservable(this.getLoadAllObservable(e),j,"loadAll",e).subscribe(),this.collection$},t.prototype.load=function(e,t){if(void 0===t&&(t=!1),this.cacheExpirationTracker.getCacheStatus(T,"load",e)===O||t){var r=this.getLoadObservable(e).pipe(s.map((function(e){return{collection:[e],passthrough:e}})));this.wrapObservable(r,T,"load",e).subscribe()}return this.find(e)},t.prototype.getItemId=function(e){return e.id},t.prototype.getLoadObservable=function(e){throw new Error("Not implemented")},t.prototype.getLoadAllObservable=function(e){throw void 0===e&&(e=null),new Error("Not implemented")},t}(w);A.decorators=[{type:i.Injectable}];var _=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.isRefreshing=!1,t}return l(t,e),t.prototype.init=function(e){this.user$=new a.BehaviorSubject(void 0),this.apiService=e,this.hasUserToken()?this.loadCurrentUser(!0).subscribe():this.user$.next(null)},t.prototype.getUserToken=function(){return this.userToken},t.prototype.hasUserToken=function(){return"string"==typeof this.getUserToken()},t.prototype.setUserTokens=function(e,t){void 0===t&&(t=null),localStorage.setItem("userToken",e),this.userToken=e,null!==t&&(localStorage.setItem("refreshToken",t),this.refreshToken=t)},t.prototype.removeUserTokens=function(){localStorage.removeItem("userToken"),localStorage.removeItem("refreshToken"),this.userToken=void 0,this.refreshToken=void 0},t.prototype.loadCurrentUser=function(e){var t=this;void 0===e&&(e=!1);var r="currentUser";if(this.cacheExpirationTracker.getCacheStatus(T,"load",r)===O||e){var n=this.apiService.getCurrentUser().pipe(s.map((function(e){return t.user$.next(e),{collection:[e],passthrough:e}})));this.wrapObservable(n,T,"load",r).subscribe()}return this.getCurrentUser()},t.prototype.getCurrentUser=function(){return this.convertObservableToBehaviorSubject(this.user$,void 0)},t.prototype.hasCurrentUser=function(){var e=this.getCurrentUser().pipe(s.filter((function(e){return void 0!==e})),s.map((function(e){return null!==e})));return this.convertObservableToBehaviorSubject(e,void 0)},t.prototype.refreshUserToken=function(){var e=this,t={refresh_token:this.refreshToken};return this.apiService.post("/token/refresh",t).pipe(s.map((function(t){var r=t.token,n=t.refresh_token;return e.setUserTokens(r,n),!0})))},t.prototype.login=function(e,t){var r=this,n={username:e,password:t};return this.apiService.post(this.apiLoginUrl,n,{errorPassthrough:!1}).pipe(s.concatMap((function(e){var t=e.token,n=e.refresh_token;return r.setUserTokens(t,n),r.loadCurrentUser(!0).pipe(s.filter((function(e){return null!==e})),s.first())})))},t.prototype.logout=function(){var e=this;return a.of(null).pipe(s.map((function(){e.removeUserTokens(),e.user$.next(null)})))},t.prototype.patch=function(e,t){console.log("todo")},t.prototype.getRolesCurrentUser=function(){return this.user$.pipe(s.map((function(e){if(e)return e.getRoles()})))},t.prototype.isGranted=function(e){return this.getRolesCurrentUser().pipe(s.map((function(t){if(t)return t.includes(e)})))},t.prototype.onInit=function(){this.userToken=localStorage.getItem("userToken"),this.refreshToken=localStorage.getItem("refreshToken")},t.prototype.convertObservableToBehaviorSubject=function(e,t){var r=new a.BehaviorSubject(t);return e.subscribe({complete:function(){return r.complete()},error:function(e){return r.error(e)},next:function(e){return r.next(e)}}),r},t}(A);_.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],_.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new _(i.ɵɵinject(i.INJECTOR))},token:_,providedIn:"root"});var P=function(){function e(e){this.currentUserService=e}return e.prototype.intercept=function(e,r){var n=this;return r.handle(e).pipe(s.tap((function(e){if(e instanceof u.HttpResponse&&e.hasOwnProperty("body")&&null!==e.body){var r=e.body.currentUser;if(!r)return;var o=t.EntityBuilder.buildOne(k,r);n.currentUserService.user$.next(o),delete e.body.currentUser}})))},e}();P.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],P.ctorParameters=function(){return[{type:_}]},P.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new P(i.ɵɵinject(_))},token:P,providedIn:"root"});var H=function(e){function t(t,r){var n=e.call(this,{fromObject:r})||this;return n.interceptorConfig=t,n}return l(t,e),t}(u.HttpParams);var N=function(){function e(e,t){this.httpClient=e,this.router=t,this.apiUrl=this.getApiUrl()}return e.checkOptions=function(e){return e&&(e.errorPassthrough||e.dontSetContentTypeHeader)&&(e.params instanceof H?(e.params.interceptorConfig.errorPassthrough=!0,e.params.interceptorConfig.dontSetContentTypeHeader=!0):e.params=new H({errorPassthrough:null==e?void 0:e.errorPassthrough,dontSetContentTypeHeader:null==e?void 0:e.dontSetContentTypeHeader},e.params)),e},e.prototype.getEntityCollection=function(e,r){return this.get(null!=r?r:e.getBaseUri()).pipe(s.map((function(r){return t.EntityBuilder.buildMany(e,r)})))},e.prototype.getEntity=function(e,r,n){return this.get(null!=n?n:e.getUriById(r)).pipe(s.map((function(r){return t.EntityBuilder.buildOne(e,r)})))},e.prototype.putEntity=function(e,t,r,n){return this.put(null!=n?n:e.getUriById(r),t)},e.prototype.postEntity=function(e,t,r,n){return this.post(null!=n?n:e.getUriById(r),t)},e.prototype.deleteEntity=function(e,t,r){return this.delete(null!=r?r:e.getUriById(t))},e.prototype.get=function(t,r){return r=e.checkOptions(r),this.httpClient.get(this.apiUrl+t,r)},e.prototype.post=function(t,r,n){return n=e.checkOptions(n),this.httpClient.post(this.apiUrl+t,r,n)},e.prototype.put=function(t,r,n){return n=e.checkOptions(n),this.httpClient.put(this.apiUrl+t,n)},e.prototype.delete=function(t,r){return r=e.checkOptions(r),this.httpClient.delete(this.apiUrl+t,r).pipe(s.delay(2e3))},e.prototype.patch=function(t,r,n,o){return o&&(r=Object.keys(r).filter((function(e){return o.indexOf(e)>=0})).reduce((function(e,t){var n;return Object.assign(e,((n={})[t]=r[t],n))}),{})),void 0===n&&(n={headers:new u.HttpHeaders({"Content-Type":"application/merge-patch+json"})}),n=e.checkOptions(n),this.httpClient.patch(this.apiUrl+t,r,n)},e}();N.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],N.ctorParameters=function(){return[{type:u.HttpClient},{type:c.Router}]},N.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new N(i.ɵɵinject(u.HttpClient),i.ɵɵinject(c.Router))},token:N,providedIn:"root"});var B=function(){this.message$=new a.Subject};B.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],B.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new B},token:B,providedIn:"root"});var M=function(){function e(e){this.currentUserService=e,this.isLoading=!1}return e.prototype.intercept=function(e,t){return t.handle(this.clonedRequestsWithProperHeaders(e))},e.prototype.clonedRequestsWithProperHeaders=function(e){var t=e.headers,r=e.params instanceof H?e.params.interceptorConfig:{};return this.currentUserService.hasUserToken()&&(/\/\/[^/]+\/api\/(authentication|refresh)_token$/.exec(e.url)||(t=t.set("Authorization","Bearer "+this.currentUserService.getUserToken()))),"OPTIONS"===e.method||e.headers.has("Content-Type")||(null==r?void 0:r.dontSetContentTypeHeader)||(t=t.set("Content-Type","application/json")),t=t.set("Accept","application/json"),e.clone({headers:t})},e}();M.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],M.ctorParameters=function(){return[{type:_}]},M.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new M(i.ɵɵinject(_))},token:M,providedIn:"root"});var R="02a35cd6-8a6e-11eb-8dcd-0242ac130003",z=function(){function e(e,t,r,n){this.currentUserService=e,this.router=t,this.httpRequestInterceptor=r,this.errorEventService=n,this.refreshSubject=new a.Subject}return e.prototype.intercept=function(e,t){var r=this;return t.handle(e).pipe(s.catchError((function(n,o){var i,c,p,l;if(!(n instanceof u.HttpErrorResponse))return a.throwError(n);if(e.params instanceof H&&e.params.interceptorConfig.errorPassthrough)return a.throwError(n);var h=null===(i=n.error)||void 0===i?void 0:i.uuid,f=null!==(l=null!==(p=null===(c=n.error)||void 0===c?void 0:c.message)&&void 0!==p?p:n.message)&&void 0!==l?l:n.toString();switch(r.errorEventService.message$.next({message:f,error:n}),!0){case h===R:return r.refreshUserToken().pipe(s.switchMap((function(n){return n?t.handle(r.httpRequestInterceptor.clonedRequestsWithProperHeaders(e)):r.currentUserService.logout()})));case 401===n.status:return r.currentUserService.logout();case 403===n.status:default:return a.throwError(n)}})))},e.prototype.refreshUserToken=function(){var e=this;return 0===this.refreshSubject.observers.length&&(this.refreshSubject.subscribe({complete:function(){return e.refreshSubject=new a.Subject}}),this.currentUserService.refreshUserToken().subscribe(this.refreshSubject)),this.refreshSubject},e.prototype.isExpiredTokenError=function(e){var t;return 401===e.status&&"Expired JWT Token"===(null===(t=e)||void 0===t?void 0:t.error.message)},e}();z.decorators=[{type:i.Injectable}],z.ctorParameters=function(){return[{type:_},{type:c.Router},{type:M},{type:B}]},e.AbstractApiService=N,e.AbstractCurrentUserService=_,e.AbstractDataService=w,e.AbstractEntity=E,e.AbstractEntitydataService=A,e.AbstractUser=k,e.CACHE_STATUS_BEING_REFRESHED=U,e.CACHE_STATUS_FRESH=I,e.CACHE_STATUS_OLD=O,e.CacheExpirationTracker=x,e.CurrentUserInterceptor=P,e.ErrorEventService=B,e.ErrorInterceptor=z,e.HttpRequestInterceptor=M,e.InterceptorHttpParams=H,e.LOAD_TYPE_COLLECTION=j,e.LOAD_TYPE_FULL=T,e.LOAD_TYPE_UNSPECIFIED="unspecified",e.NORMALIZERS=b,e.Normalizer=function(e){return function(t,r){var n=new v(t,r,e);S.addNormalizerMetadata(n)}},e.NormalizerMetadata=v,e.NormalizerMetadataStorage=m,e.defaultNormalizerMetadataStorage=S,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=forlabs-api-bridge.umd.min.js.map

@@ -32,3 +32,3 @@ /**

(event) => {
if (event instanceof HttpResponse && event.hasOwnProperty('body')) {
if (event instanceof HttpResponse && event.hasOwnProperty('body') && event.body !== null) {
const { currentUser } = event.body;

@@ -67,2 +67,2 @@ if (!currentUser) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVudC11c2VyLmludGVyY2VwdG9yLmpzIiwic291cmNlUm9vdCI6Ii4uLy4uLy4uLy4uL3Byb2plY3RzL2FwaS1icmlkZ2Uvc3JjLyIsInNvdXJjZXMiOlsibGliL2ludGVyY2VwdG9yL2N1cnJlbnQtdX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ityBuilder } from '@decahedron/entity';

(event) => {
if (event instanceof HttpResponse && event.hasOwnProperty('body')) {
if (event instanceof HttpResponse && event.hasOwnProperty('body') && event.body !== null) {
const { currentUser } = event.body;

@@ -1147,0 +1147,0 @@ if (!currentUser) {

{
"name": "@forlabs/api-bridge",
"version": "0.0.7",
"version": "0.0.8",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "^7.2.0",

@@ -11,2 +11,3 @@ # ApiBridge

## Build
CHANGE VERSION IN PACKAGE.json

@@ -13,0 +14,0 @@ Run `ng build api-bridge --prod` to build the project. The build artifacts will be stored in the `dist/` directory.

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 not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc