@daffodil/auth 0.88.1 → 0.89.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/driver/in-memory/index.d.ts +84 -1
- package/driver/index.d.ts +135 -1
- package/driver/magento/index.d.ts +132 -1
- package/driver/testing/index.d.ts +49 -1
- package/fesm2022/daffodil-auth-driver-in-memory.mjs +19 -19
- package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-magento.mjs +22 -22
- package/fesm2022/daffodil-auth-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-testing.mjs +16 -16
- package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver.mjs +3 -3
- package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
- package/fesm2022/daffodil-auth-routing.mjs +20 -20
- package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state-testing.mjs +16 -16
- package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state.mjs +28 -28
- package/fesm2022/daffodil-auth-state.mjs.map +1 -1
- package/fesm2022/daffodil-auth-testing.mjs +9 -9
- package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth.mjs +3 -3
- package/fesm2022/daffodil-auth.mjs.map +1 -1
- package/index.d.ts +76 -1
- package/package.json +1 -1
- package/routing/index.d.ts +104 -1
- package/state/index.d.ts +424 -1
- package/state/testing/index.d.ts +59 -1
- package/testing/index.d.ts +38 -1
- package/driver/constants/public_api.d.ts +0 -1
- package/driver/constants/unauthenticated-error-codes.d.ts +0 -10
- package/driver/errors/authentication-failed.d.ts +0 -6
- package/driver/errors/codes.enum.d.ts +0 -6
- package/driver/errors/invalid-api-response.d.ts +0 -6
- package/driver/errors/map.d.ts +0 -13
- package/driver/errors/public_api.d.ts +0 -6
- package/driver/errors/registration-failed.d.ts +0 -9
- package/driver/errors/unauthorized.d.ts +0 -6
- package/driver/in-memory/backend/auth.service.d.ts +0 -24
- package/driver/in-memory/collection-name.const.d.ts +0 -1
- package/driver/in-memory/drivers/auth/auth.service.d.ts +0 -16
- package/driver/in-memory/drivers/auth-driver.module.d.ts +0 -9
- package/driver/in-memory/drivers/login/login.service.d.ts +0 -18
- package/driver/in-memory/drivers/public_api.d.ts +0 -4
- package/driver/in-memory/drivers/register/register.service.d.ts +0 -20
- package/driver/in-memory/drivers/reset-password/service.d.ts +0 -21
- package/driver/in-memory/models/db-customer.type.d.ts +0 -8
- package/driver/in-memory/public_api.d.ts +0 -2
- package/driver/interfaces/auth-service.interface.d.ts +0 -8
- package/driver/interfaces/login-service.interface.d.ts +0 -15
- package/driver/interfaces/public_api.d.ts +0 -4
- package/driver/interfaces/register-service.interface.d.ts +0 -18
- package/driver/interfaces/reset-password-service.interface.d.ts +0 -17
- package/driver/magento/apollo-bearer-token-link-generator.d.ts +0 -16
- package/driver/magento/auth-driver.module.d.ts +0 -9
- package/driver/magento/auth.service.d.ts +0 -14
- package/driver/magento/errors/codes.d.ts +0 -5
- package/driver/magento/errors/map.d.ts +0 -2
- package/driver/magento/errors/transform.d.ts +0 -1
- package/driver/magento/login.service.d.ts +0 -18
- package/driver/magento/models/public_api.d.ts +0 -4
- package/driver/magento/models/response/auth.d.ts +0 -3
- package/driver/magento/models/response/register.type.d.ts +0 -7
- package/driver/magento/models/response/reset-password.type.d.ts +0 -3
- package/driver/magento/models/response/send-reset-email.type.d.ts +0 -3
- package/driver/magento/public_api.d.ts +0 -8
- package/driver/magento/queries/check-token.d.ts +0 -1
- package/driver/magento/queries/create-customer.d.ts +0 -1
- package/driver/magento/queries/generate-token.d.ts +0 -1
- package/driver/magento/queries/public_api.d.ts +0 -7
- package/driver/magento/queries/reset-password.d.ts +0 -1
- package/driver/magento/queries/responses/check-token-response.d.ts +0 -5
- package/driver/magento/queries/responses/generate-token-response.d.ts +0 -4
- package/driver/magento/queries/responses/public_api.d.ts +0 -3
- package/driver/magento/queries/responses/revoke-customer-token-response.d.ts +0 -5
- package/driver/magento/queries/revoke-customer-token.d.ts +0 -1
- package/driver/magento/queries/send-reset-email.d.ts +0 -1
- package/driver/magento/register.service.d.ts +0 -18
- package/driver/magento/reset-password.service.d.ts +0 -19
- package/driver/magento/transforms/auth-transformer.service.d.ts +0 -16
- package/driver/magento/validators/check-token.d.ts +0 -3
- package/driver/magento/validators/generate-token.d.ts +0 -3
- package/driver/magento/validators/public_api.d.ts +0 -5
- package/driver/magento/validators/reset-password.d.ts +0 -3
- package/driver/magento/validators/revoke-token.d.ts +0 -3
- package/driver/magento/validators/send-reset-email.d.ts +0 -3
- package/driver/public_api.d.ts +0 -4
- package/driver/services/auth-check.service.d.ts +0 -17
- package/driver/services/public_api.d.ts +0 -1
- package/driver/testing/drivers/auth/auth.service.d.ts +0 -11
- package/driver/testing/drivers/auth-driver.module.d.ts +0 -9
- package/driver/testing/drivers/login/login.service.d.ts +0 -16
- package/driver/testing/drivers/public_api.d.ts +0 -4
- package/driver/testing/drivers/register/register.service.d.ts +0 -16
- package/driver/testing/drivers/reset-password/service.d.ts +0 -17
- package/driver/testing/public_api.d.ts +0 -1
- package/errors/codes.enum.d.ts +0 -3
- package/errors/map.d.ts +0 -7
- package/errors/missing-token.d.ts +0 -10
- package/errors/public_api.d.ts +0 -3
- package/models/account-registration.d.ts +0 -15
- package/models/auth-token.d.ts +0 -3
- package/models/login-info.d.ts +0 -4
- package/models/public_api.d.ts +0 -4
- package/models/reset-password-info.type.d.ts +0 -14
- package/public_api.d.ts +0 -3
- package/routing/config/default.d.ts +0 -2
- package/routing/config/interface.d.ts +0 -29
- package/routing/config/public_api.d.ts +0 -3
- package/routing/config/token.d.ts +0 -2
- package/routing/effects/redirect.effects.d.ts +0 -18
- package/routing/guards/guest-only-guard-redirect.token.d.ts +0 -1
- package/routing/guards/guest-only.guard.d.ts +0 -20
- package/routing/guards/member-only-guard-redirect.token.d.ts +0 -1
- package/routing/guards/member-only.guard.d.ts +0 -20
- package/routing/guards/public_api.d.ts +0 -5
- package/routing/guards/reset-password.guard.d.ts +0 -13
- package/routing/helpers/public_api.d.ts +0 -1
- package/routing/helpers/redirect-unauthenticated-hook-factory.d.ts +0 -4
- package/routing/module.d.ts +0 -9
- package/routing/public_api.d.ts +0 -5
- package/routing/redirect.module.d.ts +0 -7
- package/state/actions/auth.actions.d.ts +0 -56
- package/state/actions/login.actions.d.ts +0 -64
- package/state/actions/public_api.d.ts +0 -4
- package/state/actions/register.actions.d.ts +0 -40
- package/state/actions/reset-password.actions.d.ts +0 -74
- package/state/auth-state.module.d.ts +0 -11
- package/state/config/default.d.ts +0 -2
- package/state/config/public_api.d.ts +0 -3
- package/state/config/token.d.ts +0 -2
- package/state/config/type.d.ts +0 -7
- package/state/effects/auth.effects.d.ts +0 -28
- package/state/effects/login.effects.d.ts +0 -17
- package/state/effects/register.effects.d.ts +0 -17
- package/state/effects/reset-password.effects.d.ts +0 -18
- package/state/facades/auth/facade.d.ts +0 -19
- package/state/facades/auth/facade.interface.d.ts +0 -11
- package/state/facades/auth/public_api.d.ts +0 -2
- package/state/facades/login/facade.d.ts +0 -18
- package/state/facades/login/facade.interface.d.ts +0 -7
- package/state/facades/login/public_api.d.ts +0 -2
- package/state/facades/public_api.d.ts +0 -4
- package/state/facades/register/facade.d.ts +0 -18
- package/state/facades/register/facade.interface.d.ts +0 -7
- package/state/facades/register/public_api.d.ts +0 -2
- package/state/facades/reset-password/facade.d.ts +0 -20
- package/state/facades/reset-password/facade.interface.d.ts +0 -9
- package/state/facades/reset-password/public_api.d.ts +0 -2
- package/state/injection-tokens/error-matcher.token.d.ts +0 -2
- package/state/injection-tokens/public_api.d.ts +0 -2
- package/state/injection-tokens/unauthenticated/hook.token.d.ts +0 -2
- package/state/injection-tokens/unauthenticated/hook.type.d.ts +0 -9
- package/state/injection-tokens/unauthenticated/hooks.token.d.ts +0 -2
- package/state/injection-tokens/unauthenticated/public_api.d.ts +0 -2
- package/state/public_api.d.ts +0 -7
- package/state/reducers/auth/auth-initial-state.d.ts +0 -2
- package/state/reducers/auth/auth-reducer-state.interface.d.ts +0 -4
- package/state/reducers/auth/auth.reducer.d.ts +0 -3
- package/state/reducers/auth/public_api.d.ts +0 -3
- package/state/reducers/auth-feature-state.interface.d.ts +0 -14
- package/state/reducers/auth-reducers.d.ts +0 -3
- package/state/reducers/auth-store-feature-key.d.ts +0 -1
- package/state/reducers/login/login-initial-state.d.ts +0 -2
- package/state/reducers/login/login-reducer-state.interface.d.ts +0 -2
- package/state/reducers/login/login.reducer.d.ts +0 -4
- package/state/reducers/login/public_api.d.ts +0 -3
- package/state/reducers/public_api.d.ts +0 -8
- package/state/reducers/register/public_api.d.ts +0 -3
- package/state/reducers/register/register-initial-state.d.ts +0 -2
- package/state/reducers/register/register-reducer-state.interface.d.ts +0 -2
- package/state/reducers/register/register.reducer.d.ts +0 -4
- package/state/reducers/reset-password/initial-state.d.ts +0 -2
- package/state/reducers/reset-password/public_api.d.ts +0 -3
- package/state/reducers/reset-password/reducer.d.ts +0 -4
- package/state/reducers/reset-password/state.interface.d.ts +0 -5
- package/state/reducers/token/extra.token.d.ts +0 -3
- package/state/reducers/token/public_api.d.ts +0 -1
- package/state/reducers/token/reducers.token.d.ts +0 -3
- package/state/selectors/auth/auth.selector.d.ts +0 -8
- package/state/selectors/auth-all.selector.d.ts +0 -10
- package/state/selectors/auth-feature.selector.d.ts +0 -6
- package/state/selectors/login/login.selector.d.ts +0 -7
- package/state/selectors/public_api.d.ts +0 -5
- package/state/selectors/register/register.selector.d.ts +0 -7
- package/state/selectors/reset-password/selector.d.ts +0 -9
- package/state/testing/auth-testing.module.d.ts +0 -6
- package/state/testing/mock-auth-facade.d.ts +0 -16
- package/state/testing/mock-login-facade.d.ts +0 -15
- package/state/testing/mock-register-facade.d.ts +0 -15
- package/state/testing/mock-reset-password-facade.d.ts +0 -16
- package/state/testing/public_api.d.ts +0 -5
- package/storage/auth-storage.service.d.ts +0 -12
- package/testing/factories/account-registration.factory.d.ts +0 -15
- package/testing/factories/auth-token.factory.d.ts +0 -11
- package/testing/factories/public_api.d.ts +0 -3
- package/testing/factories/reset-password-info.factory.d.ts +0 -13
- package/testing/public_api.d.ts +0 -1
|
@@ -1 +1,84 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
import { InMemoryBackendConfig, InMemoryDbService } from 'angular-in-memory-web-api';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
|
|
8
|
+
import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
|
|
9
|
+
import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration } from '@daffodil/auth';
|
|
10
|
+
|
|
11
|
+
declare class DaffAuthInMemoryDriverModule {
|
|
12
|
+
static forRoot(): ModuleWithProviders<DaffAuthInMemoryDriverModule>;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthInMemoryDriverModule, never>;
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
|
|
15
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthInMemoryDriverModule>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @inheritdoc DaffAuthServiceInterface
|
|
20
|
+
*/
|
|
21
|
+
declare class DaffInMemoryAuthService extends DaffInMemoryDriverBase implements DaffAuthServiceInterface {
|
|
22
|
+
private http;
|
|
23
|
+
constructor(http: HttpClient, config: InMemoryBackendConfig);
|
|
24
|
+
check(): Observable<void>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryAuthService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryAuthService>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @inheritdoc
|
|
31
|
+
*/
|
|
32
|
+
declare class DaffInMemoryLoginService extends DaffInMemoryDriverBase implements DaffLoginServiceInterface {
|
|
33
|
+
private http;
|
|
34
|
+
constructor(http: HttpClient, config: InMemoryBackendConfig);
|
|
35
|
+
login(request: DaffLoginInfo): Observable<DaffAuthToken>;
|
|
36
|
+
logout(): Observable<void>;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryLoginService, never>;
|
|
38
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryLoginService>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @inheritdoc
|
|
43
|
+
*/
|
|
44
|
+
declare class DaffInMemoryRegisterService extends DaffInMemoryDriverBase implements DaffRegisterServiceInterface {
|
|
45
|
+
private http;
|
|
46
|
+
private loginService;
|
|
47
|
+
constructor(http: HttpClient, loginService: DaffInMemoryLoginService, config: InMemoryBackendConfig);
|
|
48
|
+
register(registration: DaffAccountRegistration): Observable<string>;
|
|
49
|
+
registerOnly(registration: DaffAccountRegistration): Observable<void>;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryRegisterService, never>;
|
|
51
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryRegisterService>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Represents a customer in the in-memory database.
|
|
56
|
+
*/
|
|
57
|
+
interface DaffInMemoryDbCustomer {
|
|
58
|
+
email: string;
|
|
59
|
+
password: string;
|
|
60
|
+
token?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @inheritdoc DaffInMemorySingleRouteableBackend
|
|
65
|
+
*/
|
|
66
|
+
declare class DaffInMemoryBackendAuthService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
67
|
+
readonly collectionName = "auth";
|
|
68
|
+
customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer>;
|
|
69
|
+
private generateToken;
|
|
70
|
+
createDb(): {
|
|
71
|
+
auth: Record<string, DaffInMemoryDbCustomer>;
|
|
72
|
+
};
|
|
73
|
+
post(reqInfo: any): any;
|
|
74
|
+
private login;
|
|
75
|
+
private register;
|
|
76
|
+
private logout;
|
|
77
|
+
private check;
|
|
78
|
+
private resetPassword;
|
|
79
|
+
private sendResetEmail;
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendAuthService, never>;
|
|
81
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryBackendAuthService>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { DaffAuthInMemoryDriverModule, DaffInMemoryAuthService, DaffInMemoryBackendAuthService, DaffInMemoryLoginService, DaffInMemoryRegisterService };
|
package/driver/index.d.ts
CHANGED
|
@@ -1 +1,135 @@
|
|
|
1
|
-
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthStorageService } from '@daffodil/auth';
|
|
4
|
+
import { DaffInheritableError, DaffError } from '@daffodil/core';
|
|
5
|
+
|
|
6
|
+
interface DaffAuthServiceInterface {
|
|
7
|
+
/**
|
|
8
|
+
* Checks the validity of an auth token.
|
|
9
|
+
*/
|
|
10
|
+
check(): Observable<void>;
|
|
11
|
+
}
|
|
12
|
+
declare const DaffAuthDriver: _angular_core.InjectionToken<DaffAuthServiceInterface>;
|
|
13
|
+
declare const provideDaffAuthDriver: <R extends DaffAuthServiceInterface = DaffAuthServiceInterface>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
|
|
14
|
+
|
|
15
|
+
interface DaffLoginServiceInterface<TRequest extends DaffLoginInfo = DaffLoginInfo, TResponse extends DaffAuthToken = DaffAuthToken> {
|
|
16
|
+
/**
|
|
17
|
+
* Logs the user in.
|
|
18
|
+
*
|
|
19
|
+
* @returns An access token.
|
|
20
|
+
*/
|
|
21
|
+
login(loginInfo: TRequest): Observable<TResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Logs the user out by revoking their access token.
|
|
24
|
+
*/
|
|
25
|
+
logout(): Observable<void>;
|
|
26
|
+
}
|
|
27
|
+
declare const DaffLoginDriver: _angular_core.InjectionToken<DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>;
|
|
28
|
+
declare const provideDaffLoginDriver: <R extends DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> = DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
|
|
29
|
+
|
|
30
|
+
interface DaffRegisterServiceInterface<TRequest extends DaffAccountRegistration = DaffAccountRegistration> {
|
|
31
|
+
/**
|
|
32
|
+
* Registers an account for the specified customer and logs the customer in.
|
|
33
|
+
*
|
|
34
|
+
* @param registration The account registration info.
|
|
35
|
+
* @return The authentication token.
|
|
36
|
+
*/
|
|
37
|
+
register(registration: TRequest): Observable<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Registers an account for the specified customer but does not log the customer in.
|
|
40
|
+
*
|
|
41
|
+
* @param registration The account registration info.
|
|
42
|
+
*/
|
|
43
|
+
registerOnly(registration: TRequest): Observable<void>;
|
|
44
|
+
}
|
|
45
|
+
declare const DaffRegisterDriver: _angular_core.InjectionToken<DaffRegisterServiceInterface<DaffAccountRegistration>>;
|
|
46
|
+
declare const provideDaffRegisterDriver: <R extends DaffRegisterServiceInterface<DaffAccountRegistration> = DaffRegisterServiceInterface<DaffAccountRegistration>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
|
|
47
|
+
|
|
48
|
+
interface DaffResetPasswordServiceInterface<T extends DaffAuthResetPasswordInfo = DaffAuthResetPasswordInfo> {
|
|
49
|
+
/**
|
|
50
|
+
* Resets password for the specified customer and logs in.
|
|
51
|
+
*/
|
|
52
|
+
resetPassword(info: T): Observable<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Resets password for the specified customer.
|
|
55
|
+
*/
|
|
56
|
+
resetPasswordOnly(info: T): Observable<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Send a password reset email to the specified email address.
|
|
59
|
+
*/
|
|
60
|
+
sendResetEmail(email: string): Observable<void>;
|
|
61
|
+
}
|
|
62
|
+
declare const DaffResetPasswordDriver: _angular_core.InjectionToken<DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>;
|
|
63
|
+
declare const provideDaffResetPasswordDriver: <R extends DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo> = DaffResetPasswordServiceInterface<DaffAuthResetPasswordInfo>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
|
|
64
|
+
|
|
65
|
+
declare class DaffUnauthorizedError extends DaffInheritableError implements DaffError {
|
|
66
|
+
message: string;
|
|
67
|
+
readonly code: string;
|
|
68
|
+
constructor(message: string);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class DaffAuthenticationFailedError extends DaffInheritableError implements DaffError {
|
|
72
|
+
message: string;
|
|
73
|
+
readonly code: string;
|
|
74
|
+
constructor(message: string);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* An error thrown when registration failed.
|
|
79
|
+
*/
|
|
80
|
+
declare class DaffRegistrationFailedError extends DaffInheritableError implements DaffError {
|
|
81
|
+
message: string;
|
|
82
|
+
readonly code: string;
|
|
83
|
+
constructor(message: string);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare class DaffAuthInvalidAPIResponseError extends DaffInheritableError implements DaffError {
|
|
87
|
+
message: string;
|
|
88
|
+
readonly code: string;
|
|
89
|
+
constructor(message: string);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare enum DaffAuthDriverErrorCodes {
|
|
93
|
+
AUTHENTICATION_FAILED = "DAFF_AUTH_AUTHENTICATION_FAILED",
|
|
94
|
+
INVALID_API_RESPONSE = "DAFF_AUTH_INVALID_API_RESPONSE",
|
|
95
|
+
REGISTRATION_FAILED = "DAFF_AUTH_REGISTRATION_FAILED",
|
|
96
|
+
UNAUTHORIZED = "DAFF_AUTH_UNAUTHORIZED"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A mapping from error codes to error class constructors.
|
|
101
|
+
*/
|
|
102
|
+
declare const DaffAuthDriverErrorMap: {
|
|
103
|
+
DAFF_AUTH_AUTHENTICATION_FAILED: typeof DaffAuthenticationFailedError;
|
|
104
|
+
DAFF_AUTH_INVALID_API_RESPONSE: typeof DaffAuthInvalidAPIResponseError;
|
|
105
|
+
DAFF_AUTH_REGISTRATION_FAILED: typeof DaffRegistrationFailedError;
|
|
106
|
+
DAFF_AUTH_UNAUTHORIZED: typeof DaffUnauthorizedError;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
declare class DaffAuthDriverTokenCheck {
|
|
110
|
+
private storage;
|
|
111
|
+
private driver;
|
|
112
|
+
constructor(storage: DaffAuthStorageService, driver: DaffAuthServiceInterface);
|
|
113
|
+
/**
|
|
114
|
+
* Checks if the auth token in storage is valid.
|
|
115
|
+
* If there is not an auth token in storage, the driver is not called
|
|
116
|
+
* and an error is immediately thrown.
|
|
117
|
+
*/
|
|
118
|
+
check(): Observable<void>;
|
|
119
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DaffAuthDriverTokenCheck, never>;
|
|
120
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DaffAuthDriverTokenCheck>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The error codes that indicate that the user definitely should not be in an unauthenticated state
|
|
125
|
+
* and if an auth token exists in storage, it is invalid.
|
|
126
|
+
* These are contrasted to network failures and other sporadic and generic errors that aren't
|
|
127
|
+
* a guarantee of the token's invalidity.
|
|
128
|
+
*/
|
|
129
|
+
declare const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES: {
|
|
130
|
+
DAFF_AUTH_UNAUTHORIZED: boolean;
|
|
131
|
+
DAFF_AUTH_AUTHENTICATION_FAILED: boolean;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES, DaffAuthDriver, DaffAuthDriverErrorCodes, DaffAuthDriverErrorMap, DaffAuthDriverTokenCheck, DaffAuthInvalidAPIResponseError, DaffAuthenticationFailedError, DaffLoginDriver, DaffRegisterDriver, DaffRegistrationFailedError, DaffResetPasswordDriver, DaffUnauthorizedError, provideDaffAuthDriver, provideDaffLoginDriver, provideDaffRegisterDriver, provideDaffResetPasswordDriver };
|
|
135
|
+
export type { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface, DaffResetPasswordServiceInterface };
|
|
@@ -1 +1,132 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import * as apollo_angular from 'apollo-angular';
|
|
5
|
+
import { Apollo } from 'apollo-angular';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
|
|
8
|
+
import { DaffAuthToken, DaffLoginInfo, DaffAccountRegistration, DaffAuthStorageService } from '@daffodil/auth';
|
|
9
|
+
import { DaffQueuedApollo, DaffApolloLinkGenerator } from '@daffodil/core/graphql';
|
|
10
|
+
import { ApolloLink } from '@apollo/client/core';
|
|
11
|
+
|
|
12
|
+
declare class DaffAuthMagentoDriverModule {
|
|
13
|
+
static forRoot(): ModuleWithProviders<DaffAuthMagentoDriverModule>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthMagentoDriverModule, never>;
|
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthMagentoDriverModule, never, [typeof i1.CommonModule], never>;
|
|
16
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthMagentoDriverModule>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @inheritdoc
|
|
21
|
+
*/
|
|
22
|
+
declare class DaffMagentoAuthService implements DaffAuthServiceInterface {
|
|
23
|
+
private apollo;
|
|
24
|
+
constructor(apollo: Apollo);
|
|
25
|
+
check(): Observable<void>;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoAuthService>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface MagentoAuth {
|
|
31
|
+
token: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Transforms magento auths into an object usable by daffodil.
|
|
36
|
+
*/
|
|
37
|
+
declare class DaffMagentoAuthTransformerService {
|
|
38
|
+
/**
|
|
39
|
+
* Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.
|
|
40
|
+
*
|
|
41
|
+
* @param auth the auth from a magento auth query.
|
|
42
|
+
*/
|
|
43
|
+
transform(auth: MagentoAuth): DaffAuthToken;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthTransformerService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoAuthTransformerService>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @inheritdoc
|
|
50
|
+
*/
|
|
51
|
+
declare class DaffMagentoLoginService implements DaffLoginServiceInterface {
|
|
52
|
+
private apollo;
|
|
53
|
+
authTransformer: DaffMagentoAuthTransformerService;
|
|
54
|
+
constructor(apollo: DaffQueuedApollo, authTransformer: DaffMagentoAuthTransformerService);
|
|
55
|
+
login({ email, password }: DaffLoginInfo): Observable<DaffAuthToken>;
|
|
56
|
+
logout(): Observable<any>;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoLoginService, never>;
|
|
58
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoLoginService>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @inheritdoc
|
|
63
|
+
*/
|
|
64
|
+
declare class DaffMagentoRegisterService implements DaffRegisterServiceInterface {
|
|
65
|
+
private apollo;
|
|
66
|
+
private loginService;
|
|
67
|
+
constructor(apollo: DaffQueuedApollo, loginService: DaffMagentoLoginService);
|
|
68
|
+
register(registration: DaffAccountRegistration): Observable<string>;
|
|
69
|
+
registerOnly({ email, password, subscribe, firstName, lastName }: DaffAccountRegistration): Observable<void>;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoRegisterService, never>;
|
|
71
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoRegisterService>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
|
|
76
|
+
*
|
|
77
|
+
* @inheritdoc
|
|
78
|
+
*/
|
|
79
|
+
declare class MagentoAuthApolloBearerTokenLinkGenerator implements DaffApolloLinkGenerator {
|
|
80
|
+
private storage;
|
|
81
|
+
constructor(storage: DaffAuthStorageService);
|
|
82
|
+
getLink(): ApolloLink;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MagentoAuthApolloBearerTokenLinkGenerator, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MagentoAuthApolloBearerTokenLinkGenerator>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare const checkTokenQuery: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
88
|
+
|
|
89
|
+
declare const createCustomerMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
90
|
+
|
|
91
|
+
declare const generateTokenMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
92
|
+
|
|
93
|
+
declare const revokeCustomerTokenMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
94
|
+
|
|
95
|
+
declare const sendPasswordResetEmailMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
96
|
+
|
|
97
|
+
declare const resetPasswordMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
|
|
98
|
+
|
|
99
|
+
interface MagentoCheckTokenResponse {
|
|
100
|
+
customer: {
|
|
101
|
+
email?: string;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
interface MagentoGenerateTokenResponse {
|
|
106
|
+
generateCustomerToken: MagentoAuth;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface MagentoRevokeCustomerTokenResponse {
|
|
110
|
+
revokeCustomerToken: {
|
|
111
|
+
result: boolean;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface MagentoRegisterResponse {
|
|
116
|
+
createCustomerV2: {
|
|
117
|
+
customer: {
|
|
118
|
+
email: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface MagentoSendResetEmailResponse {
|
|
124
|
+
requestPasswordResetEmail: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface MagentoResetPasswordResponse {
|
|
128
|
+
resetPassword: boolean;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { DaffAuthMagentoDriverModule, DaffMagentoAuthService, DaffMagentoAuthTransformerService, DaffMagentoLoginService, DaffMagentoRegisterService, MagentoAuthApolloBearerTokenLinkGenerator, checkTokenQuery, createCustomerMutation, generateTokenMutation, resetPasswordMutation, revokeCustomerTokenMutation, sendPasswordResetEmailMutation };
|
|
132
|
+
export type { MagentoAuth, MagentoCheckTokenResponse, MagentoGenerateTokenResponse, MagentoRegisterResponse, MagentoResetPasswordResponse, MagentoRevokeCustomerTokenResponse, MagentoSendResetEmailResponse };
|
|
@@ -1 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
|
|
6
|
+
import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration } from '@daffodil/auth';
|
|
7
|
+
import { DaffAuthTokenFactory } from '@daffodil/auth/testing';
|
|
8
|
+
|
|
9
|
+
declare class DaffAuthTestingDriverModule {
|
|
10
|
+
static forRoot(): ModuleWithProviders<DaffAuthTestingDriverModule>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthTestingDriverModule, never>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthTestingDriverModule, never, [typeof i1.CommonModule], never>;
|
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthTestingDriverModule>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @inheritdoc
|
|
18
|
+
*/
|
|
19
|
+
declare class DaffTestingAuthService implements DaffAuthServiceInterface {
|
|
20
|
+
check(): Observable<void>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingAuthService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingAuthService>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @inheritdoc
|
|
27
|
+
*/
|
|
28
|
+
declare class DaffTestingLoginService implements DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> {
|
|
29
|
+
private factory;
|
|
30
|
+
constructor(factory: DaffAuthTokenFactory);
|
|
31
|
+
login(loginInfo: DaffLoginInfo): Observable<DaffAuthToken>;
|
|
32
|
+
logout(): Observable<void>;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingLoginService, never>;
|
|
34
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingLoginService>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @inheritdoc
|
|
39
|
+
*/
|
|
40
|
+
declare class DaffTestingRegisterService implements DaffRegisterServiceInterface {
|
|
41
|
+
private authTokenFactory;
|
|
42
|
+
constructor(authTokenFactory: DaffAuthTokenFactory);
|
|
43
|
+
register(registration: DaffAccountRegistration): Observable<string>;
|
|
44
|
+
registerOnly(registration: DaffLoginInfo): Observable<void>;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingRegisterService, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingRegisterService>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { DaffAuthTestingDriverModule, DaffTestingAuthService, DaffTestingLoginService, DaffTestingRegisterService };
|
|
@@ -23,10 +23,10 @@ class DaffInMemoryAuthService extends DaffInMemoryDriverBase {
|
|
|
23
23
|
check() {
|
|
24
24
|
return this.http.post(`${this.url}/check`, {}).pipe(map(() => undefined));
|
|
25
25
|
}
|
|
26
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
27
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
26
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryAuthService, deps: [{ token: i1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryAuthService, providedIn: 'root' }); }
|
|
28
28
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryAuthService, decorators: [{
|
|
30
30
|
type: Injectable,
|
|
31
31
|
args: [{
|
|
32
32
|
providedIn: 'root',
|
|
@@ -47,10 +47,10 @@ class DaffInMemoryLoginService extends DaffInMemoryDriverBase {
|
|
|
47
47
|
logout() {
|
|
48
48
|
return this.http.post(`${this.url}/logout`, {}).pipe(switchMap(({ success }) => success ? of(undefined) : throwError(() => new Error('Logout failed'))));
|
|
49
49
|
}
|
|
50
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
51
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryLoginService, deps: [{ token: i1.HttpClient }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryLoginService, providedIn: 'root' }); }
|
|
52
52
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryLoginService, decorators: [{
|
|
54
54
|
type: Injectable,
|
|
55
55
|
args: [{
|
|
56
56
|
providedIn: 'root',
|
|
@@ -72,10 +72,10 @@ class DaffInMemoryRegisterService extends DaffInMemoryDriverBase {
|
|
|
72
72
|
registerOnly(registration) {
|
|
73
73
|
return this.http.post(`${this.url}/register`, registration);
|
|
74
74
|
}
|
|
75
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
76
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
75
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryRegisterService, deps: [{ token: i1.HttpClient }, { token: DaffInMemoryLoginService }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
76
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryRegisterService, providedIn: 'root' }); }
|
|
77
77
|
}
|
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryRegisterService, decorators: [{
|
|
79
79
|
type: Injectable,
|
|
80
80
|
args: [{
|
|
81
81
|
providedIn: 'root',
|
|
@@ -100,10 +100,10 @@ class DaffInMemoryResetPasswordService extends DaffInMemoryDriverBase {
|
|
|
100
100
|
sendResetEmail(email) {
|
|
101
101
|
return this.http.post(`${this.url}/sendResetEmail`, { email });
|
|
102
102
|
}
|
|
103
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
104
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
103
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryResetPasswordService, deps: [{ token: i1.HttpClient }, { token: DaffInMemoryLoginService }, { token: i2.InMemoryBackendConfig }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
104
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryResetPasswordService, providedIn: 'root' }); }
|
|
105
105
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryResetPasswordService, decorators: [{
|
|
107
107
|
type: Injectable,
|
|
108
108
|
args: [{
|
|
109
109
|
providedIn: 'root',
|
|
@@ -206,10 +206,10 @@ class DaffInMemoryBackendAuthService {
|
|
|
206
206
|
status: STATUS.OK,
|
|
207
207
|
}));
|
|
208
208
|
}
|
|
209
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
210
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
209
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryBackendAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
210
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryBackendAuthService, providedIn: 'root' }); }
|
|
211
211
|
}
|
|
212
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffInMemoryBackendAuthService, decorators: [{
|
|
213
213
|
type: Injectable,
|
|
214
214
|
args: [{
|
|
215
215
|
providedIn: 'root',
|
|
@@ -229,11 +229,11 @@ class DaffAuthInMemoryDriverModule {
|
|
|
229
229
|
],
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
233
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
234
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
232
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAuthInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
233
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: DaffAuthInMemoryDriverModule, imports: [CommonModule] }); }
|
|
234
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAuthInMemoryDriverModule, imports: [CommonModule] }); }
|
|
235
235
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffAuthInMemoryDriverModule, decorators: [{
|
|
237
237
|
type: NgModule,
|
|
238
238
|
args: [{
|
|
239
239
|
imports: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-driver-in-memory.mjs","sources":["../../../libs/auth/driver/in-memory/src/collection-name.const.ts","../../../libs/auth/driver/in-memory/src/drivers/auth/auth.service.ts","../../../libs/auth/driver/in-memory/src/drivers/login/login.service.ts","../../../libs/auth/driver/in-memory/src/drivers/register/register.service.ts","../../../libs/auth/driver/in-memory/src/drivers/reset-password/service.ts","../../../libs/auth/driver/in-memory/src/backend/auth.service.ts","../../../libs/auth/driver/in-memory/src/drivers/auth-driver.module.ts","../../../libs/auth/driver/in-memory/src/daffodil-auth-driver-in-memory.ts"],"sourcesContent":["export const DAFF_AUTH_IN_MEMORY_COLLECTION_NAME = 'auth';\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\n\n/**\n * @inheritdoc DaffAuthServiceInterface\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryAuthService extends DaffInMemoryDriverBase implements DaffAuthServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n check(): Observable<void> {\n return this.http.post(`${this.url}/check`, {}).pipe(\n map(() => undefined),\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryLoginService extends DaffInMemoryDriverBase implements DaffLoginServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n login(request: DaffLoginInfo): Observable<DaffAuthToken> {\n return this.http.post<DaffAuthToken>(`${this.url}/login`, request);\n }\n\n logout(): Observable<void> {\n return this.http.post<{success: boolean}>(`${this.url}/logout`, {}).pipe(\n switchMap(({ success }) => success ? of(undefined) : throwError(() => new Error('Logout failed'))),\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRegisterService extends DaffInMemoryDriverBase implements DaffRegisterServiceInterface {\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n register(registration: DaffAccountRegistration): Observable<string> {\n return this.registerOnly(registration).pipe(\n switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })),\n map(({ token }) => token),\n );\n }\n\n registerOnly(registration: DaffAccountRegistration): Observable<void> {\n return this.http.post<void>(`${this.url}/register`, registration);\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryResetPasswordService extends DaffInMemoryDriverBase implements DaffResetPasswordServiceInterface {\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n resetPassword(info: DaffAuthResetPasswordInfo): Observable<string> {\n return this.resetPasswordOnly(info).pipe(\n switchMap(() => this.loginService.login({ email: info.email, password: info.password })),\n map(({ token }) => token),\n );\n }\n\n resetPasswordOnly(info: DaffAuthResetPasswordInfo): Observable<void> {\n return this.http.post<void>(`${this.url}/resetPassword`, info);\n }\n\n sendResetEmail(email: string): Observable<void> {\n return this.http.post<void>(`${this.url}/sendResetEmail`, { email });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\nimport {\n InMemoryDbService,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { DaffInMemoryDbCustomer } from '../models/db-customer.type';\n\n/**\n * @inheritdoc DaffInMemorySingleRouteableBackend\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendAuthService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_AUTH_IN_MEMORY_COLLECTION_NAME;\n\n customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer> = {};\n\n private generateToken(): string {\n return faker.string.alphanumeric(16);\n }\n\n createDb() {\n return {\n auth: this.customers,\n };\n }\n\n post(reqInfo) {\n if (reqInfo.id === 'login') {\n return this.login(reqInfo);\n } else if (reqInfo.id === 'register') {\n return this.register(reqInfo);\n } else if (reqInfo.id === 'logout') {\n return this.logout(reqInfo);\n } else if (reqInfo.id === 'check') {\n return this.check(reqInfo);\n } else if (reqInfo.id === 'resetPassword') {\n return this.resetPassword(reqInfo);\n } else if (reqInfo.id === 'sendResetEmail') {\n return this.sendResetEmail(reqInfo);\n }\n }\n\n private login(reqInfo: any) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n const customer = this.customers[email];\n\n if (password && customer?.password === password) {\n this.customers[email].token = this.generateToken();\n\n return reqInfo.utils.createResponse$(() => ({\n body: {\n token: customer.token,\n },\n status: STATUS.OK,\n }));\n }\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.UNAUTHORIZED,\n }));\n }\n\n private register(reqInfo) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n this.customers[email] = {\n email,\n password,\n };\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.CREATED,\n }));\n }\n\n private logout(reqInfo) {\n const {\n email,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n if (this.customers[email]) {\n this.customers[email].token = null;\n }\n\n return reqInfo.utils.createResponse$(() => ({\n body: { success: true },\n status: STATUS.OK,\n }));\n }\n\n private check(reqInfo) {\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.OK,\n }));\n }\n\n private resetPassword(reqInfo) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n if (this.customers[email]) {\n this.customers[email].password = password;\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n }));\n }\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.UNAUTHORIZED,\n }));\n }\n\n private sendResetEmail(reqInfo) {\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.OK,\n }));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffLoginDriver,\n provideDaffRegisterDriver,\n provideDaffAuthDriver,\n provideDaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\n\nimport { DaffInMemoryAuthService } from './auth/auth.service';\nimport { DaffInMemoryLoginService } from './login/login.service';\nimport { DaffInMemoryRegisterService } from './register/register.service';\nimport { DaffInMemoryResetPasswordService } from './reset-password/service';\nimport { DaffInMemoryBackendAuthService } from '../backend/auth.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthInMemoryDriverModule> {\n return {\n ngModule: DaffAuthInMemoryDriverModule,\n providers: [\n provideDaffLoginDriver(DaffInMemoryLoginService),\n provideDaffRegisterDriver(DaffInMemoryRegisterService),\n provideDaffAuthDriver(DaffInMemoryAuthService),\n provideDaffResetPasswordDriver(DaffInMemoryResetPasswordService),\n provideDaffInMemoryBackends(\n DaffInMemoryBackendAuthService,\n ),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.DaffInMemoryLoginService","i3"],"mappings":";;;;;;;;;;;;AAAO,MAAM,mCAAmC,GAAG,MAAM;;ACWzD;;AAEG;AAIG,MAAO,uBAAwB,SAAQ,sBAAsB,CAAA;IACjE,WACU,CAAA,IAAgB,EACxB,MAA6B,EAAA;AAE7B,QAAA,KAAK,CAAC,MAAM,EAAE,mCAAmC,CAAC;QAH1C,IAAI,CAAA,IAAA,GAAJ,IAAI;;IAMd,KAAK,GAAA;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAG,EAAA,IAAI,CAA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C;gBAC9C,8BAA8B,CAAC,gCAAgC,CAAC;gBAChE,2BAA2B,CACzB,8BAA8B,CAC/B;AACF,aAAA;SACF;;kIAbQ,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,YAHrC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,YAHrC,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAGH,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACxBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-auth-driver-in-memory.mjs","sources":["../../../libs/auth/driver/in-memory/src/collection-name.const.ts","../../../libs/auth/driver/in-memory/src/drivers/auth/auth.service.ts","../../../libs/auth/driver/in-memory/src/drivers/login/login.service.ts","../../../libs/auth/driver/in-memory/src/drivers/register/register.service.ts","../../../libs/auth/driver/in-memory/src/drivers/reset-password/service.ts","../../../libs/auth/driver/in-memory/src/backend/auth.service.ts","../../../libs/auth/driver/in-memory/src/drivers/auth-driver.module.ts","../../../libs/auth/driver/in-memory/src/daffodil-auth-driver-in-memory.ts"],"sourcesContent":["export const DAFF_AUTH_IN_MEMORY_COLLECTION_NAME = 'auth';\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\n\n/**\n * @inheritdoc DaffAuthServiceInterface\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryAuthService extends DaffInMemoryDriverBase implements DaffAuthServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n check(): Observable<void> {\n return this.http.post(`${this.url}/check`, {}).pipe(\n map(() => undefined),\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryLoginService extends DaffInMemoryDriverBase implements DaffLoginServiceInterface {\n constructor(\n private http: HttpClient,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n login(request: DaffLoginInfo): Observable<DaffAuthToken> {\n return this.http.post<DaffAuthToken>(`${this.url}/login`, request);\n }\n\n logout(): Observable<void> {\n return this.http.post<{success: boolean}>(`${this.url}/logout`, {}).pipe(\n switchMap(({ success }) => success ? of(undefined) : throwError(() => new Error('Logout failed'))),\n );\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRegisterService extends DaffInMemoryDriverBase implements DaffRegisterServiceInterface {\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n register(registration: DaffAccountRegistration): Observable<string> {\n return this.registerOnly(registration).pipe(\n switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })),\n map(({ token }) => token),\n );\n }\n\n registerOnly(registration: DaffAccountRegistration): Observable<void> {\n return this.http.post<void>(`${this.url}/register`, registration);\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { InMemoryBackendConfig } from 'angular-in-memory-web-api';\nimport { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffInMemoryDriverBase } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../../collection-name.const';\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryResetPasswordService extends DaffInMemoryDriverBase implements DaffResetPasswordServiceInterface {\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\n config: InMemoryBackendConfig,\n ) {\n super(config, DAFF_AUTH_IN_MEMORY_COLLECTION_NAME);\n }\n\n resetPassword(info: DaffAuthResetPasswordInfo): Observable<string> {\n return this.resetPasswordOnly(info).pipe(\n switchMap(() => this.loginService.login({ email: info.email, password: info.password })),\n map(({ token }) => token),\n );\n }\n\n resetPasswordOnly(info: DaffAuthResetPasswordInfo): Observable<void> {\n return this.http.post<void>(`${this.url}/resetPassword`, info);\n }\n\n sendResetEmail(email: string): Observable<void> {\n return this.http.post<void>(`${this.url}/sendResetEmail`, { email });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\nimport {\n InMemoryDbService,\n STATUS,\n} from 'angular-in-memory-web-api';\n\nimport { DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';\n\nimport { DAFF_AUTH_IN_MEMORY_COLLECTION_NAME } from '../collection-name.const';\nimport { DaffInMemoryDbCustomer } from '../models/db-customer.type';\n\n/**\n * @inheritdoc DaffInMemorySingleRouteableBackend\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendAuthService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {\n readonly collectionName = DAFF_AUTH_IN_MEMORY_COLLECTION_NAME;\n\n customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer> = {};\n\n private generateToken(): string {\n return faker.string.alphanumeric(16);\n }\n\n createDb() {\n return {\n auth: this.customers,\n };\n }\n\n post(reqInfo) {\n if (reqInfo.id === 'login') {\n return this.login(reqInfo);\n } else if (reqInfo.id === 'register') {\n return this.register(reqInfo);\n } else if (reqInfo.id === 'logout') {\n return this.logout(reqInfo);\n } else if (reqInfo.id === 'check') {\n return this.check(reqInfo);\n } else if (reqInfo.id === 'resetPassword') {\n return this.resetPassword(reqInfo);\n } else if (reqInfo.id === 'sendResetEmail') {\n return this.sendResetEmail(reqInfo);\n }\n }\n\n private login(reqInfo: any) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n const customer = this.customers[email];\n\n if (password && customer?.password === password) {\n this.customers[email].token = this.generateToken();\n\n return reqInfo.utils.createResponse$(() => ({\n body: {\n token: customer.token,\n },\n status: STATUS.OK,\n }));\n }\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.UNAUTHORIZED,\n }));\n }\n\n private register(reqInfo) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n this.customers[email] = {\n email,\n password,\n };\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.CREATED,\n }));\n }\n\n private logout(reqInfo) {\n const {\n email,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n if (this.customers[email]) {\n this.customers[email].token = null;\n }\n\n return reqInfo.utils.createResponse$(() => ({\n body: { success: true },\n status: STATUS.OK,\n }));\n }\n\n private check(reqInfo) {\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.OK,\n }));\n }\n\n private resetPassword(reqInfo) {\n const {\n email,\n password,\n } = reqInfo.utils.getJsonBody(reqInfo.req);\n\n if (this.customers[email]) {\n this.customers[email].password = password;\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.OK,\n }));\n }\n\n return reqInfo.utils.createResponse$(() => ({\n status: STATUS.UNAUTHORIZED,\n }));\n }\n\n private sendResetEmail(reqInfo) {\n return reqInfo.utils.createResponse$(() => ({\n body: {},\n status: STATUS.OK,\n }));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffLoginDriver,\n provideDaffRegisterDriver,\n provideDaffAuthDriver,\n provideDaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\nimport { provideDaffInMemoryBackends } from '@daffodil/driver/in-memory';\n\nimport { DaffInMemoryAuthService } from './auth/auth.service';\nimport { DaffInMemoryLoginService } from './login/login.service';\nimport { DaffInMemoryRegisterService } from './register/register.service';\nimport { DaffInMemoryResetPasswordService } from './reset-password/service';\nimport { DaffInMemoryBackendAuthService } from '../backend/auth.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthInMemoryDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthInMemoryDriverModule> {\n return {\n ngModule: DaffAuthInMemoryDriverModule,\n providers: [\n provideDaffLoginDriver(DaffInMemoryLoginService),\n provideDaffRegisterDriver(DaffInMemoryRegisterService),\n provideDaffAuthDriver(DaffInMemoryAuthService),\n provideDaffResetPasswordDriver(DaffInMemoryResetPasswordService),\n provideDaffInMemoryBackends(\n DaffInMemoryBackendAuthService,\n ),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.DaffInMemoryLoginService","i3"],"mappings":";;;;;;;;;;;;AAAO,MAAM,mCAAmC,GAAG,MAAM;;ACWzD;;AAEG;AAIG,MAAO,uBAAwB,SAAQ,sBAAsB,CAAA;IACjE,WAAA,CACU,IAAgB,EACxB,MAA6B,EAAA;AAE7B,QAAA,KAAK,CAAC,MAAM,EAAE,mCAAmC,CAAC;QAH1C,IAAA,CAAA,IAAI,GAAJ,IAAI;IAId;IAEA,KAAK,GAAA;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,EAAG,IAAI,CAAC,GAAG,CAAA,MAAA,CAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CACjD,GAAG,CAAC,MAAM,SAAS,CAAC,CACrB;IACH;iIAZW,uBAAuB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,qBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,SAAA,IAAA,CAAA,K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