@frontegg/angular 5.34.0 → 5.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/bundles/frontegg-angular.umd.js +1 -1
- package/bundles/frontegg-angular.umd.js.map +1 -1
- package/bundles/frontegg-angular.umd.min.js +1 -1
- package/bundles/frontegg-angular.umd.min.js.map +1 -1
- package/esm2015/sdkVersion.js +2 -2
- package/fesm2015/frontegg-angular.js +1 -1
- package/fesm2015/frontegg-angular.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@frontegg/js"),require("@frontegg/redux-store"),require("rxjs"),require("@frontegg/rest-api"),require("rxjs/operators"),require("fast-deep-equal")):"function"==typeof define&&define.amd?define("@frontegg/angular",["exports","@angular/core","@angular/common","@angular/router","@frontegg/js","@frontegg/redux-store","rxjs","@frontegg/rest-api","rxjs/operators","fast-deep-equal"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).frontegg=t.frontegg||{},t.frontegg.angular={}),t.ng.core,t.ng.common,t.ng.router,t.FronteggJS,t.FronteggReduxStore,t.rxjs,t.FronteggRestApi,t.rxjs.operators,t.FastDeepEqual)}(this,(function(t,e,n,i,o,r,c,a,s,u){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function h(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=h(e),f=h(i),S=l(u),d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function b(t,e,n,i){return new(n||(n=Promise))((function(o,r){function c(t){try{s(i.next(t))}catch(t){r(t)}}function a(t){try{s(i.throw(t))}catch(t){r(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,a)}s((i=i.apply(t,e||[])).next())}))}function g(t,e){var n,i,o,r,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return c.label++,{value:r[1],done:!1};case 5:c.label++,i=r[1],r=[0];continue;case 7:r=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){c=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){c.label=r[1];break}if(6===r[0]&&c.label<o[1]){c.label=o[1],o=r;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(r);break}o[2]&&c.ops.pop(),c.trys.pop();continue}r=e.call(t,c)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}Object.create;function A(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)c.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return c}function v(t,e){for(var n=0,i=e.length,o=t.length;n<i;n++,o++)t[o]=e[n];return t}Object.create;var j=function(){function t(t){this.fronteggAppService=t}return t.prototype.canActivate=function(t,e){var n=this;return new c.Observable((function(t){n.fronteggAppService.isLoading$.subscribe((function(e){e||t.next(!0)}))}))},t}();j.decorators=[{type:e.Injectable}],j.ctorParameters=function(){return[{type:w}]};var P=function(){};P.decorators=[{type:e.Component,args:[{selector:"frontegg",template:""}]}];var m="5.34.0",O=function(){this.contextOptions={baseUrl:"https://sub-domain.frontegg.com"}},w=function(){function t(t,e,n){var i,s=this;if(this.config=t,this.router=e,this.ngZone=n,this.isLoadingSubject=new c.BehaviorSubject(!0),this.isAuthenticatedSubject=new c.BehaviorSubject(!1),this.stateSubject=new c.BehaviorSubject({}),this.authStateSubject=new c.BehaviorSubject({isLoading:!0,isAuthenticated:!1}),this.entitlementsStateSubject=new c.BehaviorSubject(void 0),this.auditsStateSubject=new c.BehaviorSubject({}),this.connectivityStateSubject=new c.BehaviorSubject({}),this.subscriptionsStateSubject=new c.BehaviorSubject({}),this.vendorStateSubject=new c.BehaviorSubject({}),!this.config)throw Error("Need to pass config: FronteggConfigOptions in FronteggAppModule.forRoot(config)");window.CYPRESS_CONFIG&&(this.config=window.CYPRESS_CONFIG);var u=function(e,n){var i,o=window.location.origin,c=e;c.startsWith(o)&&"/"!==o&&(c=c.substring(o.length-1)),((null==n?void 0:n.preserveQueryParams)||r.isAuthRoute(c,null===(i=t.authOptions)||void 0===i?void 0:i.routes))&&(c=""+c+window.location.search),(null==n?void 0:n.refresh)?window.location.href=c:s.ngZone.run((function(){(null==n?void 0:n.replace)?s.router.navigateByUrl(c,{replaceUrl:!0}):s.router.navigateByUrl(c)}))};(null!==(i=this.config)&&void 0!==i?i:{}).contextOptions.metadataHeaders={fronteggSdkVersion:"@frontegg/angular@"+m,framework:a.FronteggFrameworks.Angular},a.ContextHolder.setOnRedirectTo(u),this.fronteggApp=o.initialize(Object.assign({onRedirectTo:u},this.config)),this.router.resetConfig(v(v([],y(this.mapAuthComponents)),[{path:"",canActivate:[j],children:v([],y(this.router.config))}]));var l=this.fronteggApp.store.getState();this.updateState(l),this.fronteggApp.store.subscribe((function(){s.updateState(s.fronteggApp.store.getState())}))}return Object.defineProperty(t.prototype,"state$",{get:function(){return this.stateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authState$",{get:function(){return this.authStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"auditsState$",{get:function(){return this.auditsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectivityState$",{get:function(){return this.connectivityStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionsState$",{get:function(){return this.subscriptionsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendorState$",{get:function(){return this.vendorStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading$",{get:function(){return this.isLoadingSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.entitlements$=function(t,e){var n=new c.BehaviorSubject([]),i=this.entitlementsStateSubject.subscribe((function(e){n.next(r.getEntitlements(null!=e?e:{},t))})),o=n.asObservable().subscribe(e),a=o.unsubscribe.bind(o);return o.unsubscribe=function(){a(),i.unsubscribe()},o},Object.defineProperty(t.prototype,"isAuthenticated$",{get:function(){return this.isAuthenticatedSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.updateState=function(t){var e;this.isLoadingSubject.getValue()!==t.auth.isLoading&&this.isLoadingSubject.next(t.auth.isLoading),this.isAuthenticatedSubject.getValue()!==t.auth.isAuthenticated&&this.isAuthenticatedSubject.next(t.auth.isAuthenticated),this.stateSubject.next(t),this.authStateSubject.next(t.auth),this.entitlementsStateSubject.next(null===(e=t.auth.entitlementsState)||void 0===e?void 0:e.entitlements),this.auditsStateSubject.next(t.audits),this.connectivityStateSubject.next(t.connectivity),this.subscriptionsStateSubject.next(t.subscriptions),this.vendorStateSubject.next(t.vendor)},Object.defineProperty(t.prototype,"mapAuthComponents",{get:function(){var t=this.authRoutes;return Object.keys(t).filter((function(t){return"authenticatedUrl"!==t&&"signUpSuccessUrl"!==t&&null!=t})).map((function(e){var n;return{path:null===(n=t[e])||void 0===n?void 0:n.substring(1),component:P}}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authRoutes",{get:function(){return this.fronteggApp.store.getState().auth.routes},enumerable:!1,configurable:!0}),t.prototype.showAdminPortal=function(){this.fronteggApp.showAdminPortal()},t.prototype.hideAdminPortal=function(){var t;null===(t=this.fronteggApp)||void 0===t||t.hideAdminPortal()},t.prototype.showCheckoutDialog=function(t){this.fronteggApp.showCheckoutDialog(t)},t.prototype.hideCheckoutDialog=function(){var t;null===(t=this.fronteggApp)||void 0===t||t.hideCheckoutDialog()},t.prototype.getEntitlements=function(t){return this.fronteggApp.getEntitlements(t)},t}();w.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new w(p.ɵɵinject(O),p.ɵɵinject(f.Router),p.ɵɵinject(p.NgZone))},token:w,providedIn:"root"}),w.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[O]}]},{type:i.Router},{type:e.NgZone}]};var k=function(){function t(){}return t.prototype.parse=function(t){return(new i.DefaultUrlSerializer).parse(t)},t.prototype.serialize=function(t){return(new i.DefaultUrlSerializer).serialize(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/").replace(/(https?):\/([\w\d])/gi,"$1://$2")},t}(),T=function(){function t(t,e){var n=this;this.fronteggAppService=t,this.router=e,this.authStateSubject=new c.BehaviorSubject({isAuthenticated:!1,isLoading:!0}),this.acceptInvitationStateSubject=new c.BehaviorSubject({}),this.accountSettingsStateSubject=new c.BehaviorSubject({}),this.activateStateSubject=new c.BehaviorSubject({}),this.apiTokensStateSubject=new c.BehaviorSubject({}),this.forgotPasswordStateSubject=new c.BehaviorSubject({}),this.loginStateSubject=new c.BehaviorSubject({}),this.mfaStateSubject=new c.BehaviorSubject({}),this.profileStateSubject=new c.BehaviorSubject({}),this.rolesStateSubject=new c.BehaviorSubject({}),this.routesSubject=new c.BehaviorSubject({}),this.securityPolicyStateSubject=new c.BehaviorSubject({}),this.signUpStateSubject=new c.BehaviorSubject({}),this.socialLoginStateSubject=new c.BehaviorSubject({}),this.ssoStateSubject=new c.BehaviorSubject({}),this.teamStateSubject=new c.BehaviorSubject({}),this.tenantsStateSubject=new c.BehaviorSubject({}),this.userSubject=new c.BehaviorSubject({}),this.isAuthenticatedSubject=new c.BehaviorSubject(!1),this.isLoadingSubject=new c.BehaviorSubject(!0),this.isSSOAuthSubject=new c.BehaviorSubject(!1),this.ssoACSSubject=new c.BehaviorSubject(""),this.setState=function(t){return n.dispatchAction("setState",t)},this.resetState=function(){return n.dispatchAction("resetState")},this.setUser=function(t){return n.dispatchAction("setUser",t)},this.setLoginState=function(t){return n.dispatchAction("setLoginState",t)},this.resetLoginState=function(){return n.dispatchAction("resetLoginState")},this.requestAuthorize=function(t){return n.dispatchAction("requestAuthorize",t)},this.loginWithRedirect=function(){n.isHostedLoginCallbackRoute()||(n.dispatchAction("requestHostedLoginAuthorize"),n.setState({isLoading:!0}))},this.preLogin=function(t){return n.dispatchAction("preLogin",t)},this.postLogin=function(t){return n.dispatchAction("postLogin",t)},this.login=function(t){return n.dispatchAction("login",t)},this.loginWithMfa=function(t){return n.dispatchAction("loginWithMfa",t)},this.recoverMfa=function(t){return n.dispatchAction("recoverMfa",t)},this.logout=function(t){return n.dispatchAction("logout",t)},this.silentLogout=function(t){return n.dispatchAction("silentLogout",t)},this.checkIfAllowToRememberMfaDevice=function(t){return n.dispatchAction("checkIfAllowToRememberMfaDevice",t)},this.setSocialLoginsState=function(t){return n.dispatchAction("setSocialLoginsState",t)},this.resetSocialLoginsState=function(){return n.dispatchAction("resetSocialLoginsState")},this.loadSocialLoginsConfiguration=function(){return n.dispatchAction("loadSocialLoginsConfiguration")},this.loginViaSocialLogin=function(t){return n.dispatchAction("loginViaSocialLogin",t)},this.setSocialLoginError=function(t){return n.dispatchAction("setSocialLoginError",t)},this.setActivateState=function(t){return n.dispatchAction("setActivateState",t)},this.resetActivateState=function(){return n.dispatchAction("resetActivateState")},this.setActivateStrategyState=function(t){return n.dispatchAction("setActivateStrategyState",t)},this.activateAccount=function(t){return n.dispatchAction("activateAccount",t)},this.resendActivationEmail=function(t){return n.dispatchAction("resendActivationEmail",t)},this.getActivateAccountStrategy=function(t){return n.dispatchAction("getActivateAccountStrategy",t)},this.setAcceptInvitationState=function(t){return n.dispatchAction("setAcceptInvitationState",t)},this.resetAcceptInvitationState=function(){return n.dispatchAction("resetAcceptInvitationState")},this.acceptInvitation=function(t){return n.dispatchAction("acceptInvitation",t)},this.setForgotPasswordState=function(t){return n.dispatchAction("setForgotPasswordState",t)},this.resetForgotPasswordState=function(){return n.dispatchAction("resetForgotPasswordState")},this.forgotPassword=function(t){return n.dispatchAction("forgotPassword",t)},this.resetPassword=function(t){return n.dispatchAction("resetPassword",t)},this.loadPasswordConfig=function(t){return n.dispatchAction("loadPasswordConfig",t)},this.setSignUpState=function(t){return n.dispatchAction("setSignUpState",t)},this.resetSignUpState=function(){return n.dispatchAction("resetSignUpState")},this.signUpUser=function(t){return n.dispatchAction("signUpUser",t)},this.resetSignUpStateSoft=function(){return n.dispatchAction("resetSignUpStateSoft")},this.setProfileState=function(t){return n.dispatchAction("setProfileState",t)},this.resetProfileState=function(){return n.dispatchAction("resetProfileState")},this.loadProfile=function(){return n.dispatchAction("loadProfile")},this.saveProfile=function(t){return n.dispatchAction("saveProfile",t)},this.changePassword=function(t){return n.dispatchAction("changePassword",t)},this.setSSOState=function(t){return n.dispatchAction("setSSOState",t)},this.resetSSOState=function(){return n.dispatchAction("resetSSOState")},this.loadSSOConfigurations=function(){return n.dispatchAction("loadSSOConfigurations")},this.loadSSOAuthorizationRoles=function(){return n.dispatchAction("loadSSOAuthorizationRoles")},this.saveSSOConfigurations=function(t){return n.dispatchAction("saveSSOConfigurations",t)},this.saveSSOConfigurationsFile=function(t){return n.dispatchAction("saveSSOConfigurationsFile",t)},this.saveSSOConfigurationsFileWithCallback=function(t){return n.dispatchAction("saveSSOConfigurationsFileWithCallback",t)},this.validateSSODomain=function(t){return n.dispatchAction("validateSSODomain",t)},this.updateSSOAuthorizationRoles=function(t){return n.dispatchAction("updateSSOAuthorizationRoles",t)},this.deleteSamlGroup=function(t){return n.dispatchAction("deleteSamlGroup",t)},this.createSamlGroup=function(t){return n.dispatchAction("createSamlGroup",t)},this.oidcPostlogin=function(t){return n.dispatchAction("oidcPostlogin",t)},this.setMfaState=function(t){return n.dispatchAction("setMfaState",t)},this.resetMfaState=function(){return n.dispatchAction("resetMfaState")},this.enrollMfa=function(){return n.dispatchAction("enrollMfa")},this.verifyMfa=function(t){return n.dispatchAction("verifyMfa",t)},this.verifyMfaAfterForce=function(t){return n.dispatchAction("verifyMfaAfterForce",t)},this.disableMfa=function(t){return n.dispatchAction("disableMfa",t)},this.setTeamLoader=function(t){return n.dispatchAction("setTeamLoader",t)},this.setTeamError=function(t){return n.dispatchAction("setTeamError",t)},this.setTeamState=function(t){return n.dispatchAction("setTeamState",t)},this.resetTeamState=function(){return n.dispatchAction("resetTeamState")},this.loadUsers=function(t){return n.dispatchAction("loadUsers",t)},this.loadRoles=function(t){return n.dispatchAction("loadRoles",t)},this.addUser=function(t){return n.dispatchAction("addUser",t)},this.updateUser=function(t){return n.dispatchAction("updateUser",t)},this.deleteUser=function(t){return n.dispatchAction("deleteUser",t)},this.resendActivationLink=function(t){return n.dispatchAction("resendActivationLink",t)},this.resendInvitationLink=function(t){return n.dispatchAction("resendInvitationLink",t)},this.openAddUserDialog=function(t){return n.dispatchAction("openAddUserDialog",t)},this.closeAddUserDialog=function(t){return n.dispatchAction("closeAddUserDialog",t)},this.openDeleteUserDialog=function(t){return n.dispatchAction("openDeleteUserDialog",t)},this.closeDeleteUserDialog=function(t){return n.dispatchAction("closeDeleteUserDialog",t)},this.setApiTokensLoader=function(t){return n.dispatchAction("setApiTokensLoader",t)},this.setApiTokensError=function(t){return n.dispatchAction("setApiTokensError",t)},this.setApiTokensState=function(t){return n.dispatchAction("setApiTokensState",t)},this.resetApiTokensState=function(){return n.dispatchAction("resetApiTokensState")},this.loadApiTokens=function(t){return n.dispatchAction("loadApiTokens",t)},this.initApiTokensData=function(t){return n.dispatchAction("initApiTokensData",t)},this.addTenantApiToken=function(t){return n.dispatchAction("addTenantApiToken",t)},this.addUserApiToken=function(t){return n.dispatchAction("addUserApiToken",t)},this.deleteUserApiToken=function(t){return n.dispatchAction("deleteUserApiToken",t)},this.deleteTenantApiToken=function(t){return n.dispatchAction("deleteTenantApiToken",t)},this.setSecurityPolicyState=function(t){return n.dispatchAction("setSecurityPolicyState",t)},this.setSecurityPolicyGlobalState=function(t){return n.dispatchAction("setSecurityPolicyGlobalState",t)},this.setSecurityPolicyPublicState=function(t){return n.dispatchAction("setSecurityPolicyPublicState",t)},this.setSecurityPolicyMfaState=function(t){return n.dispatchAction("setSecurityPolicyMfaState",t)},this.setSecurityPolicyLockoutState=function(t){return n.dispatchAction("setSecurityPolicyLockoutState",t)},this.setSecurityPolicyCaptchaState=function(t){return n.dispatchAction("setSecurityPolicyCaptchaState",t)},this.setSecurityPolicyPasswordHistoryState=function(t){return n.dispatchAction("setSecurityPolicyPasswordHistoryState",t)},this.resetSecurityPolicyState=function(){return n.dispatchAction("resetSecurityPolicyState")},this.setSecurityPolicyPasswordState=function(t){return n.dispatchAction("setSecurityPolicyPasswordState",t)},this.loadSecurityPolicy=function(){return n.dispatchAction("loadSecurityPolicy")},this.loadPublicSecurityPolicy=function(){return n.dispatchAction("loadPublicSecurityPolicy")},this.loadVendorPasswordConfig=function(){return n.dispatchAction("loadVendorPasswordConfig")},this.loadSecurityPolicyMfa=function(){return n.dispatchAction("loadSecurityPolicyMfa")},this.saveSecurityPolicyMfa=function(t){return n.dispatchAction("saveSecurityPolicyMfa",t)},this.loadSecurityPolicyLockout=function(){return n.dispatchAction("loadSecurityPolicyLockout")},this.saveSecurityPolicyLockout=function(t){return n.dispatchAction("saveSecurityPolicyLockout",t)},this.loadSecurityPolicyCaptcha=function(){return n.dispatchAction("loadSecurityPolicyCaptcha")},this.loadSecurityPolicyPasswordHistory=function(){return n.dispatchAction("loadSecurityPolicyPasswordHistory")},this.saveSecurityPolicyPasswordHistory=function(t){return n.dispatchAction("saveSecurityPolicyPasswordHistory",t)},this.setAccountSettingsState=function(t){return n.dispatchAction("setAccountSettingsState",t)},this.resetAccountSettingsState=function(){return n.dispatchAction("resetAccountSettingsState")},this.loadAccountSettings=function(t){return n.dispatchAction("loadAccountSettings",t)},this.saveAccountSettings=function(t){return n.dispatchAction("saveAccountSettings",t)},this.setTenantsState=function(t){return n.dispatchAction("setTenantsState",t)},this.resetTenantsState=function(){return n.dispatchAction("resetTenantsState")},this.switchTenant=function(t){return n.dispatchAction("switchTenant",t)},this.loadTenants=function(t){return n.dispatchAction("loadTenants",t)},this.setRolesState=function(t){return n.dispatchAction("setRolesState",t)},this.resetRolesState=function(){return n.dispatchAction("resetRolesState")},this.loadRolesAndPermissions=function(t){return n.dispatchAction("loadRolesAndPermissions",t)},this.addRole=function(t){return n.dispatchAction("addRole",t)},this.updateRole=function(t){return n.dispatchAction("updateRole",t)},this.deleteRole=function(t){return n.dispatchAction("deleteRole",t)},this.attachPermissionsToRole=function(t){return n.dispatchAction("attachPermissionsToRole",t)},this.attachPermissionToRoles=function(t){return n.dispatchAction("attachPermissionToRoles",t)};var i=[{field:"acceptInvitationState",subject:this.acceptInvitationStateSubject},{field:"accountSettingsState",subject:this.accountSettingsStateSubject},{field:"activateState",subject:this.activateStateSubject},{field:"apiTokensState",subject:this.apiTokensStateSubject},{field:"forgotPasswordState",subject:this.forgotPasswordStateSubject},{field:"tenantsState",subject:this.tenantsStateSubject},{field:"loginState",subject:this.loginStateSubject},{field:"mfaState",subject:this.mfaStateSubject},{field:"profileState",subject:this.profileStateSubject},{field:"rolesState",subject:this.rolesStateSubject},{field:"routes",subject:this.routesSubject},{field:"securityPolicyState",subject:this.securityPolicyStateSubject},{field:"signUpState",subject:this.signUpStateSubject},{field:"socialLoginState",subject:this.socialLoginStateSubject},{field:"ssoState",subject:this.ssoStateSubject},{field:"teamState",subject:this.teamStateSubject},{field:"user",subject:this.userSubject},{field:"isSSOAuth",subject:this.isSSOAuthSubject},{field:"ssoACS",subject:this.ssoACSSubject}],o=this.fronteggAppService.fronteggApp.store.getState();this.updateState(o.auth,i),this.fronteggAppService.fronteggApp.store.subscribe((function(){var t=n.fronteggAppService.fronteggApp.store.getState();n.updateState(t.auth,i)}))}return Object.defineProperty(t.prototype,"authState$",{get:function(){return this.authStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"acceptInvitationState$",{get:function(){return this.acceptInvitationStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accountSettingsState$",{get:function(){return this.accountSettingsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activateState$",{get:function(){return this.activateStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"apiTokensState$",{get:function(){return this.apiTokensStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forgotPasswordState$",{get:function(){return this.forgotPasswordStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loginState$",{get:function(){return this.loginStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mfaState$",{get:function(){return this.mfaStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"profileState$",{get:function(){return this.profileStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rolesState$",{get:function(){return this.rolesStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"routesState$",{get:function(){return this.routesSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"securityPolicyState$",{get:function(){return this.securityPolicyStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"signUpState$",{get:function(){return this.signUpStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"socialLoginState$",{get:function(){return this.socialLoginStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ssoState$",{get:function(){return this.ssoStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"teamState$",{get:function(){return this.teamStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenantsState$",{get:function(){return this.tenantsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user$",{get:function(){return this.userSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this.fronteggAppService.fronteggApp.store.getState().auth.user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAuthenticated$",{get:function(){return this.isAuthenticatedSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAuthenticated",{get:function(){return this.fronteggAppService.fronteggApp.store.getState().auth.isAuthenticated},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading$",{get:function(){return this.isLoadingSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSSOAuth$",{get:function(){return this.isSSOAuthSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ssoACS$",{get:function(){return this.ssoACSSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.updateState=function(t,e){var n,i;this.authStateSubject.value!==t&&this.authStateSubject.next(t);try{for(var o=A(e),r=o.next();!r.done;r=o.next()){var c=r.value;S.default(c.subject.value,t[c.field])||c.subject.next(t[c.field])}}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.isAuthenticatedSubject.value!==t.isAuthenticated&&this.isAuthenticatedSubject.next(t.isAuthenticated),this.isLoadingSubject.value!==t.isLoading&&this.isLoadingSubject.next(t.isLoading)},t.prototype.dispatchAction=function(t,e){this.fronteggAppService.fronteggApp.store.dispatch({type:r.authStoreName+"/"+t,payload:e})},t.prototype.isHostedLoginCallbackRoute=function(){var t=this.fronteggAppService.router.url,e=this.fronteggAppService.authRoutes.hostedLoginRedirectUrl;return t.startsWith(null!=e?e:"/oauth/callback")},t}();T.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new T(p.ɵɵinject(w),p.ɵɵinject(f.Router))},token:T,providedIn:"root"}),T.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],T.ctorParameters=function(){return[{type:w},{type:i.Router}]};var L=function(t){function n(e,n,i,o){var r=t.call(this)||this;return r.fronteggAppService=e,r.fronteggAuthService=n,r.router=i,r.ngZone=o,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.prototype.navigateToUrl=function(t){return b(this,void 0,void 0,(function(){return g(this,(function(e){return this.fronteggAppService.fronteggApp.options.hostedLoginBox?(localStorage.setItem("FRONTEGG_AFTER_AUTH_REDIRECT_URL",t),this.fronteggAuthService.loginWithRedirect(),[2,!1]):[2,this.router.navigateByUrl(this.fronteggAppService.authRoutes.loginUrl+"?redirectUrl="+encodeURIComponent(t))]}))}))},n.prototype.canActivate=function(t,n){var i=this,o=n.url;return new Promise((function(t,n){i.fronteggAppService.isAuthenticated$.pipe(s.take(1)).subscribe((function(r){r?t(!0):e.NgZone.isInAngularZone()?i.navigateToUrl(o).then(t,n):i.ngZone.run((function(){i.navigateToUrl(o).then(t,n)}))})).unsubscribe()}))},n}(k);L.decorators=[{type:e.Injectable}],L.ctorParameters=function(){return[{type:w},{type:T},{type:i.Router},{type:e.NgZone}]};var C=function(){function t(t,e,n){this.templateRef=t,this.viewContainer=e,this.fronteggAuthService=n,this._roles=[]}return Object.defineProperty(t.prototype,"authorizedContent",{set:function(t){this._roles=t},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this.fronteggAuthService.user$.subscribe((function(e){var n;(null===(n=null==e?void 0:e.roles)||void 0===n?void 0:n.some((function(e){return t._roles.includes(e.name)})))?t.viewContainer.createEmbeddedView(t.templateRef):t.viewContainer.clear()}))},t}();C.decorators=[{type:e.Directive,args:[{selector:"[authorizedContent]"}]}],C.ctorParameters=function(){return[{type:e.TemplateRef},{type:e.ViewContainerRef},{type:T}]},C.propDecorators={authorizedContent:[{type:e.Input}]};var R=function(){function t(t){var e=this;this.fronteggAppService=t,this.subscriptionStateSubject=new c.BehaviorSubject({}),this.checkoutStateSubject=new c.BehaviorSubject({loading:!1,open:!1,success:!1,error:null}),this.loadSubscription=function(){return e.dispatchAction("billing/subscription/loadSubscription")},this.openCheckout=function(t){e.checkoutStateSubject.next({loading:!1,open:!0,success:!1,error:null}),e.fronteggAppService.showCheckoutDialog({plan:t,onSuccess:function(){e.checkoutStateSubject.next({loading:!1,open:!1,success:!0,error:null})},onError:function(t){var n=e.checkoutStateSubject.value;e.checkoutStateSubject.next(Object.assign(Object.assign({},n),{error:t}))},onClose:function(){var t=e.checkoutStateSubject.value;e.checkoutStateSubject.next(Object.assign(Object.assign({},t),{open:!1}))}})},this.hideCheckout=function(){e.fronteggAppService.hideCheckoutDialog()},this.fronteggAppService.subscriptionsState$.subscribe((function(t){if(null!=t){var n=t.billing.subscription,i=t.checkout;S.default(e.subscriptionStateSubject.getValue(),n)||e.subscriptionStateSubject.next(n);var o=e.checkoutStateSubject.getValue();o.loading!==i.loading&&e.checkoutStateSubject.next(Object.assign(Object.assign({},o),{loading:i.loading}))}}))}return Object.defineProperty(t.prototype,"subscriptionState$",{get:function(){return this.subscriptionStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkoutState$",{get:function(){return this.checkoutStateSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.dispatchAction=function(t,e){this.fronteggAppService.fronteggApp.store.dispatch({type:r.subscriptionsStoreName+"/"+t,payload:e})},t}();R.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new R(p.ɵɵinject(w))},token:R,providedIn:"root"}),R.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],R.ctorParameters=function(){return[{type:w}]};var U=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[w,L,j,T,R,{provide:O,useValue:e}]}},t}();U.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.RouterModule],declarations:[P,C],exports:[P,C]}]}],Object.defineProperty(t,"ContextHolder",{enumerable:!0,get:function(){return a.ContextHolder}}),t.AuthorizedContentDirective=C,t.FronteggAppModule=U,t.FronteggAppService=w,t.FronteggAuthGuard=L,t.FronteggAuthService=T,t.FronteggComponent=P,t.FronteggLoadGuard=j,t.FronteggSubscriptionService=R,t.ɵa=O,t.ɵb=k,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("@frontegg/js"),require("@frontegg/redux-store"),require("rxjs"),require("@frontegg/rest-api"),require("rxjs/operators"),require("fast-deep-equal")):"function"==typeof define&&define.amd?define("@frontegg/angular",["exports","@angular/core","@angular/common","@angular/router","@frontegg/js","@frontegg/redux-store","rxjs","@frontegg/rest-api","rxjs/operators","fast-deep-equal"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).frontegg=t.frontegg||{},t.frontegg.angular={}),t.ng.core,t.ng.common,t.ng.router,t.FronteggJS,t.FronteggReduxStore,t.rxjs,t.FronteggRestApi,t.rxjs.operators,t.FastDeepEqual)}(this,(function(t,e,n,i,o,r,c,a,s,u){"use strict";function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function h(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=h(e),f=h(i),S=l(u),d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function b(t,e,n,i){return new(n||(n=Promise))((function(o,r){function c(t){try{s(i.next(t))}catch(t){r(t)}}function a(t){try{s(i.throw(t))}catch(t){r(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,a)}s((i=i.apply(t,e||[])).next())}))}function g(t,e){var n,i,o,r,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return c.label++,{value:r[1],done:!1};case 5:c.label++,i=r[1],r=[0];continue;case 7:r=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){c=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){c.label=r[1];break}if(6===r[0]&&c.label<o[1]){c.label=o[1],o=r;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(r);break}o[2]&&c.ops.pop(),c.trys.pop();continue}r=e.call(t,c)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}Object.create;function A(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)c.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return c}function v(t,e){for(var n=0,i=e.length,o=t.length;n<i;n++,o++)t[o]=e[n];return t}Object.create;var j=function(){function t(t){this.fronteggAppService=t}return t.prototype.canActivate=function(t,e){var n=this;return new c.Observable((function(t){n.fronteggAppService.isLoading$.subscribe((function(e){e||t.next(!0)}))}))},t}();j.decorators=[{type:e.Injectable}],j.ctorParameters=function(){return[{type:w}]};var P=function(){};P.decorators=[{type:e.Component,args:[{selector:"frontegg",template:""}]}];var m="5.35.0",O=function(){this.contextOptions={baseUrl:"https://sub-domain.frontegg.com"}},w=function(){function t(t,e,n){var i,s=this;if(this.config=t,this.router=e,this.ngZone=n,this.isLoadingSubject=new c.BehaviorSubject(!0),this.isAuthenticatedSubject=new c.BehaviorSubject(!1),this.stateSubject=new c.BehaviorSubject({}),this.authStateSubject=new c.BehaviorSubject({isLoading:!0,isAuthenticated:!1}),this.entitlementsStateSubject=new c.BehaviorSubject(void 0),this.auditsStateSubject=new c.BehaviorSubject({}),this.connectivityStateSubject=new c.BehaviorSubject({}),this.subscriptionsStateSubject=new c.BehaviorSubject({}),this.vendorStateSubject=new c.BehaviorSubject({}),!this.config)throw Error("Need to pass config: FronteggConfigOptions in FronteggAppModule.forRoot(config)");window.CYPRESS_CONFIG&&(this.config=window.CYPRESS_CONFIG);var u=function(e,n){var i,o=window.location.origin,c=e;c.startsWith(o)&&"/"!==o&&(c=c.substring(o.length-1)),((null==n?void 0:n.preserveQueryParams)||r.isAuthRoute(c,null===(i=t.authOptions)||void 0===i?void 0:i.routes))&&(c=""+c+window.location.search),(null==n?void 0:n.refresh)?window.location.href=c:s.ngZone.run((function(){(null==n?void 0:n.replace)?s.router.navigateByUrl(c,{replaceUrl:!0}):s.router.navigateByUrl(c)}))};(null!==(i=this.config)&&void 0!==i?i:{}).contextOptions.metadataHeaders={fronteggSdkVersion:"@frontegg/angular@"+m,framework:a.FronteggFrameworks.Angular},a.ContextHolder.setOnRedirectTo(u),this.fronteggApp=o.initialize(Object.assign({onRedirectTo:u},this.config)),this.router.resetConfig(v(v([],y(this.mapAuthComponents)),[{path:"",canActivate:[j],children:v([],y(this.router.config))}]));var l=this.fronteggApp.store.getState();this.updateState(l),this.fronteggApp.store.subscribe((function(){s.updateState(s.fronteggApp.store.getState())}))}return Object.defineProperty(t.prototype,"state$",{get:function(){return this.stateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authState$",{get:function(){return this.authStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"auditsState$",{get:function(){return this.auditsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectivityState$",{get:function(){return this.connectivityStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionsState$",{get:function(){return this.subscriptionsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendorState$",{get:function(){return this.vendorStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading$",{get:function(){return this.isLoadingSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.entitlements$=function(t,e){var n=new c.BehaviorSubject([]),i=this.entitlementsStateSubject.subscribe((function(e){n.next(r.getEntitlements(null!=e?e:{},t))})),o=n.asObservable().subscribe(e),a=o.unsubscribe.bind(o);return o.unsubscribe=function(){a(),i.unsubscribe()},o},Object.defineProperty(t.prototype,"isAuthenticated$",{get:function(){return this.isAuthenticatedSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.updateState=function(t){var e;this.isLoadingSubject.getValue()!==t.auth.isLoading&&this.isLoadingSubject.next(t.auth.isLoading),this.isAuthenticatedSubject.getValue()!==t.auth.isAuthenticated&&this.isAuthenticatedSubject.next(t.auth.isAuthenticated),this.stateSubject.next(t),this.authStateSubject.next(t.auth),this.entitlementsStateSubject.next(null===(e=t.auth.entitlementsState)||void 0===e?void 0:e.entitlements),this.auditsStateSubject.next(t.audits),this.connectivityStateSubject.next(t.connectivity),this.subscriptionsStateSubject.next(t.subscriptions),this.vendorStateSubject.next(t.vendor)},Object.defineProperty(t.prototype,"mapAuthComponents",{get:function(){var t=this.authRoutes;return Object.keys(t).filter((function(t){return"authenticatedUrl"!==t&&"signUpSuccessUrl"!==t&&null!=t})).map((function(e){var n;return{path:null===(n=t[e])||void 0===n?void 0:n.substring(1),component:P}}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authRoutes",{get:function(){return this.fronteggApp.store.getState().auth.routes},enumerable:!1,configurable:!0}),t.prototype.showAdminPortal=function(){this.fronteggApp.showAdminPortal()},t.prototype.hideAdminPortal=function(){var t;null===(t=this.fronteggApp)||void 0===t||t.hideAdminPortal()},t.prototype.showCheckoutDialog=function(t){this.fronteggApp.showCheckoutDialog(t)},t.prototype.hideCheckoutDialog=function(){var t;null===(t=this.fronteggApp)||void 0===t||t.hideCheckoutDialog()},t.prototype.getEntitlements=function(t){return this.fronteggApp.getEntitlements(t)},t}();w.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new w(p.ɵɵinject(O),p.ɵɵinject(f.Router),p.ɵɵinject(p.NgZone))},token:w,providedIn:"root"}),w.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],w.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[O]}]},{type:i.Router},{type:e.NgZone}]};var k=function(){function t(){}return t.prototype.parse=function(t){return(new i.DefaultUrlSerializer).parse(t)},t.prototype.serialize=function(t){return(new i.DefaultUrlSerializer).serialize(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/").replace(/(https?):\/([\w\d])/gi,"$1://$2")},t}(),T=function(){function t(t,e){var n=this;this.fronteggAppService=t,this.router=e,this.authStateSubject=new c.BehaviorSubject({isAuthenticated:!1,isLoading:!0}),this.acceptInvitationStateSubject=new c.BehaviorSubject({}),this.accountSettingsStateSubject=new c.BehaviorSubject({}),this.activateStateSubject=new c.BehaviorSubject({}),this.apiTokensStateSubject=new c.BehaviorSubject({}),this.forgotPasswordStateSubject=new c.BehaviorSubject({}),this.loginStateSubject=new c.BehaviorSubject({}),this.mfaStateSubject=new c.BehaviorSubject({}),this.profileStateSubject=new c.BehaviorSubject({}),this.rolesStateSubject=new c.BehaviorSubject({}),this.routesSubject=new c.BehaviorSubject({}),this.securityPolicyStateSubject=new c.BehaviorSubject({}),this.signUpStateSubject=new c.BehaviorSubject({}),this.socialLoginStateSubject=new c.BehaviorSubject({}),this.ssoStateSubject=new c.BehaviorSubject({}),this.teamStateSubject=new c.BehaviorSubject({}),this.tenantsStateSubject=new c.BehaviorSubject({}),this.userSubject=new c.BehaviorSubject({}),this.isAuthenticatedSubject=new c.BehaviorSubject(!1),this.isLoadingSubject=new c.BehaviorSubject(!0),this.isSSOAuthSubject=new c.BehaviorSubject(!1),this.ssoACSSubject=new c.BehaviorSubject(""),this.setState=function(t){return n.dispatchAction("setState",t)},this.resetState=function(){return n.dispatchAction("resetState")},this.setUser=function(t){return n.dispatchAction("setUser",t)},this.setLoginState=function(t){return n.dispatchAction("setLoginState",t)},this.resetLoginState=function(){return n.dispatchAction("resetLoginState")},this.requestAuthorize=function(t){return n.dispatchAction("requestAuthorize",t)},this.loginWithRedirect=function(){n.isHostedLoginCallbackRoute()||(n.dispatchAction("requestHostedLoginAuthorize"),n.setState({isLoading:!0}))},this.preLogin=function(t){return n.dispatchAction("preLogin",t)},this.postLogin=function(t){return n.dispatchAction("postLogin",t)},this.login=function(t){return n.dispatchAction("login",t)},this.loginWithMfa=function(t){return n.dispatchAction("loginWithMfa",t)},this.recoverMfa=function(t){return n.dispatchAction("recoverMfa",t)},this.logout=function(t){return n.dispatchAction("logout",t)},this.silentLogout=function(t){return n.dispatchAction("silentLogout",t)},this.checkIfAllowToRememberMfaDevice=function(t){return n.dispatchAction("checkIfAllowToRememberMfaDevice",t)},this.setSocialLoginsState=function(t){return n.dispatchAction("setSocialLoginsState",t)},this.resetSocialLoginsState=function(){return n.dispatchAction("resetSocialLoginsState")},this.loadSocialLoginsConfiguration=function(){return n.dispatchAction("loadSocialLoginsConfiguration")},this.loginViaSocialLogin=function(t){return n.dispatchAction("loginViaSocialLogin",t)},this.setSocialLoginError=function(t){return n.dispatchAction("setSocialLoginError",t)},this.setActivateState=function(t){return n.dispatchAction("setActivateState",t)},this.resetActivateState=function(){return n.dispatchAction("resetActivateState")},this.setActivateStrategyState=function(t){return n.dispatchAction("setActivateStrategyState",t)},this.activateAccount=function(t){return n.dispatchAction("activateAccount",t)},this.resendActivationEmail=function(t){return n.dispatchAction("resendActivationEmail",t)},this.getActivateAccountStrategy=function(t){return n.dispatchAction("getActivateAccountStrategy",t)},this.setAcceptInvitationState=function(t){return n.dispatchAction("setAcceptInvitationState",t)},this.resetAcceptInvitationState=function(){return n.dispatchAction("resetAcceptInvitationState")},this.acceptInvitation=function(t){return n.dispatchAction("acceptInvitation",t)},this.setForgotPasswordState=function(t){return n.dispatchAction("setForgotPasswordState",t)},this.resetForgotPasswordState=function(){return n.dispatchAction("resetForgotPasswordState")},this.forgotPassword=function(t){return n.dispatchAction("forgotPassword",t)},this.resetPassword=function(t){return n.dispatchAction("resetPassword",t)},this.loadPasswordConfig=function(t){return n.dispatchAction("loadPasswordConfig",t)},this.setSignUpState=function(t){return n.dispatchAction("setSignUpState",t)},this.resetSignUpState=function(){return n.dispatchAction("resetSignUpState")},this.signUpUser=function(t){return n.dispatchAction("signUpUser",t)},this.resetSignUpStateSoft=function(){return n.dispatchAction("resetSignUpStateSoft")},this.setProfileState=function(t){return n.dispatchAction("setProfileState",t)},this.resetProfileState=function(){return n.dispatchAction("resetProfileState")},this.loadProfile=function(){return n.dispatchAction("loadProfile")},this.saveProfile=function(t){return n.dispatchAction("saveProfile",t)},this.changePassword=function(t){return n.dispatchAction("changePassword",t)},this.setSSOState=function(t){return n.dispatchAction("setSSOState",t)},this.resetSSOState=function(){return n.dispatchAction("resetSSOState")},this.loadSSOConfigurations=function(){return n.dispatchAction("loadSSOConfigurations")},this.loadSSOAuthorizationRoles=function(){return n.dispatchAction("loadSSOAuthorizationRoles")},this.saveSSOConfigurations=function(t){return n.dispatchAction("saveSSOConfigurations",t)},this.saveSSOConfigurationsFile=function(t){return n.dispatchAction("saveSSOConfigurationsFile",t)},this.saveSSOConfigurationsFileWithCallback=function(t){return n.dispatchAction("saveSSOConfigurationsFileWithCallback",t)},this.validateSSODomain=function(t){return n.dispatchAction("validateSSODomain",t)},this.updateSSOAuthorizationRoles=function(t){return n.dispatchAction("updateSSOAuthorizationRoles",t)},this.deleteSamlGroup=function(t){return n.dispatchAction("deleteSamlGroup",t)},this.createSamlGroup=function(t){return n.dispatchAction("createSamlGroup",t)},this.oidcPostlogin=function(t){return n.dispatchAction("oidcPostlogin",t)},this.setMfaState=function(t){return n.dispatchAction("setMfaState",t)},this.resetMfaState=function(){return n.dispatchAction("resetMfaState")},this.enrollMfa=function(){return n.dispatchAction("enrollMfa")},this.verifyMfa=function(t){return n.dispatchAction("verifyMfa",t)},this.verifyMfaAfterForce=function(t){return n.dispatchAction("verifyMfaAfterForce",t)},this.disableMfa=function(t){return n.dispatchAction("disableMfa",t)},this.setTeamLoader=function(t){return n.dispatchAction("setTeamLoader",t)},this.setTeamError=function(t){return n.dispatchAction("setTeamError",t)},this.setTeamState=function(t){return n.dispatchAction("setTeamState",t)},this.resetTeamState=function(){return n.dispatchAction("resetTeamState")},this.loadUsers=function(t){return n.dispatchAction("loadUsers",t)},this.loadRoles=function(t){return n.dispatchAction("loadRoles",t)},this.addUser=function(t){return n.dispatchAction("addUser",t)},this.updateUser=function(t){return n.dispatchAction("updateUser",t)},this.deleteUser=function(t){return n.dispatchAction("deleteUser",t)},this.resendActivationLink=function(t){return n.dispatchAction("resendActivationLink",t)},this.resendInvitationLink=function(t){return n.dispatchAction("resendInvitationLink",t)},this.openAddUserDialog=function(t){return n.dispatchAction("openAddUserDialog",t)},this.closeAddUserDialog=function(t){return n.dispatchAction("closeAddUserDialog",t)},this.openDeleteUserDialog=function(t){return n.dispatchAction("openDeleteUserDialog",t)},this.closeDeleteUserDialog=function(t){return n.dispatchAction("closeDeleteUserDialog",t)},this.setApiTokensLoader=function(t){return n.dispatchAction("setApiTokensLoader",t)},this.setApiTokensError=function(t){return n.dispatchAction("setApiTokensError",t)},this.setApiTokensState=function(t){return n.dispatchAction("setApiTokensState",t)},this.resetApiTokensState=function(){return n.dispatchAction("resetApiTokensState")},this.loadApiTokens=function(t){return n.dispatchAction("loadApiTokens",t)},this.initApiTokensData=function(t){return n.dispatchAction("initApiTokensData",t)},this.addTenantApiToken=function(t){return n.dispatchAction("addTenantApiToken",t)},this.addUserApiToken=function(t){return n.dispatchAction("addUserApiToken",t)},this.deleteUserApiToken=function(t){return n.dispatchAction("deleteUserApiToken",t)},this.deleteTenantApiToken=function(t){return n.dispatchAction("deleteTenantApiToken",t)},this.setSecurityPolicyState=function(t){return n.dispatchAction("setSecurityPolicyState",t)},this.setSecurityPolicyGlobalState=function(t){return n.dispatchAction("setSecurityPolicyGlobalState",t)},this.setSecurityPolicyPublicState=function(t){return n.dispatchAction("setSecurityPolicyPublicState",t)},this.setSecurityPolicyMfaState=function(t){return n.dispatchAction("setSecurityPolicyMfaState",t)},this.setSecurityPolicyLockoutState=function(t){return n.dispatchAction("setSecurityPolicyLockoutState",t)},this.setSecurityPolicyCaptchaState=function(t){return n.dispatchAction("setSecurityPolicyCaptchaState",t)},this.setSecurityPolicyPasswordHistoryState=function(t){return n.dispatchAction("setSecurityPolicyPasswordHistoryState",t)},this.resetSecurityPolicyState=function(){return n.dispatchAction("resetSecurityPolicyState")},this.setSecurityPolicyPasswordState=function(t){return n.dispatchAction("setSecurityPolicyPasswordState",t)},this.loadSecurityPolicy=function(){return n.dispatchAction("loadSecurityPolicy")},this.loadPublicSecurityPolicy=function(){return n.dispatchAction("loadPublicSecurityPolicy")},this.loadVendorPasswordConfig=function(){return n.dispatchAction("loadVendorPasswordConfig")},this.loadSecurityPolicyMfa=function(){return n.dispatchAction("loadSecurityPolicyMfa")},this.saveSecurityPolicyMfa=function(t){return n.dispatchAction("saveSecurityPolicyMfa",t)},this.loadSecurityPolicyLockout=function(){return n.dispatchAction("loadSecurityPolicyLockout")},this.saveSecurityPolicyLockout=function(t){return n.dispatchAction("saveSecurityPolicyLockout",t)},this.loadSecurityPolicyCaptcha=function(){return n.dispatchAction("loadSecurityPolicyCaptcha")},this.loadSecurityPolicyPasswordHistory=function(){return n.dispatchAction("loadSecurityPolicyPasswordHistory")},this.saveSecurityPolicyPasswordHistory=function(t){return n.dispatchAction("saveSecurityPolicyPasswordHistory",t)},this.setAccountSettingsState=function(t){return n.dispatchAction("setAccountSettingsState",t)},this.resetAccountSettingsState=function(){return n.dispatchAction("resetAccountSettingsState")},this.loadAccountSettings=function(t){return n.dispatchAction("loadAccountSettings",t)},this.saveAccountSettings=function(t){return n.dispatchAction("saveAccountSettings",t)},this.setTenantsState=function(t){return n.dispatchAction("setTenantsState",t)},this.resetTenantsState=function(){return n.dispatchAction("resetTenantsState")},this.switchTenant=function(t){return n.dispatchAction("switchTenant",t)},this.loadTenants=function(t){return n.dispatchAction("loadTenants",t)},this.setRolesState=function(t){return n.dispatchAction("setRolesState",t)},this.resetRolesState=function(){return n.dispatchAction("resetRolesState")},this.loadRolesAndPermissions=function(t){return n.dispatchAction("loadRolesAndPermissions",t)},this.addRole=function(t){return n.dispatchAction("addRole",t)},this.updateRole=function(t){return n.dispatchAction("updateRole",t)},this.deleteRole=function(t){return n.dispatchAction("deleteRole",t)},this.attachPermissionsToRole=function(t){return n.dispatchAction("attachPermissionsToRole",t)},this.attachPermissionToRoles=function(t){return n.dispatchAction("attachPermissionToRoles",t)};var i=[{field:"acceptInvitationState",subject:this.acceptInvitationStateSubject},{field:"accountSettingsState",subject:this.accountSettingsStateSubject},{field:"activateState",subject:this.activateStateSubject},{field:"apiTokensState",subject:this.apiTokensStateSubject},{field:"forgotPasswordState",subject:this.forgotPasswordStateSubject},{field:"tenantsState",subject:this.tenantsStateSubject},{field:"loginState",subject:this.loginStateSubject},{field:"mfaState",subject:this.mfaStateSubject},{field:"profileState",subject:this.profileStateSubject},{field:"rolesState",subject:this.rolesStateSubject},{field:"routes",subject:this.routesSubject},{field:"securityPolicyState",subject:this.securityPolicyStateSubject},{field:"signUpState",subject:this.signUpStateSubject},{field:"socialLoginState",subject:this.socialLoginStateSubject},{field:"ssoState",subject:this.ssoStateSubject},{field:"teamState",subject:this.teamStateSubject},{field:"user",subject:this.userSubject},{field:"isSSOAuth",subject:this.isSSOAuthSubject},{field:"ssoACS",subject:this.ssoACSSubject}],o=this.fronteggAppService.fronteggApp.store.getState();this.updateState(o.auth,i),this.fronteggAppService.fronteggApp.store.subscribe((function(){var t=n.fronteggAppService.fronteggApp.store.getState();n.updateState(t.auth,i)}))}return Object.defineProperty(t.prototype,"authState$",{get:function(){return this.authStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"acceptInvitationState$",{get:function(){return this.acceptInvitationStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accountSettingsState$",{get:function(){return this.accountSettingsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activateState$",{get:function(){return this.activateStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"apiTokensState$",{get:function(){return this.apiTokensStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"forgotPasswordState$",{get:function(){return this.forgotPasswordStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loginState$",{get:function(){return this.loginStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mfaState$",{get:function(){return this.mfaStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"profileState$",{get:function(){return this.profileStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rolesState$",{get:function(){return this.rolesStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"routesState$",{get:function(){return this.routesSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"securityPolicyState$",{get:function(){return this.securityPolicyStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"signUpState$",{get:function(){return this.signUpStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"socialLoginState$",{get:function(){return this.socialLoginStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ssoState$",{get:function(){return this.ssoStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"teamState$",{get:function(){return this.teamStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenantsState$",{get:function(){return this.tenantsStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user$",{get:function(){return this.userSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this.fronteggAppService.fronteggApp.store.getState().auth.user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAuthenticated$",{get:function(){return this.isAuthenticatedSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAuthenticated",{get:function(){return this.fronteggAppService.fronteggApp.store.getState().auth.isAuthenticated},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading$",{get:function(){return this.isLoadingSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSSOAuth$",{get:function(){return this.isSSOAuthSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ssoACS$",{get:function(){return this.ssoACSSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.updateState=function(t,e){var n,i;this.authStateSubject.value!==t&&this.authStateSubject.next(t);try{for(var o=A(e),r=o.next();!r.done;r=o.next()){var c=r.value;S.default(c.subject.value,t[c.field])||c.subject.next(t[c.field])}}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}this.isAuthenticatedSubject.value!==t.isAuthenticated&&this.isAuthenticatedSubject.next(t.isAuthenticated),this.isLoadingSubject.value!==t.isLoading&&this.isLoadingSubject.next(t.isLoading)},t.prototype.dispatchAction=function(t,e){this.fronteggAppService.fronteggApp.store.dispatch({type:r.authStoreName+"/"+t,payload:e})},t.prototype.isHostedLoginCallbackRoute=function(){var t=this.fronteggAppService.router.url,e=this.fronteggAppService.authRoutes.hostedLoginRedirectUrl;return t.startsWith(null!=e?e:"/oauth/callback")},t}();T.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new T(p.ɵɵinject(w),p.ɵɵinject(f.Router))},token:T,providedIn:"root"}),T.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],T.ctorParameters=function(){return[{type:w},{type:i.Router}]};var L=function(t){function n(e,n,i,o){var r=t.call(this)||this;return r.fronteggAppService=e,r.fronteggAuthService=n,r.router=i,r.ngZone=o,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,t),n.prototype.navigateToUrl=function(t){return b(this,void 0,void 0,(function(){return g(this,(function(e){return this.fronteggAppService.fronteggApp.options.hostedLoginBox?(localStorage.setItem("FRONTEGG_AFTER_AUTH_REDIRECT_URL",t),this.fronteggAuthService.loginWithRedirect(),[2,!1]):[2,this.router.navigateByUrl(this.fronteggAppService.authRoutes.loginUrl+"?redirectUrl="+encodeURIComponent(t))]}))}))},n.prototype.canActivate=function(t,n){var i=this,o=n.url;return new Promise((function(t,n){i.fronteggAppService.isAuthenticated$.pipe(s.take(1)).subscribe((function(r){r?t(!0):e.NgZone.isInAngularZone()?i.navigateToUrl(o).then(t,n):i.ngZone.run((function(){i.navigateToUrl(o).then(t,n)}))})).unsubscribe()}))},n}(k);L.decorators=[{type:e.Injectable}],L.ctorParameters=function(){return[{type:w},{type:T},{type:i.Router},{type:e.NgZone}]};var C=function(){function t(t,e,n){this.templateRef=t,this.viewContainer=e,this.fronteggAuthService=n,this._roles=[]}return Object.defineProperty(t.prototype,"authorizedContent",{set:function(t){this._roles=t},enumerable:!1,configurable:!0}),t.prototype.ngAfterContentInit=function(){var t=this;this.fronteggAuthService.user$.subscribe((function(e){var n;(null===(n=null==e?void 0:e.roles)||void 0===n?void 0:n.some((function(e){return t._roles.includes(e.name)})))?t.viewContainer.createEmbeddedView(t.templateRef):t.viewContainer.clear()}))},t}();C.decorators=[{type:e.Directive,args:[{selector:"[authorizedContent]"}]}],C.ctorParameters=function(){return[{type:e.TemplateRef},{type:e.ViewContainerRef},{type:T}]},C.propDecorators={authorizedContent:[{type:e.Input}]};var R=function(){function t(t){var e=this;this.fronteggAppService=t,this.subscriptionStateSubject=new c.BehaviorSubject({}),this.checkoutStateSubject=new c.BehaviorSubject({loading:!1,open:!1,success:!1,error:null}),this.loadSubscription=function(){return e.dispatchAction("billing/subscription/loadSubscription")},this.openCheckout=function(t){e.checkoutStateSubject.next({loading:!1,open:!0,success:!1,error:null}),e.fronteggAppService.showCheckoutDialog({plan:t,onSuccess:function(){e.checkoutStateSubject.next({loading:!1,open:!1,success:!0,error:null})},onError:function(t){var n=e.checkoutStateSubject.value;e.checkoutStateSubject.next(Object.assign(Object.assign({},n),{error:t}))},onClose:function(){var t=e.checkoutStateSubject.value;e.checkoutStateSubject.next(Object.assign(Object.assign({},t),{open:!1}))}})},this.hideCheckout=function(){e.fronteggAppService.hideCheckoutDialog()},this.fronteggAppService.subscriptionsState$.subscribe((function(t){if(null!=t){var n=t.billing.subscription,i=t.checkout;S.default(e.subscriptionStateSubject.getValue(),n)||e.subscriptionStateSubject.next(n);var o=e.checkoutStateSubject.getValue();o.loading!==i.loading&&e.checkoutStateSubject.next(Object.assign(Object.assign({},o),{loading:i.loading}))}}))}return Object.defineProperty(t.prototype,"subscriptionState$",{get:function(){return this.subscriptionStateSubject.asObservable()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checkoutState$",{get:function(){return this.checkoutStateSubject.asObservable()},enumerable:!1,configurable:!0}),t.prototype.dispatchAction=function(t,e){this.fronteggAppService.fronteggApp.store.dispatch({type:r.subscriptionsStoreName+"/"+t,payload:e})},t}();R.ɵprov=p.ɵɵdefineInjectable({factory:function(){return new R(p.ɵɵinject(w))},token:R,providedIn:"root"}),R.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],R.ctorParameters=function(){return[{type:w}]};var U=function(){function t(){}return t.forRoot=function(e){return{ngModule:t,providers:[w,L,j,T,R,{provide:O,useValue:e}]}},t}();U.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule,i.RouterModule],declarations:[P,C],exports:[P,C]}]}],Object.defineProperty(t,"ContextHolder",{enumerable:!0,get:function(){return a.ContextHolder}}),t.AuthorizedContentDirective=C,t.FronteggAppModule=U,t.FronteggAppService=w,t.FronteggAuthGuard=L,t.FronteggAuthService=T,t.FronteggComponent=P,t.FronteggLoadGuard=j,t.FronteggSubscriptionService=R,t.ɵa=O,t.ɵb=k,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=frontegg-angular.umd.min.js.map
|