@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,127 +1,221 @@
1
- import { CommonModule } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, NgModule } from '@angular/core';
4
- import { provideDaffLoginDriver, provideDaffRegisterDriver, provideDaffAuthDriver, provideDaffResetPasswordDriver } from '@daffodil/auth/driver';
5
- import { of } from 'rxjs';
6
- import * as i1 from '@daffodil/auth/testing';
1
+ import { CommonModule } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
4
+ import { provideDaffAuthDriver, provideDaffLoginDriver, provideDaffRegisterDriver, provideDaffResetPasswordDriver } from "@daffodil/auth/driver";
5
+ import { of } from "rxjs";
6
+ import * as i1 from "@daffodil/auth/testing";
7
+ var DaffTestingAuthService = class DaffTestingAuthService {
8
+ check() {
9
+ return of(void 0);
10
+ }
11
+ static {
12
+ this.ɵfac = i0.ɵɵngDeclareFactory({
13
+ minVersion: "12.0.0",
14
+ version: "22.2.4",
15
+ ngImport: i0,
16
+ type: DaffTestingAuthService,
17
+ deps: [],
18
+ target: i0.ɵɵFactoryTarget.Injectable
19
+ });
20
+ }
21
+ static {
22
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
23
+ minVersion: "12.0.0",
24
+ version: "22.2.4",
25
+ ngImport: i0,
26
+ type: DaffTestingAuthService,
27
+ providedIn: "root"
28
+ });
29
+ }
30
+ };
31
+ i0.ɵɵngDeclareClassMetadata({
32
+ minVersion: "12.0.0",
33
+ version: "22.2.4",
34
+ ngImport: i0,
35
+ type: DaffTestingAuthService,
36
+ decorators: [{
37
+ type: Injectable,
38
+ args: [{ providedIn: "root" }]
39
+ }]
40
+ });
41
+ var DaffTestingLoginService = class DaffTestingLoginService {
42
+ constructor(factory) {
43
+ this.factory = factory;
44
+ }
45
+ login(loginInfo) {
46
+ return of(this.factory.create());
47
+ }
48
+ logout() {
49
+ return of(void 0);
50
+ }
51
+ static {
52
+ this.ɵfac = i0.ɵɵngDeclareFactory({
53
+ minVersion: "12.0.0",
54
+ version: "22.2.4",
55
+ ngImport: i0,
56
+ type: DaffTestingLoginService,
57
+ deps: [{ token: i1.DaffAuthTokenFactory }],
58
+ target: i0.ɵɵFactoryTarget.Injectable
59
+ });
60
+ }
61
+ static {
62
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
63
+ minVersion: "12.0.0",
64
+ version: "22.2.4",
65
+ ngImport: i0,
66
+ type: DaffTestingLoginService,
67
+ providedIn: "root"
68
+ });
69
+ }
70
+ };
71
+ i0.ɵɵngDeclareClassMetadata({
72
+ minVersion: "12.0.0",
73
+ version: "22.2.4",
74
+ ngImport: i0,
75
+ type: DaffTestingLoginService,
76
+ decorators: [{
77
+ type: Injectable,
78
+ args: [{ providedIn: "root" }]
79
+ }],
80
+ ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }]
81
+ });
82
+ var DaffTestingRegisterService = class DaffTestingRegisterService {
83
+ constructor(authTokenFactory) {
84
+ this.authTokenFactory = authTokenFactory;
85
+ }
86
+ register(registration) {
87
+ return of(this.authTokenFactory.create().token);
88
+ }
89
+ registerOnly(registration) {
90
+ return of(void 0);
91
+ }
92
+ static {
93
+ this.ɵfac = i0.ɵɵngDeclareFactory({
94
+ minVersion: "12.0.0",
95
+ version: "22.2.4",
96
+ ngImport: i0,
97
+ type: DaffTestingRegisterService,
98
+ deps: [{ token: i1.DaffAuthTokenFactory }],
99
+ target: i0.ɵɵFactoryTarget.Injectable
100
+ });
101
+ }
102
+ static {
103
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
104
+ minVersion: "12.0.0",
105
+ version: "22.2.4",
106
+ ngImport: i0,
107
+ type: DaffTestingRegisterService,
108
+ providedIn: "root"
109
+ });
110
+ }
111
+ };
112
+ i0.ɵɵngDeclareClassMetadata({
113
+ minVersion: "12.0.0",
114
+ version: "22.2.4",
115
+ ngImport: i0,
116
+ type: DaffTestingRegisterService,
117
+ decorators: [{
118
+ type: Injectable,
119
+ args: [{ providedIn: "root" }]
120
+ }],
121
+ ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }]
122
+ });
123
+ var DaffTestingResetPasswordService = class DaffTestingResetPasswordService {
124
+ constructor(authTokenFactory) {
125
+ this.authTokenFactory = authTokenFactory;
126
+ }
127
+ resetPassword() {
128
+ return of(this.authTokenFactory.create().token);
129
+ }
130
+ resetPasswordOnly(info) {
131
+ return of(void 0);
132
+ }
133
+ sendResetEmail() {
134
+ return of(void 0);
135
+ }
136
+ static {
137
+ this.ɵfac = i0.ɵɵngDeclareFactory({
138
+ minVersion: "12.0.0",
139
+ version: "22.2.4",
140
+ ngImport: i0,
141
+ type: DaffTestingResetPasswordService,
142
+ deps: [{ token: i1.DaffAuthTokenFactory }],
143
+ target: i0.ɵɵFactoryTarget.Injectable
144
+ });
145
+ }
146
+ static {
147
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
148
+ minVersion: "12.0.0",
149
+ version: "22.2.4",
150
+ ngImport: i0,
151
+ type: DaffTestingResetPasswordService,
152
+ providedIn: "root"
153
+ });
154
+ }
155
+ };
156
+ i0.ɵɵngDeclareClassMetadata({
157
+ minVersion: "12.0.0",
158
+ version: "22.2.4",
159
+ ngImport: i0,
160
+ type: DaffTestingResetPasswordService,
161
+ decorators: [{
162
+ type: Injectable,
163
+ args: [{ providedIn: "root" }]
164
+ }],
165
+ ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }]
166
+ });
167
+ const provideDaffAuthTestingDriver = () => makeEnvironmentProviders([
168
+ provideDaffLoginDriver(DaffTestingLoginService),
169
+ provideDaffRegisterDriver(DaffTestingRegisterService),
170
+ provideDaffAuthDriver(DaffTestingAuthService),
171
+ provideDaffResetPasswordDriver(DaffTestingResetPasswordService)
172
+ ]);
173
+ var DaffAuthTestingDriverModule = class DaffAuthTestingDriverModule {
174
+ static forRoot() {
175
+ return {
176
+ ngModule: DaffAuthTestingDriverModule,
177
+ providers: [provideDaffAuthTestingDriver()]
178
+ };
179
+ }
180
+ static {
181
+ this.ɵfac = i0.ɵɵngDeclareFactory({
182
+ minVersion: "12.0.0",
183
+ version: "22.2.4",
184
+ ngImport: i0,
185
+ type: DaffAuthTestingDriverModule,
186
+ deps: [],
187
+ target: i0.ɵɵFactoryTarget.NgModule
188
+ });
189
+ }
190
+ static {
191
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
192
+ minVersion: "14.0.0",
193
+ version: "22.2.4",
194
+ ngImport: i0,
195
+ type: DaffAuthTestingDriverModule,
196
+ imports: [CommonModule]
197
+ });
198
+ }
199
+ static {
200
+ this.ɵinj = i0.ɵɵngDeclareInjector({
201
+ minVersion: "12.0.0",
202
+ version: "22.2.4",
203
+ ngImport: i0,
204
+ type: DaffAuthTestingDriverModule,
205
+ imports: [CommonModule]
206
+ });
207
+ }
208
+ };
209
+ i0.ɵɵngDeclareClassMetadata({
210
+ minVersion: "12.0.0",
211
+ version: "22.2.4",
212
+ ngImport: i0,
213
+ type: DaffAuthTestingDriverModule,
214
+ decorators: [{
215
+ type: NgModule,
216
+ args: [{ imports: [CommonModule] }]
217
+ }]
218
+ });
219
+ export { DaffAuthTestingDriverModule, DaffTestingAuthService, DaffTestingLoginService, DaffTestingRegisterService, provideDaffAuthTestingDriver };
7
220
 
