@daffodil/auth 0.94.1-rc.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
- package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
- package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver.mjs +99 -126
- package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
- package/fesm2022/daffodil-auth-routing.mjs +392 -257
- package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
- package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state.mjs +867 -852
- package/fesm2022/daffodil-auth-state.mjs.map +1 -1
- package/fesm2022/daffodil-auth-testing.mjs +132 -76
- package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth.mjs +65 -57
- package/fesm2022/daffodil-auth.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
- package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
- package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-auth-driver-testing.d.ts +37 -36
- package/types/daffodil-auth-driver.d.ts +93 -112
- package/types/daffodil-auth-routing.d.ts +100 -104
- package/types/daffodil-auth-state-testing.d.ts +44 -43
- package/types/daffodil-auth-state.d.ts +265 -306
- package/types/daffodil-auth-testing.d.ts +28 -33
- package/types/daffodil-auth.d.ts +51 -62
- package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
- package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
- package/types/daffodil-auth-driver-magento.d.ts +0 -135
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
import { DaffAccountRegistration,
|
|
2
|
-
import { DaffModelFactory } from
|
|
3
|
-
import * as i0 from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
lastName: string;
|
|
1
|
+
import { DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthToken } from "@daffodil/auth";
|
|
2
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MockAccountRegistration implements DaffAccountRegistration {
|
|
5
|
+
email: string;
|
|
6
|
+
password: string;
|
|
7
|
+
subscribe: boolean;
|
|
8
|
+
firstName: string;
|
|
9
|
+
lastName: string;
|
|
11
10
|
}
|
|
12
|
-
declare class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export declare class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {
|
|
12
|
+
constructor();
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAccountRegistrationFactory, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
token: string;
|
|
16
|
+
export declare class MockAuthToken implements DaffAuthToken {
|
|
17
|
+
token: string;
|
|
20
18
|
}
|
|
21
|
-
declare class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
export declare class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {
|
|
20
|
+
constructor();
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthTokenFactory, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
token: string;
|
|
24
|
+
export declare class MockAuthResetPasswordInfo implements DaffAuthResetPasswordInfo {
|
|
25
|
+
email: string;
|
|
26
|
+
password: string;
|
|
27
|
+
token: string;
|
|
31
28
|
}
|
|
32
|
-
declare class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { DaffAccountRegistrationFactory, DaffAuthResetPasswordInfoFactory, DaffAuthTokenFactory, MockAccountRegistration, MockAuthResetPasswordInfo, MockAuthToken };
|
|
29
|
+
export declare class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {
|
|
30
|
+
constructor();
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthResetPasswordInfoFactory, never>;
|
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
33
|
+
}
|
package/types/daffodil-auth.d.ts
CHANGED
|
@@ -1,76 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as i0 from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DaffAuthStorageService>;
|
|
1
|
+
import { DaffError, DaffInheritableError, DaffPersistenceService } from "@daffodil/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DaffAuthStorageService {
|
|
4
|
+
private storageService;
|
|
5
|
+
private readonly AUTH_STORAGE_TOKEN;
|
|
6
|
+
constructor(storageService: DaffPersistenceService);
|
|
7
|
+
getAuthToken(): string;
|
|
8
|
+
setAuthToken(value: string): void;
|
|
9
|
+
removeAuthToken(): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthStorageService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
password: string;
|
|
13
|
+
export interface DaffLoginInfo {
|
|
14
|
+
email: string;
|
|
15
|
+
password: string;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
lastName?: string;
|
|
17
|
+
export interface DaffAccountRegistration extends DaffLoginInfo {
|
|
18
|
+
/**
|
|
19
|
+
* Whether the customer be subscribed to the newsletter upon registration.
|
|
20
|
+
*/
|
|
21
|
+
subscribe?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The customer's first name.
|
|
24
|
+
*/
|
|
25
|
+
firstName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The customer's last name.
|
|
28
|
+
*/
|
|
29
|
+
lastName?: string;
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
token: string;
|
|
31
|
+
export interface DaffAuthToken {
|
|
32
|
+
token: string;
|
|
37
33
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
password: string;
|
|
34
|
+
export interface DaffAuthResetPasswordInfo {
|
|
35
|
+
/**
|
|
36
|
+
* The customer's email.
|
|
37
|
+
*/
|
|
38
|
+
email: string;
|
|
39
|
+
/**
|
|
40
|
+
* The reset password token.
|
|
41
|
+
*/
|
|
42
|
+
token: string;
|
|
43
|
+
/**
|
|
44
|
+
* The customer's new password.
|
|
45
|
+
*/
|
|
46
|
+
password: string;
|
|
52
47
|
}
|
|
53
|
-
|
|
54
48
|
/**
|
|
55
49
|
* An error thrown when an authenticated action was initiated
|
|
56
50
|
* but an auth token was not present.
|
|
57
51
|
*/
|
|
58
|
-
declare class DaffAuthMissingTokenError extends DaffInheritableError implements DaffError {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
export declare class DaffAuthMissingTokenError extends DaffInheritableError implements DaffError {
|
|
53
|
+
message: string;
|
|
54
|
+
readonly code: string;
|
|
55
|
+
constructor(message: string);
|
|
62
56
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
MISSING_TOKEN = "DAFF_AUTH_MISSING_TOKEN"
|
|
57
|
+
export declare enum DaffAuthErrorCodes {
|
|
58
|
+
MISSING_TOKEN = "DAFF_AUTH_MISSING_TOKEN"
|
|
66
59
|
}
|
|
67
|
-
|
|
68
60
|
/**
|
|
69
61
|
* A mapping from error codes to error class constructors.
|
|
70
62
|
*/
|
|
71
|
-
declare const DaffAuthErrorMap: {
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export { DaffAuthErrorCodes, DaffAuthErrorMap, DaffAuthMissingTokenError, DaffAuthStorageService };
|
|
76
|
-
export type { DaffAccountRegistration, DaffAuthResetPasswordInfo, DaffAuthToken, DaffLoginInfo };
|
|
63
|
+
export declare const DaffAuthErrorMap: {
|
|
64
|
+
DAFF_AUTH_MISSING_TOKEN: typeof DaffAuthMissingTokenError;
|
|
65
|
+
};
|
|
@@ -1,385 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, NgModule, makeEnvironmentProviders, inject } from '@angular/core';
|
|
4
|
-
import { DaffAuthenticationFailedError, DaffUnauthorizedError, DaffAuthInvalidAPIResponseError, DaffRegistrationFailedError, provideDaffRegisterDriver, provideDaffLoginDriver, provideDaffAuthDriver, provideDaffResetPasswordDriver } from '@daffodil/auth/driver';
|
|
5
|
-
import * as i1 from 'apollo-angular';
|
|
6
|
-
import { gql } from 'apollo-angular';
|
|
7
|
-
import { throwError } from 'rxjs';
|
|
8
|
-
import { map, catchError, switchMap } from 'rxjs/operators';
|
|
9
|
-
import { daffTransformMagentoError, makeMagentoDriverFeature } from '@daffodil/driver/magento';
|
|
10
|
-
import { DaffBadInputError } from '@daffodil/driver';
|
|
11
|
-
import * as i1$1 from '@daffodil/core/graphql';
|
|
12
|
-
import { provideDaffApolloHeaderProviders, getApolloOperationHeaders } from '@daffodil/core/graphql';
|
|
13
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
14
|
-
import { ApolloLink } from '@apollo/client';
|
|
15
|
-
import * as i1$2 from '@daffodil/auth';
|
|
16
|
-
import { DaffAuthStorageService } from '@daffodil/auth';
|
|
17
|
-
|
|
18
|
-
var MagentoAuthGraphQlErrorCode;
|
|
19
|
-
(function (MagentoAuthGraphQlErrorCode) {
|
|
20
|
-
MagentoAuthGraphQlErrorCode["UNAUTHORIZED"] = "graphql-authorization";
|
|
21
|
-
MagentoAuthGraphQlErrorCode["AUTHENTICATION_FAILED"] = "graphql-authentication";
|
|
22
|
-
MagentoAuthGraphQlErrorCode["BAD_INPUT"] = "graphql-input";
|
|
23
|
-
})(MagentoAuthGraphQlErrorCode || (MagentoAuthGraphQlErrorCode = {}));
|
|
24
|
-
|
|
25
|
-
const DaffAuthMagentoErrorMap = {
|
|
26
|
-
[MagentoAuthGraphQlErrorCode.UNAUTHORIZED]: DaffUnauthorizedError,
|
|
27
|
-
[MagentoAuthGraphQlErrorCode.AUTHENTICATION_FAILED]: DaffAuthenticationFailedError,
|
|
28
|
-
[MagentoAuthGraphQlErrorCode.BAD_INPUT]: DaffBadInputError,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const transformMagentoAuthError = (error) => daffTransformMagentoError(error, DaffAuthMagentoErrorMap) || new DaffAuthInvalidAPIResponseError(error.message);
|
|
32
|
-
|
|
33
|
-
const checkTokenQuery = gql `
|
|
34
|
-
query MagentoCheckToken {
|
|
35
|
-
customer {
|
|
36
|
-
email
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
const createCustomerMutation = gql `
|
|
42
|
-
mutation MagentoCreateCustomer(
|
|
43
|
-
$email: String!,
|
|
44
|
-
$password: String!,
|
|
45
|
-
$subscribe: Boolean!,
|
|
46
|
-
$firstname: String!,
|
|
47
|
-
$lastname: String!,
|
|
48
|
-
) {
|
|
49
|
-
createCustomerV2(input: {
|
|
50
|
-
firstname: $firstname,
|
|
51
|
-
lastname: $lastname,
|
|
52
|
-
email: $email,
|
|
53
|
-
password: $password,
|
|
54
|
-
is_subscribed: $subscribe
|
|
55
|
-
}) {
|
|
56
|
-
customer {
|
|
57
|
-
email
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
const generateTokenMutation = gql `
|
|
64
|
-
mutation MagentoGenerateToken($email: String!, $password: String!) {
|
|
65
|
-
generateCustomerToken(
|
|
66
|
-
email: $email,
|
|
67
|
-
password: $password
|
|
68
|
-
) {
|
|
69
|
-
token
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
const revokeCustomerTokenMutation = gql `
|
|
75
|
-
mutation revokeCustomerToken {
|
|
76
|
-
revokeCustomerToken {
|
|
77
|
-
result
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
|
|
82
|
-
const sendPasswordResetEmailMutation = gql `
|
|
83
|
-
mutation MagentoSendPasswordResetEmail($email: String!) {
|
|
84
|
-
requestPasswordResetEmail(
|
|
85
|
-
email: $email,
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
const resetPasswordMutation = gql `
|
|
91
|
-
mutation MagentoResetPassword($email: String!, $password: String!, $token: String!) {
|
|
92
|
-
resetPassword(
|
|
93
|
-
email: $email,
|
|
94
|
-
newPassword: $password
|
|
95
|
-
resetPasswordToken: $token
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
`;
|
|
99
|
-
|
|
100
|
-
const validateCheckTokenResponse = (response) => {
|
|
101
|
-
if (response.data.customer.email) {
|
|
102
|
-
return response;
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
throw new DaffAuthInvalidAPIResponseError('Check token response does not contain a valid customer email.');
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const validateGenerateTokenResponse = (response) => {
|
|
110
|
-
if (response.data.generateCustomerToken.token) {
|
|
111
|
-
return response;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
throw new DaffAuthInvalidAPIResponseError('Generate token response does not contain an auth token.');
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const validateRevokeTokenResponse = (response) => {
|
|
119
|
-
if (response.data.revokeCustomerToken.result) {
|
|
120
|
-
return response;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
throw new DaffAuthInvalidAPIResponseError('Revoke token response does not contain a successful result.');
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const validateSendResetEmailResponse = (response) => {
|
|
128
|
-
if (response.data.requestPasswordResetEmail) {
|
|
129
|
-
return response;
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
throw new DaffAuthInvalidAPIResponseError('The reset password email was not sent successfully.');
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const validateResetPasswordResponse = (response) => {
|
|
137
|
-
if (response.data.resetPassword) {
|
|
138
|
-
return response;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
throw new DaffAuthInvalidAPIResponseError('The password was not reset.');
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @inheritdoc
|
|
147
|
-
*/
|
|
148
|
-
class DaffMagentoAuthService {
|
|
149
|
-
constructor(apollo) {
|
|
150
|
-
this.apollo = apollo;
|
|
151
|
-
}
|
|
152
|
-
check() {
|
|
153
|
-
return this.apollo.query({
|
|
154
|
-
query: checkTokenQuery,
|
|
155
|
-
fetchPolicy: 'no-cache',
|
|
156
|
-
}).pipe(map(validateCheckTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
157
|
-
}
|
|
158
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
159
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthService, providedIn: 'root' }); }
|
|
160
|
-
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthService, decorators: [{
|
|
162
|
-
type: Injectable,
|
|
163
|
-
args: [{
|
|
164
|
-
providedIn: 'root',
|
|
165
|
-
}]
|
|
166
|
-
}], ctorParameters: () => [{ type: i1.Apollo }] });
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Transforms magento auths into an object usable by daffodil.
|
|
170
|
-
*/
|
|
171
|
-
class DaffMagentoAuthTransformerService {
|
|
172
|
-
/**
|
|
173
|
-
* Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.
|
|
174
|
-
*
|
|
175
|
-
* @param auth the auth from a magento auth query.
|
|
176
|
-
*/
|
|
177
|
-
transform(auth) {
|
|
178
|
-
return {
|
|
179
|
-
token: auth.token,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthTransformerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
183
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthTransformerService, providedIn: 'root' }); }
|
|
184
|
-
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoAuthTransformerService, decorators: [{
|
|
186
|
-
type: Injectable,
|
|
187
|
-
args: [{
|
|
188
|
-
providedIn: 'root',
|
|
189
|
-
}]
|
|
190
|
-
}] });
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* @inheritdoc
|
|
194
|
-
*/
|
|
195
|
-
class DaffMagentoLoginService {
|
|
196
|
-
constructor(apollo, authTransformer) {
|
|
197
|
-
this.apollo = apollo;
|
|
198
|
-
this.authTransformer = authTransformer;
|
|
199
|
-
}
|
|
200
|
-
login({ email, password }) {
|
|
201
|
-
return this.apollo.mutate({
|
|
202
|
-
mutation: generateTokenMutation,
|
|
203
|
-
variables: {
|
|
204
|
-
email,
|
|
205
|
-
password,
|
|
206
|
-
},
|
|
207
|
-
}).pipe(map(validateGenerateTokenResponse), map(res => this.authTransformer.transform(res.data.generateCustomerToken)), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
208
|
-
}
|
|
209
|
-
logout() {
|
|
210
|
-
return this.apollo.mutate({ mutation: revokeCustomerTokenMutation }).pipe(map(validateRevokeTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
211
|
-
}
|
|
212
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoLoginService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoAuthTransformerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
213
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoLoginService, providedIn: 'root' }); }
|
|
214
|
-
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoLoginService, decorators: [{
|
|
216
|
-
type: Injectable,
|
|
217
|
-
args: [{
|
|
218
|
-
providedIn: 'root',
|
|
219
|
-
}]
|
|
220
|
-
}], ctorParameters: () => [{ type: i1$1.DaffQueuedApollo }, { type: DaffMagentoAuthTransformerService }] });
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* @inheritdoc
|
|
224
|
-
*/
|
|
225
|
-
class DaffMagentoRegisterService {
|
|
226
|
-
constructor(apollo, loginService) {
|
|
227
|
-
this.apollo = apollo;
|
|
228
|
-
this.loginService = loginService;
|
|
229
|
-
}
|
|
230
|
-
register(registration) {
|
|
231
|
-
return this.registerOnly(registration).pipe(switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })), map(({ token }) => token));
|
|
232
|
-
}
|
|
233
|
-
registerOnly({ email, password, subscribe, firstName, lastName }) {
|
|
234
|
-
return this.apollo.mutate({
|
|
235
|
-
mutation: createCustomerMutation,
|
|
236
|
-
variables: {
|
|
237
|
-
email,
|
|
238
|
-
password,
|
|
239
|
-
firstname: firstName || 'temp',
|
|
240
|
-
lastname: lastName || 'temp',
|
|
241
|
-
subscribe,
|
|
242
|
-
},
|
|
243
|
-
}).pipe(map((resp) => {
|
|
244
|
-
if (!resp.data.createCustomerV2.customer.email) {
|
|
245
|
-
throw new DaffRegistrationFailedError(`The account for email ${email} was not successful.`);
|
|
246
|
-
}
|
|
247
|
-
return;
|
|
248
|
-
}), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
249
|
-
}
|
|
250
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoRegisterService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
251
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoRegisterService, providedIn: 'root' }); }
|
|
252
|
-
}
|
|
253
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoRegisterService, decorators: [{
|
|
254
|
-
type: Injectable,
|
|
255
|
-
args: [{
|
|
256
|
-
providedIn: 'root',
|
|
257
|
-
}]
|
|
258
|
-
}], ctorParameters: () => [{ type: i1$1.DaffQueuedApollo }, { type: DaffMagentoLoginService }] });
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @inheritdoc
|
|
262
|
-
*/
|
|
263
|
-
class DaffMagentoResetPasswordService {
|
|
264
|
-
constructor(apollo, loginService) {
|
|
265
|
-
this.apollo = apollo;
|
|
266
|
-
this.loginService = loginService;
|
|
267
|
-
}
|
|
268
|
-
resetPassword(info) {
|
|
269
|
-
return this.resetPasswordOnly(info).pipe(switchMap(() => this.loginService.login({ email: info.email, password: info.password })), map(({ token }) => token));
|
|
270
|
-
}
|
|
271
|
-
resetPasswordOnly({ email, password, token }) {
|
|
272
|
-
return this.apollo.mutate({
|
|
273
|
-
mutation: resetPasswordMutation,
|
|
274
|
-
variables: {
|
|
275
|
-
email,
|
|
276
|
-
password,
|
|
277
|
-
token,
|
|
278
|
-
},
|
|
279
|
-
}).pipe(map(validateResetPasswordResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
280
|
-
}
|
|
281
|
-
sendResetEmail(email) {
|
|
282
|
-
return this.apollo.mutate({
|
|
283
|
-
mutation: sendPasswordResetEmailMutation,
|
|
284
|
-
variables: {
|
|
285
|
-
email,
|
|
286
|
-
},
|
|
287
|
-
}).pipe(map(validateSendResetEmailResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
288
|
-
}
|
|
289
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoResetPasswordService, deps: [{ token: i1$1.DaffQueuedApollo }, { token: DaffMagentoLoginService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
290
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoResetPasswordService, providedIn: 'root' }); }
|
|
291
|
-
}
|
|
292
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffMagentoResetPasswordService, decorators: [{
|
|
293
|
-
type: Injectable,
|
|
294
|
-
args: [{
|
|
295
|
-
providedIn: 'root',
|
|
296
|
-
}]
|
|
297
|
-
}], ctorParameters: () => [{ type: i1$1.DaffQueuedApollo }, { type: DaffMagentoLoginService }] });
|
|
298
|
-
|
|
299
|
-
class DaffAuthMagentoDriverModule {
|
|
300
|
-
static forRoot() {
|
|
301
|
-
return {
|
|
302
|
-
ngModule: DaffAuthMagentoDriverModule,
|
|
303
|
-
providers: [
|
|
304
|
-
provideDaffRegisterDriver(DaffMagentoRegisterService),
|
|
305
|
-
provideDaffLoginDriver(DaffMagentoLoginService),
|
|
306
|
-
provideDaffAuthDriver(DaffMagentoAuthService),
|
|
307
|
-
provideDaffResetPasswordDriver(DaffMagentoResetPasswordService),
|
|
308
|
-
],
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
312
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthMagentoDriverModule, imports: [CommonModule] }); }
|
|
313
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthMagentoDriverModule, imports: [CommonModule] }); }
|
|
314
|
-
}
|
|
315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthMagentoDriverModule, decorators: [{
|
|
316
|
-
type: NgModule,
|
|
317
|
-
args: [{
|
|
318
|
-
imports: [
|
|
319
|
-
CommonModule,
|
|
320
|
-
],
|
|
321
|
-
}]
|
|
322
|
-
}] });
|
|
323
|
-
|
|
324
|
-
function withAuth() {
|
|
325
|
-
return makeMagentoDriverFeature('MagentoAuthApolloBearerToken', [
|
|
326
|
-
provideMagentoAuthApolloBearerToken(),
|
|
327
|
-
]);
|
|
328
|
-
}
|
|
329
|
-
function provideMagentoAuthApolloBearerToken() {
|
|
330
|
-
return makeEnvironmentProviders([
|
|
331
|
-
provideDaffApolloHeaderProviders(() => {
|
|
332
|
-
const storage = inject(DaffAuthStorageService);
|
|
333
|
-
let token = null;
|
|
334
|
-
try {
|
|
335
|
-
token = storage.getAuthToken();
|
|
336
|
-
}
|
|
337
|
-
catch (e) { }
|
|
338
|
-
return new HttpHeaders(token
|
|
339
|
-
? {
|
|
340
|
-
authorization: `Bearer ${token}`,
|
|
341
|
-
}
|
|
342
|
-
: {});
|
|
343
|
-
}),
|
|
344
|
-
]);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
|
|
348
|
-
*
|
|
349
|
-
* @inheritdoc
|
|
350
|
-
*/
|
|
351
|
-
class MagentoAuthApolloBearerTokenLinkGenerator {
|
|
352
|
-
constructor(storage) {
|
|
353
|
-
this.storage = storage;
|
|
354
|
-
}
|
|
355
|
-
getLink() {
|
|
356
|
-
return new ApolloLink((operation, forward) => {
|
|
357
|
-
let token = null;
|
|
358
|
-
try {
|
|
359
|
-
token = this.storage.getAuthToken();
|
|
360
|
-
}
|
|
361
|
-
catch (e) { }
|
|
362
|
-
if (token) {
|
|
363
|
-
operation.setContext({
|
|
364
|
-
headers: getApolloOperationHeaders(operation).append('authorization', `Bearer ${token}`),
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
return forward(operation);
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, deps: [{ token: i1$2.DaffAuthStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
371
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, providedIn: 'root' }); }
|
|
372
|
-
}
|
|
373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoAuthApolloBearerTokenLinkGenerator, decorators: [{
|
|
374
|
-
type: Injectable,
|
|
375
|
-
args: [{
|
|
376
|
-
providedIn: 'root',
|
|
377
|
-
}]
|
|
378
|
-
}], ctorParameters: () => [{ type: i1$2.DaffAuthStorageService }] });
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Generated bundle index. Do not edit.
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
|
-
export { DaffAuthMagentoDriverModule, DaffMagentoAuthService, DaffMagentoAuthTransformerService, DaffMagentoLoginService, DaffMagentoRegisterService, MagentoAuthApolloBearerTokenLinkGenerator, checkTokenQuery, createCustomerMutation, generateTokenMutation, provideMagentoAuthApolloBearerToken, resetPasswordMutation, revokeCustomerTokenMutation, sendPasswordResetEmailMutation, withAuth };
|
|
385
|
-
//# sourceMappingURL=daffodil-auth-driver-magento.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { Apollo } from 'apollo-angular';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoCheckTokenResponse } from '../queries/public_api';\n\nexport const validateCheckTokenResponse = (response: Apollo.QueryResult<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 { Apollo } from 'apollo-angular';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoGenerateTokenResponse } from '../queries/public_api';\n\nexport const validateGenerateTokenResponse = (response: Apollo.QueryResult<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 { Apollo } from 'apollo-angular';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoRevokeCustomerTokenResponse } from '../queries/public_api';\n\nexport const validateRevokeTokenResponse = (response: Apollo.QueryResult<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 { Apollo } from 'apollo-angular';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoSendResetEmailResponse } from '../models/public_api';\n\nexport const validateSendResetEmailResponse = (response: Apollo.QueryResult<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 { Apollo } from 'apollo-angular';\n\nimport { DaffAuthInvalidAPIResponseError } from '@daffodil/auth/driver';\n\nimport { MagentoResetPasswordResponse } from '../models/public_api';\n\nexport const validateResetPasswordResponse = (response: Apollo.QueryResult<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 {\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 {\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 {\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 provideDaffRegisterDriver,\n provideDaffLoginDriver,\n provideDaffAuthDriver,\n provideDaffResetPasswordDriver,\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 provideDaffRegisterDriver(DaffMagentoRegisterService),\n provideDaffLoginDriver(DaffMagentoLoginService),\n provideDaffAuthDriver(DaffMagentoAuthService),\n provideDaffResetPasswordDriver(DaffMagentoResetPasswordService),\n ],\n };\n }\n}\n","import { HttpHeaders } from '@angular/common/http';\nimport {\n inject,\n Injectable,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { ApolloLink } from '@apollo/client';\n\nimport { DaffAuthStorageService } from '@daffodil/auth';\nimport {\n DaffApolloLinkGenerator,\n getApolloOperationHeaders,\n provideDaffApolloHeaderProviders,\n} from '@daffodil/core/graphql';\nimport {\n makeMagentoDriverFeature,\n MagentoDriverFeature,\n} from '@daffodil/driver/magento';\n\nexport function withAuth(): MagentoDriverFeature {\n return makeMagentoDriverFeature('MagentoAuthApolloBearerToken', [\n provideMagentoAuthApolloBearerToken(),\n ]);\n}\n\nexport function provideMagentoAuthApolloBearerToken() {\n return makeEnvironmentProviders([\n provideDaffApolloHeaderProviders(() => {\n const storage = inject(DaffAuthStorageService);\n let token = null;\n\n try {\n token = storage.getAuthToken();\n } catch(e){}\n\n return new HttpHeaders(token\n ? {\n authorization: `Bearer ${token}`,\n }\n : {});\n }),\n ]);\n}\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: getApolloOperationHeaders(operation).append('authorization', `Bearer ${token}`),\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;AAJD,CAAA,UAAY,2BAA2B,EAAA;AACrC,IAAA,2BAAA,CAAA,cAAA,CAAA,GAAA,uBAAsC;AACtC,IAAA,2BAAA,CAAA,uBAAA,CAAA,GAAA,wBAAgD;AAChD,IAAA,2BAAA,CAAA,WAAA,CAAA,GAAA,eAA2B;AAC7B,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,GAAA,EAAA,CAAA,CAAA;;ACShC,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,y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