@daffodil/auth 0.47.3 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/magento/register.service.d.ts +1 -1
- package/esm2020/driver/magento/auth.service.mjs +5 -2
- package/esm2020/driver/magento/register.service.mjs +4 -4
- package/esm2020/models/account-registration.mjs +1 -1
- package/esm2020/testing/factories/account-registration.factory.mjs +3 -1
- package/fesm2015/daffodil-auth-driver-magento.mjs +7 -4
- package/fesm2015/daffodil-auth-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-auth-testing.mjs +2 -0
- package/fesm2015/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2020/daffodil-auth-driver-magento.mjs +7 -4
- package/fesm2020/daffodil-auth-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-auth-testing.mjs +2 -0
- package/fesm2020/daffodil-auth-testing.mjs.map +1 -1
- package/models/account-registration.d.ts +8 -0
- package/package.json +3 -3
- package/testing/factories/account-registration.factory.d.ts +2 -0
|
@@ -12,7 +12,7 @@ export declare class DaffMagentoRegisterService implements DaffRegisterServiceIn
|
|
|
12
12
|
private loginService;
|
|
13
13
|
constructor(apollo: DaffQueuedApollo, loginService: DaffMagentoLoginService);
|
|
14
14
|
register(registration: DaffAccountRegistration): Observable<string>;
|
|
15
|
-
registerOnly({ email, password, subscribe }: DaffAccountRegistration): Observable<void>;
|
|
15
|
+
registerOnly({ email, password, subscribe, firstName, lastName }: DaffAccountRegistration): Observable<void>;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoRegisterService, never>;
|
|
17
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoRegisterService>;
|
|
18
18
|
}
|
|
@@ -15,7 +15,10 @@ export class DaffMagentoAuthService {
|
|
|
15
15
|
this.apollo = apollo;
|
|
16
16
|
}
|
|
17
17
|
check() {
|
|
18
|
-
return this.apollo.query({
|
|
18
|
+
return this.apollo.query({
|
|
19
|
+
query: checkTokenQuery,
|
|
20
|
+
fetchPolicy: 'no-cache',
|
|
21
|
+
}).pipe(map(validateCheckTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
/** @nocollapse */ DaffMagentoAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoAuthService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -26,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
26
29
|
providedIn: 'root',
|
|
27
30
|
}]
|
|
28
31
|
}], ctorParameters: function () { return [{ type: i1.Apollo }]; } });
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9hdXRoL2RyaXZlci9tYWdlbnRvL3NyYy9hdXRoLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDeEMsT0FBTyxFQUVMLFVBQVUsR0FDWCxNQUFNLE1BQU0sQ0FBQztBQUNkLE9BQU8sRUFDTCxVQUFVLEVBQ1YsR0FBRyxHQUNKLE1BQU0sZ0JBQWdCLENBQUM7QUFJeEIsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDL0QsT0FBTyxFQUNMLGVBQWUsR0FFaEIsTUFBTSxzQkFBc0IsQ0FB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terService {
|
|
|
20
20
|
register(registration) {
|
|
21
21
|
return this.registerOnly(registration).pipe(switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })), map(({ token }) => token));
|
|
22
22
|
}
|
|
23
|
-
registerOnly({ email, password, subscribe }) {
|
|
23
|
+
registerOnly({ email, password, subscribe, firstName, lastName }) {
|
|
24
24
|
return this.apollo.mutate({
|
|
25
25
|
mutation: createCustomerMutation,
|
|
26
26
|
variables: {
|
|
27
27
|
email,
|
|
28
28
|
password,
|
|
29
|
-
firstname: 'temp',
|
|
30
|
-
lastname: 'temp',
|
|
29
|
+
firstname: firstName || 'temp',
|
|
30
|
+
lastname: lastName || 'temp',
|
|
31
31
|
subscribe,
|
|
32
32
|
},
|
|
33
33
|
}).pipe(map((resp) => {
|
|
@@ -46,4 +46,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
46
46
|
providedIn: 'root',
|
|
47
47
|
}]
|
|
48
48
|
}], ctorParameters: function () { return [{ type: i1.DaffQueuedApollo }, { type: i2.DaffMagentoLoginService }]; } });
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnaXN0ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYXV0aC9kcml2ZXIvbWFnZW50by9zcmMvcmVnaXN0ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFFTCxVQUFVLEdBQ1gsTUFBTSxNQUFNLENBQUM7QUFDZCxPQUFPLEVBQ0wsR0FBRyxFQUNILFVBQVUsRUFDVixTQUFTLEdBQ1YsTUFBTSxnQkFBZ0IsQ0FBQztB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nVsLmApO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSksXG4gICAgICBjYXRjaEVycm9yKGVyciA9PiB0aHJvd0Vycm9yKCgpID0+IHRyYW5zZm9ybU1hZ2VudG9BdXRoRXJyb3IoZXJyKSkpLFxuICAgICk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
;
|
|
2
2
|
export {};
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudC1yZWdpc3RyYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2F1dGgvc3JjL21vZGVscy9hY2NvdW50LXJlZ2lzdHJhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQkMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERhZmZMb2dpbkluZm8gfSBmcm9tICcuL2xvZ2luLWluZm8nO1xuXG5leHBvcnQgaW50ZXJmYWNlIERhZmZBY2NvdW50UmVnaXN0cmF0aW9uIGV4dGVuZHMgRGFmZkxvZ2luSW5mbyB7XG4gIC8qKlxuICAgKiBXaGV0aGVyIHRoZSBjdXN0b21lciBiZSBzdWJzY3JpYmVkIHRvIHRoZSBuZXdzbGV0dGVyIHVwb24gcmVnaXN0cmF0aW9uLlxuICAgKi9cbiAgc3Vic2NyaWJlPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogVGhlIGN1c3RvbWVyJ3MgZmlyc3QgbmFtZS5cbiAgICovXG4gIGZpcnN0TmFtZT86IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIGN1c3RvbWVyJ3MgbGFzdCBuYW1lLlxuICAgKi9cbiAgbGFzdE5hbWU/OiBzdHJpbmc7XG59O1xuIl19
|
|
@@ -7,6 +7,8 @@ export class MockAccountRegistration {
|
|
|
7
7
|
this.email = faker.internet.email();
|
|
8
8
|
this.password = faker.random.alphaNumeric(16);
|
|
9
9
|
this.subscribe = faker.datatype.boolean();
|
|
10
|
+
this.firstName = faker.name.firstName();
|
|
11
|
+
this.lastName = faker.name.lastName();
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
;
|
|
@@ -23,4 +25,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
23
25
|
providedIn: 'root',
|
|
24
26
|
}]
|
|
25
27
|
}], ctorParameters: function () { return []; } });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudC1yZWdpc3RyYXRpb24uZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvYXV0aC90ZXN0aW5nL3NyYy9mYWN0b3JpZXMvYWNjb3VudC1yZWdpc3RyYXRpb24uZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sS0FBSyxLQUFLLE1BQU0sOEJBQThCLENBQUM7QUFHdEQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7O0FBRTFELE1BQU0sT0FBTyx1QkFBdUI7SUFBcEM7UUFDRSxVQUFLLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUMvQixhQUFRLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDekMsY0FBUyxHQUFHLEtBQUssQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUFFLENBQ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ROYW1lID0gZmFrZXIubmFtZS5sYXN0TmFtZSgpO1xufTtcblxuQEluamVjdGFibGUoe1xuICBwcm92aWRlZEluOiAncm9vdCcsXG59KVxuZXhwb3J0IGNsYXNzIERhZmZBY2NvdW50UmVnaXN0cmF0aW9uRmFjdG9yeSBleHRlbmRzIERhZmZNb2RlbEZhY3Rvcnk8RGFmZkFjY291bnRSZWdpc3RyYXRpb24+IHtcbiAgY29uc3RydWN0b3IoKSB7XG4gICAgc3VwZXIoTW9ja0FjY291bnRSZWdpc3RyYXRpb24pO1xuICB9XG59XG4iXX0=
|
|
@@ -147,7 +147,10 @@ class DaffMagentoAuthService {
|
|
|
147
147
|
this.apollo = apollo;
|
|
148
148
|
}
|
|
149
149
|
check() {
|
|
150
|
-
return this.apollo.query({
|
|
150
|
+
return this.apollo.query({
|
|
151
|
+
query: checkTokenQuery,
|
|
152
|
+
fetchPolicy: 'no-cache',
|
|
153
|
+
}).pipe(map(validateCheckTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
156
|
/** @nocollapse */ DaffMagentoAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoAuthService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -224,14 +227,14 @@ class DaffMagentoRegisterService {
|
|
|
224
227
|
register(registration) {
|
|
225
228
|
return this.registerOnly(registration).pipe(switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })), map(({ token }) => token));
|
|
226
229
|
}
|
|
227
|
-
registerOnly({ email, password, subscribe }) {
|
|
230
|
+
registerOnly({ email, password, subscribe, firstName, lastName }) {
|
|
228
231
|
return this.apollo.mutate({
|
|
229
232
|
mutation: createCustomerMutation,
|
|
230
233
|
variables: {
|
|
231
234
|
email,
|
|
232
235
|
password,
|
|
233
|
-
firstname: 'temp',
|
|
234
|
-
lastname: 'temp',
|
|
236
|
+
firstname: firstName || 'temp',
|
|
237
|
+
lastname: lastName || 'temp',
|
|
235
238
|
subscribe,
|
|
236
239
|
},
|
|
237
240
|
}).pipe(map((resp) => {
|
|
@@ -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>({ query: checkTokenQuery }).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 }: DaffAccountRegistration): Observable<void> {\n return this.apollo.mutate<MagentoRegisterResponse>({\n mutation: createCustomerMutation,\n variables: {\n email,\n password,\n firstname: 'temp',\n 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 const token = this.storage.getAuthToken();\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,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AA,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;2FAEP,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,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 const token = this.storage.getAuthToken();\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,sB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AAC;AACJ,aAAA;AACD,YAAA,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;AAC5B,SAAC,CAAC,CAAC;KACJ;;yJAlBU,yCAAyC,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAF,IAAA,CAAA,sBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzC,mBAAA,yCAAA,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;2FAEP,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -8,6 +8,8 @@ class MockAccountRegistration {
|
|
|
8
8
|
this.email = faker.internet.email();
|
|
9
9
|
this.password = faker.random.alphaNumeric(16);
|
|
10
10
|
this.subscribe = faker.datatype.boolean();
|
|
11
|
+
this.firstName = faker.name.firstName();
|
|
12
|
+
this.lastName = faker.name.lastName();
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-testing.mjs","sources":["../../../libs/auth/testing/src/factories/account-registration.factory.ts","../../../libs/auth/testing/src/factories/auth-token.factory.ts","../../../libs/auth/testing/src/factories/reset-password-info.factory.ts","../../../libs/auth/testing/src/daffodil-auth-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAccountRegistration implements DaffAccountRegistration {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n subscribe = faker.datatype.boolean();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {\n constructor() {\n super(MockAccountRegistration);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthToken } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthToken implements DaffAuthToken {\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {\n constructor() {\n super(MockAuthToken);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthResetPasswordInfo implements DaffAuthResetPasswordInfo {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {\n constructor() {\n super(MockAuthResetPasswordInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAApC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACzC,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"daffodil-auth-testing.mjs","sources":["../../../libs/auth/testing/src/factories/account-registration.factory.ts","../../../libs/auth/testing/src/factories/auth-token.factory.ts","../../../libs/auth/testing/src/factories/reset-password-info.factory.ts","../../../libs/auth/testing/src/daffodil-auth-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAccountRegistration implements DaffAccountRegistration {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n subscribe = faker.datatype.boolean();\n firstName = faker.name.firstName();\n lastName = faker.name.lastName();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {\n constructor() {\n super(MockAccountRegistration);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthToken } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthToken implements DaffAuthToken {\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {\n constructor() {\n super(MockAuthToken);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthResetPasswordInfo implements DaffAuthResetPasswordInfo {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {\n constructor() {\n super(MockAuthResetPasswordInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAApC,IAAA,WAAA,GAAA;QACE,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AAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -147,7 +147,10 @@ class DaffMagentoAuthService {
|
|
|
147
147
|
this.apollo = apollo;
|
|
148
148
|
}
|
|
149
149
|
check() {
|
|
150
|
-
return this.apollo.query({
|
|
150
|
+
return this.apollo.query({
|
|
151
|
+
query: checkTokenQuery,
|
|
152
|
+
fetchPolicy: 'no-cache',
|
|
153
|
+
}).pipe(map(validateCheckTokenResponse), map(() => undefined), catchError(err => throwError(() => transformMagentoAuthError(err))));
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
156
|
/** @nocollapse */ DaffMagentoAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMagentoAuthService, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -224,14 +227,14 @@ class DaffMagentoRegisterService {
|
|
|
224
227
|
register(registration) {
|
|
225
228
|
return this.registerOnly(registration).pipe(switchMap(() => this.loginService.login({ email: registration.email, password: registration.password })), map(({ token }) => token));
|
|
226
229
|
}
|
|
227
|
-
registerOnly({ email, password, subscribe }) {
|
|
230
|
+
registerOnly({ email, password, subscribe, firstName, lastName }) {
|
|
228
231
|
return this.apollo.mutate({
|
|
229
232
|
mutation: createCustomerMutation,
|
|
230
233
|
variables: {
|
|
231
234
|
email,
|
|
232
235
|
password,
|
|
233
|
-
firstname: 'temp',
|
|
234
|
-
lastname: 'temp',
|
|
236
|
+
firstname: firstName || 'temp',
|
|
237
|
+
lastname: lastName || 'temp',
|
|
235
238
|
subscribe,
|
|
236
239
|
},
|
|
237
240
|
}).pipe(map((resp) => {
|
|
@@ -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>({ query: checkTokenQuery }).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 }: DaffAccountRegistration): Observable<void> {\n return this.apollo.mutate<MagentoRegisterResponse>({\n mutation: createCustomerMutation,\n variables: {\n email,\n password,\n firstname: 'temp',\n 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 const token = this.storage.getAuthToken();\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"],"m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ento.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 const token = this.storage.getAuthToken();\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,KAAI;AACnG,IAAA,IAAI,QAAQ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AAA,EAAA,yCAAyC,cAFxC,MAAM,EAAA,CAAA,CAAA;2FAEP,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBAHrD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -8,6 +8,8 @@ class MockAccountRegistration {
|
|
|
8
8
|
this.email = faker.internet.email();
|
|
9
9
|
this.password = faker.random.alphaNumeric(16);
|
|
10
10
|
this.subscribe = faker.datatype.boolean();
|
|
11
|
+
this.firstName = faker.name.firstName();
|
|
12
|
+
this.lastName = faker.name.lastName();
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-auth-testing.mjs","sources":["../../../libs/auth/testing/src/factories/account-registration.factory.ts","../../../libs/auth/testing/src/factories/auth-token.factory.ts","../../../libs/auth/testing/src/factories/reset-password-info.factory.ts","../../../libs/auth/testing/src/daffodil-auth-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAccountRegistration implements DaffAccountRegistration {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n subscribe = faker.datatype.boolean();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {\n constructor() {\n super(MockAccountRegistration);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthToken } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthToken implements DaffAuthToken {\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {\n constructor() {\n super(MockAuthToken);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthResetPasswordInfo implements DaffAuthResetPasswordInfo {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {\n constructor() {\n super(MockAuthResetPasswordInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAApC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AACzC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"daffodil-auth-testing.mjs","sources":["../../../libs/auth/testing/src/factories/account-registration.factory.ts","../../../libs/auth/testing/src/factories/auth-token.factory.ts","../../../libs/auth/testing/src/factories/reset-password-info.factory.ts","../../../libs/auth/testing/src/daffodil-auth-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAccountRegistration } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAccountRegistration implements DaffAccountRegistration {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n subscribe = faker.datatype.boolean();\n firstName = faker.name.firstName();\n lastName = faker.name.lastName();\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {\n constructor() {\n super(MockAccountRegistration);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthToken } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthToken implements DaffAuthToken {\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthTokenFactory extends DaffModelFactory<DaffAuthToken> {\n constructor() {\n super(MockAuthToken);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffModelFactory } from '@daffodil/core/testing';\n\nexport class MockAuthResetPasswordInfo implements DaffAuthResetPasswordInfo {\n email = faker.internet.email();\n password = faker.random.alphaNumeric(16);\n token = faker.random.alphaNumeric(16);\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthResetPasswordInfoFactory extends DaffModelFactory<DaffAuthResetPasswordInfo> {\n constructor() {\n super(MockAuthResetPasswordInfo);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAApC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AACzC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,Q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,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCNY,yBAAyB,CAAA;AAAtC,IAAA,WAAA,GAAA;AACE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACzC,IAAK,CAAA,KAAA,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;KACvC;AAAA,CAAA;AAAA,CAAC;AAKI,MAAO,gCAAiC,SAAQ,gBAA2C,CAAA;AAC/F,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAClC;;gJAHU,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,mBAAA,gCAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;2FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -4,4 +4,12 @@ export interface DaffAccountRegistration extends DaffLoginInfo {
|
|
|
4
4
|
* Whether the customer be subscribed to the newsletter upon registration.
|
|
5
5
|
*/
|
|
6
6
|
subscribe?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The customer's first name.
|
|
9
|
+
*/
|
|
10
|
+
firstName?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The customer's last name.
|
|
13
|
+
*/
|
|
14
|
+
lastName?: string;
|
|
7
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daffodil/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "Reducers, State, Selectors, and Drivers for logging in and registering users.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@angular/common": "^13.0.0",
|
|
20
20
|
"@angular/core": "^13.0.0",
|
|
21
|
-
"@daffodil/core": "0.
|
|
21
|
+
"@daffodil/core": "0.48.0",
|
|
22
22
|
"@ngrx/store": "^13.0.0",
|
|
23
23
|
"rxjs": "7.5.5"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@daffodil/driver": "0.
|
|
26
|
+
"@daffodil/driver": "0.48.0"
|
|
27
27
|
},
|
|
28
28
|
"module": "fesm2015/daffodil-auth.mjs",
|
|
29
29
|
"es2020": "fesm2020/daffodil-auth.mjs",
|
|
@@ -5,6 +5,8 @@ export declare class MockAccountRegistration implements DaffAccountRegistration
|
|
|
5
5
|
email: any;
|
|
6
6
|
password: any;
|
|
7
7
|
subscribe: any;
|
|
8
|
+
firstName: any;
|
|
9
|
+
lastName: any;
|
|
8
10
|
}
|
|
9
11
|
export declare class DaffAccountRegistrationFactory extends DaffModelFactory<DaffAccountRegistration> {
|
|
10
12
|
constructor();
|