@daffodil/auth 0.94.1 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
  2. package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
  4. package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
  5. package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
  6. package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
  7. package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
  8. package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
  9. package/fesm2022/daffodil-auth-driver.mjs +99 -126
  10. package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
  11. package/fesm2022/daffodil-auth-routing.mjs +392 -257
  12. package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
  13. package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
  14. package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
  15. package/fesm2022/daffodil-auth-state.mjs +867 -852
  16. package/fesm2022/daffodil-auth-state.mjs.map +1 -1
  17. package/fesm2022/daffodil-auth-testing.mjs +132 -76
  18. package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
  19. package/fesm2022/daffodil-auth.mjs +65 -57
  20. package/fesm2022/daffodil-auth.mjs.map +1 -1
  21. package/package.json +1 -1
  22. package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
  23. package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
  24. package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
  25. package/types/daffodil-auth-driver-testing.d.ts +37 -36
  26. package/types/daffodil-auth-driver.d.ts +93 -112
  27. package/types/daffodil-auth-routing.d.ts +100 -104
  28. package/types/daffodil-auth-state-testing.d.ts +44 -43
  29. package/types/daffodil-auth-state.d.ts +265 -306
  30. package/types/daffodil-auth-testing.d.ts +28 -33
  31. package/types/daffodil-auth.d.ts +51 -62
  32. package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
  33. package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
  34. package/types/daffodil-auth-driver-magento.d.ts +0 -135
@@ -1,135 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import * as apollo_angular from 'apollo-angular';
5
- import { Apollo } from 'apollo-angular';
6
- import { Observable } from 'rxjs';
7
- import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
8
- import { DaffAuthToken, DaffLoginInfo, DaffAccountRegistration, DaffAuthStorageService } from '@daffodil/auth';
9
- import { DaffQueuedApollo, DaffApolloLinkGenerator } from '@daffodil/core/graphql';
10
- import { ApolloLink } from '@apollo/client';
11
- import { MagentoDriverFeature } from '@daffodil/driver/magento';
12
-
13
- declare class DaffAuthMagentoDriverModule {
14
- static forRoot(): ModuleWithProviders<DaffAuthMagentoDriverModule>;
15
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthMagentoDriverModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthMagentoDriverModule, never, [typeof i1.CommonModule], never>;
17
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthMagentoDriverModule>;
18
- }
19
-
20
- /**
21
- * @inheritdoc
22
- */
23
- declare class DaffMagentoAuthService implements DaffAuthServiceInterface {
24
- private apollo;
25
- constructor(apollo: Apollo);
26
- check(): Observable<void>;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthService, never>;
28
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoAuthService>;
29
- }
30
-
31
- interface MagentoAuth {
32
- token: string;
33
- }
34
-
35
- /**
36
- * Transforms magento auths into an object usable by daffodil.
37
- */
38
- declare class DaffMagentoAuthTransformerService {
39
- /**
40
- * Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.
41
- *
42
- * @param auth the auth from a magento auth query.
43
- */
44
- transform(auth: MagentoAuth): DaffAuthToken;
45
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthTransformerService, never>;
46
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoAuthTransformerService>;
47
- }
48
-
49
- /**
50
- * @inheritdoc
51
- */
52
- declare class DaffMagentoLoginService implements DaffLoginServiceInterface {
53
- private apollo;
54
- authTransformer: DaffMagentoAuthTransformerService;
55
- constructor(apollo: DaffQueuedApollo, authTransformer: DaffMagentoAuthTransformerService);
56
- login({ email, password }: DaffLoginInfo): Observable<DaffAuthToken>;
57
- logout(): Observable<any>;
58
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoLoginService, never>;
59
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoLoginService>;
60
- }
61
-
62
- /**
63
- * @inheritdoc
64
- */
65
- declare class DaffMagentoRegisterService implements DaffRegisterServiceInterface {
66
- private apollo;
67
- private loginService;
68
- constructor(apollo: DaffQueuedApollo, loginService: DaffMagentoLoginService);
69
- register(registration: DaffAccountRegistration): Observable<string>;
70
- registerOnly({ email, password, subscribe, firstName, lastName }: DaffAccountRegistration): Observable<void>;
71
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoRegisterService, never>;
72
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffMagentoRegisterService>;
73
- }
74
-
75
- declare function withAuth(): MagentoDriverFeature;
76
- declare function provideMagentoAuthApolloBearerToken(): i0.EnvironmentProviders;
77
- /**
78
- * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
79
- *
80
- * @inheritdoc
81
- */
82
- declare class MagentoAuthApolloBearerTokenLinkGenerator implements DaffApolloLinkGenerator {
83
- private storage;
84
- constructor(storage: DaffAuthStorageService);
85
- getLink(): ApolloLink;
86
- static ɵfac: i0.ɵɵFactoryDeclaration<MagentoAuthApolloBearerTokenLinkGenerator, never>;
87
- static ɵprov: i0.ɵɵInjectableDeclaration<MagentoAuthApolloBearerTokenLinkGenerator>;
88
- }
89
-
90
- declare const checkTokenQuery: apollo_angular.TypedDocumentNode<unknown, unknown>;
91
-
92
- declare const createCustomerMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
93
-
94
- declare const generateTokenMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
95
-
96
- declare const revokeCustomerTokenMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
97
-
98
- declare const sendPasswordResetEmailMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
99
-
100
- declare const resetPasswordMutation: apollo_angular.TypedDocumentNode<unknown, unknown>;
101
-
102
- interface MagentoCheckTokenResponse {
103
- customer: {
104
- email?: string;
105
- };
106
- }
107
-
108
- interface MagentoGenerateTokenResponse {
109
- generateCustomerToken: MagentoAuth;
110
- }
111
-
112
- interface MagentoRevokeCustomerTokenResponse {
113
- revokeCustomerToken: {
114
- result: boolean;
115
- };
116
- }
117
-
118
- interface MagentoRegisterResponse {
119
- createCustomerV2: {
120
- customer: {
121
- email: string;
122
- };
123
- };
124
- }
125
-
126
- interface MagentoSendResetEmailResponse {
127
- requestPasswordResetEmail: boolean;
128
- }
129
-
130
- interface MagentoResetPasswordResponse {
131
- resetPassword: boolean;
132
- }
133
-
134
- export { DaffAuthMagentoDriverModule, DaffMagentoAuthService, DaffMagentoAuthTransformerService, DaffMagentoLoginService, DaffMagentoRegisterService, MagentoAuthApolloBearerTokenLinkGenerator, checkTokenQuery, createCustomerMutation, generateTokenMutation, provideMagentoAuthApolloBearerToken, resetPasswordMutation, revokeCustomerTokenMutation, sendPasswordResetEmailMutation, withAuth };
135
- export type { MagentoAuth, MagentoCheckTokenResponse, MagentoGenerateTokenResponse, MagentoRegisterResponse, MagentoResetPasswordResponse, MagentoRevokeCustomerTokenResponse, MagentoSendResetEmailResponse };