@daffodil/auth 0.94.1 → 0.95.1

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,61 +1,69 @@
1
- import * as i0 from '@angular/core';
2
- import { Inject, Injectable } from '@angular/core';
3
- import { DaffPersistenceServiceToken, DaffInheritableError } from '@daffodil/core';
4
-
5
- class DaffAuthStorageService {
6
- constructor(storageService) {
7
- this.storageService = storageService;
8
- this.AUTH_STORAGE_TOKEN = 'DAFF_AUTH_TOKEN';
9
- }
10
- getAuthToken() {
11
- return this.storageService.getItem(this.AUTH_STORAGE_TOKEN);
12
- }
13
- setAuthToken(value) {
14
- this.storageService.setItem(this.AUTH_STORAGE_TOKEN, value);
15
- }
16
- removeAuthToken() {
17
- this.storageService.removeItem(this.AUTH_STORAGE_TOKEN);
18
- }
19
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStorageService, deps: [{ token: DaffPersistenceServiceToken }], target: i0.ɵɵFactoryTarget.Injectable }); }
20
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStorageService, providedIn: 'root' }); }
21
- }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffAuthStorageService, decorators: [{
23
- type: Injectable,
24
- args: [{
25
- providedIn: 'root',
26
- }]
27
- }], ctorParameters: () => [{ type: undefined, decorators: [{
28
- type: Inject,
29
- args: [DaffPersistenceServiceToken]
30
- }] }] });
31
-
1
+ import * as i0 from "@angular/core";
2
+ import { Inject, Injectable } from "@angular/core";
3
+ import { DaffInheritableError, DaffPersistenceServiceToken } from "@daffodil/core";
4
+ var DaffAuthStorageService = class DaffAuthStorageService {
5
+ constructor(storageService) {
6
+ this.storageService = storageService;
7
+ this.AUTH_STORAGE_TOKEN = "DAFF_AUTH_TOKEN";
8
+ }
9
+ getAuthToken() {
10
+ return this.storageService.getItem(this.AUTH_STORAGE_TOKEN);
11
+ }
12
+ setAuthToken(value) {
13
+ this.storageService.setItem(this.AUTH_STORAGE_TOKEN, value);
14
+ }
15
+ removeAuthToken() {
16
+ this.storageService.removeItem(this.AUTH_STORAGE_TOKEN);
17
+ }
18
+ static {
19
+ this.ɵfac = i0.ɵɵngDeclareFactory({
20
+ minVersion: "12.0.0",
21
+ version: "22.2.4",
22
+ ngImport: i0,
23
+ type: DaffAuthStorageService,
24
+ deps: [{ token: DaffPersistenceServiceToken }],
25
+ target: i0.ɵɵFactoryTarget.Injectable
26
+ });
27
+ }
28
+ static {
29
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
30
+ minVersion: "12.0.0",
31
+ version: "22.2.4",
32
+ ngImport: i0,
33
+ type: DaffAuthStorageService,
34
+ providedIn: "root"
35
+ });
36
+ }
37
+ };
38
+ i0.ɵɵngDeclareClassMetadata({
39
+ minVersion: "12.0.0",
40
+ version: "22.2.4",
41
+ ngImport: i0,
42
+ type: DaffAuthStorageService,
43
+ decorators: [{
44
+ type: Injectable,
45
+ args: [{ providedIn: "root" }]
46
+ }],
47
+ ctorParameters: () => [{
48
+ type: void 0,
49
+ decorators: [{
50
+ type: Inject,
51
+ args: [DaffPersistenceServiceToken]
52
+ }]
53
+ }]
54
+ });
32
55
  var DaffAuthErrorCodes;
