@daffodil/auth 0.94.1-rc.0 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-auth-driver-in-memory.mjs +356 -249
- package/fesm2022/daffodil-auth-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs +459 -0
- package/fesm2022/daffodil-auth-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-auth-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-auth-driver-testing.mjs +220 -126
- package/fesm2022/daffodil-auth-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-driver.mjs +99 -126
- package/fesm2022/daffodil-auth-driver.mjs.map +1 -1
- package/fesm2022/daffodil-auth-routing.mjs +392 -257
- package/fesm2022/daffodil-auth-routing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state-testing.mjs +209 -106
- package/fesm2022/daffodil-auth-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth-state.mjs +867 -852
- package/fesm2022/daffodil-auth-state.mjs.map +1 -1
- package/fesm2022/daffodil-auth-testing.mjs +132 -76
- package/fesm2022/daffodil-auth-testing.mjs.map +1 -1
- package/fesm2022/daffodil-auth.mjs +65 -57
- package/fesm2022/daffodil-auth.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-auth-driver-in-memory.d.ts +62 -62
- package/types/daffodil-auth-driver-magento-2.4.7.d.ts +119 -0
- package/types/daffodil-auth-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-auth-driver-testing.d.ts +37 -36
- package/types/daffodil-auth-driver.d.ts +93 -112
- package/types/daffodil-auth-routing.d.ts +100 -104
- package/types/daffodil-auth-state-testing.d.ts +44 -43
- package/types/daffodil-auth-state.d.ts +265 -306
- package/types/daffodil-auth-testing.d.ts +28 -33
- package/types/daffodil-auth.d.ts +51 -62
- package/fesm2022/daffodil-auth-driver-magento.mjs +0 -385
- package/fesm2022/daffodil-auth-driver-magento.mjs.map +0 -1
- package/types/daffodil-auth-driver-magento.d.ts +0 -135
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Inject, Injectable } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
34
|
-
|
|
56
|
+
(function(DaffAuthErrorCodes) {
|
|
57
|
+
DaffAuthErrorCodes["MISSING_TOKEN"] = "DAFF_AUTH_MISSING_TOKEN";
|
|
35
58
|
})(DaffAuthErrorCodes || (DaffAuthErrorCodes = {}));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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"
|
|
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.
|
|
1
|
+
{"name":"@daffodil/auth","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/auth"]}}},"version":"0.95.0","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.0","@ngrx/store":"^22","rxjs":"^7.0.0","@daffodil/driver":"0.95.0"},"optionalDependencies":{"@daffodil/driver":"0.95.0"},"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
|
|
2
|
-
import { ModuleWithProviders } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { HttpClient } from
|
|
5
|
-
import { InMemoryBackendConfig, InMemoryDbService } from
|
|
6
|
-
import { Observable } from
|
|
7
|
-
import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from
|
|
8
|
-
import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
|
2
|
-
import { ModuleWithProviders } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { Observable } from
|
|
5
|
-
import { DaffAuthServiceInterface, DaffLoginServiceInterface, DaffRegisterServiceInterface } from
|
|
6
|
-
import {
|
|
7
|
-
import { DaffAuthTokenFactory } from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Provides the testing implementations of the `@daffodil/auth/driver` interfaces.
|
|
49
|
+
*/
|
|
50
|
+
export declare const provideDaffAuthTestingDriver: () => EnvironmentProviders;
|