@daffodil/auth 0.75.0 → 0.77.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/README.md +10 -8
- package/esm2022/driver/errors/authentication-failed.mjs +1 -1
- package/esm2022/driver/errors/registration-failed.mjs +1 -1
- package/esm2022/driver/errors/unauthorized.mjs +1 -1
- package/esm2022/driver/in-memory/backend/auth.service.mjs +4 -4
- package/esm2022/driver/in-memory/drivers/auth/auth.service.mjs +4 -4
- package/esm2022/driver/in-memory/drivers/auth-driver.module.mjs +5 -5
- package/esm2022/driver/in-memory/drivers/login/login.service.mjs +4 -4
- package/esm2022/driver/in-memory/drivers/register/register.service.mjs +4 -4
- package/esm2022/driver/in-memory/drivers/reset-password/service.mjs +4 -4
- package/esm2022/driver/magento/apollo-bearer-token-link-generator.mjs +4 -4
- package/esm2022/driver/magento/auth-driver.module.mjs +5 -5
- package/esm2022/driver/magento/auth.service.mjs +4 -4
- package/esm2022/driver/magento/login.service.mjs +4 -4
- package/esm2022/driver/magento/register.service.mjs +4 -4
- package/esm2022/driver/magento/reset-password.service.mjs +4 -4
- package/esm2022/driver/magento/transforms/auth-transformer.service.mjs +4 -4
- package/esm2022/driver/magento/validators/check-token.mjs +1 -1
- package/esm2022/driver/magento/validators/generate-token.mjs +1 -1
- package/esm2022/driver/magento/validators/reset-password.mjs +1 -1
- package/esm2022/driver/magento/validators/revoke-token.mjs +1 -1
- package/esm2022/driver/magento/validators/send-reset-email.mjs +1 -1
- package/esm2022/driver/services/auth-check.service.mjs +4 -4
- package/esm2022/driver/testing/drivers/auth/auth.service.mjs +4 -4
- package/esm2022/driver/testing/drivers/auth-driver.module.mjs +5 -5
- package/esm2022/driver/testing/drivers/login/login.service.mjs +4 -4
- package/esm2022/driver/testing/drivers/register/register.service.mjs +4 -4
- package/esm2022/driver/testing/drivers/reset-password/service.mjs +4 -4
- package/esm2022/routing/effects/redirect.effects.mjs +4 -4
- package/esm2022/routing/guards/guest-only.guard.mjs +4 -4
- package/esm2022/routing/guards/member-only.guard.mjs +4 -4
- package/esm2022/routing/guards/reset-password.guard.mjs +4 -4
- package/esm2022/routing/helpers/redirect-unauthenticated-hook-factory.mjs +1 -1
- package/esm2022/routing/module.mjs +5 -5
- package/esm2022/routing/redirect.module.mjs +5 -5
- package/esm2022/state/auth-state.module.mjs +5 -5
- package/esm2022/state/effects/auth.effects.mjs +4 -4
- package/esm2022/state/effects/login.effects.mjs +4 -4
- package/esm2022/state/effects/register.effects.mjs +4 -4
- package/esm2022/state/effects/reset-password.effects.mjs +4 -4
- package/esm2022/state/facades/auth/facade.mjs +4 -4
- package/esm2022/state/facades/login/facade.mjs +4 -4
- package/esm2022/state/facades/register/facade.mjs +4 -4
- package/esm2022/state/facades/reset-password/facade.mjs +4 -4
- package/esm2022/state/reducers/auth/auth.reducer.mjs +1 -1
- package/esm2022/state/reducers/login/login.reducer.mjs +1 -1
- package/esm2022/state/reducers/register/register.reducer.mjs +1 -1
- package/esm2022/state/reducers/reset-password/reducer.mjs +1 -1
- package/esm2022/state/testing/auth-testing.module.mjs +5 -5
- package/esm2022/state/testing/mock-auth-facade.mjs +4 -4
- package/esm2022/state/testing/mock-login-facade.mjs +4 -4
- package/esm2022/state/testing/mock-register-facade.mjs +4 -4
- package/esm2022/state/testing/mock-reset-password-facade.mjs +4 -4
- package/esm2022/storage/auth-storage.service.mjs +4 -4
- package/esm2022/testing/factories/account-registration.factory.mjs +4 -4
- package/esm2022/testing/factories/auth-token.factory.mjs +4 -4
- package/esm2022/testing/factories/reset-password-info.factory.mjs +4 -4
- 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/package.json +1 -1
- package/state/reducers/token/extra.token.d.ts +1 -1
- package/state/reducers/token/reducers.token.d.ts +1 -1
|
@@ -12,13 +12,13 @@ export class DaffAuthTokenFactory extends DaffModelFactory {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(MockAuthToken);
|
|
14
14
|
}
|
|
15
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
16
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
15
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTokenFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
16
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTokenFactory, providedIn: 'root' }); }
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTokenFactory, decorators: [{
|
|
19
19
|
type: Injectable,
|
|
20
20
|
args: [{
|
|
21
21
|
providedIn: 'root',
|
|
22
22
|
}]
|
|
23
23
|
}], ctorParameters: () => [] });
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC10b2tlbi5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9hdXRoL3Rlc3Rpbmcvc3JjL2ZhY3Rvcmllcy9hdXRoLXRva2VuLmZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFHckQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7O0FBRTFELE1BQU0sT0FBTyxhQUFhO0lBQTFCO1FBQ0UsVUFBSyxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQ3hDLENBQUM7Q0FBQTtBQUFBLENBQUM7QUFLRixNQUFNLE9BQU8sb0JBQXFCLFNBQVEsZ0JBQStCO0lBQ3ZFO1FBQ0UsS0FBSyxDQUFDLGFBQWEsQ0FBQyxDQUFDO0lBQ3ZCLENBQUM7aUlBSFUsb0JBQW9CO3FJQUFwQixvQkFBb0IsY0FGbkIsTUFBTTs7MkZBRVAsb0JBQW9CO2tCQUhoQyxVQUFVO21CQUFDO29CQUNWLFVBQVUsRUFBRSxNQUFNO2lCQUNuQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IGZha2VyIH0gZnJvbSAnQGZha2VyLWpzL2Zha2VyL2xvY2FsZS9lbl9VUyc7XG5cbmltcG9ydCB7IERhZmZBdXRoVG9rZW4gfSBmcm9tICdAZGFmZm9kaWwvYXV0aCc7XG5pbXBvcnQgeyBEYWZmTW9kZWxGYWN0b3J5IH0gZnJvbSAnQGRhZmZvZGlsL2NvcmUvdGVzdGluZyc7XG5cbmV4cG9ydCBjbGFzcyBNb2NrQXV0aFRva2VuIGltcGxlbWVudHMgRGFmZkF1dGhUb2tlbiB7XG4gIHRva2VuID0gZmFrZXIucmFuZG9tLmFscGhhTnVtZXJpYygxNik7XG59O1xuXG5ASW5qZWN0YWJsZSh7XG4gIHByb3ZpZGVkSW46ICdyb290Jyxcbn0pXG5leHBvcnQgY2xhc3MgRGFmZkF1dGhUb2tlbkZhY3RvcnkgZXh0ZW5kcyBEYWZmTW9kZWxGYWN0b3J5PERhZmZBdXRoVG9rZW4+IHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoTW9ja0F1dGhUb2tlbik7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -14,13 +14,13 @@ export class DaffAuthResetPasswordInfoFactory extends DaffModelFactory {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
super(MockAuthResetPasswordInfo);
|
|
16
16
|
}
|
|
17
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
17
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthResetPasswordInfoFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
18
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthResetPasswordInfoFactory, providedIn: 'root' }); }
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthResetPasswordInfoFactory, decorators: [{
|
|
21
21
|
type: Injectable,
|
|
22
22
|
args: [{
|
|
23
23
|
providedIn: 'root',
|
|
24
24
|
}]
|
|
25
25
|
}], ctorParameters: () => [] });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzZXQtcGFzc3dvcmQtaW5mby5mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9hdXRoL3Rlc3Rpbmcvc3JjL2ZhY3Rvcmllcy9yZXNldC1wYXNzd29yZC1pbmZvLmZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFHckQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7O0FBRTFELE1BQU0sT0FBTyx5QkFBeUI7SUFBdEM7UUFDRSxVQUFLLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUMvQixhQUFRLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDekMsVUFBSyxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQ3hDLENBQUM7Q0FBQTtBQUFBLENBQUM7QUFLRixNQUFNLE9BQU8sZ0NBQ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ZXRQYXNzd29yZEluZm8pO1xuICB9XG59XG4iXX0=
|
|
@@ -19,10 +19,10 @@ class DaffInMemoryAuthService {
|
|
|
19
19
|
check() {
|
|
20
20
|
return this.http.post(`${this.url}check`, {}).pipe(map(() => undefined));
|
|
21
21
|
}
|
|
22
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
22
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryAuthService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
23
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryAuthService, providedIn: 'root' }); }
|
|
24
24
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryAuthService, decorators: [{
|
|
26
26
|
type: Injectable,
|
|
27
27
|
args: [{
|
|
28
28
|
providedIn: 'root',
|
|
@@ -43,10 +43,10 @@ class DaffInMemoryLoginService {
|
|
|
43
43
|
logout() {
|
|
44
44
|
return this.http.post(`${this.url}logout`, {}).pipe(switchMap(({ success }) => success ? of(undefined) : throwError(() => new Error('Logout failed'))));
|
|
45
45
|
}
|
|
46
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
47
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
46
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryLoginService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
47
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryLoginService, providedIn: 'root' }); }
|
|
48
48
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryLoginService, decorators: [{
|
|
50
50
|
type: Injectable,
|
|
51
51
|
args: [{
|
|
52
52
|
providedIn: 'root',
|
|
@@ -68,10 +68,10 @@ class DaffInMemoryRegisterService {
|
|
|
68
68
|
registerOnly(registration) {
|
|
69
69
|
return this.http.post(`${this.url}register`, registration);
|
|
70
70
|
}
|
|
71
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
72
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
71
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryRegisterService, deps: [{ token: i1.HttpClient }, { token: DaffInMemoryLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
72
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryRegisterService, providedIn: 'root' }); }
|
|
73
73
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryRegisterService, decorators: [{
|
|
75
75
|
type: Injectable,
|
|
76
76
|
args: [{
|
|
77
77
|
providedIn: 'root',
|
|
@@ -96,10 +96,10 @@ class DaffInMemoryResetPasswordService {
|
|
|
96
96
|
sendResetEmail(email) {
|
|
97
97
|
return this.http.post(`${this.url}sendResetEmail`, { email });
|
|
98
98
|
}
|
|
99
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
100
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
99
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryResetPasswordService, deps: [{ token: i1.HttpClient }, { token: DaffInMemoryLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
100
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryResetPasswordService, providedIn: 'root' }); }
|
|
101
101
|
}
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryResetPasswordService, decorators: [{
|
|
103
103
|
type: Injectable,
|
|
104
104
|
args: [{
|
|
105
105
|
providedIn: 'root',
|
|
@@ -130,11 +130,11 @@ class DaffAuthInMemoryDriverModule {
|
|
|
130
130
|
],
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
135
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
133
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
134
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthInMemoryDriverModule, imports: [CommonModule] }); }
|
|
135
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthInMemoryDriverModule, imports: [CommonModule] }); }
|
|
136
136
|
}
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthInMemoryDriverModule, decorators: [{
|
|
138
138
|
type: NgModule,
|
|
139
139
|
args: [{
|
|
140
140
|
imports: [
|
|
@@ -238,10 +238,10 @@ class DaffInMemoryBackendAuthService {
|
|
|
238
238
|
status: STATUS.OK,
|
|
239
239
|
}));
|
|
240
240
|
}
|
|
241
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
242
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
241
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryBackendAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
242
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryBackendAuthService, providedIn: 'root' }); }
|
|
243
243
|
}
|
|
244
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffInMemoryBackendAuthService, decorators: [{
|
|
245
245
|
type: Injectable,
|
|
246
246
|
args: [{
|
|
247
247
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-driver-in-memory.mjs","sources":["../../../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/drivers/auth-driver.module.ts","../../../libs/auth/driver/in-memory/src/backend/auth.service.ts","../../../libs/auth/driver/in-memory/src/daffodil-auth-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryAuthService implements DaffAuthServiceInterface {\n url = '/api/auth/';\n\n constructor(private http: HttpClient) {}\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 {\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';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryLoginService implements DaffLoginServiceInterface {\n url = '/api/auth/';\n\n constructor(private http: HttpClient) {}\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 { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\n\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRegisterService implements DaffRegisterServiceInterface {\n url = '/api/auth/';\n\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\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 { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\n\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryResetPasswordService implements DaffResetPasswordServiceInterface {\n url = '/api/auth/';\n\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\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 { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffLoginDriver,\n DaffRegisterDriver,\n DaffAuthDriver,\n DaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\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';\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 {\n provide: DaffLoginDriver,\n useExisting: DaffInMemoryLoginService,\n },\n {\n provide: DaffRegisterDriver,\n useExisting: DaffInMemoryRegisterService,\n },\n {\n provide: DaffAuthDriver,\n useExisting: DaffInMemoryAuthService,\n },\n {\n provide: DaffResetPasswordDriver,\n useExisting: DaffInMemoryResetPasswordService,\n },\n ],\n };\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 { DaffInMemoryDbCustomer } from '../models/db-customer.type';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendAuthService implements InMemoryDbService {\n customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer> = {};\n\n private generateToken(): string {\n return faker.random.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i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,CAAA,CAAA,EAAA;;4FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-auth-driver-in-memory.mjs","sources":["../../../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/drivers/auth-driver.module.ts","../../../libs/auth/driver/in-memory/src/backend/auth.service.ts","../../../libs/auth/driver/in-memory/src/daffodil-auth-driver-in-memory.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryAuthService implements DaffAuthServiceInterface {\n url = '/api/auth/';\n\n constructor(private http: HttpClient) {}\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 {\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';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryLoginService implements DaffLoginServiceInterface {\n url = '/api/auth/';\n\n constructor(private http: HttpClient) {}\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 { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\n\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryRegisterService implements DaffRegisterServiceInterface {\n url = '/api/auth/';\n\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\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 { Observable } from 'rxjs';\nimport {\n map,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\n\nimport { DaffInMemoryLoginService } from '../login/login.service';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryResetPasswordService implements DaffResetPasswordServiceInterface {\n url = '/api/auth/';\n\n constructor(\n private http: HttpClient,\n private loginService: DaffInMemoryLoginService,\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 { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffLoginDriver,\n DaffRegisterDriver,\n DaffAuthDriver,\n DaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\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';\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 {\n provide: DaffLoginDriver,\n useExisting: DaffInMemoryLoginService,\n },\n {\n provide: DaffRegisterDriver,\n useExisting: DaffInMemoryRegisterService,\n },\n {\n provide: DaffAuthDriver,\n useExisting: DaffInMemoryAuthService,\n },\n {\n provide: DaffResetPasswordDriver,\n useExisting: DaffInMemoryResetPasswordService,\n },\n ],\n };\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 { DaffInMemoryDbCustomer } from '../models/db-customer.type';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffInMemoryBackendAuthService implements InMemoryDbService {\n customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer> = {};\n\n private generateToken(): string {\n return faker.random.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.DaffInMemoryLoginService"],"mappings":";;;;;;;;;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A,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -152,10 +152,10 @@ class DaffMagentoAuthService {
|
|
|
152
152
|
fetchPolicy: 'no-cache',
|
|
153
153
|
}).pipe(map(validateCheckTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
154
154
|
}
|
|
155
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
156
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
155
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
156
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthService, providedIn: 'root' }); }
|
|
157
157
|
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthService, decorators: [{
|
|
159
159
|
type: Injectable,
|
|
160
160
|
args: [{
|
|
161
161
|
providedIn: 'root',
|
|
@@ -176,10 +176,10 @@ class DaffMagentoAuthTransformerService {
|
|
|
176
176
|
token: auth.token,
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
180
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
179
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthTransformerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
180
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthTransformerService, providedIn: 'root' }); }
|
|
181
181
|
}
|
|
182
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoAuthTransformerService, decorators: [{
|
|
183
183
|
type: Injectable,
|
|
184
184
|
args: [{
|
|
185
185
|
providedIn: 'root',
|
|
@@ -206,10 +206,10 @@ class DaffMagentoLoginService {
|
|
|
206
206
|
logout() {
|
|
207
207
|
return this.apollo.mutate({ mutation: revokeCustomerTokenMutation }).pipe(map(validateRevokeTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
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: "18.2.2", ngImport: i0, type: DaffMagentoLoginService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoAuthTransformerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
210
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoLoginService, providedIn: 'root' }); }
|
|
211
211
|
}
|
|
212
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoLoginService, decorators: [{
|
|
213
213
|
type: Injectable,
|
|
214
214
|
args: [{
|
|
215
215
|
providedIn: 'root',
|
|
@@ -244,10 +244,10 @@ class DaffMagentoRegisterService {
|
|
|
244
244
|
return;
|
|
245
245
|
}), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
246
246
|
}
|
|
247
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
248
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
247
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoRegisterService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
248
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoRegisterService, providedIn: 'root' }); }
|
|
249
249
|
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoRegisterService, decorators: [{
|
|
251
251
|
type: Injectable,
|
|
252
252
|
args: [{
|
|
253
253
|
providedIn: 'root',
|
|
@@ -283,10 +283,10 @@ class DaffMagentoResetPasswordService {
|
|
|
283
283
|
},
|
|
284
284
|
}).pipe(map(validateSendResetEmailResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
285
285
|
}
|
|
286
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
287
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
286
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoResetPasswordService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
287
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoResetPasswordService, providedIn: 'root' }); }
|
|
288
288
|
}
|
|
289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffMagentoResetPasswordService, decorators: [{
|
|
290
290
|
type: Injectable,
|
|
291
291
|
args: [{
|
|
292
292
|
providedIn: 'root',
|
|
@@ -317,11 +317,11 @@ class DaffAuthMagentoDriverModule {
|
|
|
317
317
|
],
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
321
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
322
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
320
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
321
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthMagentoDriverModule, imports: [CommonModule] }); }
|
|
322
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthMagentoDriverModule, imports: [CommonModule] }); }
|
|
323
323
|
}
|
|
324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthMagentoDriverModule, decorators: [{
|
|
325
325
|
type: NgModule,
|
|
326
326
|
args: [{
|
|
327
327
|
imports: [
|
|
@@ -357,10 +357,10 @@ class MagentoAuthApolloBearerTokenLinkGenerator {
|
|
|
357
357
|
return forward(operation);
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
361
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
360
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, deps: [{ token: i1$2.DaffAuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
361
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, providedIn: 'root' }); }
|
|
362
362
|
}
|
|
363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, decorators: [{
|
|
364
364
|
type: Injectable,
|
|
365
365
|
args: [{
|
|
366
366
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-driver-magento.mjs","sources":["../../../libs/auth/driver/magento/src/errors/codes.ts","../../../libs/auth/driver/magento/src/errors/map.ts","../../../libs/auth/driver/magento/src/errors/transform.ts","../../../libs/auth/driver/magento/src/queries/check-token.ts","../../../libs/auth/driver/magento/src/queries/create-customer.ts","../../../libs/auth/driver/magento/src/queries/generate-token.ts","../../../libs/auth/driver/magento/src/queries/revoke-customer-token.ts","../../../libs/auth/driver/magento/src/queries/send-reset-email.ts","../../../libs/auth/driver/magento/src/queries/reset-password.ts","../../../libs/auth/driver/magento/src/validators/check-token.ts","../../../libs/auth/driver/magento/src/validators/generate-token.ts","../../../libs/auth/driver/magento/src/validators/revoke-token.ts","../../../libs/auth/driver/magento/src/validators/send-reset-email.ts","../../../libs/auth/driver/magento/src/validators/reset-password.ts","../../../libs/auth/driver/magento/src/auth.service.ts","../../../libs/auth/driver/magento/src/transforms/auth-transformer.service.ts","../../../libs/auth/driver/magento/src/login.service.ts","../../../libs/auth/driver/magento/src/register.service.ts","../../../libs/auth/driver/magento/src/reset-password.service.ts","../../../libs/auth/driver/magento/src/auth-driver.module.ts","../../../libs/auth/driver/magento/src/apollo-bearer-token-link-generator.ts","../../../libs/auth/driver/magento/src/daffodil-auth-driver-magento.ts"],"sourcesContent":["export enum MagentoAuthGraphQlErrorCode {\n UNAUTHORIZED = 'graphql-authorization',\n AUTHENTICATION_FAILED = 'graphql-authentication',\n BAD_INPUT = 'graphql-input'\n}\n","import {\n DaffUnauthorizedError,\n DaffAuthenticationFailedError,\n} from '@daffodil/auth/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\nimport { DaffBadInputError } from '@daffodil/driver';\n\nimport { MagentoAuthGraphQlErrorCode } from './codes';\n\nexport const DaffAuthMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoAuthGraphQlErrorCode.UNAUTHORIZED]: DaffUnauthorizedError,\n [MagentoAuthGraphQlErrorCode.AUTHENTICATION_FAILED]: DaffAuthenticationFailedError,\n [MagentoAuthGraphQlErrorCode.BAD_INPUT]: DaffBadInputError,\n};\n","import { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffAuthMagentoErrorMap } from './map';\n\nexport const transformMagentoAuthError = (error: any): Error => daffTransformMagentoError(error, DaffAuthMagentoErrorMap) || new DaffAuthInvalidAPIResponseError(error.message);\n","import { gql } from 'apollo-angular';\n\n\nexport const checkTokenQuery = gql`\n query MagentoCheckToken {\n customer {\n email\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const createCustomerMutation = gql`\n mutation MagentoCreateCustomer(\n $email: String!,\n $password: String!,\n $subscribe: Boolean!,\n $firstname: String!,\n $lastname: String!,\n ) {\n createCustomerV2(input: {\n firstname: $firstname,\n lastname: $lastname,\n email: $email,\n password: $password,\n is_subscribed: $subscribe\n }) {\n customer {\n email\n }\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const generateTokenMutation = gql`\n mutation MagentoGenerateToken($email: String!, $password: String!) {\n generateCustomerToken(\n email: $email,\n password: $password\n ) {\n token\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const revokeCustomerTokenMutation = gql`\n mutation revokeCustomerToken {\n revokeCustomerToken {\n result\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const sendPasswordResetEmailMutation = gql`\n mutation MagentoSendPasswordResetEmail($email: String!) {\n requestPasswordResetEmail(\n email: $email,\n )\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const resetPasswordMutation = gql`\n mutation MagentoResetPassword($email: String!, $password: String!, $token: String!) {\n resetPassword(\n email: $email,\n newPassword: $password\n resetPasswordToken: $token\n )\n }\n`;\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoCheckTokenResponse } from '../queries/public_api';\n\nexport const validateCheckTokenResponse = (response: ApolloQueryResult<MagentoCheckTokenResponse>) => {\n if (response.data.customer.email) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Check token response does not contain a valid customer email.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoGenerateTokenResponse } from '../queries/public_api';\n\nexport const validateGenerateTokenResponse = (response: ApolloQueryResult<MagentoGenerateTokenResponse>) => {\n if (response.data.generateCustomerToken.token) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Generate token response does not contain an auth token.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoRevokeCustomerTokenResponse } from '../queries/public_api';\n\nexport const validateRevokeTokenResponse = (response: ApolloQueryResult<MagentoRevokeCustomerTokenResponse>) => {\n if (response.data.revokeCustomerToken.result) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Revoke token response does not contain a successful result.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoSendResetEmailResponse } from '../models/public_api';\n\nexport const validateSendResetEmailResponse = (response: ApolloQueryResult<MagentoSendResetEmailResponse>) => {\n if (response.data.requestPasswordResetEmail) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('The reset password email was not sent successfully.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoResetPasswordResponse } from '../models/public_api';\n\nexport const validateResetPasswordResponse = (response: ApolloQueryResult<MagentoResetPasswordResponse>) => {\n if (response.data.resetPassword) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('The password was not reset.');\n }\n};\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport {\n checkTokenQuery,\n MagentoCheckTokenResponse,\n} from './queries/public_api';\nimport { validateCheckTokenResponse } from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAuthService implements DaffAuthServiceInterface {\n constructor(private apollo: Apollo) {}\n\n check(): Observable<void> {\n return this.apollo.query<MagentoCheckTokenResponse>({\n query: checkTokenQuery,\n fetchPolicy: 'no-cache',\n }).pipe(\n map(validateCheckTokenResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffAuthToken } from '@daffodil/auth';\n\nimport { MagentoAuth } from '../models/response/auth';\n\n/**\n * Transforms magento auths into an object usable by daffodil.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAuthTransformerService {\n\n /**\n * Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.\n *\n * @param auth the auth from a magento auth query.\n */\n transform(auth: MagentoAuth): DaffAuthToken {\n return {\n token: auth.token,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport {\n MagentoRevokeCustomerTokenResponse,\n MagentoGenerateTokenResponse,\n generateTokenMutation,\n revokeCustomerTokenMutation,\n} from './queries/public_api';\nimport { DaffMagentoAuthTransformerService } from './transforms/auth-transformer.service';\nimport {\n validateRevokeTokenResponse,\n validateGenerateTokenResponse,\n} from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoLoginService implements DaffLoginServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n public authTransformer: DaffMagentoAuthTransformerService,\n ) {}\n\n login({ email, password }: DaffLoginInfo): Observable<DaffAuthToken> {\n return this.apollo.mutate<MagentoGenerateTokenResponse>({\n mutation: generateTokenMutation,\n variables: {\n email,\n password,\n },\n }).pipe(\n map(validateGenerateTokenResponse),\n map(res => this.authTransformer.transform(res.data.generateCustomerToken)),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n\n logout() {\n return this.apollo.mutate<MagentoRevokeCustomerTokenResponse>({ mutation: revokeCustomerTokenMutation }).pipe(\n map(validateRevokeTokenResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport {\n DaffRegisterServiceInterface,\n DaffRegistrationFailedError,\n} from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport { DaffMagentoLoginService } from './login.service';\nimport { MagentoRegisterResponse } from './models/public_api';\nimport { createCustomerMutation } from './queries/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoRegisterService implements DaffRegisterServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n private loginService: DaffMagentoLoginService,\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({ email, password, subscribe, firstName, lastName }: DaffAccountRegistration): Observable<void> {\n return this.apollo.mutate<MagentoRegisterResponse>({\n mutation: createCustomerMutation,\n variables: {\n email,\n password,\n firstname: firstName || 'temp',\n lastname: lastName || 'temp',\n subscribe,\n },\n }).pipe(\n map((resp) => {\n if (!resp.data.createCustomerV2.customer.email) {\n throw new DaffRegistrationFailedError(`The account for email ${email} was not successful.`);\n }\n\n return;\n }),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport { DaffMagentoLoginService } from './login.service';\nimport {\n MagentoResetPasswordResponse,\n MagentoSendResetEmailResponse,\n} from './models/public_api';\nimport {\n resetPasswordMutation,\n sendPasswordResetEmailMutation,\n} from './queries/public_api';\nimport {\n validateResetPasswordResponse,\n validateSendResetEmailResponse,\n} from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoResetPasswordService implements DaffResetPasswordServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n private loginService: DaffMagentoLoginService,\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({ email, password, token }: DaffAuthResetPasswordInfo): Observable<void> {\n return this.apollo.mutate<MagentoResetPasswordResponse>({\n mutation: resetPasswordMutation,\n variables: {\n email,\n password,\n token,\n },\n }).pipe(\n map(validateResetPasswordResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n\n sendResetEmail(email: string): Observable<void> {\n return this.apollo.mutate<MagentoSendResetEmailResponse>({\n mutation: sendPasswordResetEmailMutation,\n variables: {\n email,\n },\n }).pipe(\n map(validateSendResetEmailResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffRegisterDriver,\n DaffLoginDriver,\n DaffAuthDriver,\n DaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\n\nimport { DaffMagentoAuthService } from './auth.service';\nimport { DaffMagentoLoginService } from './login.service';\nimport { DaffMagentoRegisterService } from './register.service';\nimport { DaffMagentoResetPasswordService } from './reset-password.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthMagentoDriverModule> {\n return {\n ngModule: DaffAuthMagentoDriverModule,\n providers: [\n {\n provide: DaffRegisterDriver,\n useExisting: DaffMagentoRegisterService,\n },\n {\n provide: DaffLoginDriver,\n useExisting: DaffMagentoLoginService,\n },\n {\n provide: DaffAuthDriver,\n useExisting: DaffMagentoAuthService,\n },\n {\n provide: DaffResetPasswordDriver,\n useExisting: DaffMagentoResetPasswordService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoAuthApolloBearerTokenLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n private storage: DaffAuthStorageService,\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n let token = null;\n\n try {\n token = this.storage.getAuthToken();\n } catch(e){}\n\n if (token) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n authorization: `Bearer ${token}`,\n },\n });\n }\n return forward(operation);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.DaffMagentoAuthTransformerService","i2.DaffMagentoLoginService"],"mappings":";;;;;;;;;;;;;;AAAA,IAAY,2BAIX,CAAA;AAJD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,cAAA,CAAA,GAAA,uBAAsC,CAAA;AACtC,IAAA,2BAAA,CAAA,uBAAA,CAAA,GAAA,wBAAgD,CAAA;AAChD,IAAA,2BAAA,CAAA,WAAA,CAAA,GAAA,eAA2B,CAAA;AAC7B,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,GAItC,EAAA,CAAA,CAAA;;ACKM,MAAM,uBAAuB,GAAqB;AACvD,IAAA,CAAC,2BAA2B,CAAC,YAAY,GAAG,qBAAqB;AACjE,IAAA,CAAC,2BAA2B,CAAC,qBAAqB,GAAG,6BAA6B;AAClF,IAAA,CAAC,2BAA2B,CAAC,SAAS,GAAG,iBAAiB;CAC3D;;ACRM,MAAM,yBAAyB,GAAG,CAAC,KAAU,KAAY,yBAAyB,CAAC,KAAK,EAAE,uBAAuB,CAAC,IAAI,IAAI,+BAA+B,CAAC,KAAK,CAAC,OAAO,CAAC;;ACFxK,MAAM,eAAe,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACA3B,MAAM,sBAAsB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;ACAlC,MAAM,qBAAqB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;ACAjC,MAAM,2BAA2B,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACAvC,MAAM,8BAA8B,GAAG,GAAG,CAAA,CAAA;;;;;;;;ACA1C,MAAM,qBAAqB,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;ACGjC,MAAM,0BAA0B,GAAG,CAAC,QAAsD,K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A,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAzC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yCAAyC,cAFxC,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-auth-driver-magento.mjs","sources":["../../../libs/auth/driver/magento/src/errors/codes.ts","../../../libs/auth/driver/magento/src/errors/map.ts","../../../libs/auth/driver/magento/src/errors/transform.ts","../../../libs/auth/driver/magento/src/queries/check-token.ts","../../../libs/auth/driver/magento/src/queries/create-customer.ts","../../../libs/auth/driver/magento/src/queries/generate-token.ts","../../../libs/auth/driver/magento/src/queries/revoke-customer-token.ts","../../../libs/auth/driver/magento/src/queries/send-reset-email.ts","../../../libs/auth/driver/magento/src/queries/reset-password.ts","../../../libs/auth/driver/magento/src/validators/check-token.ts","../../../libs/auth/driver/magento/src/validators/generate-token.ts","../../../libs/auth/driver/magento/src/validators/revoke-token.ts","../../../libs/auth/driver/magento/src/validators/send-reset-email.ts","../../../libs/auth/driver/magento/src/validators/reset-password.ts","../../../libs/auth/driver/magento/src/auth.service.ts","../../../libs/auth/driver/magento/src/transforms/auth-transformer.service.ts","../../../libs/auth/driver/magento/src/login.service.ts","../../../libs/auth/driver/magento/src/register.service.ts","../../../libs/auth/driver/magento/src/reset-password.service.ts","../../../libs/auth/driver/magento/src/auth-driver.module.ts","../../../libs/auth/driver/magento/src/apollo-bearer-token-link-generator.ts","../../../libs/auth/driver/magento/src/daffodil-auth-driver-magento.ts"],"sourcesContent":["export enum MagentoAuthGraphQlErrorCode {\n UNAUTHORIZED = 'graphql-authorization',\n AUTHENTICATION_FAILED = 'graphql-authentication',\n BAD_INPUT = 'graphql-input'\n}\n","import {\n DaffUnauthorizedError,\n DaffAuthenticationFailedError,\n} from '@daffodil/auth/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\nimport { DaffBadInputError } from '@daffodil/driver';\n\nimport { MagentoAuthGraphQlErrorCode } from './codes';\n\nexport const DaffAuthMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoAuthGraphQlErrorCode.UNAUTHORIZED]: DaffUnauthorizedError,\n [MagentoAuthGraphQlErrorCode.AUTHENTICATION_FAILED]: DaffAuthenticationFailedError,\n [MagentoAuthGraphQlErrorCode.BAD_INPUT]: DaffBadInputError,\n};\n","import { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffAuthMagentoErrorMap } from './map';\n\nexport const transformMagentoAuthError = (error: any): Error => daffTransformMagentoError(error, DaffAuthMagentoErrorMap) || new DaffAuthInvalidAPIResponseError(error.message);\n","import { gql } from 'apollo-angular';\n\n\nexport const checkTokenQuery = gql`\n query MagentoCheckToken {\n customer {\n email\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const createCustomerMutation = gql`\n mutation MagentoCreateCustomer(\n $email: String!,\n $password: String!,\n $subscribe: Boolean!,\n $firstname: String!,\n $lastname: String!,\n ) {\n createCustomerV2(input: {\n firstname: $firstname,\n lastname: $lastname,\n email: $email,\n password: $password,\n is_subscribed: $subscribe\n }) {\n customer {\n email\n }\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const generateTokenMutation = gql`\n mutation MagentoGenerateToken($email: String!, $password: String!) {\n generateCustomerToken(\n email: $email,\n password: $password\n ) {\n token\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const revokeCustomerTokenMutation = gql`\n mutation revokeCustomerToken {\n revokeCustomerToken {\n result\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const sendPasswordResetEmailMutation = gql`\n mutation MagentoSendPasswordResetEmail($email: String!) {\n requestPasswordResetEmail(\n email: $email,\n )\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const resetPasswordMutation = gql`\n mutation MagentoResetPassword($email: String!, $password: String!, $token: String!) {\n resetPassword(\n email: $email,\n newPassword: $password\n resetPasswordToken: $token\n )\n }\n`;\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoCheckTokenResponse } from '../queries/public_api';\n\nexport const validateCheckTokenResponse = (response: ApolloQueryResult<MagentoCheckTokenResponse>) => {\n if (response.data.customer.email) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Check token response does not contain a valid customer email.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoGenerateTokenResponse } from '../queries/public_api';\n\nexport const validateGenerateTokenResponse = (response: ApolloQueryResult<MagentoGenerateTokenResponse>) => {\n if (response.data.generateCustomerToken.token) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Generate token response does not contain an auth token.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoRevokeCustomerTokenResponse } from '../queries/public_api';\n\nexport const validateRevokeTokenResponse = (response: ApolloQueryResult<MagentoRevokeCustomerTokenResponse>) => {\n if (response.data.revokeCustomerToken.result) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('Revoke token response does not contain a successful result.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoSendResetEmailResponse } from '../models/public_api';\n\nexport const validateSendResetEmailResponse = (response: ApolloQueryResult<MagentoSendResetEmailResponse>) => {\n if (response.data.requestPasswordResetEmail) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('The reset password email was not sent successfully.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoResetPasswordResponse } from '../models/public_api';\n\nexport const validateResetPasswordResponse = (response: ApolloQueryResult<MagentoResetPasswordResponse>) => {\n if (response.data.resetPassword) {\n return response;\n } else {\n throw new DaffAuthInvalidAPIResponseError('The password was not reset.');\n }\n};\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n catchError,\n map,\n} from 'rxjs/operators';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport {\n checkTokenQuery,\n MagentoCheckTokenResponse,\n} from './queries/public_api';\nimport { validateCheckTokenResponse } from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAuthService implements DaffAuthServiceInterface {\n constructor(private apollo: Apollo) {}\n\n check(): Observable<void> {\n return this.apollo.query<MagentoCheckTokenResponse>({\n query: checkTokenQuery,\n fetchPolicy: 'no-cache',\n }).pipe(\n map(validateCheckTokenResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffAuthToken } from '@daffodil/auth';\n\nimport { MagentoAuth } from '../models/response/auth';\n\n/**\n * Transforms magento auths into an object usable by daffodil.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoAuthTransformerService {\n\n /**\n * Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.\n *\n * @param auth the auth from a magento auth query.\n */\n transform(auth: MagentoAuth): DaffAuthToken {\n return {\n token: auth.token,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport {\n MagentoRevokeCustomerTokenResponse,\n MagentoGenerateTokenResponse,\n generateTokenMutation,\n revokeCustomerTokenMutation,\n} from './queries/public_api';\nimport { DaffMagentoAuthTransformerService } from './transforms/auth-transformer.service';\nimport {\n validateRevokeTokenResponse,\n validateGenerateTokenResponse,\n} from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoLoginService implements DaffLoginServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n public authTransformer: DaffMagentoAuthTransformerService,\n ) {}\n\n login({ email, password }: DaffLoginInfo): Observable<DaffAuthToken> {\n return this.apollo.mutate<MagentoGenerateTokenResponse>({\n mutation: generateTokenMutation,\n variables: {\n email,\n password,\n },\n }).pipe(\n map(validateGenerateTokenResponse),\n map(res => this.authTransformer.transform(res.data.generateCustomerToken)),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n\n logout() {\n return this.apollo.mutate<MagentoRevokeCustomerTokenResponse>({ mutation: revokeCustomerTokenMutation }).pipe(\n map(validateRevokeTokenResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport {\n DaffRegisterServiceInterface,\n DaffRegistrationFailedError,\n} from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport { DaffMagentoLoginService } from './login.service';\nimport { MagentoRegisterResponse } from './models/public_api';\nimport { createCustomerMutation } from './queries/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoRegisterService implements DaffRegisterServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n private loginService: DaffMagentoLoginService,\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({ email, password, subscribe, firstName, lastName }: DaffAccountRegistration): Observable<void> {\n return this.apollo.mutate<MagentoRegisterResponse>({\n mutation: createCustomerMutation,\n variables: {\n email,\n password,\n firstname: firstName || 'temp',\n lastname: lastName || 'temp',\n subscribe,\n },\n }).pipe(\n map((resp) => {\n if (!resp.data.createCustomerV2.customer.email) {\n throw new DaffRegistrationFailedError(`The account for email ${email} was not successful.`);\n }\n\n return;\n }),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\n\nimport { transformMagentoAuthError } from './errors/transform';\nimport { DaffMagentoLoginService } from './login.service';\nimport {\n MagentoResetPasswordResponse,\n MagentoSendResetEmailResponse,\n} from './models/public_api';\nimport {\n resetPasswordMutation,\n sendPasswordResetEmailMutation,\n} from './queries/public_api';\nimport {\n validateResetPasswordResponse,\n validateSendResetEmailResponse,\n} from './validators/public_api';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffMagentoResetPasswordService implements DaffResetPasswordServiceInterface {\n constructor(\n private apollo: DaffQueuedApollo,\n private loginService: DaffMagentoLoginService,\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({ email, password, token }: DaffAuthResetPasswordInfo): Observable<void> {\n return this.apollo.mutate<MagentoResetPasswordResponse>({\n mutation: resetPasswordMutation,\n variables: {\n email,\n password,\n token,\n },\n }).pipe(\n map(validateResetPasswordResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n\n sendResetEmail(email: string): Observable<void> {\n return this.apollo.mutate<MagentoSendResetEmailResponse>({\n mutation: sendPasswordResetEmailMutation,\n variables: {\n email,\n },\n }).pipe(\n map(validateSendResetEmailResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoAuthError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffRegisterDriver,\n DaffLoginDriver,\n DaffAuthDriver,\n DaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\n\nimport { DaffMagentoAuthService } from './auth.service';\nimport { DaffMagentoLoginService } from './login.service';\nimport { DaffMagentoRegisterService } from './register.service';\nimport { DaffMagentoResetPasswordService } from './reset-password.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthMagentoDriverModule> {\n return {\n ngModule: DaffAuthMagentoDriverModule,\n providers: [\n {\n provide: DaffRegisterDriver,\n useExisting: DaffMagentoRegisterService,\n },\n {\n provide: DaffLoginDriver,\n useExisting: DaffMagentoLoginService,\n },\n {\n provide: DaffAuthDriver,\n useExisting: DaffMagentoAuthService,\n },\n {\n provide: DaffResetPasswordDriver,\n useExisting: DaffMagentoResetPasswordService,\n },\n ],\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ApolloLink } from '@apollo/client/core';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport { DaffApolloLinkGenerator } from '@daffodil/core/graphql';\n\n/**\n * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoAuthApolloBearerTokenLinkGenerator implements DaffApolloLinkGenerator {\n constructor(\n private storage: DaffAuthStorageService,\n ) {}\n\n getLink(): ApolloLink {\n return new ApolloLink((operation, forward) => {\n let token = null;\n\n try {\n token = this.storage.getAuthToken();\n } catch(e){}\n\n if (token) {\n operation.setContext({\n headers: {\n ...operation.getContext().headers,\n authorization: `Bearer ${token}`,\n },\n });\n }\n return forward(operation);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.DaffMagentoAuthTransformerService","i2.DaffMagentoLoginService"],"mappings":";;;;;;;;;;;;;;AAAA,IAAY,2BAIX,CAAA;AAJD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,cAAA,CAAA,GAAA,uBAAsC,CAAA;AACtC,IAAA,2BAAA,CAAA,uBAAA,CAAA,GAAA,wBAAgD,CAAA;AAChD,IAAA,2BAAA,CAAA,WAAA,CAAA,GAAA,eAA2B,CAAA;AAC7B,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,GAItC,EAAA,CAAA,CAAA;;ACKM,MAAM,uBAAuB,GAAqB;AACvD,IAAA,CAAC,2BAA2B,CAAC,YAAY,GAAG,qBAAqB;AACjE,IAAA,CAAC,2BAA2B,CAAC,qBAAqB,GAAG,6BAA6B;AAClF,IAAA,CAAC,2BAA2B,CAAC,SAAS,GAAG,iBAAiB;CAC3D;;ACRM,MAAM,yBAAyB,GAAG,CAAC,KAAU,KAAY,yBAAyB,CAAC,KAAK,E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AACP,wBAAA,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,OAAO;wBACjC,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,qBAAA;AACF,iBAAA,CAAC,CAAC;aACJ;AACD,YAAA,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC5B,SAAC,CAAC,CAAC;KACJ;iIAvBU,yCAAyC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAF,IAAA,CAAA,sBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAzC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yCAAyC,cAFxC,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEP,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -12,10 +12,10 @@ class DaffTestingAuthService {
|
|
|
12
12
|
check() {
|
|
13
13
|
return of(undefined);
|
|
14
14
|
}
|
|
15
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
16
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
15
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
16
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingAuthService, providedIn: 'root' }); }
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingAuthService, decorators: [{
|
|
19
19
|
type: Injectable,
|
|
20
20
|
args: [{
|
|
21
21
|
providedIn: 'root',
|
|
@@ -35,10 +35,10 @@ class DaffTestingLoginService {
|
|
|
35
35
|
logout() {
|
|
36
36
|
return of(undefined);
|
|
37
37
|
}
|
|
38
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
39
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
38
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingLoginService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
39
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingLoginService, providedIn: 'root' }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingLoginService, decorators: [{
|
|
42
42
|
type: Injectable,
|
|
43
43
|
args: [{
|
|
44
44
|
providedIn: 'root',
|
|
@@ -58,10 +58,10 @@ class DaffTestingRegisterService {
|
|
|
58
58
|
registerOnly(registration) {
|
|
59
59
|
return of(undefined);
|
|
60
60
|
}
|
|
61
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
62
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
61
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingRegisterService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
62
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingRegisterService, providedIn: 'root' }); }
|
|
63
63
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingRegisterService, decorators: [{
|
|
65
65
|
type: Injectable,
|
|
66
66
|
args: [{
|
|
67
67
|
providedIn: 'root',
|
|
@@ -84,10 +84,10 @@ class DaffTestingResetPasswordService {
|
|
|
84
84
|
sendResetEmail() {
|
|
85
85
|
return of(undefined);
|
|
86
86
|
}
|
|
87
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
88
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
87
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingResetPasswordService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
88
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingResetPasswordService, providedIn: 'root' }); }
|
|
89
89
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffTestingResetPasswordService, decorators: [{
|
|
91
91
|
type: Injectable,
|
|
92
92
|
args: [{
|
|
93
93
|
providedIn: 'root',
|
|
@@ -118,11 +118,11 @@ class DaffAuthTestingDriverModule {
|
|
|
118
118
|
],
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
122
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
123
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
121
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
122
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTestingDriverModule, imports: [CommonModule] }); }
|
|
123
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTestingDriverModule, imports: [CommonModule] }); }
|
|
124
124
|
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: DaffAuthTestingDriverModule, decorators: [{
|
|
126
126
|
type: NgModule,
|
|
127
127
|
args: [{
|
|
128
128
|
imports: [
|