@daffodil/customer 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.
- package/fesm2022/daffodil-customer-driver-in-memory.mjs +344 -324
- package/fesm2022/daffodil-customer-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-customer-driver-magento-2.4.7-testing.mjs +116 -0
- package/fesm2022/daffodil-customer-driver-magento-2.4.7-testing.mjs.map +1 -0
- package/fesm2022/daffodil-customer-driver-magento-2.4.7.mjs +399 -0
- package/fesm2022/daffodil-customer-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-customer-driver-magento-auto-testing.mjs +7 -0
- package/fesm2022/daffodil-customer-driver-magento-auto-testing.mjs.map +1 -0
- package/fesm2022/daffodil-customer-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-customer-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-customer-driver-testing.mjs +152 -105
- package/fesm2022/daffodil-customer-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-driver.mjs +45 -88
- package/fesm2022/daffodil-customer-driver.mjs.map +1 -1
- package/fesm2022/daffodil-customer-routing.mjs +86 -52
- package/fesm2022/daffodil-customer-routing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-state-testing.mjs +176 -108
- package/fesm2022/daffodil-customer-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-state.mjs +581 -718
- package/fesm2022/daffodil-customer-state.mjs.map +1 -1
- package/fesm2022/daffodil-customer-testing.mjs +102 -75
- package/fesm2022/daffodil-customer-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer.mjs +0 -4
- package/package.json +1 -1
- package/types/daffodil-customer-driver-in-memory.d.ts +102 -104
- package/types/daffodil-customer-driver-magento-2.4.7-testing.d.ts +33 -0
- package/types/daffodil-customer-driver-magento-2.4.7.d.ts +193 -0
- package/types/daffodil-customer-driver-magento-auto-testing.d.ts +1 -0
- package/types/daffodil-customer-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-customer-driver-testing.d.ts +38 -37
- package/types/daffodil-customer-driver.d.ts +76 -90
- package/types/daffodil-customer-routing.d.ts +18 -22
- package/types/daffodil-customer-state-testing.d.ts +43 -43
- package/types/daffodil-customer-state.d.ts +240 -264
- package/types/daffodil-customer-testing.d.ts +27 -31
- package/types/daffodil-customer.d.ts +33 -37
- package/fesm2022/daffodil-customer-driver-magento-testing.mjs +0 -75
- package/fesm2022/daffodil-customer-driver-magento-testing.mjs.map +0 -1
- package/fesm2022/daffodil-customer-driver-magento.mjs +0 -448
- package/fesm2022/daffodil-customer-driver-magento.mjs.map +0 -1
- package/fesm2022/daffodil-customer.mjs.map +0 -1
- package/types/daffodil-customer-driver-magento-testing.d.ts +0 -37
- package/types/daffodil-customer-driver-magento.d.ts +0 -205
|
@@ -1,129 +1,127 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import * as i1 from '@angular/common';
|
|
13
|
-
|
|
1
|
+
import { InMemoryBackendConfig, InMemoryDbService, ParsedRequestUrl, RequestInfo, RequestInfoUtilities } from "angular-in-memory-web-api";
|
|
2
|
+
import { DaffCustomer, DaffCustomerAddress } from "@daffodil/customer";
|
|
3
|
+
import { DaffCustomerAddressFactory, DaffCustomerFactory } from "@daffodil/customer/testing";
|
|
4
|
+
import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from "@daffodil/driver/in-memory";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
7
|
+
import { HttpClient } from "@angular/common/http";
|
|
8
|
+
import { Observable } from "rxjs";
|
|
9
|
+
import { DaffCustomerAddressDriverInterface, DaffCustomerDriverInterface } from "@daffodil/customer/driver";
|
|
10
|
+
import { DaffIdentifiable } from "@daffodil/core";
|
|
11
|
+
import * as i1 from "@angular/common";
|
|
14
12
|
/**
|
|
15
13
|
* An in-memory service that delegates customer queries to child backends
|
|
16
14
|
* via the {@link DAFF_CUSTOMER_IN_MEMORY_BACKENDS}.
|
|
17
15
|
*/
|
|
18
|
-
declare class DaffCustomerInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
16
|
+
export declare class DaffCustomerInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
17
|
+
private factory;
|
|
18
|
+
readonly collectionName = "customer";
|
|
19
|
+
customers: Record<DaffCustomer['id'], DaffCustomer>;
|
|
20
|
+
constructor(factory: DaffCustomerFactory);
|
|
21
|
+
/**
|
|
22
|
+
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
23
|
+
*
|
|
24
|
+
* @param url initial url
|
|
25
|
+
* @param utils utility to parse url
|
|
26
|
+
* @returns ParsedRequestUrl
|
|
27
|
+
* @docs-private
|
|
28
|
+
*/
|
|
29
|
+
parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
|
|
30
|
+
/**
|
|
31
|
+
* @docs-private
|
|
32
|
+
*/
|
|
33
|
+
createDb(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Gets a customer.
|
|
36
|
+
*
|
|
37
|
+
* @param reqInfo request object
|
|
38
|
+
* @returns An http response object
|
|
39
|
+
*/
|
|
40
|
+
get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
41
|
+
put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
42
|
+
private updateCustomer;
|
|
43
|
+
private changeEmail;
|
|
44
|
+
private changePassword;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerInMemoryBackendService, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
48
|
/**
|
|
52
49
|
* An in-memory service that handles customer address HTTP requests.
|
|
53
50
|
*/
|
|
54
|
-
declare class DaffCustomerAddressInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
51
|
+
export declare class DaffCustomerAddressInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
52
|
+
private factory;
|
|
53
|
+
readonly collectionName = "customer-address";
|
|
54
|
+
addresses: Record<DaffCustomerAddress['id'], DaffCustomerAddress>;
|
|
55
|
+
constructor(factory: DaffCustomerAddressFactory);
|
|
56
|
+
/**
|
|
57
|
+
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
58
|
+
*
|
|
59
|
+
* @param url initial url
|
|
60
|
+
* @param utils utility to parse url
|
|
61
|
+
* @returns ParsedRequestUrl
|
|
62
|
+
* @docs-private
|
|
63
|
+
*/
|
|
64
|
+
parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
|
|
65
|
+
/**
|
|
66
|
+
* @docs-private
|
|
67
|
+
*/
|
|
68
|
+
createDb(): any;
|
|
69
|
+
/**
|
|
70
|
+
* Gets a customer.
|
|
71
|
+
*
|
|
72
|
+
* @param reqInfo request object
|
|
73
|
+
* @returns An http response object
|
|
74
|
+
*/
|
|
75
|
+
get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
76
|
+
put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
77
|
+
post(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
78
|
+
delete(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressInMemoryBackendService, never>;
|
|
80
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
84
81
|
}
|
|
85
|
-
|
|
86
82
|
/**
|
|
87
83
|
* The customer inmemory driver to mock the customer backend service.
|
|
88
84
|
*
|
|
89
85
|
* @inheritdoc
|
|
90
86
|
*/
|
|
91
|
-
declare class DaffCustomerInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerDriverInterface {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
export declare class DaffCustomerInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerDriverInterface {
|
|
88
|
+
private http;
|
|
89
|
+
constructor(http: HttpClient, config: InMemoryBackendConfig);
|
|
90
|
+
changeEmail(email: string, password: string): Observable<DaffCustomer>;
|
|
91
|
+
changePassword(oldPassword: string, newPassword: string): Observable<void>;
|
|
92
|
+
get(): Observable<DaffCustomer>;
|
|
93
|
+
update(customer: Partial<DaffCustomer>): Observable<DaffCustomer>;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerInMemoryDriver, never>;
|
|
95
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
100
96
|
}
|
|
101
|
-
|
|
102
97
|
/**
|
|
103
98
|
* The customer address in-memory driver to mock the customer address backend service.
|
|
104
99
|
*
|
|
105
100
|
* @inheritdoc
|
|
106
101
|
*/
|
|
107
|
-
declare class DaffCustomerAddressInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerAddressDriverInterface {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
export declare class DaffCustomerAddressInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerAddressDriverInterface {
|
|
103
|
+
private http;
|
|
104
|
+
constructor(http: HttpClient, config: InMemoryBackendConfig);
|
|
105
|
+
list(): Observable<DaffCustomerAddress[]>;
|
|
106
|
+
get(addressId: string): Observable<DaffCustomerAddress>;
|
|
107
|
+
update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]>;
|
|
108
|
+
add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]>;
|
|
109
|
+
delete(addressId: string): Observable<DaffCustomerAddress[]>;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressInMemoryDriver, never>;
|
|
111
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
117
112
|
}
|
|
118
|
-
|
|
119
113
|
/**
|
|
120
114
|
* Provides the {@link DaffCustomerInMemoryDriver} as the {@link DaffCustomerDriver}.
|
|
115
|
+
*
|
|
116
|
+
* @deprecated in favor of {@link provideDaffCustomerInMemoryDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
121
117
|
*/
|
|
122
|
-
declare class DaffCustomerInMemoryDriverModule {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
export declare class DaffCustomerInMemoryDriverModule {
|
|
119
|
+
static forRoot(): ModuleWithProviders<DaffCustomerInMemoryDriverModule>;
|
|
120
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerInMemoryDriverModule, never>;
|
|
121
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
|
|
122
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerInMemoryDriverModule>;
|
|
127
123
|
}
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
/**
|
|
125
|
+
* Provides the {@link DaffCustomerInMemoryDriver} as the {@link DaffCustomerDriver}.
|
|
126
|
+
*/
|
|
127
|
+
export declare const provideDaffCustomerInMemoryDriver: () => EnvironmentProviders;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
2
|
+
import { MagentoCustomer, MagentoCustomerAddress } from "@daffodil/customer/driver/magento/2.4.7";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MockMagentoCustomerAddress implements MagentoCustomerAddress {
|
|
5
|
+
__typename: string;
|
|
6
|
+
id: number;
|
|
7
|
+
region: {
|
|
8
|
+
__typename: string;
|
|
9
|
+
region_code: string;
|
|
10
|
+
region_id: number;
|
|
11
|
+
};
|
|
12
|
+
country_code: string;
|
|
13
|
+
street: string[];
|
|
14
|
+
company: string;
|
|
15
|
+
telephone: string;
|
|
16
|
+
postcode: string;
|
|
17
|
+
city: string;
|
|
18
|
+
firstname: string;
|
|
19
|
+
lastname: string;
|
|
20
|
+
email: string;
|
|
21
|
+
default_billing: boolean;
|
|
22
|
+
default_shipping: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare class MagentoCustomerAddressFactory extends DaffModelFactory<MagentoCustomerAddress> {
|
|
25
|
+
constructor();
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MagentoCustomerAddressFactory, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
28
|
+
}
|
|
29
|
+
export declare class MagentoCustomerFactory extends DaffModelFactory<MagentoCustomer> {
|
|
30
|
+
constructor(addressFactory: MagentoCustomerAddressFactory);
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MagentoCustomerFactory, never>;
|
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { DaffCustomer, DaffCustomerAddress } from "@daffodil/customer";
|
|
2
|
+
import "graphql";
|
|
3
|
+
import { DaffError } from "@daffodil/core";
|
|
4
|
+
import { DaffCustomerDriverInterface, DaffCustomerInvalidAPIResponseError } from "@daffodil/customer/driver";
|
|
5
|
+
import { Apollo } from "apollo-angular";
|
|
6
|
+
import { Observable } from "rxjs";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
9
|
+
import * as i1 from "@angular/common";
|
|
10
|
+
export declare enum MagentoCustomerGender {
|
|
11
|
+
MALE = 1,
|
|
12
|
+
FEMALE = 2
|
|
13
|
+
}
|
|
14
|
+
export interface MagentoCustomerInput {
|
|
15
|
+
allow_remote_shopping_assistance?: boolean;
|
|
16
|
+
date_of_birth?: string;
|
|
17
|
+
firstname?: string;
|
|
18
|
+
gender?: MagentoCustomerGender;
|
|
19
|
+
is_subscribed?: boolean;
|
|
20
|
+
lastname?: string;
|
|
21
|
+
middlename?: string;
|
|
22
|
+
password?: string;
|
|
23
|
+
prefix?: string;
|
|
24
|
+
suffix?: string;
|
|
25
|
+
taxvat?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MagentoCustomerAddressAttributeInput {
|
|
28
|
+
attribute_code?: string;
|
|
29
|
+
value?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface MagentoCustomerAddressRegionInput {
|
|
32
|
+
region?: string;
|
|
33
|
+
region_code?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Note that this is always required for US addresses even though the schema does not enforce it.
|
|
36
|
+
*/
|
|
37
|
+
region_id?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface MagentoCustomerAddressInput {
|
|
40
|
+
city?: string;
|
|
41
|
+
company?: string;
|
|
42
|
+
country_code?: string;
|
|
43
|
+
country_id?: string;
|
|
44
|
+
custom_attributes?: MagentoCustomerAddressAttributeInput;
|
|
45
|
+
default_billing?: boolean;
|
|
46
|
+
default_shipping?: boolean;
|
|
47
|
+
fax?: string;
|
|
48
|
+
firstname?: string;
|
|
49
|
+
lastname?: string;
|
|
50
|
+
middlename?: string;
|
|
51
|
+
postcode?: string;
|
|
52
|
+
prefix?: string;
|
|
53
|
+
region?: MagentoCustomerAddressRegionInput;
|
|
54
|
+
street?: string[];
|
|
55
|
+
suffix?: string;
|
|
56
|
+
telephone?: string;
|
|
57
|
+
vat_id?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface MagentoCustomerAddress {
|
|
60
|
+
id?: number;
|
|
61
|
+
region: {
|
|
62
|
+
region_code: string;
|
|
63
|
+
region_id: number;
|
|
64
|
+
};
|
|
65
|
+
country_code?: string;
|
|
66
|
+
street?: string[];
|
|
67
|
+
company?: string;
|
|
68
|
+
telephone?: string;
|
|
69
|
+
postcode?: string;
|
|
70
|
+
city?: string;
|
|
71
|
+
firstname?: string;
|
|
72
|
+
lastname?: string;
|
|
73
|
+
email?: string;
|
|
74
|
+
default_billing?: boolean;
|
|
75
|
+
default_shipping?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface MagentoCustomer {
|
|
78
|
+
email: string;
|
|
79
|
+
firstname: string;
|
|
80
|
+
lastname: string;
|
|
81
|
+
is_subscribed: boolean;
|
|
82
|
+
addresses: MagentoCustomerAddress[];
|
|
83
|
+
}
|
|
84
|
+
export interface MagentoGetCustomerResponse {
|
|
85
|
+
customer: MagentoCustomer;
|
|
86
|
+
}
|
|
87
|
+
export interface MagentoChangeEmailResponse {
|
|
88
|
+
updateCustomerEmail: {
|
|
89
|
+
customer: MagentoCustomer;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface MagentoChangePasswordResponse {
|
|
93
|
+
changeCustomerPassword: {
|
|
94
|
+
email: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface MagentoUpdateCustomerResponse {
|
|
98
|
+
updateCustomerV2: {
|
|
99
|
+
customer: MagentoCustomer;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface MagentoGetCustomerAddressesResponse {
|
|
103
|
+
customer: Pick<MagentoCustomer, 'addresses'>;
|
|
104
|
+
}
|
|
105
|
+
export interface MagentoCreateCustomerAddressResponse {
|
|
106
|
+
createCustomerAddress: MagentoCustomerAddress;
|
|
107
|
+
}
|
|
108
|
+
export interface MagentoUpdateCustomerAddressResponse {
|
|
109
|
+
updateCustomerAddress: MagentoCustomerAddress;
|
|
110
|
+
}
|
|
111
|
+
export interface MagentoDeleteCustomerAddressResponse {
|
|
112
|
+
deleteCustomerAddress: boolean;
|
|
113
|
+
}
|
|
114
|
+
export declare const magentoCustomerInputTransform: (customer: Partial<DaffCustomer>) => MagentoCustomerInput;
|
|
115
|
+
export declare const magentoCustomerAddressInputTransform: (address: Partial<DaffCustomerAddress>) => MagentoCustomerAddressInput;
|
|
116
|
+
export declare const magentoCustomerTransform: (customer: MagentoCustomer) => DaffCustomer;
|
|
117
|
+
export declare const magentoCustomerAddressTransform: (address: MagentoCustomerAddress) => DaffCustomerAddress;
|
|
118
|
+
export declare const magentoCustomerFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
119
|
+
export declare const magentoCustomerAddressFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
120
|
+
export declare const MAGENTO_GET_CUSTOMER_QUERY_NAME = "MagentoGetCustomer";
|
|
121
|
+
export declare const getCustomer: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
122
|
+
export declare const MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME = "MagentoGetCustomerAddresses";
|
|
123
|
+
export declare const getCustomerAddresses: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
124
|
+
export declare const createCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
125
|
+
export declare const updateCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
126
|
+
export declare const deleteCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
127
|
+
export declare const MAGENTO_UPDATE_CUSTOMER_QUERY_NAME = "MagentoUpdateCustomer";
|
|
128
|
+
export declare const updateCustomer: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
129
|
+
export declare const MAGENTO_UPDATE_EMAIL_QUERY_NAME = "MagentoUpdateEmail";
|
|
130
|
+
export declare const updateEmail: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
131
|
+
export declare const MAGENTO_CHANGE_PASSWORD_QUERY_NAME = "MagentoChangePassword";
|
|
132
|
+
export declare const changePassword: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
133
|
+
export declare function transformMagentoReviewsError(error: any, requestPayload?: unknown): DaffError | DaffCustomerInvalidAPIResponseError;
|
|
134
|
+
export declare const validateGetCustomerResponse: (response: Apollo.QueryResult<MagentoGetCustomerResponse>) => {
|
|
135
|
+
data: MagentoGetCustomerResponse;
|
|
136
|
+
error?: import("@apollo/client").ErrorLike;
|
|
137
|
+
};
|
|
138
|
+
export declare const validateChangeEmailResponse: (response: Apollo.QueryResult<MagentoChangeEmailResponse>) => {
|
|
139
|
+
data: MagentoChangeEmailResponse;
|
|
140
|
+
error?: import("@apollo/client").ErrorLike;
|
|
141
|
+
};
|
|
142
|
+
export declare const validateChangePasswordResponse: (response: Apollo.QueryResult<MagentoChangePasswordResponse>) => {
|
|
143
|
+
data: MagentoChangePasswordResponse;
|
|
144
|
+
error?: import("@apollo/client").ErrorLike;
|
|
145
|
+
};
|
|
146
|
+
export declare const validateGetCustomerAddressesResponse: (response: Apollo.QueryResult<MagentoGetCustomerAddressesResponse>) => {
|
|
147
|
+
data: MagentoGetCustomerAddressesResponse;
|
|
148
|
+
error?: import("@apollo/client").ErrorLike;
|
|
149
|
+
};
|
|
150
|
+
export declare const validateCreateCustomerAddressResponse: (response: Apollo.QueryResult<MagentoCreateCustomerAddressResponse>) => {
|
|
151
|
+
data: MagentoCreateCustomerAddressResponse;
|
|
152
|
+
error?: import("@apollo/client").ErrorLike;
|
|
153
|
+
};
|
|
154
|
+
export declare const validateUpdateCustomerAddressResponse: (response: Apollo.QueryResult<MagentoUpdateCustomerAddressResponse>) => {
|
|
155
|
+
data: MagentoUpdateCustomerAddressResponse;
|
|
156
|
+
error?: import("@apollo/client").ErrorLike;
|
|
157
|
+
};
|
|
158
|
+
export declare const validateDeleteCustomerAddressResponse: (response: Apollo.QueryResult<MagentoDeleteCustomerAddressResponse>) => {
|
|
159
|
+
data: MagentoDeleteCustomerAddressResponse;
|
|
160
|
+
error?: import("@apollo/client").ErrorLike;
|
|
161
|
+
};
|
|
162
|
+
export declare const validateUpdateCustomerResponse: (response: Apollo.QueryResult<MagentoUpdateCustomerResponse>) => {
|
|
163
|
+
data: MagentoUpdateCustomerResponse;
|
|
164
|
+
error?: import("@apollo/client").ErrorLike;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* A service for making Magento GraphQL queries for customers.
|
|
168
|
+
*
|
|
169
|
+
* @inheritdoc
|
|
170
|
+
*/
|
|
171
|
+
export declare class DaffCustomerMagentoService implements DaffCustomerDriverInterface {
|
|
172
|
+
private apollo;
|
|
173
|
+
constructor(apollo: Apollo);
|
|
174
|
+
changeEmail(email: string, password: string): Observable<DaffCustomer>;
|
|
175
|
+
changePassword(oldPassword: string, newPassword: string): Observable<void>;
|
|
176
|
+
get(): Observable<DaffCustomer>;
|
|
177
|
+
update(customer: Partial<DaffCustomer>): Observable<DaffCustomer>;
|
|
178
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerMagentoService, never>;
|
|
179
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @deprecated in favor of {@link provideDaffCustomerMagentoDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
183
|
+
*/
|
|
184
|
+
export declare class DaffCustomerMagentoDriverModule {
|
|
185
|
+
static forRoot(): ModuleWithProviders<DaffCustomerMagentoDriverModule>;
|
|
186
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerMagentoDriverModule, never>;
|
|
187
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerMagentoDriverModule, never, [typeof i1.CommonModule], never>;
|
|
188
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerMagentoDriverModule>;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Provides the Magento implementations of the `@daffodil/customer/driver` interfaces.
|
|
192
|
+
*/
|
|
193
|
+
export declare const provideDaffCustomerMagentoDriver: () => EnvironmentProviders;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -1,55 +1,56 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { ModuleWithProviders } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { Observable } from
|
|
5
|
-
import { DaffCustomer, DaffCustomerAddress } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { DaffIdentifiable } from
|
|
9
|
-
|
|
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 { DaffCustomer, DaffCustomerAddress } from "@daffodil/customer";
|
|
6
|
+
import { DaffCustomerAddressDriverInterface, DaffCustomerDriverInterface } from "@daffodil/customer/driver";
|
|
7
|
+
import { DaffCustomerAddressFactory, DaffCustomerFactory } from "@daffodil/customer/testing";
|
|
8
|
+
import { DaffIdentifiable } from "@daffodil/core";
|
|
10
9
|
/**
|
|
11
10
|
* Provides the {@link DaffCustomerTestingDriver} as the {@link DaffCustomerDriver}.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated in favor of {@link provideDaffCustomerTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
12
13
|
*/
|
|
13
|
-
declare class DaffCustomerTestingDriverModule {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export declare class DaffCustomerTestingDriverModule {
|
|
15
|
+
static forRoot(): ModuleWithProviders<DaffCustomerTestingDriverModule>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerTestingDriverModule, never>;
|
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerTestingDriverModule, never, [typeof i1.CommonModule], never>;
|
|
18
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerTestingDriverModule>;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
20
|
/**
|
|
21
21
|
* A basic customer driver that creates mock customer results of different kinds.
|
|
22
22
|
* For testing purposes.
|
|
23
23
|
*
|
|
24
24
|
* @inheritdoc
|
|
25
25
|
*/
|
|
26
|
-
declare class DaffCustomerTestingDriver implements DaffCustomerDriverInterface {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
export declare class DaffCustomerTestingDriver implements DaffCustomerDriverInterface {
|
|
27
|
+
private customerFactory;
|
|
28
|
+
constructor(customerFactory: DaffCustomerFactory);
|
|
29
|
+
changeEmail(email: string, password: string): Observable<DaffCustomer>;
|
|
30
|
+
changePassword(oldPassword: string, newPassword: string): Observable<void>;
|
|
31
|
+
get(): Observable<DaffCustomer>;
|
|
32
|
+
update(customer: Partial<DaffCustomer>): Observable<DaffCustomer>;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerTestingDriver, never>;
|
|
34
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
36
|
/**
|
|
38
37
|
* A basic customer driver that creates mock customer results of different kinds.
|
|
39
38
|
* For testing purposes.
|
|
40
39
|
*
|
|
41
40
|
* @inheritdoc
|
|
42
41
|
*/
|
|
43
|
-
declare class DaffCustomerAddressTestingDriver implements DaffCustomerAddressDriverInterface {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
export declare class DaffCustomerAddressTestingDriver implements DaffCustomerAddressDriverInterface {
|
|
43
|
+
private factory;
|
|
44
|
+
constructor(factory: DaffCustomerAddressFactory);
|
|
45
|
+
list(): Observable<DaffCustomerAddress[]>;
|
|
46
|
+
get(addressId: string): Observable<DaffCustomerAddress>;
|
|
47
|
+
update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]>;
|
|
48
|
+
add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]>;
|
|
49
|
+
delete(addressId: string): Observable<DaffCustomerAddress[]>;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressTestingDriver, never>;
|
|
51
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Provides the {@link DaffCustomerTestingDriver} as the {@link DaffCustomerDriver}.
|
|
55
|
+
*/
|
|
56
|
+
export declare const provideDaffCustomerTestingDriver: () => EnvironmentProviders;
|