@daffodil/auth 0.94.1 → 0.95.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/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
- package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
- package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver.mjs +99 -126
- package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
- package/fesm2022/daffodil-auth-routing.mjs +392 -257
- package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
- package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state.mjs +867 -852
- package/fesm2022/daffodil-auth-state.mjs.map +1 -1
- package/fesm2022/daffodil-auth-testing.mjs +132 -76
- package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth.mjs +65 -57
- package/fesm2022/daffodil-auth.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
- package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
- package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-auth-driver-testing.d.ts +37 -36
- package/types/daffodil-auth-driver.d.ts +93 -112
- package/types/daffodil-auth-routing.d.ts +100 -104
- package/types/daffodil-auth-state-testing.d.ts +44 -43
- package/types/daffodil-auth-state.d.ts +265 -306
- package/types/daffodil-auth-testing.d.ts +28 -33
- package/types/daffodil-auth.d.ts +51 -62
- package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
- package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
- package/types/daffodil-auth-driver-magento.d.ts +0 -135
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-routing.mjs","sources":["../../../libs/auth/routing/src/guards/member-only-guard-redirect.token.ts","../../../libs/auth/routing/src/guards/member-only.guard.ts","../../../libs/auth/routing/src/guards/guest-only-guard-redirect.token.ts","../../../libs/auth/routing/src/guards/guest-only.guard.ts","../../../libs/auth/routing/src/config/default.ts","../../../libs/auth/routing/src/config/token.ts","../../../libs/auth/routing/src/guards/reset-password.guard.ts","../../../libs/auth/routing/src/helpers/redirect-unauthenticated-hook-factory.ts","../../../libs/auth/routing/src/module.ts","../../../libs/auth/routing/src/effects/redirect.effects.ts","../../../libs/auth/routing/src/redirect.module.ts","../../../libs/auth/routing/src/daffodil-auth-routing.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n token: DaffAuthMemberOnlyGuardRedirectUrl,\n /**\n * Provider function for {@link DaffAuthMemberOnlyGuardRedirectUrl}.\n */\n provider: provideDaffAuthMemberOnlyGuardRedirectUrl,\n} = createSingleInjectionToken<string>(\n 'DaffAuthMemberOnlyGuardRedirectUrl',\n { factory: () => '/' },\n);\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n catchError,\n map,\n tap,\n} from 'rxjs/operators';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport {\n DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES,\n DaffAuthDriverTokenCheck,\n} from '@daffodil/auth/driver';\nimport {\n DAFF_AUTH_ERROR_MATCHER,\n DaffAuthGuardLogout,\n} from '@daffodil/auth/state';\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\n\nimport { DaffAuthMemberOnlyGuardRedirectUrl } from './member-only-guard-redirect.token';\n\n\n@Injectable({\n providedIn: 'any',\n})\nexport class MemberOnlyGuard {\n constructor(\n private tokenCheck: DaffAuthDriverTokenCheck,\n private storage: DaffAuthStorageService,\n private router: Router,\n private store: Store,\n @Inject(DAFF_AUTH_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n @Inject(DaffAuthMemberOnlyGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.isAuthenticated().pipe(\n tap(result => {\n if (!result) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n\n private isAuthenticated(): Observable<boolean> {\n return this.tokenCheck.check().pipe(\n map(() => true),\n catchError((error: DaffError) => {\n if (DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES[error.code]) {\n this.store.dispatch(new DaffAuthGuardLogout(this.errorMatcher(error)));\n }\n return of(false);\n }),\n );\n }\n}\n","import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n token: DaffAuthGuestOnlyGuardRedirectUrl,\n /**\n * Provider function for {@link DaffAuthGuestOnlyGuardRedirectUrl}.\n */\n provider: provideDaffAuthGuestOnlyGuardRedirectUrl,\n} = createSingleInjectionToken<string>(\n 'DaffAuthGuestOnlyGuardRedirectUrl',\n { factory: () => '/' },\n);\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n catchError,\n map,\n tap,\n} from 'rxjs/operators';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport {\n DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES,\n DaffAuthDriverTokenCheck,\n} from '@daffodil/auth/driver';\nimport {\n DAFF_AUTH_ERROR_MATCHER,\n DaffAuthGuardLogout,\n} from '@daffodil/auth/state';\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\n\nimport { DaffAuthGuestOnlyGuardRedirectUrl } from './guest-only-guard-redirect.token';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class GuestOnlyGuard {\n constructor(\n private tokenCheck: DaffAuthDriverTokenCheck,\n private storage: DaffAuthStorageService,\n private router: Router,\n private store: Store,\n @Inject(DAFF_AUTH_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n @Inject(DaffAuthGuestOnlyGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.isUnauthenticated().pipe(\n tap(result => {\n if (!result) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n\n private isUnauthenticated(): Observable<boolean> {\n return this.tokenCheck.check().pipe(\n map(() => false),\n catchError((error: DaffError) => {\n if (DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES[error.code]) {\n this.store.dispatch(new DaffAuthGuardLogout(this.errorMatcher(error)));\n }\n return of(true);\n }),\n );\n }\n}\n","import { DaffAuthRoutingConfig } from './interface';\n\nexport const DAFF_AUTH_ROUTING_CONFIG_DEFAULT: DaffAuthRoutingConfig = {\n resetPasswordTokenParam: 'token',\n redirectUrlParam: 'redirect',\n authCompleteRedirectPath: '/',\n logoutRedirectPath: '/',\n tokenExpirationRedirectPath: '/',\n resetPasswordRedirectPath: '/',\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_AUTH_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffAuthRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/auth/routing config data.\n */\n token: DAFF_AUTH_ROUTING_CONFIG,\n /**\n * Provider function for {@link DAFF_AUTH_ROUTING_CONFIG}.\n */\n provider: provideDaffAuthRoutingConfig,\n} = createConfigInjectionToken<DaffAuthRoutingConfig>(DAFF_AUTH_ROUTING_CONFIG_DEFAULT, 'DAFF_AUTH_ROUTING_CONFIG');\n","import { isPlatformServer } from '@angular/common';\nimport {\n inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n Router,\n UrlTree,\n} from '@angular/router';\n\nimport {\n DaffAuthFacade,\n DaffResetPasswordLanding,\n} from '@daffodil/auth/state';\n\nimport { DAFF_AUTH_ROUTING_CONFIG } from '../config/public_api';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class DaffAuthResetPasswordGuard implements CanActivate {\n readonly facade = inject(DaffAuthFacade);\n readonly config = inject(DAFF_AUTH_ROUTING_CONFIG);\n readonly platformId = inject(PLATFORM_ID);\n readonly router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot): boolean | UrlTree {\n if (isPlatformServer(this.platformId)) {\n return true;\n }\n\n const token = route.queryParamMap.get(this.config.resetPasswordTokenParam);\n\n if (!token) {\n return this.router.parseUrl(this.config.resetPasswordRedirectPath);\n }\n\n this.facade.dispatch(new DaffResetPasswordLanding(token));\n\n return true;\n }\n}\n","import {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n from,\n of,\n} from 'rxjs';\n\nimport {\n DaffAuthActionTypes,\n DaffAuthLoginActionTypes,\n DaffAuthUnauthenticatedHook,\n} from '@daffodil/auth/state';\n\nimport { DaffAuthRoutingConfig } from '../config/public_api';\n\nexport function daffAuthRoutingRedirectUnauthenticatedHookFactory(router: Router, route: ActivatedRoute, config: DaffAuthRoutingConfig): DaffAuthUnauthenticatedHook {\n return (trigger) => {\n switch (trigger) {\n case DaffAuthLoginActionTypes.LogoutSuccessAction:\n return from(router.navigateByUrl(route.snapshot.queryParamMap.get(config.redirectUrlParam) || config.logoutRedirectPath));\n\n case DaffAuthActionTypes.AuthCheckFailureAction:\n case DaffAuthActionTypes.AuthGuardLogoutAction:\n return from(router.navigateByUrl(route.snapshot.queryParamMap.get(config.redirectUrlParam) || config.tokenExpirationRedirectPath));\n\n default:\n return of(null);\n }\n };\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport {\n DaffAuthRoutingConfig,\n provideDaffAuthRoutingConfig,\n} from './config/public_api';\nimport {\n DaffAuthResetPasswordGuard,\n GuestOnlyGuard,\n MemberOnlyGuard,\n} from './guards/public_api';\n\n@NgModule({\n providers: [\n DaffAuthResetPasswordGuard,\n MemberOnlyGuard,\n GuestOnlyGuard,\n ],\n})\nexport class DaffAuthRoutingModule {\n static withConfig(config?: Partial<DaffAuthRoutingConfig>): ModuleWithProviders<DaffAuthRoutingModule> {\n return {\n ngModule: DaffAuthRoutingModule,\n providers: [\n provideDaffAuthRoutingConfig(config),\n ],\n };\n }\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { EMPTY } from 'rxjs';\nimport {\n filter,\n switchMap,\n tap,\n} from 'rxjs/operators';\n\nimport {\n DaffAuthActions,\n DaffAuthLoginActionTypes,\n DaffAuthLoginActions,\n DaffAuthRegisterActionTypes,\n DaffAuthRegisterActions,\n DaffAuthResetPasswordActionTypes,\n DaffAuthResetPasswordActions,\n} from '@daffodil/auth/state';\n\nimport {\n DaffAuthRoutingConfig,\n DAFF_AUTH_ROUTING_CONFIG,\n} from '../config/public_api';\n\n/**\n * Redirects the user to certain pages based on certain auth actions.\n */\n@Injectable()\nexport class DaffAuthRedirectEffects {\n constructor(\n private actions$: Actions<DaffAuthLoginActions | DaffAuthActions | DaffAuthRegisterActions | DaffAuthResetPasswordActions>,\n private router: Router,\n private route: ActivatedRoute,\n @Inject(DAFF_AUTH_ROUTING_CONFIG) private config: DaffAuthRoutingConfig,\n ) {}\n\n redirectAfterLoginOrRegister$ = createEffect(() => this.actions$.pipe(\n ofType(\n DaffAuthLoginActionTypes.LoginSuccessAction,\n DaffAuthRegisterActionTypes.RegisterSuccessAction,\n DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction,\n ),\n filter((action) => {\n if ((action.type === DaffAuthRegisterActionTypes.RegisterSuccessAction || action.type === DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction) && !action.token) {\n return false;\n }\n return true;\n }),\n tap((action) => {\n this.router.navigateByUrl(this.route.snapshot.queryParamMap.get(this.config.redirectUrlParam) || this.config.authCompleteRedirectPath);\n }),\n switchMap(() => EMPTY),\n ), { dispatch: false });\n}\n","import {\n NgModule,\n inject,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport { DAFF_AUTH_UNAUTHENTICATED_HOOKS } from '@daffodil/auth/state';\n\nimport { DAFF_AUTH_ROUTING_CONFIG } from './config/public_api';\nimport { DaffAuthRedirectEffects } from './effects/redirect.effects';\nimport { daffAuthRoutingRedirectUnauthenticatedHookFactory } from './helpers/public_api';\n\n\n@NgModule({\n imports: [\n EffectsModule.forFeature([\n DaffAuthRedirectEffects,\n ]),\n ],\n providers: [\n {\n provide: DAFF_AUTH_UNAUTHENTICATED_HOOKS,\n multi: true,\n useFactory: () =>\n daffAuthRoutingRedirectUnauthenticatedHookFactory(\n inject(Router),\n inject(ActivatedRoute),\n inject(DAFF_AUTH_ROUTING_CONFIG),\n ),\n },\n ],\n})\nexport class DaffAuthRoutingRedirectModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;AAEO,MAAM,EACX,KAAK,EAAE,kCAAkC;AACzC;;AAEG;AACH,QAAQ,EAAE,yCAAyC,GACpD,GAAG,0BAA0B,CAC5B,oCAAoC,EACpC,EAAE,OAAO,EAAE,MAAM,GAAG,EAAE;;MCwBX,eAAe,CAAA;IAC1B,WAAA,CACU,UAAoC,EACpC,OAA+B,EAC/B,MAAc,EACd,KAAY,EACqB,YAA8B,EACnB,WAAmB,EAAA;QAL/D,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,OAAO,GAAP,OAAO;QACP,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,K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EAAE;wBACP,aAAa,CAAC,UAAU,CAAC;4BACvB,uBAAuB;yBACxB,CAAC;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,+BAA+B;AACxC,4BAAA,KAAK,EAAE,IAAI;4BACX,UAAU,GAAE,MACV,iDAAiD,CAC/C,MAAM,CAAC,MAAM,CAAC,EACd,MAAM,CAAC,cAAc,CAAC,EACtB,MAAM,CAAC,wBAAwB,CAAC,CACjC,CAAA;AACJ,yBAAA;AACF,qBAAA;AACF,iBAAA;;;ACnCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-auth-routing.mjs","names":["i1","i1","i2"],"sources":["../../../libs/auth/routing/src/guards/member-only-guard-redirect.token.ts","../../../libs/auth/routing/src/guards/member-only.guard.ts","../../../libs/auth/routing/src/guards/guest-only-guard-redirect.token.ts","../../../libs/auth/routing/src/guards/guest-only.guard.ts","../../../libs/auth/routing/src/config/default.ts","../../../libs/auth/routing/src/config/token.ts","../../../libs/auth/routing/src/guards/reset-password.guard.ts","../../../libs/auth/routing/src/helpers/redirect-unauthenticated-hook-factory.ts","../../../libs/auth/routing/src/effects/redirect.effects.ts","../../../libs/auth/routing/src/provider.ts","../../../libs/auth/routing/src/module.ts","../../../libs/auth/routing/src/redirect.module.ts"],"sourcesContent":["import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n token: DaffAuthMemberOnlyGuardRedirectUrl,\n /**\n * Provider function for {@link DaffAuthMemberOnlyGuardRedirectUrl}.\n */\n provider: provideDaffAuthMemberOnlyGuardRedirectUrl,\n} = createSingleInjectionToken<string>(\n 'DaffAuthMemberOnlyGuardRedirectUrl',\n { factory: () => '/' },\n);\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n catchError,\n map,\n tap,\n} from 'rxjs/operators';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport {\n DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES,\n DaffAuthDriverTokenCheck,\n} from '@daffodil/auth/driver';\nimport {\n DAFF_AUTH_ERROR_MATCHER,\n DaffAuthGuardLogout,\n} from '@daffodil/auth/state';\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\n\nimport { DaffAuthMemberOnlyGuardRedirectUrl } from './member-only-guard-redirect.token';\n\n\n@Injectable({\n providedIn: 'any',\n})\nexport class MemberOnlyGuard {\n constructor(\n private tokenCheck: DaffAuthDriverTokenCheck,\n private storage: DaffAuthStorageService,\n private router: Router,\n private store: Store,\n @Inject(DAFF_AUTH_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n @Inject(DaffAuthMemberOnlyGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.isAuthenticated().pipe(\n tap(result => {\n if (!result) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n\n private isAuthenticated(): Observable<boolean> {\n return this.tokenCheck.check().pipe(\n map(() => true),\n catchError((error: DaffError) => {\n if (DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES[error.code]) {\n this.store.dispatch(new DaffAuthGuardLogout(this.errorMatcher(error)));\n }\n return of(false);\n }),\n );\n }\n}\n","import { createSingleInjectionToken } from '@daffodil/core';\n\nexport const {\n token: DaffAuthGuestOnlyGuardRedirectUrl,\n /**\n * Provider function for {@link DaffAuthGuestOnlyGuardRedirectUrl}.\n */\n provider: provideDaffAuthGuestOnlyGuardRedirectUrl,\n} = createSingleInjectionToken<string>(\n 'DaffAuthGuestOnlyGuardRedirectUrl',\n { factory: () => '/' },\n);\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport {\n Observable,\n of,\n} from 'rxjs';\nimport {\n catchError,\n map,\n tap,\n} from 'rxjs/operators';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport {\n DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES,\n DaffAuthDriverTokenCheck,\n} from '@daffodil/auth/driver';\nimport {\n DAFF_AUTH_ERROR_MATCHER,\n DaffAuthGuardLogout,\n} from '@daffodil/auth/state';\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\n\nimport { DaffAuthGuestOnlyGuardRedirectUrl } from './guest-only-guard-redirect.token';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class GuestOnlyGuard {\n constructor(\n private tokenCheck: DaffAuthDriverTokenCheck,\n private storage: DaffAuthStorageService,\n private router: Router,\n private store: Store,\n @Inject(DAFF_AUTH_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n @Inject(DaffAuthGuestOnlyGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.isUnauthenticated().pipe(\n tap(result => {\n if (!result) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n\n private isUnauthenticated(): Observable<boolean> {\n return this.tokenCheck.check().pipe(\n map(() => false),\n catchError((error: DaffError) => {\n if (DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES[error.code]) {\n this.store.dispatch(new DaffAuthGuardLogout(this.errorMatcher(error)));\n }\n return of(true);\n }),\n );\n }\n}\n","import { DaffAuthRoutingConfig } from './interface';\n\nexport const DAFF_AUTH_ROUTING_CONFIG_DEFAULT: DaffAuthRoutingConfig = {\n resetPasswordTokenParam: 'token',\n redirectUrlParam: 'redirect',\n authCompleteRedirectPath: '/',\n logoutRedirectPath: '/',\n tokenExpirationRedirectPath: '/',\n resetPasswordRedirectPath: '/',\n};\n","import { createConfigInjectionToken } from '@daffodil/core';\n\nimport { DAFF_AUTH_ROUTING_CONFIG_DEFAULT } from './default';\nimport { DaffAuthRoutingConfig } from './interface';\n\nexport const {\n /**\n * The token used to provide @daffodil/auth/routing config data.\n */\n token: DAFF_AUTH_ROUTING_CONFIG,\n /**\n * Provider function for {@link DAFF_AUTH_ROUTING_CONFIG}.\n */\n provider: provideDaffAuthRoutingConfig,\n} = createConfigInjectionToken<DaffAuthRoutingConfig>(DAFF_AUTH_ROUTING_CONFIG_DEFAULT, 'DAFF_AUTH_ROUTING_CONFIG');\n","import { isPlatformServer } from '@angular/common';\nimport {\n inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n Router,\n UrlTree,\n} from '@angular/router';\n\nimport {\n DaffAuthFacade,\n DaffResetPasswordLanding,\n} from '@daffodil/auth/state';\n\nimport { DAFF_AUTH_ROUTING_CONFIG } from '../config/public_api';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class DaffAuthResetPasswordGuard implements CanActivate {\n readonly facade = inject(DaffAuthFacade);\n readonly config = inject(DAFF_AUTH_ROUTING_CONFIG);\n readonly platformId = inject(PLATFORM_ID);\n readonly router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot): boolean | UrlTree {\n if (isPlatformServer(this.platformId)) {\n return true;\n }\n\n const token = route.queryParamMap.get(this.config.resetPasswordTokenParam);\n\n if (!token) {\n return this.router.parseUrl(this.config.resetPasswordRedirectPath);\n }\n\n this.facade.dispatch(new DaffResetPasswordLanding(token));\n\n return true;\n }\n}\n","import {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n from,\n of,\n} from 'rxjs';\n\nimport {\n DaffAuthActionTypes,\n DaffAuthLoginActionTypes,\n DaffAuthUnauthenticatedHook,\n} from '@daffodil/auth/state';\n\nimport { DaffAuthRoutingConfig } from '../config/public_api';\n\nexport function daffAuthRoutingRedirectUnauthenticatedHookFactory(router: Router, route: ActivatedRoute, config: DaffAuthRoutingConfig): DaffAuthUnauthenticatedHook {\n return (trigger) => {\n switch (trigger) {\n case DaffAuthLoginActionTypes.LogoutSuccessAction:\n return from(router.navigateByUrl(route.snapshot.queryParamMap.get(config.redirectUrlParam) || config.logoutRedirectPath));\n\n case DaffAuthActionTypes.AuthCheckFailureAction:\n case DaffAuthActionTypes.AuthGuardLogoutAction:\n return from(router.navigateByUrl(route.snapshot.queryParamMap.get(config.redirectUrlParam) || config.tokenExpirationRedirectPath));\n\n default:\n return of(null);\n }\n };\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { EMPTY } from 'rxjs';\nimport {\n filter,\n switchMap,\n tap,\n} from 'rxjs/operators';\n\nimport {\n DaffAuthActions,\n DaffAuthLoginActionTypes,\n DaffAuthLoginActions,\n DaffAuthRegisterActionTypes,\n DaffAuthRegisterActions,\n DaffAuthResetPasswordActionTypes,\n DaffAuthResetPasswordActions,\n} from '@daffodil/auth/state';\n\nimport {\n DaffAuthRoutingConfig,\n DAFF_AUTH_ROUTING_CONFIG,\n} from '../config/public_api';\n\n/**\n * Redirects the user to certain pages based on certain auth actions.\n */\n@Injectable()\nexport class DaffAuthRedirectEffects {\n constructor(\n private actions$: Actions<DaffAuthLoginActions | DaffAuthActions | DaffAuthRegisterActions | DaffAuthResetPasswordActions>,\n private router: Router,\n private route: ActivatedRoute,\n @Inject(DAFF_AUTH_ROUTING_CONFIG) private config: DaffAuthRoutingConfig,\n ) {}\n\n redirectAfterLoginOrRegister$ = createEffect(() => this.actions$.pipe(\n ofType(\n DaffAuthLoginActionTypes.LoginSuccessAction,\n DaffAuthRegisterActionTypes.RegisterSuccessAction,\n DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction,\n ),\n filter((action) => {\n if ((action.type === DaffAuthRegisterActionTypes.RegisterSuccessAction || action.type === DaffAuthResetPasswordActionTypes.ResetPasswordSuccessAction) && !action.token) {\n return false;\n }\n return true;\n }),\n tap((action) => {\n this.router.navigateByUrl(this.route.snapshot.queryParamMap.get(this.config.redirectUrlParam) || this.config.authCompleteRedirectPath);\n }),\n switchMap(() => EMPTY),\n ), { dispatch: false });\n}\n","import {\n EnvironmentProviders,\n inject,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport { provideEffects } from '@ngrx/effects';\n\nimport { DAFF_AUTH_UNAUTHENTICATED_HOOKS } from '@daffodil/auth/state';\n\nimport {\n DAFF_AUTH_ROUTING_CONFIG,\n DaffAuthRoutingConfig,\n provideDaffAuthRoutingConfig,\n} from './config/public_api';\nimport { DaffAuthRedirectEffects } from './effects/redirect.effects';\nimport {\n DaffAuthResetPasswordGuard,\n GuestOnlyGuard,\n MemberOnlyGuard,\n} from './guards/public_api';\nimport { daffAuthRoutingRedirectUnauthenticatedHookFactory } from './helpers/public_api';\n\n/**\n * Provides the `@daffodil/auth/routing` guards and config.\n */\nexport const provideDaffAuthRouting = (config?: Partial<DaffAuthRoutingConfig>): EnvironmentProviders => makeEnvironmentProviders([\n DaffAuthResetPasswordGuard,\n MemberOnlyGuard,\n GuestOnlyGuard,\n provideDaffAuthRoutingConfig(config),\n]);\n\n/**\n * Provides the `@daffodil/auth/routing` redirect effects and unauthenticated hook.\n */\nexport const provideDaffAuthRoutingRedirect = (): EnvironmentProviders => makeEnvironmentProviders([\n provideEffects(\n DaffAuthRedirectEffects,\n ),\n {\n provide: DAFF_AUTH_UNAUTHENTICATED_HOOKS,\n multi: true,\n useFactory: () =>\n daffAuthRoutingRedirectUnauthenticatedHookFactory(\n inject(Router),\n inject(ActivatedRoute),\n inject(DAFF_AUTH_ROUTING_CONFIG),\n ),\n },\n]);\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\n\nimport { DaffAuthRoutingConfig } from './config/public_api';\nimport { provideDaffAuthRouting } from './provider';\n\n/**\n * @deprecated in favor of {@link provideDaffAuthRouting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule()\nexport class DaffAuthRoutingModule {\n static withConfig(config?: Partial<DaffAuthRoutingConfig>): ModuleWithProviders<DaffAuthRoutingModule> {\n return {\n ngModule: DaffAuthRoutingModule,\n providers: [\n provideDaffAuthRouting(config),\n ],\n };\n }\n}\n","import {\n NgModule,\n inject,\n} from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n} from '@angular/router';\nimport { EffectsModule } from '@ngrx/effects';\n\nimport { DAFF_AUTH_UNAUTHENTICATED_HOOKS } from '@daffodil/auth/state';\n\nimport { DAFF_AUTH_ROUTING_CONFIG } from './config/public_api';\nimport { DaffAuthRedirectEffects } from './effects/redirect.effects';\nimport { daffAuthRoutingRedirectUnauthenticatedHookFactory } from './helpers/public_api';\n\n\n/**\n * @deprecated in favor of {@link provideDaffAuthRoutingRedirect} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n imports: [\n EffectsModule.forFeature([\n DaffAuthRedirectEffects,\n ]),\n ],\n providers: [\n {\n provide: DAFF_AUTH_UNAUTHENTICATED_HOOKS,\n multi: true,\n useFactory: () =>\n daffAuthRoutingRedirectUnauthenticatedHookFactory(\n inject(Router),\n inject(ActivatedRoute),\n inject(DAFF_AUTH_ROUTING_CONFIG),\n ),\n },\n ],\n})\nexport class DaffAuthRoutingRedirectModule {}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,MAAa,EACX,OAAO,oCAIP,UAAU,8CACR,2BACF,sCACA,EAAE,eAAe,IAAG,CAAE;ACwBxB,IAAa,kBAAb,MAAa,gBAAe;CAC1B,YACU,YACA,SACA,QACA,OACiC,cACW,aAAmB;EAL/D,KAAA,aAAA;EACA,KAAA,UAAA;EACA,KAAA,SAAA;EACA,KAAA,QAAA;EACiC,KAAA,eAAA;EACW,KAAA,cAAA;CACnD;CAEH,cAAW;EACT,OAAO,KAAK,gBAAe,CAAE,CAAC,KAC5B,KAAI,WAAS;GACX,IAAI,CAAC,QACH,KAAK,OAAO,cAAc,KAAK,WAAW;EAE9C,CAAC,CAAC;CAEN;CAEQ,kBAAe;EACrB,OAAO,KAAK,WAAW,MAAK,CAAE,CAAC,KAC7B,UAAU,IAAI,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yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA6B,YAAA,CAAA;EAnBzC,MAAA;EAAS,MAAA,CAAA;GACR,SAAS,CACP,cAAc,WAAW,CACvB,uBACD,CAAA,CACF;GACD,WAAW,CACT;IACE,SAAS;IACT,OAAO;IACP,mBACE,kDACE,OAAO,MAAM,GACb,OAAO,cAAc,GACrB,OAAO,wBAAwB,CAAC;GAErC,CACF;EACF,CAAA"}
|
|
@@ -1,107 +1,210 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Injectable, NgModule } from
|
|
3
|
-
import { DaffAuthFacade, DaffAuthLoginFacade, DaffAuthRegisterFacade, DaffAuthResetPasswordFacade } from
|
|
4
|
-
import { BehaviorSubject } from
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { DaffAuthFacade, DaffAuthLoginFacade, DaffAuthRegisterFacade, DaffAuthResetPasswordFacade } from "@daffodil/auth/state";
|
|
4
|
+
import { BehaviorSubject } from "rxjs";
|
|
5
|
+
var MockDaffAuthFacade = class MockDaffAuthFacade {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.loading$ = new BehaviorSubject(false);
|
|
8
|
+
this.errors$ = new BehaviorSubject([]);
|
|
9
|
+
this.loggedIn$ = new BehaviorSubject(false);
|
|
10
|
+
}
|
|
11
|
+
dispatch(action) {}
|
|
12
|
+
static {
|
|
13
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
14
|
+
minVersion: "12.0.0",
|
|
15
|
+
version: "22.2.4",
|
|
16
|
+
ngImport: i0,
|
|
17
|
+
type: MockDaffAuthFacade,
|
|
18
|
+
deps: [],
|
|
19
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
24
|
+
minVersion: "12.0.0",
|
|
25
|
+
version: "22.2.4",
|
|
26
|
+
ngImport: i0,
|
|
27
|
+
type: MockDaffAuthFacade,
|
|
28
|
+
providedIn: "root"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
33
|
+
minVersion: "12.0.0",
|
|
34
|
+
version: "22.2.4",
|
|
35
|
+
ngImport: i0,
|
|
36
|
+
type: MockDaffAuthFacade,
|
|
37
|
+
decorators: [{
|
|
38
|
+
type: Injectable,
|
|
39
|
+
args: [{ providedIn: "root" }]
|
|
40
|
+
}]
|
|
41
|
+
});
|
|
42
|
+
var MockDaffAuthLoginFacade = class MockDaffAuthLoginFacade {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.loading$ = new BehaviorSubject(false);
|
|
45
|
+
this.errors$ = new BehaviorSubject([]);
|
|
46
|
+
}
|
|
47
|
+
dispatch(action) {}
|
|
48
|
+
static {
|
|
49
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
50
|
+
minVersion: "12.0.0",
|
|
51
|
+
version: "22.2.4",
|
|
52
|
+
ngImport: i0,
|
|
53
|
+
type: MockDaffAuthLoginFacade,
|
|
54
|
+
deps: [],
|
|
55
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static {
|
|
59
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
60
|
+
minVersion: "12.0.0",
|
|
61
|
+
version: "22.2.4",
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
type: MockDaffAuthLoginFacade,
|
|
64
|
+
providedIn: "root"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
69
|
+
minVersion: "12.0.0",
|
|
70
|
+
version: "22.2.4",
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
type: MockDaffAuthLoginFacade,
|
|
73
|
+
decorators: [{
|
|
74
|
+
type: Injectable,
|
|
75
|
+
args: [{ providedIn: "root" }]
|
|
76
|
+
}]
|
|
77
|
+
});
|
|
78
|
+
var MockDaffAuthRegisterFacade = class MockDaffAuthRegisterFacade {
|
|
79
|
+
constructor() {
|
|
80
|
+
this.loading$ = new BehaviorSubject(false);
|
|
81
|
+
this.errors$ = new BehaviorSubject([]);
|
|
82
|
+
}
|
|
83
|
+
dispatch(action) {}
|
|
84
|
+
static {
|
|
85
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
86
|
+
minVersion: "12.0.0",
|
|
87
|
+
version: "22.2.4",
|
|
88
|
+
ngImport: i0,
|
|
89
|
+
type: MockDaffAuthRegisterFacade,
|
|
90
|
+
deps: [],
|
|
91
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
static {
|
|
95
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
96
|
+
minVersion: "12.0.0",
|
|
97
|
+
version: "22.2.4",
|
|
98
|
+
ngImport: i0,
|
|
99
|
+
type: MockDaffAuthRegisterFacade,
|
|
100
|
+
providedIn: "root"
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
105
|
+
minVersion: "12.0.0",
|
|
106
|
+
version: "22.2.4",
|
|
107
|
+
ngImport: i0,
|
|
108
|
+
type: MockDaffAuthRegisterFacade,
|
|
109
|
+
decorators: [{
|
|
110
|
+
type: Injectable,
|
|
111
|
+
args: [{ providedIn: "root" }]
|
|
112
|
+
}]
|
|
113
|
+
});
|
|
114
|
+
var MockDaffAuthResetPasswordFacade = class MockDaffAuthResetPasswordFacade {
|
|
115
|
+
constructor() {
|
|
116
|
+
this.token$ = new BehaviorSubject("");
|
|
117
|
+
this.loading$ = new BehaviorSubject(false);
|
|
118
|
+
this.errors$ = new BehaviorSubject([]);
|
|
119
|
+
}
|
|
120
|
+
dispatch(action) {}
|
|
121
|
+
static {
|
|
122
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
123
|
+
minVersion: "12.0.0",
|
|
124
|
+
version: "22.2.4",
|
|
125
|
+
ngImport: i0,
|
|
126
|
+
type: MockDaffAuthResetPasswordFacade,
|
|
127
|
+
deps: [],
|
|
128
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
static {
|
|
132
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
133
|
+
minVersion: "12.0.0",
|
|
134
|
+
version: "22.2.4",
|
|
135
|
+
ngImport: i0,
|
|
136
|
+
type: MockDaffAuthResetPasswordFacade,
|
|
137
|
+
providedIn: "root"
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
142
|
+
minVersion: "12.0.0",
|
|
143
|
+
version: "22.2.4",
|
|
144
|
+
ngImport: i0,
|
|
145
|
+
type: MockDaffAuthResetPasswordFacade,
|
|
146
|
+
decorators: [{
|
|
147
|
+
type: Injectable,
|
|
148
|
+
args: [{ providedIn: "root" }]
|
|
149
|
+
}]
|
|
150
|
+
});
|
|
151
|
+
const provideDaffAuthStateTesting = () => makeEnvironmentProviders([
|
|
152
|
+
{
|
|
153
|
+
provide: DaffAuthFacade,
|
|
154
|
+
useExisting: MockDaffAuthFacade
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
provide: DaffAuthLoginFacade,
|
|
158
|
+
useExisting: MockDaffAuthLoginFacade
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
provide: DaffAuthRegisterFacade,
|
|
162
|
+
useExisting: MockDaffAuthRegisterFacade
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
provide: DaffAuthResetPasswordFacade,
|
|
166
|
+
useExisting: MockDaffAuthResetPasswordFacade
|
|
167
|
+
}
|
|
168
|
+
]);
|
|
169
|
+
var DaffAuthStateTestingModule = class DaffAuthStateTestingModule {
|
|
170
|
+
static {
|
|
171
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
172
|
+
minVersion: "12.0.0",
|
|
173
|
+
version: "22.2.4",
|
|
174
|
+
ngImport: i0,
|
|
175
|
+
type: DaffAuthStateTestingModule,
|
|
176
|
+
deps: [],
|
|
177
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
static {
|
|
181
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
182
|
+
minVersion: "14.0.0",
|
|
183
|
+
version: "22.2.4",
|
|
184
|
+
ngImport: i0,
|
|
185
|
+
type: DaffAuthStateTestingModule
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
static {
|
|
189
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
190
|
+
minVersion: "12.0.0",
|
|
191
|
+
version: "22.2.4",
|
|
192
|
+
ngImport: i0,
|
|
193
|
+
type: DaffAuthStateTestingModule,
|
|
194
|
+
providers: [provideDaffAuthStateTesting()]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
199
|
+
minVersion: "12.0.0",
|
|
200
|
+
version: "22.2.4",
|
|
201
|
+
ngImport: i0,
|
|
202
|
+
type: DaffAuthStateTestingModule,
|
|
203
|
+
decorators: [{
|
|
204
|
+
type: NgModule,
|
|
205
|
+
args: [{ providers: [provideDaffAuthStateTesting()] }]
|
|
206
|
+
}]
|
|
207
|
+
});
|
|
208
|
+
export { DaffAuthStateTestingModule, MockDaffAuthFacade, MockDaffAuthLoginFacade, MockDaffAuthRegisterFacade, MockDaffAuthResetPasswordFacade, provideDaffAuthStateTesting };
|
|
5
209
|
|
|
6
|
-
|
|
7
|
-
* @inheritdoc
|
|
8
|
-
*/
|
|
9
|
-
class MockDaffAuthFacade {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.loading$ = new BehaviorSubject(false);
|
|
12
|
-
this.errors$ = new BehaviorSubject([]);
|
|
13
|
-
this.loggedIn$ = new BehaviorSubject(false);
|
|
14
|
-
}
|
|
15
|
-
dispatch(action) { }
|
|
16
|
-
;
|
|
17
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
18
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthFacade, providedIn: 'root' }); }
|
|
19
|
-
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthFacade, decorators: [{
|
|
21
|
-
type: Injectable,
|
|
22
|
-
args: [{ providedIn: 'root' }]
|
|
23
|
-
}] });
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @inheritdoc
|
|
27
|
-
*/
|
|
28
|
-
class MockDaffAuthLoginFacade {
|
|
29
|
-
constructor() {
|
|
30
|
-
this.loading$ = new BehaviorSubject(false);
|
|
31
|
-
this.errors$ = new BehaviorSubject([]);
|
|
32
|
-
}
|
|
33
|
-
dispatch(action) { }
|
|
34
|
-
;
|
|
35
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthLoginFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
36
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthLoginFacade, providedIn: 'root' }); }
|
|
37
|
-
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthLoginFacade, decorators: [{
|
|
39
|
-
type: Injectable,
|
|
40
|
-
args: [{ providedIn: 'root' }]
|
|
41
|
-
}] });
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @inheritdoc
|
|
45
|
-
*/
|
|
46
|
-
class MockDaffAuthRegisterFacade {
|
|
47
|
-
constructor() {
|
|
48
|
-
this.loading$ = new BehaviorSubject(false);
|
|
49
|
-
this.errors$ = new BehaviorSubject([]);
|
|
50
|
-
}
|
|
51
|
-
dispatch(action) { }
|
|
52
|
-
;
|
|
53
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthRegisterFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
54
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthRegisterFacade, providedIn: 'root' }); }
|
|
55
|
-
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthRegisterFacade, decorators: [{
|
|
57
|
-
type: Injectable,
|
|
58
|
-
args: [{ providedIn: 'root' }]
|
|
59
|
-
}] });
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @inheritdoc
|
|
63
|
-
*/
|
|
64
|
-
class MockDaffAuthResetPasswordFacade {
|
|
65
|
-
constructor() {
|
|
66
|
-
this.token$ = new BehaviorSubject('');
|
|
67
|
-
this.loading$ = new BehaviorSubject(false);
|
|
68
|
-
this.errors$ = new BehaviorSubject([]);
|
|
69
|
-
}
|
|
70
|
-
dispatch(action) { }
|
|
71
|
-
;
|
|
72
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthResetPasswordFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
73
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthResetPasswordFacade, providedIn: 'root' }); }
|
|
74
|
-
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffAuthResetPasswordFacade, decorators: [{
|
|
76
|
-
type: Injectable,
|
|
77
|
-
args: [{ providedIn: 'root' }]
|
|
78
|
-
}] });
|
|
79
|
-
|
|
80
|
-
class DaffAuthStateTestingModule {
|
|
81
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStateTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
82
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStateTestingModule }); }
|
|
83
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStateTestingModule, providers: [
|
|
84
|
-
{ provide: DaffAuthFacade, useExisting: MockDaffAuthFacade },
|
|
85
|
-
{ provide: DaffAuthLoginFacade, useExisting: MockDaffAuthLoginFacade },
|
|
86
|
-
{ provide: DaffAuthRegisterFacade, useExisting: MockDaffAuthRegisterFacade },
|
|
87
|
-
{ provide: DaffAuthResetPasswordFacade, useExisting: MockDaffAuthResetPasswordFacade },
|
|
88
|
-
] }); }
|
|
89
|
-
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStateTestingModule, decorators: [{
|
|
91
|
-
type: NgModule,
|
|
92
|
-
args: [{
|
|
93
|
-
providers: [
|
|
94
|
-
{ provide: DaffAuthFacade, useExisting: MockDaffAuthFacade },
|
|
95
|
-
{ provide: DaffAuthLoginFacade, useExisting: MockDaffAuthLoginFacade },
|
|
96
|
-
{ provide: DaffAuthRegisterFacade, useExisting: MockDaffAuthRegisterFacade },
|
|
97
|
-
{ provide: DaffAuthResetPasswordFacade, useExisting: MockDaffAuthResetPasswordFacade },
|
|
98
|
-
],
|
|
99
|
-
}]
|
|
100
|
-
}] });
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Generated bundle index. Do not edit.
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
export { DaffAuthStateTestingModule, MockDaffAuthFacade, MockDaffAuthLoginFacade, MockDaffAuthRegisterFacade, MockDaffAuthResetPasswordFacade };
|
|
107
|
-
//# sourceMappingURL=daffodil-auth-state-testing.mjs.map
|
|
210
|
+
//# sourceMappingURL=daffodil-auth-state-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-state-testing.mjs","sources":["../../../libs/auth/state/testing/src/mock-auth-facade.ts","../../../libs/auth/state/testing/src/mock-login-facade.ts","../../../libs/auth/state/testing/src/mock-register-facade.ts","../../../libs/auth/state/testing/src/mock-reset-password-facade.ts","../../../libs/auth/state/testing/src/
|
|
1
|
+
{"version":3,"file":"daffodil-auth-state-testing.mjs","names":[],"sources":["../../../libs/auth/state/testing/src/mock-auth-facade.ts","../../../libs/auth/state/testing/src/mock-login-facade.ts","../../../libs/auth/state/testing/src/mock-register-facade.ts","../../../libs/auth/state/testing/src/mock-reset-password-facade.ts","../../../libs/auth/state/testing/src/provider.ts","../../../libs/auth/state/testing/src/auth-testing.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffAuthFacadeInterface } from '@daffodil/auth/state';\nimport { DaffStateError } from '@daffodil/core/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffAuthFacade implements DaffAuthFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n loggedIn$ = new BehaviorSubject<boolean>(false);\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffAuthLoginFacadeInterface } from '@daffodil/auth/state';\nimport { DaffStateError } from '@daffodil/core/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffAuthLoginFacade implements DaffAuthLoginFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffAuthRegisterFacadeInterface } from '@daffodil/auth/state';\nimport { DaffStateError } from '@daffodil/core/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffAuthRegisterFacade implements DaffAuthRegisterFacadeInterface {\n loading$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffAuthResetPasswordFacadeInterface } from '@daffodil/auth/state';\nimport { DaffStateError } from '@daffodil/core/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffAuthResetPasswordFacade implements DaffAuthResetPasswordFacadeInterface {\n token$ = new BehaviorSubject<string>('');\n loading$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n DaffAuthFacade,\n DaffAuthLoginFacade,\n DaffAuthRegisterFacade,\n DaffAuthResetPasswordFacade,\n} from '@daffodil/auth/state';\n\nimport { MockDaffAuthFacade } from './mock-auth-facade';\nimport { MockDaffAuthLoginFacade } from './mock-login-facade';\nimport { MockDaffAuthRegisterFacade } from './mock-register-facade';\nimport { MockDaffAuthResetPasswordFacade } from './mock-reset-password-facade';\n\n/**\n * Provides the mock facades for the `@daffodil/auth/state` facades.\n */\nexport const provideDaffAuthStateTesting = (): EnvironmentProviders => makeEnvironmentProviders([\n { provide: DaffAuthFacade, useExisting: MockDaffAuthFacade },\n { provide: DaffAuthLoginFacade, useExisting: MockDaffAuthLoginFacade },\n { provide: DaffAuthRegisterFacade, useExisting: MockDaffAuthRegisterFacade },\n { provide: DaffAuthResetPasswordFacade, useExisting: MockDaffAuthResetPasswordFacade },\n]);\n","import { NgModule } from '@angular/core';\n\nimport { provideDaffAuthStateTesting } from './provider';\n\n/**\n * @deprecated in favor of {@link provideDaffAuthStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n providers: [\n provideDaffAuthStateTesting(),\n ],\n})\nexport class DaffAuthStateTestingModule {}\n"],"mappings":";;;;AAWA,IAAa,qBAAb,MAAa,mBAAkB;CAD/B,cAAA;EAEE,KAAA,WAAW,IAAI,gBAAyB,KAAK;EAC7C,KAAA,UAAU,IAAI,gBAAkC,CAAA,CAAE;EAClD,KAAA,YAAY,IAAI,gBAAyB,KAAK;CAG/C;CADC,SAAS,QAAc,CAAG;CALf;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAlB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,YADL;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CA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