@daffodil/customer 0.49.0 → 0.51.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/README.md +1 -1
- package/driver/errors/address-not-found.d.ts +10 -0
- package/driver/errors/codes.d.ts +6 -0
- package/driver/errors/default-billing-address-deletion.d.ts +10 -0
- package/driver/errors/default-shipping-address-deletion.d.ts +10 -0
- package/driver/errors/map.d.ts +6 -0
- package/driver/errors/public_api.d.ts +4 -0
- package/driver/in-memory/backend/address.service.d.ts +37 -0
- package/driver/in-memory/driver/address.service.d.ts +26 -0
- package/driver/in-memory/public_api.d.ts +2 -0
- package/driver/interfaces/address-service.interface.d.ts +33 -0
- package/driver/magento/address.service.d.ts +27 -0
- package/driver/magento/errors/map.d.ts +3 -0
- package/driver/magento/errors/transform.d.ts +9 -1
- package/driver/magento/models/requests/address-attribute-input.type.d.ts +4 -0
- package/driver/magento/models/requests/address-input.type.d.ts +22 -0
- package/driver/magento/models/requests/address-region-input.type.d.ts +8 -0
- package/driver/magento/models/requests/public_api.d.ts +3 -0
- package/driver/magento/models/responses/create-customer-address.type.d.ts +4 -0
- package/driver/magento/models/responses/customer-address.type.d.ts +4 -2
- package/driver/magento/models/responses/delete-customer-address.type.d.ts +3 -0
- package/driver/magento/models/responses/get-customer-addresses.type.d.ts +4 -0
- package/driver/magento/models/responses/public_api.d.ts +4 -0
- package/driver/magento/models/responses/update-customer-address.type.d.ts +4 -0
- package/driver/magento/queries/create-customer-address.d.ts +1 -0
- package/driver/magento/queries/delete-customer-address.d.ts +1 -0
- package/driver/magento/queries/get-customer-addresses.d.ts +2 -0
- package/driver/magento/queries/public_api.d.ts +4 -0
- package/driver/magento/queries/update-customer-address.d.ts +1 -0
- package/driver/magento/testing/factories/address.factory.d.ts +3 -1
- package/driver/magento/transforms/requests/address-input.d.ts +3 -0
- package/driver/magento/transforms/requests/public_api.d.ts +1 -0
- package/driver/magento/validators/create-customer-address.d.ts +3 -0
- package/driver/magento/validators/delete-customer-address.d.ts +3 -0
- package/driver/magento/validators/get-customer-addresses.d.ts +3 -0
- package/driver/magento/validators/public_api.d.ts +7 -0
- package/driver/magento/validators/update-customer-address.d.ts +3 -0
- package/driver/public_api.d.ts +1 -0
- package/driver/testing/drivers/address.service.d.ts +23 -0
- package/esm2020/driver/errors/address-not-found.mjs +13 -0
- package/esm2020/driver/errors/codes.mjs +11 -0
- package/esm2020/driver/errors/default-billing-address-deletion.mjs +13 -0
- package/esm2020/driver/errors/default-shipping-address-deletion.mjs +13 -0
- package/esm2020/driver/errors/map.mjs +7 -1
- package/esm2020/driver/errors/public_api.mjs +5 -1
- package/esm2020/driver/in-memory/backend/address.service.mjs +110 -0
- package/esm2020/driver/in-memory/driver/address.service.mjs +42 -0
- package/esm2020/driver/in-memory/driver/customer-driver.module.mjs +6 -2
- package/esm2020/driver/in-memory/public_api.mjs +3 -1
- package/esm2020/driver/interfaces/address-service.interface.mjs +6 -0
- package/esm2020/driver/magento/address.service.mjs +91 -0
- package/esm2020/driver/magento/customer-driver.module.mjs +13 -3
- package/esm2020/driver/magento/errors/map.mjs +6 -0
- package/esm2020/driver/magento/errors/transform.mjs +28 -4
- package/esm2020/driver/magento/models/requests/address-attribute-input.type.mjs +2 -0
- package/esm2020/driver/magento/models/requests/address-input.type.mjs +2 -0
- package/esm2020/driver/magento/models/requests/address-region-input.type.mjs +2 -0
- package/esm2020/driver/magento/models/requests/public_api.mjs +1 -1
- package/esm2020/driver/magento/models/responses/create-customer-address.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/customer-address.type.mjs +1 -1
- package/esm2020/driver/magento/models/responses/delete-customer-address.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/get-customer-addresses.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/public_api.mjs +1 -1
- package/esm2020/driver/magento/models/responses/update-customer-address.type.mjs +2 -0
- package/esm2020/driver/magento/queries/create-customer-address.mjs +11 -0
- package/esm2020/driver/magento/queries/delete-customer-address.mjs +7 -0
- package/esm2020/driver/magento/queries/fragments/customer-address.mjs +4 -2
- package/esm2020/driver/magento/queries/get-customer-addresses.mjs +14 -0
- package/esm2020/driver/magento/queries/public_api.mjs +5 -1
- package/esm2020/driver/magento/queries/update-customer-address.mjs +11 -0
- package/esm2020/driver/magento/testing/factories/address.factory.mjs +4 -2
- package/esm2020/driver/magento/transforms/requests/address-input.mjs +22 -0
- package/esm2020/driver/magento/transforms/requests/public_api.mjs +2 -1
- package/esm2020/driver/magento/transforms/responses/customer-address.mjs +6 -3
- package/esm2020/driver/magento/validators/create-customer-address.mjs +10 -0
- package/esm2020/driver/magento/validators/delete-customer-address.mjs +10 -0
- package/esm2020/driver/magento/validators/get-customer-addresses.mjs +10 -0
- package/esm2020/driver/magento/validators/public_api.mjs +8 -1
- package/esm2020/driver/magento/validators/update-customer-address.mjs +10 -0
- package/esm2020/driver/public_api.mjs +2 -1
- package/esm2020/driver/testing/drivers/address.service.mjs +40 -0
- package/esm2020/driver/testing/drivers/customer-driver.module.mjs +7 -2
- package/esm2020/models/address.type.mjs +1 -1
- package/esm2020/state/actions/address.actions.mjs +175 -0
- package/esm2020/state/actions/public_api.mjs +3 -0
- package/esm2020/state/customer.module.mjs +4 -1
- package/esm2020/state/effects/address.effects.mjs +45 -0
- package/esm2020/state/facades/address/facade.mjs +41 -0
- package/esm2020/state/facades/address/interface.mjs +2 -0
- package/esm2020/state/facades/public_api.mjs +2 -1
- package/esm2020/state/models/address.type.mjs +2 -0
- package/esm2020/state/models/public_api.mjs +2 -0
- package/esm2020/state/public_api.mjs +3 -2
- package/esm2020/state/reducers/address/initial-state.mjs +6 -0
- package/esm2020/state/reducers/address/public_api.mjs +3 -0
- package/esm2020/state/reducers/address/reducer.mjs +32 -0
- package/esm2020/state/reducers/address/type.mjs +2 -0
- package/esm2020/state/reducers/address-entities/adapter.mjs +10 -0
- package/esm2020/state/reducers/address-entities/public_api.mjs +3 -0
- package/esm2020/state/reducers/address-entities/reducer.mjs +43 -0
- package/esm2020/state/reducers/customer/adapter.mjs +15 -1
- package/esm2020/state/reducers/customer/reducer.mjs +20 -17
- package/esm2020/state/reducers/public_api.mjs +3 -1
- package/esm2020/state/reducers/reducers.interface.mjs +1 -1
- package/esm2020/state/reducers/token/reducers.token.mjs +5 -1
- package/esm2020/state/selectors/address/selector.mjs +23 -0
- package/esm2020/state/selectors/customer/selector.mjs +20 -0
- package/esm2020/state/selectors/feature.selector.mjs +1 -1
- package/esm2020/state/selectors/public_api.mjs +4 -2
- package/esm2020/testing/factories/customer-address.factory.mjs +3 -1
- package/fesm2015/daffodil-customer-driver-in-memory.mjs +145 -2
- package/fesm2015/daffodil-customer-driver-in-memory.mjs.map +1 -1
- package/fesm2015/daffodil-customer-driver-magento-testing.mjs +3 -1
- package/fesm2015/daffodil-customer-driver-magento-testing.mjs.map +1 -1
- package/fesm2015/daffodil-customer-driver-magento.mjs +227 -8
- package/fesm2015/daffodil-customer-driver-magento.mjs.map +1 -1
- package/fesm2015/daffodil-customer-driver-testing.mjs +40 -1
- package/fesm2015/daffodil-customer-driver-testing.mjs.map +1 -1
- package/fesm2015/daffodil-customer-driver.mjs +52 -1
- package/fesm2015/daffodil-customer-driver.mjs.map +1 -1
- package/fesm2015/daffodil-customer-state.mjs +378 -17
- package/fesm2015/daffodil-customer-state.mjs.map +1 -1
- package/fesm2015/daffodil-customer-testing.mjs +2 -0
- package/fesm2015/daffodil-customer-testing.mjs.map +1 -1
- package/fesm2020/daffodil-customer-driver-in-memory.mjs +148 -2
- package/fesm2020/daffodil-customer-driver-in-memory.mjs.map +1 -1
- package/fesm2020/daffodil-customer-driver-magento-testing.mjs +3 -1
- package/fesm2020/daffodil-customer-driver-magento-testing.mjs.map +1 -1
- package/fesm2020/daffodil-customer-driver-magento.mjs +223 -8
- package/fesm2020/daffodil-customer-driver-magento.mjs.map +1 -1
- package/fesm2020/daffodil-customer-driver-testing.mjs +40 -1
- package/fesm2020/daffodil-customer-driver-testing.mjs.map +1 -1
- package/fesm2020/daffodil-customer-driver.mjs +52 -1
- package/fesm2020/daffodil-customer-driver.mjs.map +1 -1
- package/fesm2020/daffodil-customer-state.mjs +387 -17
- package/fesm2020/daffodil-customer-state.mjs.map +1 -1
- package/fesm2020/daffodil-customer-testing.mjs +2 -0
- package/fesm2020/daffodil-customer-testing.mjs.map +1 -1
- package/models/address.type.d.ts +8 -0
- package/package.json +4 -4
- package/state/actions/address.actions.d.ts +166 -0
- package/state/actions/public_api.d.ts +2 -0
- package/state/effects/address.effects.d.ts +31 -0
- package/state/facades/address/facade.d.ts +28 -0
- package/state/facades/address/interface.d.ts +14 -0
- package/state/facades/public_api.d.ts +2 -0
- package/state/models/address.type.d.ts +3 -0
- package/state/models/public_api.d.ts +1 -0
- package/state/public_api.d.ts +2 -1
- package/state/reducers/address/initial-state.d.ts +5 -0
- package/state/reducers/address/public_api.d.ts +3 -0
- package/state/reducers/address/reducer.d.ts +7 -0
- package/state/reducers/address/type.d.ts +5 -0
- package/state/reducers/address-entities/adapter.d.ts +6 -0
- package/state/reducers/address-entities/public_api.d.ts +2 -0
- package/state/reducers/address-entities/reducer.d.ts +12 -0
- package/state/reducers/customer/adapter.d.ts +5 -0
- package/state/reducers/customer/reducer.d.ts +2 -2
- package/state/reducers/public_api.d.ts +2 -0
- package/state/reducers/reducers.interface.d.ts +9 -5
- package/state/reducers/token/extra.token.d.ts +1 -1
- package/state/reducers/token/reducers.token.d.ts +1 -1
- package/state/selectors/address/selector.d.ts +15 -0
- package/state/selectors/{customer.selector.d.ts → customer/selector.d.ts} +1 -1
- package/state/selectors/feature.selector.d.ts +4 -4
- package/state/selectors/public_api.d.ts +3 -1
- package/testing/factories/customer-address.factory.d.ts +2 -0
- package/esm2020/state/selectors/customer.selector.mjs +0 -20
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @daffodil/customer
|
|
2
2
|
|
|
3
|
-
`@daffodil/customer` contains the main features required to support customer management in an Angular app. It supports loading a customer and
|
|
3
|
+
`@daffodil/customer` contains the main features required to support customer management in an Angular app. It supports loading a customer and saved addresses.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '@daffodil/core';
|
|
2
|
+
export declare const DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE = "DAFF_CUSTOMER_ADDRESS_NOT_FOUND";
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that the requested address cannot be found.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffCustomerAddressNotFoundError extends DaffInheritableError implements DaffError {
|
|
7
|
+
message: string;
|
|
8
|
+
readonly code: string;
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '@daffodil/core';
|
|
2
|
+
export declare const DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE = "DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION";
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that a deletion of the customer's default billing address was attempted and failed.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffCustomerDefaultBillingAddressDeletionError extends DaffInheritableError implements DaffError {
|
|
7
|
+
message: string;
|
|
8
|
+
readonly code: string;
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DaffError, DaffInheritableError } from '@daffodil/core';
|
|
2
|
+
export declare const DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE = "DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION";
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that a deletion of the customer's default shipping address was attempted and failed.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DaffCustomerDefaultShippingAddressDeletionError extends DaffInheritableError implements DaffError {
|
|
7
|
+
message: string;
|
|
8
|
+
readonly code: string;
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
package/driver/errors/map.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { DaffCustomerAddressNotFoundError } from './address-not-found';
|
|
2
|
+
import { DaffCustomerDefaultBillingAddressDeletionError } from './default-billing-address-deletion';
|
|
3
|
+
import { DaffCustomerDefaultShippingAddressDeletionError } from './default-shipping-address-deletion';
|
|
1
4
|
import { DaffCustomerInvalidAPIResponseError } from './invalid-api-response';
|
|
2
5
|
/**
|
|
3
6
|
* A mapping from error codes to error class constructors.
|
|
4
7
|
*/
|
|
5
8
|
export declare const DaffCustomerDriverErrorMap: {
|
|
6
9
|
DAFF_CUSTOMER_INVALID_API_RESPONSE: typeof DaffCustomerInvalidAPIResponseError;
|
|
10
|
+
DAFF_CUSTOMER_ADDRESS_NOT_FOUND: typeof DaffCustomerAddressNotFoundError;
|
|
11
|
+
DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION: typeof DaffCustomerDefaultBillingAddressDeletionError;
|
|
12
|
+
DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION: typeof DaffCustomerDefaultShippingAddressDeletionError;
|
|
7
13
|
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { DaffCustomerInvalidAPIResponseError, DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE, } from './invalid-api-response';
|
|
2
|
+
export { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE, DaffCustomerAddressNotFoundError, } from './address-not-found';
|
|
3
|
+
export { DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE, DaffCustomerDefaultBillingAddressDeletionError, } from './default-billing-address-deletion';
|
|
4
|
+
export { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE, DaffCustomerDefaultShippingAddressDeletionError, } from './default-shipping-address-deletion';
|
|
2
5
|
export { DaffCustomerDriverErrorMap } from './map';
|
|
6
|
+
export { DaffCustomerDriverErrorCodes } from './codes';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InMemoryDbService, RequestInfoUtilities, ParsedRequestUrl, RequestInfo } from 'angular-in-memory-web-api';
|
|
2
|
+
import { DaffCustomerAddress } from '@daffodil/customer';
|
|
3
|
+
import { DaffCustomerAddressFactory } from '@daffodil/customer/testing';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* An in-memory service that handles customer address HTTP requests.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffCustomerAddressInMemoryBackendService implements InMemoryDbService {
|
|
9
|
+
private factory;
|
|
10
|
+
addresses: Record<DaffCustomerAddress['id'], DaffCustomerAddress>;
|
|
11
|
+
constructor(factory: DaffCustomerAddressFactory);
|
|
12
|
+
/**
|
|
13
|
+
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
14
|
+
*
|
|
15
|
+
* @param url initial url
|
|
16
|
+
* @param utils utility to parse url
|
|
17
|
+
* @returns ParsedRequestUrl
|
|
18
|
+
* @docs-private
|
|
19
|
+
*/
|
|
20
|
+
parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
|
|
21
|
+
/**
|
|
22
|
+
* @docs-private
|
|
23
|
+
*/
|
|
24
|
+
createDb(): any;
|
|
25
|
+
/**
|
|
26
|
+
* Gets a customer.
|
|
27
|
+
*
|
|
28
|
+
* @param reqInfo request object
|
|
29
|
+
* @returns An http response object
|
|
30
|
+
*/
|
|
31
|
+
get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
32
|
+
put(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
33
|
+
post(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
34
|
+
delete(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressInMemoryBackendService, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerAddressInMemoryBackendService>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffIdentifiable } from '@daffodil/core';
|
|
4
|
+
import { DaffCustomerAddress } from '@daffodil/customer';
|
|
5
|
+
import { DaffCustomerAddressDriverInterface } from '@daffodil/customer/driver';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* The customer address in-memory driver to mock the customer address backend service.
|
|
9
|
+
*
|
|
10
|
+
* @inheritdoc
|
|
11
|
+
*/
|
|
12
|
+
export declare class DaffCustomerAddressInMemoryDriver implements DaffCustomerAddressDriverInterface {
|
|
13
|
+
private http;
|
|
14
|
+
/**
|
|
15
|
+
* @docs-private
|
|
16
|
+
*/
|
|
17
|
+
url: string;
|
|
18
|
+
constructor(http: HttpClient);
|
|
19
|
+
list(): Observable<DaffCustomerAddress[]>;
|
|
20
|
+
get(addressId: string): Observable<DaffCustomerAddress>;
|
|
21
|
+
update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]>;
|
|
22
|
+
add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]>;
|
|
23
|
+
delete(addressId: string): Observable<DaffCustomerAddress[]>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressInMemoryDriver, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerAddressInMemoryDriver>;
|
|
26
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { DaffCustomerInMemoryBackendService } from './backend/customer.service';
|
|
2
|
+
export { DaffCustomerAddressInMemoryBackendService } from './backend/address.service';
|
|
2
3
|
export { DaffCustomerInMemoryDriver } from './driver/customer.service';
|
|
4
|
+
export { DaffCustomerAddressInMemoryDriver } from './driver/address.service';
|
|
3
5
|
export { DaffCustomerInMemoryDriverModule } from './driver/customer-driver.module';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffIdentifiable } from '@daffodil/core';
|
|
4
|
+
import { DaffCustomerAddress } from '@daffodil/customer';
|
|
5
|
+
/**
|
|
6
|
+
* An injection token for the customer driver.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DaffCustomerAddressDriver: InjectionToken<DaffCustomerAddressDriverInterface<DaffCustomerAddress>>;
|
|
9
|
+
/**
|
|
10
|
+
* The customer driver is responsible for loading customers.
|
|
11
|
+
*/
|
|
12
|
+
export interface DaffCustomerAddressDriverInterface<T extends DaffCustomerAddress = DaffCustomerAddress> {
|
|
13
|
+
/**
|
|
14
|
+
* Lists the customer's addresses.
|
|
15
|
+
*/
|
|
16
|
+
list(): Observable<T[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the specified address.
|
|
19
|
+
*/
|
|
20
|
+
get(addressId: DaffCustomerAddress['id']): Observable<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Update the passed address.
|
|
23
|
+
*/
|
|
24
|
+
update(address: Partial<T> & DaffIdentifiable): Observable<T[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Adds the passed address.
|
|
27
|
+
*/
|
|
28
|
+
add(address: T): Observable<T[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes the specified address.
|
|
31
|
+
*/
|
|
32
|
+
delete(addressId: DaffCustomerAddress['id']): Observable<T[]>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { Apollo } from 'apollo-angular';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { DaffIdentifiable } from '@daffodil/core';
|
|
5
|
+
import { DaffQueuedApollo } from '@daffodil/core/graphql';
|
|
6
|
+
import { DaffCustomerAddress } from '@daffodil/customer';
|
|
7
|
+
import { DaffCustomerAddressDriverInterface } from '@daffodil/customer/driver';
|
|
8
|
+
import { MagentoGetCustomerAddressesResponse } from './models/public_api';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* A service for making Magento GraphQL queries for customers.
|
|
12
|
+
*
|
|
13
|
+
* @inheritdoc
|
|
14
|
+
*/
|
|
15
|
+
export declare class DaffCustomerMagentoAddressService implements DaffCustomerAddressDriverInterface {
|
|
16
|
+
private apollo;
|
|
17
|
+
private mutationQueue;
|
|
18
|
+
constructor(apollo: Apollo, mutationQueue: DaffQueuedApollo);
|
|
19
|
+
add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]>;
|
|
20
|
+
delete(addressId: DaffCustomerAddress['id']): Observable<DaffCustomerAddress[]>;
|
|
21
|
+
list(): Observable<DaffCustomerAddress[]>;
|
|
22
|
+
get(addressId: DaffCustomerAddress['id']): Observable<DaffCustomerAddress>;
|
|
23
|
+
update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]>;
|
|
24
|
+
protected listAddresses(): Observable<ApolloQueryResult<MagentoGetCustomerAddressesResponse>>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerMagentoAddressService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerMagentoAddressService>;
|
|
27
|
+
}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { DaffError } from '@daffodil/core';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms a single GraphQL error.
|
|
5
|
+
* Optionally accepts a request payload which can be used in certain cases
|
|
6
|
+
* to add supplemental info to the error.
|
|
7
|
+
*/
|
|
8
|
+
export declare function transformMagentoCartGraphQlError(error: GraphQLError, requestPayload?: unknown): DaffError;
|
|
9
|
+
export declare function transformMagentoReviewsError(error: any, requestPayload?: unknown): DaffError;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MagentoCustomerAddressAttributeInput } from './address-attribute-input.type';
|
|
2
|
+
import { MagentoCustomerAddressRegionInput } from './address-region-input.type';
|
|
3
|
+
export interface MagentoCustomerAddressInput {
|
|
4
|
+
city?: string;
|
|
5
|
+
company?: string;
|
|
6
|
+
country_code?: string;
|
|
7
|
+
country_id?: string;
|
|
8
|
+
custom_attributes?: MagentoCustomerAddressAttributeInput;
|
|
9
|
+
default_billing?: boolean;
|
|
10
|
+
default_shipping?: boolean;
|
|
11
|
+
fax?: string;
|
|
12
|
+
firstname?: string;
|
|
13
|
+
lastname?: string;
|
|
14
|
+
middlename?: string;
|
|
15
|
+
postcode?: string;
|
|
16
|
+
prefix?: string;
|
|
17
|
+
region?: MagentoCustomerAddressRegionInput;
|
|
18
|
+
street?: string[];
|
|
19
|
+
suffix?: string;
|
|
20
|
+
telephone?: string;
|
|
21
|
+
vat_id?: string;
|
|
22
|
+
}
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export { MagentoCustomerInput } from './customer-input.type';
|
|
2
|
+
export { MagentoCustomerAddressInput } from './address-input.type';
|
|
3
|
+
export { MagentoCustomerAddressAttributeInput } from './address-attribute-input.type';
|
|
4
|
+
export { MagentoCustomerAddressRegionInput } from './address-region-input.type';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface MagentoCustomerAddress {
|
|
2
|
-
id:
|
|
2
|
+
id: number;
|
|
3
3
|
region: {
|
|
4
4
|
region_code: string;
|
|
5
|
-
|
|
5
|
+
region_id: number;
|
|
6
6
|
};
|
|
7
7
|
country_code: string;
|
|
8
8
|
street: string[];
|
|
@@ -13,4 +13,6 @@ export interface MagentoCustomerAddress {
|
|
|
13
13
|
firstname: string;
|
|
14
14
|
lastname: string;
|
|
15
15
|
email: string;
|
|
16
|
+
default_billing: boolean;
|
|
17
|
+
default_shipping: boolean;
|
|
16
18
|
}
|
|
@@ -4,3 +4,7 @@ export { MagentoGetCustomerResponse } from './get-customer.type';
|
|
|
4
4
|
export { MagentoChangeEmailResponse } from './change-email.type';
|
|
5
5
|
export { MagentoChangePasswordResponse } from './change-password.type';
|
|
6
6
|
export { MagentoUpdateCustomerResponse } from './update-customer.type';
|
|
7
|
+
export { MagentoGetCustomerAddressesResponse } from './get-customer-addresses.type';
|
|
8
|
+
export { MagentoCreateCustomerAddressResponse } from './create-customer-address.type';
|
|
9
|
+
export { MagentoUpdateCustomerAddressResponse } from './update-customer-address.type';
|
|
10
|
+
export { MagentoDeleteCustomerAddressResponse } from './delete-customer-address.type';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deleteCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './fragments/public_api';
|
|
2
2
|
export * from './get-customer';
|
|
3
|
+
export * from './get-customer-addresses';
|
|
4
|
+
export * from './create-customer-address';
|
|
5
|
+
export * from './update-customer-address';
|
|
6
|
+
export * from './delete-customer-address';
|
|
3
7
|
export * from './update-customer';
|
|
4
8
|
export * from './update-email';
|
|
5
9
|
export * from './change-password';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const updateCustomerAddress: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
@@ -7,7 +7,7 @@ export declare class MockMagentoCustomerAddress implements MagentoCustomerAddres
|
|
|
7
7
|
region: {
|
|
8
8
|
__typename: string;
|
|
9
9
|
region_code: any;
|
|
10
|
-
|
|
10
|
+
region_id: any;
|
|
11
11
|
};
|
|
12
12
|
country_code: any;
|
|
13
13
|
street: any[];
|
|
@@ -18,6 +18,8 @@ export declare class MockMagentoCustomerAddress implements MagentoCustomerAddres
|
|
|
18
18
|
firstname: any;
|
|
19
19
|
lastname: any;
|
|
20
20
|
email: any;
|
|
21
|
+
default_billing: any;
|
|
22
|
+
default_shipping: any;
|
|
21
23
|
}
|
|
22
24
|
export declare class MagentoCustomerAddressFactory extends DaffModelFactory<MagentoCustomerAddress> {
|
|
23
25
|
constructor();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { MagentoCreateCustomerAddressResponse } from '../models/public_api';
|
|
3
|
+
export declare const validateCreateCustomerAddressResponse: (response: ApolloQueryResult<MagentoCreateCustomerAddressResponse>) => ApolloQueryResult<MagentoCreateCustomerAddressResponse>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { MagentoDeleteCustomerAddressResponse } from '../models/public_api';
|
|
3
|
+
export declare const validateDeleteCustomerAddressResponse: (response: ApolloQueryResult<MagentoDeleteCustomerAddressResponse>) => ApolloQueryResult<MagentoDeleteCustomerAddressResponse>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { MagentoGetCustomerAddressesResponse } from '../models/public_api';
|
|
3
|
+
export declare const validateGetCustomerAddressesResponse: (response: ApolloQueryResult<MagentoGetCustomerAddressesResponse>) => ApolloQueryResult<MagentoGetCustomerAddressesResponse>;
|
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export { validateGetCustomerResponse } from './get-customer';
|
|
2
|
+
export { validateChangeEmailResponse } from './change-email';
|
|
3
|
+
export { validateChangePasswordResponse } from './change-password';
|
|
4
|
+
export { validateGetCustomerAddressesResponse } from './get-customer-addresses';
|
|
5
|
+
export { validateCreateCustomerAddressResponse } from './create-customer-address';
|
|
6
|
+
export { validateUpdateCustomerAddressResponse } from './update-customer-address';
|
|
7
|
+
export { validateDeleteCustomerAddressResponse } from './delete-customer-address';
|
|
8
|
+
export { validateUpdateCustomerResponse } from './update-customer';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { MagentoUpdateCustomerAddressResponse } from '../models/public_api';
|
|
3
|
+
export declare const validateUpdateCustomerAddressResponse: (response: ApolloQueryResult<MagentoUpdateCustomerAddressResponse>) => ApolloQueryResult<MagentoUpdateCustomerAddressResponse>;
|
package/driver/public_api.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DaffIdentifiable } from '@daffodil/core';
|
|
3
|
+
import { DaffCustomerAddress } from '@daffodil/customer';
|
|
4
|
+
import { DaffCustomerAddressDriverInterface } from '@daffodil/customer/driver';
|
|
5
|
+
import { DaffCustomerAddressFactory } from '@daffodil/customer/testing';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A basic customer driver that creates mock customer results of different kinds.
|
|
9
|
+
* For testing purposes.
|
|
10
|
+
*
|
|
11
|
+
* @inheritdoc
|
|
12
|
+
*/
|
|
13
|
+
export declare class DaffCustomerAddressTestingDriver implements DaffCustomerAddressDriverInterface {
|
|
14
|
+
private factory;
|
|
15
|
+
constructor(factory: DaffCustomerAddressFactory);
|
|
16
|
+
list(): Observable<DaffCustomerAddress[]>;
|
|
17
|
+
get(addressId: string): Observable<DaffCustomerAddress>;
|
|
18
|
+
update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]>;
|
|
19
|
+
add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]>;
|
|
20
|
+
delete(addressId: string): Observable<DaffCustomerAddress[]>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressTestingDriver, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerAddressTestingDriver>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DaffInheritableError, } from '@daffodil/core';
|
|
2
|
+
export const DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE = 'DAFF_CUSTOMER_ADDRESS_NOT_FOUND';
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that the requested address cannot be found.
|
|
5
|
+
*/
|
|
6
|
+
export class DaffCustomerAddressNotFoundError extends DaffInheritableError {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.message = message;
|
|
10
|
+
this.code = DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy1ub3QtZm91bmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyL2RyaXZlci9zcmMvZXJyb3JzL2FkZHJlc3Mtbm90LWZvdW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxvQkFBb0IsR0FDckIsTUFBTSxnQkFBZ0IsQ0FBQztBQUV4QixNQUFNLENBQUMsTUFBTSwwQ0FBMEMsR0FBRyxpQ0FBaUMsQ0FBQztBQUU1Rjs7R0FFRztBQUNILE1BQU0sT0FBTyxnQ0FBaUMsU0FBUSxvQkFBb0I7SUFHeEUsWUFBbUIsT0FBZTtRQUNoQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFERSxZQUFPLEdBQVAsT0FBTyxDQUFRO1FBRmxCLFNBQUksR0FBVywwQ0FBMEMsQ0FBQztJQUkxRSxDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBEYWZmRXJyb3IsXG4gIERhZmZJbmhlcml0YWJsZUVycm9yLFxufSBmcm9tICdAZGFmZm9kaWwvY29yZSc7XG5cbmV4cG9ydCBjb25zdCBEQUZGX0NVU1RPTUVSX0FERFJFU1NfTk9UX0ZPVU5EX0VSUk9SX0NPREUgPSAnREFGRl9DVVNUT01FUl9BRERSRVNTX05PVF9GT1VORCc7XG5cbi8qKlxuICogQW4gZXJyb3IgaW5kaWNhdGluZyB0aGF0IHRoZSByZXF1ZXN0ZWQgYWRkcmVzcyBjYW5ub3QgYmUgZm91bmQuXG4gKi9cbmV4cG9ydCBjbGFzcyBEYWZmQ3VzdG9tZXJBZGRyZXNzTm90Rm91bmRFcnJvciBleHRlbmRzIERhZmZJbmhlcml0YWJsZUVycm9yIGltcGxlbWVudHMgRGFmZkVycm9yIHtcbiAgcHVibGljIHJlYWRvbmx5IGNvZGU6IHN0cmluZyA9IERBRkZfQ1VTVE9NRVJfQUREUkVTU19OT1RfRk9VTkRfRVJST1JfQ09ERTtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgbWVzc2FnZTogc3RyaW5nKSB7XG4gICAgc3VwZXIobWVzc2FnZSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE } from './address-not-found';
|
|
2
|
+
import { DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE } from './default-billing-address-deletion';
|
|
3
|
+
import { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE } from './default-shipping-address-deletion';
|
|
4
|
+
import { DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE } from './invalid-api-response';
|
|
5
|
+
export const DaffCustomerDriverErrorCodes = {
|
|
6
|
+
ADDRESS_NOT_FOUND: DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,
|
|
7
|
+
DEFAULT_BILLING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,
|
|
8
|
+
DEFAULT_SHIPPING_ADDRESS_DELETION: DAFF_CUSTOMER_DEF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BRkZfQ1VTVE9NRVJfREVGQVVMVF9TSElQUElOR19BRERSRVNTX0RFTEVUSU9OX0VSUk9SX0NPREUgfSBmcm9tICcuL2RlZmF1bHQtc2hpcHBpbmctYWRkcmVzcy1kZWxldGlvbic7XG5pbXBvcnQgeyBEQUZGX0NVU1RPTUVSX0lOVkFMSURfQVBJX1JFU1BPTlNFX0VSUk9SX0NPREUgfSBmcm9tICcuL2ludmFsaWQtYXBpLXJlc3BvbnNlJztcblxuZXhwb3J0IGNvbnN0IERhZmZDdXN0b21lckRyaXZlckVycm9yQ29kZXMgPSB7XG4gIEFERFJFU1NfTk9UX0ZPVU5EOiBEQUZGX0NVU1RPTUVSX0FERFJFU1NfTk9UX0ZPVU5EX0VSUk9SX0NPREUsXG4gIERFRkFVTFRfQklMTElOR19BRERSRVNTX0RFTEVUSU9OOiBEQUZGX0NVU1RPTUVSX0RFRkFVTFRfQklMTElOR19BRERSRVNTX0RFTEVUSU9OX0VSUk9SX0NPREUsXG4gIERFRkFVTFRfU0hJUFBJTkdfQUREUkVTU19ERUxFVElPTjogREFGRl9DVVNUT01FUl9ERUZBVUxUX1NISVBQSU5HX0FERFJFU1NfREVMRVRJT05fRVJST1JfQ09ERSxcbiAgSU5WQUxJRF9BUElfUkVTUE9OU0U6IERBRkZfQ1VTVE9NRVJfSU5WQUxJRF9BUElfUkVTUE9OU0VfRVJST1JfQ09ERSxcbn07XG4iXX0=
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DaffInheritableError, } from '@daffodil/core';
|
|
2
|
+
export const DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION';
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that a deletion of the customer's default billing address was attempted and failed.
|
|
5
|
+
*/
|
|
6
|
+
export class DaffCustomerDefaultBillingAddressDeletionError extends DaffInheritableError {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.message = message;
|
|
10
|
+
this.code = DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1iaWxsaW5nLWFkZHJlc3MtZGVsZXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2N1c3RvbWVyL2RyaXZlci9zcmMvZXJyb3JzL2RlZmF1bHQtYmlsbGluZy1hZGRyZXNzLWRlbGV0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxvQkFBb0IsR0FDckIsTUFBTSxnQkFBZ0IsQ0FBQztBQUV4QixNQUFNLENBQUMsTUFBTSx5REFBeUQsR0FBRyxnREFBZ0QsQ0FBQztBQUUxSDs7R0FFRztBQUNILE1BQU0sT0FBTyw4Q0FBK0MsU0FBUSxvQkFBb0I7SUFHdEYsWUFBbUIsT0FBZTtRQUNoQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFERSxZQUFPLEdBQVAsT0FBTyxDQUFRO1FBRmxCLFNBQUksR0FBVyx5REFBeUQsQ0FBQztJQUl6RixDQUFDO0NBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBEYWZmRXJyb3IsXG4gIERhZmZJbmhlcml0YWJsZUVycm9yLFxufSBmcm9tICdAZGFmZm9kaWwvY29yZSc7XG5cbmV4cG9ydCBjb25zdCBEQUZGX0NVU1RPTUVSX0RFRkFVTFRfQklMTElOR19BRERSRVNTX0RFTEVUSU9OX0VSUk9SX0NPREUgPSAnREFGRl9DVVNUT01FUl9ERUZBVUxUX0JJTExJTkdfQUREUkVTU19ERUxFVElPTic7XG5cbi8qKlxuICogQW4gZXJyb3IgaW5kaWNhdGluZyB0aGF0IGEgZGVsZXRpb24gb2YgdGhlIGN1c3RvbWVyJ3MgZGVmYXVsdCBiaWxsaW5nIGFkZHJlc3Mgd2FzIGF0dGVtcHRlZCBhbmQgZmFpbGVkLlxuICovXG5leHBvcnQgY2xhc3MgRGFmZkN1c3RvbWVyRGVmYXVsdEJpbGxpbmdBZGRyZXNzRGVsZXRpb25FcnJvciBleHRlbmRzIERhZmZJbmhlcml0YWJsZUVycm9yIGltcGxlbWVudHMgRGFmZkVycm9yIHtcbiAgcHVibGljIHJlYWRvbmx5IGNvZGU6IHN0cmluZyA9IERBRkZfQ1VTVE9NRVJfREVGQVVMVF9CSUxMSU5HX0FERFJFU1NfREVMRVRJT05fRVJST1JfQ09ERTtcblxuICBjb25zdHJ1Y3RvcihwdWJsaWMgbWVzc2FnZTogc3RyaW5nKSB7XG4gICAgc3VwZXIobWVzc2FnZSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DaffInheritableError, } from '@daffodil/core';
|
|
2
|
+
export const DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION';
|
|
3
|
+
/**
|
|
4
|
+
* An error indicating that a deletion of the customer's default shipping address was attempted and failed.
|
|
5
|
+
*/
|
|
6
|
+
export class DaffCustomerDefaultShippingAddressDeletionError extends DaffInheritableError {
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.message = message;
|
|
10
|
+
this.code = DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1zaGlwcGluZy1hZGRyZXNzLWRlbGV0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4v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RGFmZkVycm9yIHtcbiAgcHVibGljIHJlYWRvbmx5IGNvZGU6IHN0cmluZyA9IERBRkZfQ1VTVE9NRVJfREVGQVVMVF9TSElQUElOR19BRERSRVNTX0RFTEVUSU9OX0VSUk9SX0NPREU7XG5cbiAgY29uc3RydWN0b3IocHVibGljIG1lc3NhZ2U6IHN0cmluZykge1xuICAgIHN1cGVyKG1lc3NhZ2UpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE, DaffCustomerAddressNotFoundError, } from './address-not-found';
|
|
2
|
+
import { DaffCustomerDefaultBillingAddressDeletionError, DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE, } from './default-billing-address-deletion';
|
|
3
|
+
import { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE, DaffCustomerDefaultShippingAddressDeletionError, } from './default-shipping-address-deletion';
|
|
1
4
|
import { DaffCustomerInvalidAPIResponseError, DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE, } from './invalid-api-response';
|
|
2
5
|
/**
|
|
3
6
|
* A mapping from error codes to error class constructors.
|
|
4
7
|
*/
|
|
5
8
|
export const DaffCustomerDriverErrorMap = {
|
|
6
9
|
[DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,
|
|
10
|
+
[DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE]: DaffCustomerAddressNotFoundError,
|
|
11
|
+
[DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultBillingAddressDeletionError,
|
|
12
|
+
[DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultShippingAddressDeletionError,
|
|
7
13
|
};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base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LFxuICBbREFGRl9DVVNUT01FUl9ERUZBVUxUX1NISVBQSU5HX0FERFJFU1NfREVMRVRJT05fRVJST1JfQ09ERV06IERhZmZDdXN0b21lckRlZmF1bHRTaGlwcGluZ0FkZHJlc3NEZWxldGlvbkVycm9yLFxufTtcbiJdfQ==
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { DaffCustomerInvalidAPIResponseError, DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE, } from './invalid-api-response';
|
|
2
|
+
export { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE, DaffCustomerAddressNotFoundError, } from './address-not-found';
|
|
3
|
+
export { DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE, DaffCustomerDefaultBillingAddressDeletionError, } from './default-billing-address-deletion';
|
|
4
|
+
export { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE, DaffCustomerDefaultShippingAddressDeletionError, } from './default-shipping-address-deletion';
|
|
2
5
|
export { DaffCustomerDriverErrorMap } from './map';
|
|
3
|
-
|
|
6
|
+
export { DaffCustomerDriverErrorCodes } from './codes';
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY3VzdG9tZXIvZHJpdmVyL3NyYy9lcnJvcnMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsbUNBQW1DLEVBQ25DLDZDQUE2QyxHQUM5QyxNQUFNLHdCQUF3QixDQUFDO0FBQ2hDLE9BQU8sRUFDTCwwQ0FBMEMsRUFDMUMsZ0NBQWdDLEdBQ2pDLE1BQU0scUJBQXFCLENBQUM7QUFDN0IsT0FBTyxFQUNMLHlEQUF5RCxFQUN6RC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