33
- (function (DaffAuthErrorCodes) {
34
- DaffAuthErrorCodes["MISSING_TOKEN"] = "DAFF_AUTH_MISSING_TOKEN";
56
+ (function(DaffAuthErrorCodes) {
57
+ DaffAuthErrorCodes["MISSING_TOKEN"] = "DAFF_AUTH_MISSING_TOKEN";
35
58
  })(DaffAuthErrorCodes || (DaffAuthErrorCodes = {}));
36
-
37
- /**
38
- * An error thrown when an authenticated action was initiated
39
- * but an auth token was not present.
40
- */
41
- class DaffAuthMissingTokenError extends DaffInheritableError {
42
- constructor(message) {
43
- super(message);
44
- this.message = message;
45
- this.code = DaffAuthErrorCodes.MISSING_TOKEN;
46
- }
47
- }
48
-
49
- /**
50
- * A mapping from error codes to error class constructors.
51
- */
52
- const DaffAuthErrorMap = {
53
- [DaffAuthErrorCodes.MISSING_TOKEN]: DaffAuthMissingTokenError,
59
+ var DaffAuthMissingTokenError = class extends DaffInheritableError {
60
+ constructor(message) {
61
+ super(message);
62
+ this.message = message;
63
+ this.code = DaffAuthErrorCodes.MISSING_TOKEN;
64
+ }
54
65
  };
55
-
56
- /**
57
- * Generated bundle index. Do not edit.
58
- */
59
-
66
+ const DaffAuthErrorMap = { [DaffAuthErrorCodes.MISSING_TOKEN]: DaffAuthMissingTokenError };
60
67
  export { DaffAuthErrorCodes, DaffAuthErrorMap, DaffAuthMissingTokenError, DaffAuthStorageService };
61
- //# sourceMappingURL=daffodil-auth.mjs.map
68
+
69
+ //# sourceMappingURL=daffodil-auth.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-auth.mjs","sources":["../../../libs/auth/src/storage/auth-storage.service.ts","../../../libs/auth/src/errors/codes.enum.ts","../../../libs/auth/src/errors/missing-token.ts","../../../libs/auth/src/errors/map.ts","../../../libs/auth/src/daffodil-auth.ts"],"sourcesContent":["import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from '@daffodil/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthStorageService {\n private readonly AUTH_STORAGE_TOKEN = 'DAFF_AUTH_TOKEN';\n\n constructor(@Inject(DaffPersistenceServiceToken) private storageService: DaffPersistenceService) {}\n\n getAuthToken(): string {\n return this.storageService.getItem(this.AUTH_STORAGE_TOKEN);\n }\n\n setAuthToken(value: string): void {\n this.storageService.setItem(this.AUTH_STORAGE_TOKEN, value);\n }\n\n removeAuthToken(): void {\n this.storageService.removeItem(this.AUTH_STORAGE_TOKEN);\n }\n}\n","export enum DaffAuthErrorCodes {\n MISSING_TOKEN = 'DAFF_AUTH_MISSING_TOKEN',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an authenticated action was initiated\n * but an auth token was not present.\n */\nexport class DaffAuthMissingTokenError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthErrorCodes.MISSING_TOKEN;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { DaffAuthErrorCodes } from './codes.enum';\nimport { DaffAuthMissingTokenError } from './missing-token';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffAuthErrorMap = {\n [DaffAuthErrorCodes.MISSING_TOKEN]: DaffAuthMissingTokenError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAaa,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAAyD,cAAsC,EAAA;QAAtC,IAAA,CAAA,cAAc,GAAd,cAAc;QAFtD,IAAA,CAAA,kBAAkB,GAAG,iBAAiB;IAE2C;IAElG,YAAY,GAAA;QACV,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC;IAC7D;AAEA,IAAA,YAAY,CAAC,KAAa,EAAA;QACxB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC;IAC7D;IAEA,eAAe,GAAA;QACb,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;IACzD;AAfW,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,kBAGb,2BAA2B,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAHpC,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,iBAAA;;0BAIc,MAAM;2BAAC,2BAA2B;;;IChBrC;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,eAAA,CAAA,GAAA,yBAAyC;AAC3C,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;;ACO9B;;;AAGG;AACG,MAAO,yBAA0B,SAAQ,oBAAoB,CAAA;AAGjE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC;QADG,IAAA,CAAA,OAAO,GAAP,OAAO;AAFV,QAAA,IAAA,CAAA,IAAI,GAAW,kBAAkB,CAAC,aAAa;IAI/D;AACD;;ACdD;;AAEG;AACI,MAAM,gBAAgB,GAAG;AAC9B,IAAA,CAAC,kBAAkB,CAAC,aAAa,GAAG,yBAAyB;;;ACP/D;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-auth.mjs","names":[],"sources":["../../../libs/auth/src/storage/auth-storage.service.ts","../../../libs/auth/src/errors/codes.enum.ts","../../../libs/auth/src/errors/missing-token.ts","../../../libs/auth/src/errors/map.ts"],"sourcesContent":["import {\n Injectable,\n Inject,\n} from '@angular/core';\n\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from '@daffodil/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAuthStorageService {\n private readonly AUTH_STORAGE_TOKEN = 'DAFF_AUTH_TOKEN';\n\n constructor(@Inject(DaffPersistenceServiceToken) private storageService: DaffPersistenceService) {}\n\n getAuthToken(): string {\n return this.storageService.getItem(this.AUTH_STORAGE_TOKEN);\n }\n\n setAuthToken(value: string): void {\n this.storageService.setItem(this.AUTH_STORAGE_TOKEN, value);\n }\n\n removeAuthToken(): void {\n this.storageService.removeItem(this.AUTH_STORAGE_TOKEN);\n }\n}\n","export enum DaffAuthErrorCodes {\n MISSING_TOKEN = 'DAFF_AUTH_MISSING_TOKEN',\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nimport { DaffAuthErrorCodes } from './codes.enum';\n\n/**\n * An error thrown when an authenticated action was initiated\n * but an auth token was not present.\n */\nexport class DaffAuthMissingTokenError extends DaffInheritableError implements DaffError {\n public readonly code: string = DaffAuthErrorCodes.MISSING_TOKEN;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { DaffAuthErrorCodes } from './codes.enum';\nimport { DaffAuthMissingTokenError } from './missing-token';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffAuthErrorMap = {\n [DaffAuthErrorCodes.MISSING_TOKEN]: DaffAuthMissingTokenError,\n};\n"],"mappings":";;;AAaA,IAAa,yBAAb,MAAa,uBAAsB;CAGjC,YAAyD,gBAAsC;EAAtC,KAAA,iBAAA;EAFxC,KAAA,qBAAqB;CAE4D;CAElG,eAAY;EACV,OAAO,KAAK,eAAe,QAAQ,KAAK,kBAAkB;CAC5D;CAEA,aAAa,OAAa;EACxB,KAAK,eAAe,QAAQ,KAAK,oBAAoB,KAAK;CAC5D;CAEA,kBAAe;EACb,KAAK,eAAe,WAAW,KAAK,kBAAkB;CACxD;CAfW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,MAAA,CAAA,EAAA,OAGb,4BAA2B,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAHpC;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,YAFrB;EAAM,CAAA;CAAA;;AAEP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAHlC,MAAA;EAAW,MAAA,CAAA,EACV,YAAY,OACb,CAAA;;;;;GAIc,MAAA;GAAO,MAAA,CAAA,2BAA2B;;;;AChBjD,IAAY;CAAZ,SAAY,oBAAkB;CAC5B,mBAAA,mBAAA;AACF,EAAA,CAFY,uBAAA,qBAAkB,CAAA,EAAA;ACW9B,IAAa,4BAAb,cAA+C,qBAAoB;CAGjE,YAAmB,SAAe;EAChC,MAAM,OAAO;EADI,KAAA,UAAA;EAFH,KAAA,OAAe,mBAAmB;CAIlD;AACD;ACXD,MAAa,mBAAmB,GAC7B,mBAAmB,gBAAgB,0BACrC"}
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/auth","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/auth"]}}},"version":"0.94.1","description":"Platform-agnostic models, state management, and drivers for user authentication and access token management. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"publishConfig":{"directory":"../../dist/auth"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^21","@angular/core":"^21","@daffodil/core":"0.94.1","@ngrx/store":"^21","rxjs":"^7.0.0"},"optionalDependencies":{"@daffodil/driver":"0.94.1"},"module":"fesm2022/daffodil-auth.mjs","typings":"types/daffodil-auth.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-auth.d.ts","default":"./fesm2022/daffodil-auth.mjs"},"./driver":{"types":"./types/daffodil-auth-driver.d.ts","default":"./fesm2022/daffodil-auth-driver.mjs"},"./driver/in-memory":{"types":"./types/daffodil-auth-driver-in-memory.d.ts","default":"./fesm2022/daffodil-auth-driver-in-memory.mjs"},"./driver/magento":{"types":"./types/daffodil-auth-driver-magento.d.ts","default":"./fesm2022/daffodil-auth-driver-magento.mjs"},"./driver/testing":{"types":"./types/daffodil-auth-driver-testing.d.ts","default":"./fesm2022/daffodil-auth-driver-testing.mjs"},"./routing":{"types":"./types/daffodil-auth-routing.d.ts","default":"./fesm2022/daffodil-auth-routing.mjs"},"./state":{"types":"./types/daffodil-auth-state.d.ts","default":"./fesm2022/daffodil-auth-state.mjs"},"./state/testing":{"types":"./types/daffodil-auth-state-testing.d.ts","default":"./fesm2022/daffodil-auth-state-testing.mjs"},"./testing":{"types":"./types/daffodil-auth-testing.d.ts","default":"./fesm2022/daffodil-auth-testing.mjs"}},"sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
1
+ {"name":"@daffodil/auth","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/auth"]}}},"version":"0.95.1","description":"Platform-agnostic models, state management, and drivers for user authentication and access token management. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"publishConfig":{"directory":"../../dist/auth"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^22","@angular/core":"^22","@daffodil/core":"0.95.1","@ngrx/store":"^22","rxjs":"^7.0.0","@daffodil/driver":"0.95.1"},"optionalDependencies":{"@daffodil/driver":"0.95.1"},"exports":{"./driver/magento/auto":{"auth-magento-2.4.7":{"types":"./types/daffodil-auth-driver-magento-2.4.7.d.ts","default":"./fesm2022/daffodil-auth-driver-magento-2.4.7.mjs"},"types":"./types/daffodil-auth-driver-magento-auto.d.ts","default":"./fesm2022/daffodil-auth-driver-magento-auto.mjs"},"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-auth.d.ts","default":"./fesm2022/daffodil-auth.mjs"},"./driver":{"types":"./types/daffodil-auth-driver.d.ts","default":"./fesm2022/daffodil-auth-driver.mjs"},"./driver/in-memory":{"types":"./types/daffodil-auth-driver-in-memory.d.ts","default":"./fesm2022/daffodil-auth-driver-in-memory.mjs"},"./driver/magento/2.4.7":{"types":"./types/daffodil-auth-driver-magento-2.4.7.d.ts","default":"./fesm2022/daffodil-auth-driver-magento-2.4.7.mjs"},"./driver/testing":{"types":"./types/daffodil-auth-driver-testing.d.ts","default":"./fesm2022/daffodil-auth-driver-testing.mjs"},"./routing":{"types":"./types/daffodil-auth-routing.d.ts","default":"./fesm2022/daffodil-auth-routing.mjs"},"./state":{"types":"./types/daffodil-auth-state.d.ts","default":"./fesm2022/daffodil-auth-state.mjs"},"./state/testing":{"types":"./types/daffodil-auth-state-testing.d.ts","default":"./fesm2022/daffodil-auth-state-testing.mjs"},"./testing":{"types":"./types/daffodil-auth-testing.d.ts","default":"./fesm2022/daffodil-auth-testing.mjs"}},"module":"fesm2022/daffodil-auth.mjs","typings":"types/daffodil-auth.d.ts","sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
@@ -1,84 +1,84 @@
1
- import * as i0 from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { HttpClient } from '@angular/common/http';
5
- import { InMemoryBackendConfig, InMemoryDbService } from 'angular-in-memory-web-api';
6
- import { Observable } from 'rxjs';
7
- import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
8
- import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from '@daffodil/driver/in-memory';
9
- import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration } from '@daffodil/auth';
10
-
11
- declare class DaffAuthInMemoryDriverModule {
12
- static forRoot(): ModuleWithProviders<DaffAuthInMemoryDriverModule>;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthInMemoryDriverModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
15
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthInMemoryDriverModule>;
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { HttpClient } from "@angular/common/http";
5
+ import { InMemoryBackendConfig, InMemoryDbService } from "angular-in-memory-web-api";
6
+ import { Observable } from "rxjs";
7
+ import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from "@daffodil/auth/driver";
8
+ import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from "@daffodil/driver/in-memory";
9
+ import { DaffAccountRegistration, DaffAuthToken, DaffLoginInfo } from "@daffodil/auth";
10
+ /**
11
+ * @deprecated in favor of {@link provideDaffAuthInMemoryDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
12
+ */
13
+ export declare class DaffAuthInMemoryDriverModule {
14
+ static forRoot(): ModuleWithProviders<DaffAuthInMemoryDriverModule>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthInMemoryDriverModule, never>;
16
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
17
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthInMemoryDriverModule>;
16
18
  }
17
-
18
19
  /**
19
20
  * @inheritdoc DaffAuthServiceInterface
20
21
  */
21
- declare class DaffInMemoryAuthService extends DaffInMemoryDriverBase implements DaffAuthServiceInterface {
22
- private http;
23
- constructor(http: HttpClient, config: InMemoryBackendConfig);
24
- check(): Observable<void>;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryAuthService, never>;
26
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryAuthService>;
22
+ export declare class DaffInMemoryAuthService extends DaffInMemoryDriverBase implements DaffAuthServiceInterface {
23
+ private http;
24
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
25
+ check(): Observable<void>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryAuthService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
27
28
  }
28
-
29
29
  /**
30
30
  * @inheritdoc
31
31
  */
32
- declare class DaffInMemoryLoginService extends DaffInMemoryDriverBase implements DaffLoginServiceInterface {
33
- private http;
34
- constructor(http: HttpClient, config: InMemoryBackendConfig);
35
- login(request: DaffLoginInfo): Observable<DaffAuthToken>;
36
- logout(): Observable<void>;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryLoginService, never>;
38
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryLoginService>;
32
+ export declare class DaffInMemoryLoginService extends DaffInMemoryDriverBase implements DaffLoginServiceInterface {
33
+ private http;
34
+ constructor(http: HttpClient, config: InMemoryBackendConfig);
35
+ login(request: DaffLoginInfo): Observable<DaffAuthToken>;
36
+ logout(): Observable<void>;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryLoginService, never>;
38
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
39
39
  }
40
-
41
40
  /**
42
41
  * @inheritdoc
43
42
  */
44
- declare class DaffInMemoryRegisterService extends DaffInMemoryDriverBase implements DaffRegisterServiceInterface {
45
- private http;
46
- private loginService;
47
- constructor(http: HttpClient, loginService: DaffInMemoryLoginService, config: InMemoryBackendConfig);
48
- register(registration: DaffAccountRegistration): Observable<string>;
49
- registerOnly(registration: DaffAccountRegistration): Observable<void>;
50
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryRegisterService, never>;
51
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryRegisterService>;
43
+ export declare class DaffInMemoryRegisterService extends DaffInMemoryDriverBase implements DaffRegisterServiceInterface {
44
+ private http;
45
+ private loginService;
46
+ constructor(http: HttpClient, loginService: DaffInMemoryLoginService, config: InMemoryBackendConfig);
47
+ register(registration: DaffAccountRegistration): Observable<string>;
48
+ registerOnly(registration: DaffAccountRegistration): Observable<void>;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryRegisterService, never>;
50
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
52
51
  }
53
-
52
+ /**
53
+ * Provides the in-memory implementations of the `@daffodil/auth/driver` interfaces.
54
+ */
55
+ export declare const provideDaffAuthInMemoryDriver: () => EnvironmentProviders;
54
56
  /**
55
57
  * Represents a customer in the in-memory database.
56
58
  */
57
59
  interface DaffInMemoryDbCustomer {
58
- email: string;
59
- password: string;
60
- token?: string;
60
+ email: string;
61
+ password: string;
62
+ token?: string;
61
63
  }
62
-
63
64
  /**
64
65
  * @inheritdoc DaffInMemorySingleRouteableBackend
65
66
  */
66
- declare class DaffInMemoryBackendAuthService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
67
- readonly collectionName = "auth";
68
- customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer>;
69
- private generateToken;
70
- createDb(): {
71
- auth: Record<string, DaffInMemoryDbCustomer>;
72
- };
73
- post(reqInfo: any): any;
74
- private login;
75
- private register;
76
- private logout;
77
- private check;
78
- private resetPassword;
79
- private sendResetEmail;
80
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendAuthService, never>;
81
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffInMemoryBackendAuthService>;
67
+ export declare class DaffInMemoryBackendAuthService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
68
+ readonly collectionName = "auth";
69
+ customers: Record<DaffInMemoryDbCustomer['email'], DaffInMemoryDbCustomer>;
70
+ private generateToken;
71
+ createDb(): {
72
+ auth: Record<string, DaffInMemoryDbCustomer>;
73
+ };
74
+ post(reqInfo: any): any;
75
+ private login;
76
+ private register;
77
+ private logout;
78
+ private check;
79
+ private resetPassword;
80
+ private sendResetEmail;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffInMemoryBackendAuthService, never>;
82
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
82
83
  }
83
-
84
- export { DaffAuthInMemoryDriverModule, DaffInMemoryAuthService, DaffInMemoryBackendAuthService, DaffInMemoryLoginService, DaffInMemoryRegisterService };
84
+ export {};
@@ -0,0 +1,119 @@
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { Apollo } from "apollo-angular";
5
+ import { Observable } from "rxjs";
6
+ import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from "@daffodil/auth/driver";
7
+ import { DaffAccountRegistration, DaffAuthStorageService, DaffAuthToken, DaffLoginInfo } from "@daffodil/auth";
8
+ import { DaffApolloLinkGenerator, DaffQueuedApollo } from "@daffodil/core/graphql";
9
+ import { ApolloLink } from "@apollo/client";
10
+ import { MagentoDriverFeature } from "@daffodil/driver/magento/2.4.7";
11
+ /**
12
+ * @deprecated in favor of {@link provideDaffAuthMagentoDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
13
+ */
14
+ export declare class DaffAuthMagentoDriverModule {
15
+ static forRoot(): ModuleWithProviders<DaffAuthMagentoDriverModule>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthMagentoDriverModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthMagentoDriverModule, never, [typeof i1.CommonModule], never>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthMagentoDriverModule>;
19
+ }
20
+ /**
21
+ * Provides the Magento implementations of the `@daffodil/auth/driver` interfaces.
22
+ */
23
+ export declare const provideDaffAuthMagentoDriver: () => EnvironmentProviders;
24
+ /**
25
+ * @inheritdoc
26
+ */
27
+ export declare class DaffMagentoAuthService implements DaffAuthServiceInterface {
28
+ private apollo;
29
+ constructor(apollo: Apollo);
30
+ check(): Observable<void>;
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthService, never>;
32
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
33
+ }
34
+ export interface MagentoAuth {
35
+ token: string;
36
+ }
37
+ /**
38
+ * Transforms magento auths into an object usable by daffodil.
39
+ */
40
+ export declare class DaffMagentoAuthTransformerService {
41
+ /**
42
+ * Transforms the magento AuthNode from the magento auth query into a DaffAuthToken.
43
+ *
44
+ * @param auth the auth from a magento auth query.
45
+ */
46
+ transform(auth: MagentoAuth): DaffAuthToken;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoAuthTransformerService, never>;
48
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
49
+ }
50
+ /**
51
+ * @inheritdoc
52
+ */
53
+ export declare class DaffMagentoLoginService implements DaffLoginServiceInterface {
54
+ private apollo;
55
+ authTransformer: DaffMagentoAuthTransformerService;
56
+ constructor(apollo: DaffQueuedApollo, authTransformer: DaffMagentoAuthTransformerService);
57
+ login({ email, password }: DaffLoginInfo): Observable<DaffAuthToken>;
58
+ logout(): Observable<any>;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffMagentoLoginService, never>;
60
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
61
+ }
62
+ /**
63
+ * @inheritdoc
64
+ */
65
+ export 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<any>;
73
+ }
74
+ export declare function withAuth(): MagentoDriverFeature;
75
+ export declare function provideMagentoAuthApolloBearerToken(): import("@angular/core").EnvironmentProviders;
76
+ /**
77
+ * A service that will convert cacheable apollo operations into a format that Magento will understand as cacheable.
78
+ *
79
+ * @inheritdoc
80
+ */
81
+ export declare class MagentoAuthApolloBearerTokenLinkGenerator implements DaffApolloLinkGenerator {
82
+ private storage;
83
+ constructor(storage: DaffAuthStorageService);
84
+ getLink(): ApolloLink;
85
+ static ɵfac: i0.ɵɵFactoryDeclaration<MagentoAuthApolloBearerTokenLinkGenerator, never>;
86
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
87
+ }
88
+ export declare const checkTokenQuery: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
89
+ export declare const createCustomerMutation: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
90
+ export declare const generateTokenMutation: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
91
+ export declare const revokeCustomerTokenMutation: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
92
+ export declare const sendPasswordResetEmailMutation: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
93
+ export declare const resetPasswordMutation: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
94
+ export interface MagentoCheckTokenResponse {
95
+ customer: {
96
+ email?: string;
97
+ };
98
+ }
99
+ export interface MagentoGenerateTokenResponse {
100
+ generateCustomerToken: MagentoAuth;
101
+ }
102
+ export interface MagentoRevokeCustomerTokenResponse {
103
+ revokeCustomerToken: {
104
+ result: boolean;
105
+ };
106
+ }
107
+ export interface MagentoRegisterResponse {
108
+ createCustomerV2: {
109
+ customer: {
110
+ email: string;
111
+ };
112
+ };
113
+ }
114
+ export interface MagentoSendResetEmailResponse {
115
+ requestPasswordResetEmail: boolean;
116
+ }
117
+ export interface MagentoResetPasswordResponse {
118
+ resetPassword: boolean;
119
+ }
@@ -0,0 +1 @@
1
+ export {}
@@ -1,49 +1,50 @@
1
- import * as i0 from '@angular/core';
2
- import { ModuleWithProviders } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { Observable } from 'rxjs';
5
- import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from '@daffodil/auth/driver';
6
- import { DaffLoginInfo, DaffAuthToken, DaffAccountRegistration } from '@daffodil/auth';
7
- import { DaffAuthTokenFactory } from '@daffodil/auth/testing';
8
-
9
- declare class DaffAuthTestingDriverModule {
10
- static forRoot(): ModuleWithProviders<DaffAuthTestingDriverModule>;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthTestingDriverModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthTestingDriverModule, never, [typeof i1.CommonModule], never>;
13
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthTestingDriverModule>;
1
+ import * as i0 from "@angular/core";
2
+ import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
3
+ import * as i1 from "@angular/common";
4
+ import { Observable } from "rxjs";
5
+ import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from "@daffodil/auth/driver";
6
+ import { DaffAccountRegistration, DaffAuthToken, DaffLoginInfo } from "@daffodil/auth";
7
+ import { DaffAuthTokenFactory } from "@daffodil/auth/testing";
8
+ /**
9
+ * @deprecated in favor of {@link provideDaffAuthTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
10
+ */
11
+ export declare class DaffAuthTestingDriverModule {
12
+ static forRoot(): ModuleWithProviders<DaffAuthTestingDriverModule>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffAuthTestingDriverModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffAuthTestingDriverModule, never, [typeof i1.CommonModule], never>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffAuthTestingDriverModule>;
14
16
  }
15
-
16
17
  /**
17
18
  * @inheritdoc
18
19
  */
19
- declare class DaffTestingAuthService implements DaffAuthServiceInterface {
20
- check(): Observable<void>;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingAuthService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingAuthService>;
20
+ export declare class DaffTestingAuthService implements DaffAuthServiceInterface {
21
+ check(): Observable<void>;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingAuthService, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
23
24
  }
24
-
25
25
  /**
26
26
  * @inheritdoc
27
27
  */
28
- declare class DaffTestingLoginService implements DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> {
29
- private factory;
30
- constructor(factory: DaffAuthTokenFactory);
31
- login(loginInfo: DaffLoginInfo): Observable<DaffAuthToken>;
32
- logout(): Observable<void>;
33
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingLoginService, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingLoginService>;
28
+ export declare class DaffTestingLoginService implements DaffLoginServiceInterface<DaffLoginInfo, DaffAuthToken> {
29
+ private factory;
30
+ constructor(factory: DaffAuthTokenFactory);
31
+ login(loginInfo: DaffLoginInfo): Observable<DaffAuthToken>;
32
+ logout(): Observable<void>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingLoginService, never>;
34
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
35
35
  }
36
-
37
36
  /**
38
37
  * @inheritdoc
39
38
  */
40
- declare class DaffTestingRegisterService implements DaffRegisterServiceInterface {
41
- private authTokenFactory;
42
- constructor(authTokenFactory: DaffAuthTokenFactory);
43
- register(registration: DaffAccountRegistration): Observable<string>;
44
- registerOnly(registration: DaffLoginInfo): Observable<void>;
45
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingRegisterService, never>;
46
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffTestingRegisterService>;
39
+ export declare class DaffTestingRegisterService implements DaffRegisterServiceInterface {
40
+ private authTokenFactory;
41
+ constructor(authTokenFactory: DaffAuthTokenFactory);
42
+ register(registration: DaffAccountRegistration): Observable<string>;
43
+ registerOnly(registration: DaffLoginInfo): Observable<void>;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffTestingRegisterService, never>;
45
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
47
46
  }
48
-
49
- export { DaffAuthTestingDriverModule, DaffTestingAuthService, DaffTestingLoginService, DaffTestingRegisterService };
47
+ /**
48
+ * Provides the testing implementations of the `@daffodil/auth/driver` interfaces.
49
+ */
50
+ export declare const provideDaffAuthTestingDriver: () => EnvironmentProviders;