8
- /**
9
- * @inheritdoc
10
- */
11
- class DaffTestingAuthService {
12
- check() {
13
- return of(undefined);
14
- }
15
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingAuthService, providedIn: 'root' }); }
17
- }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingAuthService, decorators: [{
19
- type: Injectable,
20
- args: [{
21
- providedIn: 'root',
22
- }]
23
- }] });
24
-
25
- /**
26
- * @inheritdoc
27
- */
28
- class DaffTestingLoginService {
29
- constructor(factory) {
30
- this.factory = factory;
31
- }
32
- login(loginInfo) {
33
- return of(this.factory.create());
34
- }
35
- logout() {
36
- return of(undefined);
37
- }
38
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingLoginService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
39
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingLoginService, providedIn: 'root' }); }
40
- }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingLoginService, decorators: [{
42
- type: Injectable,
43
- args: [{
44
- providedIn: 'root',
45
- }]
46
- }], ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }] });
47
-
48
- /**
49
- * @inheritdoc
50
- */
51
- class DaffTestingRegisterService {
52
- constructor(authTokenFactory) {
53
- this.authTokenFactory = authTokenFactory;
54
- }
55
- register(registration) {
56
- return of(this.authTokenFactory.create().token);
57
- }
58
- registerOnly(registration) {
59
- return of(undefined);
60
- }
61
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingRegisterService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
62
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingRegisterService, providedIn: 'root' }); }
63
- }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingRegisterService, decorators: [{
65
- type: Injectable,
66
- args: [{
67
- providedIn: 'root',
68
- }]
69
- }], ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }] });
70
-
71
- /**
72
- * @inheritdoc
73
- */
74
- class DaffTestingResetPasswordService {
75
- constructor(authTokenFactory) {
76
- this.authTokenFactory = authTokenFactory;
77
- }
78
- resetPassword() {
79
- return of(this.authTokenFactory.create().token);
80
- }
81
- resetPasswordOnly(info) {
82
- return of(undefined);
83
- }
84
- sendResetEmail() {
85
- return of(undefined);
86
- }
87
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingResetPasswordService, deps: [{ token: i1.DaffAuthTokenFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
88
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingResetPasswordService, providedIn: 'root' }); }
89
- }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffTestingResetPasswordService, decorators: [{
91
- type: Injectable,
92
- args: [{
93
- providedIn: 'root',
94
- }]
95
- }], ctorParameters: () => [{ type: i1.DaffAuthTokenFactory }] });
96
-
97
- class DaffAuthTestingDriverModule {
98
- static forRoot() {
99
- return {
100
- ngModule: DaffAuthTestingDriverModule,
101
- providers: [
102
- provideDaffLoginDriver(DaffTestingLoginService),
103
- provideDaffRegisterDriver(DaffTestingRegisterService),
104
- provideDaffAuthDriver(DaffTestingAuthService),
105
- provideDaffResetPasswordDriver(DaffTestingResetPasswordService),
106
- ],
107
- };
108
- }
109
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
110
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthTestingDriverModule, imports: [CommonModule] }); }
111
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthTestingDriverModule, imports: [CommonModule] }); }
112
- }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthTestingDriverModule, decorators: [{
114
- type: NgModule,
115
- args: [{
116
- imports: [
117
- CommonModule,
118
- ],
119
- }]
120
- }] });
121
-
122
- /**
123
- * Generated bundle index. Do not edit.
124
- */
125
-
126
- export { DaffAuthTestingDriverModule, DaffTestingAuthService, DaffTestingLoginService, DaffTestingRegisterService };
127
- //# sourceMappingURL=daffodil-auth-driver-testing.mjs.map
221
+ //# sourceMappingURL=daffodil-auth-driver-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-auth-driver-testing.mjs","sources":["../../../libs/auth/driver/testing/src/drivers/auth/auth.service.ts","../../../libs/auth/driver/testing/src/drivers/login/login.service.ts","../../../libs/auth/driver/testing/src/drivers/register/register.service.ts","../../../libs/auth/driver/testing/src/drivers/reset-password/service.ts","../../../libs/auth/driver/testing/src/drivers/auth-driver.module.ts","../../../libs/auth/driver/testing/src/daffodil-auth-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingAuthService implements DaffAuthServiceInterface {\n check(): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingLoginService implements DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> {\n constructor(private factory: DaffAuthTokenFactory) {}\n\n login(loginInfo: DaffLoginInfo): Observable<DaffAuthToken> {\n return of(this.factory.create());\n }\n\n logout(): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffAccountRegistration,\n DaffLoginInfo,\n} from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingRegisterService implements DaffRegisterServiceInterface {\n constructor(\n private authTokenFactory: DaffAuthTokenFactory,\n ) {}\n\n register(registration: DaffAccountRegistration): Observable<string> {\n return of(this.authTokenFactory.create().token);\n }\n\n registerOnly(registration: DaffLoginInfo): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingResetPasswordService implements DaffResetPasswordServiceInterface {\n constructor(\n private authTokenFactory: DaffAuthTokenFactory,\n ) {}\n\n resetPassword(): Observable<string> {\n return of(this.authTokenFactory.create().token);\n }\n\n resetPasswordOnly(info: DaffAuthResetPasswordInfo): Observable<void> {\n return of(undefined);\n }\n\n sendResetEmail(): Observable<void> {\n return of(undefined);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n provideDaffLoginDriver,\n provideDaffRegisterDriver,\n provideDaffAuthDriver,\n provideDaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\n\nimport { DaffTestingAuthService } from './auth/auth.service';\nimport { DaffTestingLoginService } from './login/login.service';\nimport { DaffTestingRegisterService } from './register/register.service';\nimport { DaffTestingResetPasswordService } from './reset-password/service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthTestingDriverModule> {\n return {\n ngModule: DaffAuthTestingDriverModule,\n providers: [\n provideDaffLoginDriver(DaffTestingLoginService),\n provideDaffRegisterDriver(DaffTestingRegisterService),\n provideDaffAuthDriver(DaffTestingAuthService),\n provideDaffResetPasswordDriver(DaffTestingResetPasswordService),\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAQA;;AAEG;MAIU,sBAAsB,CAAA;IACjC,KAAK,GAAA;AACH,QAAA,OAAO,EAAE,CAAC,SAAS,CAAC;IACtB;iIAHW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cAFrB,MAAM,EAAA,CAAA,CAAA;;2FAEP,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,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iBAAA;;;MCQY,2BAA2B,CAAA;AACtC,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,2BAA2B;AACrC,YAAA,SAAS,EAAE;gBACT,sBAAsB,CAAC,uBAAuB,CAAC;gBAC/C,yBAAyB,CAAC,0BAA0B,CAAC;gBACrD,qBAAqB,CAAC,sBAAsB,CAAC;gBAC7C,8BAA8B,CAAC,+BAA+B,CAAC;AAChE,aAAA;SACF;IACH;iIAXW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA3B,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAHpC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAHpC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBALvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-auth-driver-testing.mjs","names":[],"sources":["../../../libs/auth/driver/testing/src/drivers/auth/auth.service.ts","../../../libs/auth/driver/testing/src/drivers/login/login.service.ts","../../../libs/auth/driver/testing/src/drivers/register/register.service.ts","../../../libs/auth/driver/testing/src/drivers/reset-password/service.ts","../../../libs/auth/driver/testing/src/provider.ts","../../../libs/auth/driver/testing/src/drivers/auth-driver.module.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffAuthServiceInterface } from '@daffodil/auth/driver';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingAuthService implements DaffAuthServiceInterface {\n check(): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffLoginInfo,\n DaffAuthToken,\n} from '@daffodil/auth';\nimport { DaffLoginServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingLoginService implements DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> {\n constructor(private factory: DaffAuthTokenFactory) {}\n\n login(loginInfo: DaffLoginInfo): Observable<DaffAuthToken> {\n return of(this.factory.create());\n }\n\n logout(): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport {\n DaffAccountRegistration,\n DaffLoginInfo,\n} from '@daffodil/auth';\nimport { DaffRegisterServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingRegisterService implements DaffRegisterServiceInterface {\n constructor(\n private authTokenFactory: DaffAuthTokenFactory,\n ) {}\n\n register(registration: DaffAccountRegistration): Observable<string> {\n return of(this.authTokenFactory.create().token);\n }\n\n registerOnly(registration: DaffLoginInfo): Observable<void> {\n return of(undefined);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffAuthResetPasswordInfo } from '@daffodil/auth';\nimport { DaffResetPasswordServiceInterface } from '@daffodil/auth/driver';\nimport { DaffAuthTokenFactory } from '@daffodil/auth/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingResetPasswordService implements DaffResetPasswordServiceInterface {\n constructor(\n private authTokenFactory: DaffAuthTokenFactory,\n ) {}\n\n resetPassword(): Observable<string> {\n return of(this.authTokenFactory.create().token);\n }\n\n resetPasswordOnly(info: DaffAuthResetPasswordInfo): Observable<void> {\n return of(undefined);\n }\n\n sendResetEmail(): Observable<void> {\n return of(undefined);\n }\n}\n","import {\n EnvironmentProviders,\n makeEnvironmentProviders,\n} from '@angular/core';\n\nimport {\n provideDaffLoginDriver,\n provideDaffRegisterDriver,\n provideDaffAuthDriver,\n provideDaffResetPasswordDriver,\n} from '@daffodil/auth/driver';\n\nimport { DaffTestingAuthService } from './drivers/auth/auth.service';\nimport { DaffTestingLoginService } from './drivers/login/login.service';\nimport { DaffTestingRegisterService } from './drivers/register/register.service';\nimport { DaffTestingResetPasswordService } from './drivers/reset-password/service';\n\n/**\n * Provides the testing implementations of the `@daffodil/auth/driver` interfaces.\n */\nexport const provideDaffAuthTestingDriver = (): EnvironmentProviders => makeEnvironmentProviders([\n provideDaffLoginDriver(DaffTestingLoginService),\n provideDaffRegisterDriver(DaffTestingRegisterService),\n provideDaffAuthDriver(DaffTestingAuthService),\n provideDaffResetPasswordDriver(DaffTestingResetPasswordService),\n]);\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { provideDaffAuthTestingDriver } from '../provider';\n\n/**\n * @deprecated in favor of {@link provideDaffAuthTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffAuthTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffAuthTestingDriverModule> {\n return {\n ngModule: DaffAuthTestingDriverModule,\n providers: [\n provideDaffAuthTestingDriver(),\n ],\n };\n }\n}\n"],"mappings":";;;;;;AAcA,IAA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AAa,qCAA2D,yBAAyB;CAC/F,uBAAuB,uBAAuB;CAC9C,0BAA0B,0BAA0B;CACpD,sBAAsB,sBAAsB;CAC5C,+BAA+B,+BAA+B;AAC/D,CAAA;ACTD,IAAa,8BAAb,MAAa,4BAA2B;CACtC,OAAO,UAAO;EACZ,OAAO;GACL,UAAU;GACV,WAAW,CACT,6BAA4B,CAC7B;EACF;CACH;CARW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA2B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA3B;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA2B,SAAA,CAHpC,YAAY;EAAA,CAAA;CAAA;CAGH;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA2B,SAAA,CAHpC,YAAY;EAAA,CAAA;CAAA;;AAGH,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA2B,YAAA,CAAA;EALvC,MAAA;EAAS,MAAA,CAAA,EACR,SAAS,CACP,YACD,EACF,CAAA"}
@@ -1,133 +1,106 @@
1
- import { createSingletonInjectionToken, DaffInheritableError } from '@daffodil/core';
2
- import * as i0 from '@angular/core';
3
- import { Inject, Injectable } from '@angular/core';
4
- import { of, switchMap, throwError } from 'rxjs';
5
- import * as i1 from '@daffodil/auth';
6
- import { DaffAuthMissingTokenError } from '@daffodil/auth';
7
-
8
- const { token: DaffAuthDriver,
9
- /**
10
- * Provider function for {@link DaffAuthDriver}.
11
- */
12
- provider: provideDaffAuthDriver, } = createSingletonInjectionToken('DaffAuthDriver');
13
-
14
- const { token: DaffLoginDriver,
15
- /**
16
- * Provider function for {@link DaffLoginDriver}.
17
- */
18
- provider: provideDaffLoginDriver, } = createSingletonInjectionToken('DaffLoginDriver');
19
-
20
- const { token: DaffRegisterDriver,
21
- /**
22
- * Provider function for {@link DaffRegisterDriver}.
23
- */
24
- provider: provideDaffRegisterDriver, } = createSingletonInjectionToken('DaffRegisterDriver');
25
-
26
- const { token: DaffResetPasswordDriver,
27
- /**
28
- * Provider function for {@link DaffResetPasswordDriver}.
29
- */
30
- provider: provideDaffResetPasswordDriver, } = createSingletonInjectionToken('DaffResetPasswordDriver');
31
-
1
+ import { DaffInheritableError, createSingletonInjectionToken } from "@daffodil/core";
2
+ import * as i0 from "@angular/core";
3
+ import { Inject, Injectable } from "@angular/core";
4
+ import { of, switchMap, throwError } from "rxjs";
5
+ import * as i1 from "@daffodil/auth";
6
+ import { DaffAuthMissingTokenError } from "@daffodil/auth";
7
+ const { token: DaffAuthDriver, provider: provideDaffAuthDriver } = createSingletonInjectionToken("DaffAuthDriver");
8
+ const { token: DaffLoginDriver, provider: provideDaffLoginDriver } = createSingletonInjectionToken("DaffLoginDriver");
9
+ const { token: DaffRegisterDriver, provider: provideDaffRegisterDriver } = createSingletonInjectionToken("DaffRegisterDriver");
10
+ const { token: DaffResetPasswordDriver, provider: provideDaffResetPasswordDriver } = createSingletonInjectionToken("DaffResetPasswordDriver");
32
11
  var DaffAuthDriverErrorCodes;
33
- (function (DaffAuthDriverErrorCodes) {
34
- DaffAuthDriverErrorCodes["AUTHENTICATION_FAILED"] = "DAFF_AUTH_AUTHENTICATION_FAILED";
35
- DaffAuthDriverErrorCodes["INVALID_API_RESPONSE"] = "DAFF_AUTH_INVALID_API_RESPONSE";
36
- DaffAuthDriverErrorCodes["REGISTRATION_FAILED"] = "DAFF_AUTH_REGISTRATION_FAILED";
37
- DaffAuthDriverErrorCodes["UNAUTHORIZED"] = "DAFF_AUTH_UNAUTHORIZED";
12
+ (function(DaffAuthDriverErrorCodes) {
13
+ DaffAuthDriverErrorCodes["AUTHENTICATION_FAILED"] = "DAFF_AUTH_AUTHENTICATION_FAILED";
14
+ DaffAuthDriverErrorCodes["INVALID_API_RESPONSE"] = "DAFF_AUTH_INVALID_API_RESPONSE";
15
+ DaffAuthDriverErrorCodes["REGISTRATION_FAILED"] = "DAFF_AUTH_REGISTRATION_FAILED";
16
+ DaffAuthDriverErrorCodes["UNAUTHORIZED"] = "DAFF_AUTH_UNAUTHORIZED";
38
17
  })(DaffAuthDriverErrorCodes || (DaffAuthDriverErrorCodes = {}));
39
-
40
- class DaffUnauthorizedError extends DaffInheritableError {
41
- constructor(message) {
42
- super(message);
43
- this.message = message;
44
- this.code = DaffAuthDriverErrorCodes.UNAUTHORIZED;
45
- }
46
- }
47
-
48
- class DaffAuthenticationFailedError extends DaffInheritableError {
49
- constructor(message) {
50
- super(message);
51
- this.message = message;
52
- this.code = DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED;
53
- }
54
- }
55
-
56
- /**
57
- * An error thrown when registration failed.
58
- */
59
- class DaffRegistrationFailedError extends DaffInheritableError {
60
- constructor(message) {
61
- super(message);
62
- this.message = message;
63
- this.code = DaffAuthDriverErrorCodes.REGISTRATION_FAILED;
64
- }
65
- }
66
-
67
- class DaffAuthInvalidAPIResponseError extends DaffInheritableError {
68
- constructor(message) {
69
- super(message);
70
- this.message = message;
71
- this.code = DaffAuthDriverErrorCodes.INVALID_API_RESPONSE;
72
- }
73
- }
74
-
75
- /**
76
- * A mapping from error codes to error class constructors.
77
- */
18
+ var DaffUnauthorizedError = class extends DaffInheritableError {
19
+ constructor(message) {
20
+ super(message);
21
+ this.message = message;
22
+ this.code = DaffAuthDriverErrorCodes.UNAUTHORIZED;
23
+ }
24
+ };
25
+ var DaffAuthenticationFailedError = class extends DaffInheritableError {
26
+ constructor(message) {
27
+ super(message);
28
+ this.message = message;
29
+ this.code = DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED;
30
+ }
31
+ };
32
+ var DaffRegistrationFailedError = class extends DaffInheritableError {
33
+ constructor(message) {
34
+ super(message);
35
+ this.message = message;
36
+ this.code = DaffAuthDriverErrorCodes.REGISTRATION_FAILED;
37
+ }
38
+ };
39
+ var DaffAuthInvalidAPIResponseError = class extends DaffInheritableError {
40
+ constructor(message) {
41
+ super(message);
42
+ this.message = message;
43
+ this.code = DaffAuthDriverErrorCodes.INVALID_API_RESPONSE;
44
+ }
45
+ };
78
46
  const DaffAuthDriverErrorMap = {
79
- [DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: DaffAuthenticationFailedError,
80
- [DaffAuthDriverErrorCodes.INVALID_API_RESPONSE]: DaffAuthInvalidAPIResponseError,
81
- [DaffAuthDriverErrorCodes.REGISTRATION_FAILED]: DaffRegistrationFailedError,
82
- [DaffAuthDriverErrorCodes.UNAUTHORIZED]: DaffUnauthorizedError,
47
+ [DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: DaffAuthenticationFailedError,
48
+ [DaffAuthDriverErrorCodes.INVALID_API_RESPONSE]: DaffAuthInvalidAPIResponseError,
49
+ [DaffAuthDriverErrorCodes.REGISTRATION_FAILED]: DaffRegistrationFailedError,
50
+ [DaffAuthDriverErrorCodes.UNAUTHORIZED]: DaffUnauthorizedError
83
51
  };
84
-
85
- class DaffAuthDriverTokenCheck {
86
- constructor(storage, driver) {
87
- this.storage = storage;
88
- this.driver = driver;
89
- }
90
- /**
91
- * Checks if the auth token in storage is valid.
92
- * If there is not an auth token in storage, the driver is not called
93
- * and an error is immediately thrown.
94
- */
95
- check() {
96
- return of(null).pipe(switchMap(() => {
97
- const token = this.storage.getAuthToken();
98
- if (!token) {
99
- return throwError(() => new DaffAuthMissingTokenError('There is not an auth token in storage'));
100
- }
101
- return this.driver.check();
102
- }));
103
- }
104
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthDriverTokenCheck, deps: [{ token: i1.DaffAuthStorageService }, { token: DaffAuthDriver }], target: i0.ɵɵFactoryTarget.Injectable }); }
105
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthDriverTokenCheck, providedIn: 'root' }); }
106
- }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthDriverTokenCheck, decorators: [{
108
- type: Injectable,
109
- args: [{
110
- providedIn: 'root',
111
- }]
112
- }], ctorParameters: () => [{ type: i1.DaffAuthStorageService }, { type: undefined, decorators: [{
113
- type: Inject,
114
- args: [DaffAuthDriver]
115
- }] }] });
116
-
117
- /**
118
- * The error codes that indicate that the user definitely should not be in an unauthenticated state
119
- * and if an auth token exists in storage, it is invalid.
120
- * These are contrasted to network failures and other sporadic and generic errors that aren't
121
- * a guarantee of the token's invalidity.
122
- */
52
+ var DaffAuthDriverTokenCheck = class DaffAuthDriverTokenCheck {
53
+ constructor(storage, driver) {
54
+ this.storage = storage;
55
+ this.driver = driver;
56
+ }
57
+ check() {
58
+ return of(null).pipe(switchMap(() => {
59
+ if (!this.storage.getAuthToken()) return throwError(() => new DaffAuthMissingTokenError("There is not an auth token in storage"));
60
+ return this.driver.check();
61
+ }));
62
+ }
63
+ static {
64
+ this.ɵfac = i0.ɵɵngDeclareFactory({
65
+ minVersion: "12.0.0",
66
+ version: "22.2.4",
67
+ ngImport: i0,
68
+ type: DaffAuthDriverTokenCheck,
69
+ deps: [{ token: i1.DaffAuthStorageService }, { token: DaffAuthDriver }],
70
+ target: i0.ɵɵFactoryTarget.Injectable
71
+ });
72
+ }
73
+ static {
74
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
75
+ minVersion: "12.0.0",
76
+ version: "22.2.4",
77
+ ngImport: i0,
78
+ type: DaffAuthDriverTokenCheck,
79
+ providedIn: "root"
80
+ });
81
+ }
82
+ };
83
+ i0.ɵɵngDeclareClassMetadata({
84
+ minVersion: "12.0.0",
85
+ version: "22.2.4",
86
+ ngImport: i0,
87
+ type: DaffAuthDriverTokenCheck,
88
+ decorators: [{
89
+ type: Injectable,
90
+ args: [{ providedIn: "root" }]
91
+ }],
92
+ ctorParameters: () => [{ type: i1.DaffAuthStorageService }, {
93
+ type: void 0,
94
+ decorators: [{
95
+ type: Inject,
96
+ args: [DaffAuthDriver]
97
+ }]
98
+ }]
99
+ });
123
100
  const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES = {
124
- [DaffAuthDriverErrorCodes.UNAUTHORIZED]: true,
125
- [DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: true,
101
+ [DaffAuthDriverErrorCodes.UNAUTHORIZED]: true,
102
+ [DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: true
126
103
  };
127
-
128
- /**
129
- * Generated bundle index. Do not edit.
130
- */
131
-
132
104
  export { DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES, DaffAuthDriver, DaffAuthDriverErrorCodes, DaffAuthDriverErrorMap, DaffAuthDriverTokenCheck, DaffAuthInvalidAPIResponseError, DaffAuthenticationFailedError, DaffLoginDriver, DaffRegisterDriver, DaffRegistrationFailedError, DaffResetPasswordDriver, DaffUnauthorizedError, provideDaffAuthDriver, provideDaffLoginDriver, provideDaffRegisterDriver, provideDaffResetPasswordDriver };
133
- //# sourceMappingURL=daffodil-auth-driver.mjs.map
105
+
106
+ //# sourceMappingURL=daffodil-auth-driver.mjs.map