@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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as i1 from 'apollo-angular';
|
|
2
2
|
import { gql } from 'apollo-angular';
|
|
3
|
-
import { DaffCustomerInvalidAPIResponseError, DaffCustomerDriver } from '@daffodil/customer/driver';
|
|
3
|
+
import { DaffCustomerDriverErrorCodes, DaffCustomerDriverErrorMap, DaffCustomerInvalidAPIResponseError, DaffCustomerAddressNotFoundError, DaffCustomerDriver, DaffCustomerAddressDriver } from '@daffodil/customer/driver';
|
|
4
4
|
import { daffTransformMagentoError, DAFF_MAGENTO_CACHEABLE_OPERATIONS } from '@daffodil/driver/magento';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { Injectable, NgModule } from '@angular/core';
|
|
7
7
|
import { throwError } from 'rxjs';
|
|
8
|
-
import { map, catchError } from 'rxjs/operators';
|
|
8
|
+
import { map, catchError, switchMap } from 'rxjs/operators';
|
|
9
9
|
import { CommonModule } from '@angular/common';
|
|
10
|
+
import * as i2 from '@daffodil/core/graphql';
|
|
10
11
|
|
|
11
12
|
const magentoCustomerInputTransform = (customer) => ({
|
|
12
13
|
firstname: customer.firstName,
|
|
@@ -14,11 +15,34 @@ const magentoCustomerInputTransform = (customer) => ({
|
|
|
14
15
|
is_subscribed: customer.isSubscribed,
|
|
15
16
|
});
|
|
16
17
|
|
|
18
|
+
const magentoCustomerAddressInputTransform = (address) => ({
|
|
19
|
+
city: address.city,
|
|
20
|
+
country_code: address.country,
|
|
21
|
+
country_id: address.country,
|
|
22
|
+
default_billing: address.defaultBilling,
|
|
23
|
+
default_shipping: address.defaultShipping,
|
|
24
|
+
firstname: address.firstname,
|
|
25
|
+
lastname: address.lastname,
|
|
26
|
+
middlename: address.middlename,
|
|
27
|
+
postcode: address.postcode,
|
|
28
|
+
prefix: address.prefix,
|
|
29
|
+
region: {
|
|
30
|
+
region_id: Number(address.region),
|
|
31
|
+
},
|
|
32
|
+
street: [
|
|
33
|
+
address.street,
|
|
34
|
+
...(address.street2 ? [address.street2] : []),
|
|
35
|
+
],
|
|
36
|
+
suffix: address.suffix,
|
|
37
|
+
telephone: address.telephone,
|
|
38
|
+
});
|
|
39
|
+
|
|
17
40
|
const magentoCustomerAddressTransform = (address) => ({
|
|
18
|
-
id: address.id,
|
|
41
|
+
id: String(address.id),
|
|
19
42
|
street: address.street[0],
|
|
20
43
|
city: address.city,
|
|
21
|
-
region: address.region.
|
|
44
|
+
region: String(address.region.region_id),
|
|
45
|
+
region_code: address.region.region_code,
|
|
22
46
|
country: address.country_code,
|
|
23
47
|
country_id: address.country_code,
|
|
24
48
|
postcode: address.postcode,
|
|
@@ -26,6 +50,8 @@ const magentoCustomerAddressTransform = (address) => ({
|
|
|
26
50
|
lastname: address.lastname,
|
|
27
51
|
telephone: address.telephone,
|
|
28
52
|
email: address.email,
|
|
53
|
+
defaultBilling: address.default_billing,
|
|
54
|
+
defaultShipping: address.default_shipping,
|
|
29
55
|
});
|
|
30
56
|
|
|
31
57
|
const magentoCustomerTransform = (customer) => ({
|
|
@@ -53,11 +79,13 @@ const magentoCustomerAddressFragment = gql `
|
|
|
53
79
|
postcode
|
|
54
80
|
region {
|
|
55
81
|
region_code
|
|
56
|
-
|
|
82
|
+
region_id
|
|
57
83
|
}
|
|
58
84
|
street
|
|
59
85
|
telephone
|
|
60
86
|
company
|
|
87
|
+
default_billing
|
|
88
|
+
default_shipping
|
|
61
89
|
}
|
|
62
90
|
`;
|
|
63
91
|
|
|
@@ -84,6 +112,42 @@ const getCustomer = gql `
|
|
|
84
112
|
${magentoCustomerFragment}
|
|
85
113
|
`;
|
|
86
114
|
|
|
115
|
+
const MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME = 'MagentoGetCustomerAddresses';
|
|
116
|
+
const getCustomerAddresses = gql `
|
|
117
|
+
query ${MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME} {
|
|
118
|
+
customer {
|
|
119
|
+
addresses {
|
|
120
|
+
...magentoCustomerAddress
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
${magentoCustomerAddressFragment}
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
const createCustomerAddress = gql `
|
|
128
|
+
mutation MagentoCreateCustomerAddress($input: CustomerAddressInput!) {
|
|
129
|
+
createCustomerAddress(input: $input) {
|
|
130
|
+
...magentoCustomerAddress
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
${magentoCustomerAddressFragment}
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
const updateCustomerAddress = gql `
|
|
137
|
+
mutation MagentoUpdateCustomerAddress($id: Int!, $input: CustomerAddressInput!) {
|
|
138
|
+
updateCustomerAddress(id: $id, input: $input) {
|
|
139
|
+
...magentoCustomerAddress
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
${magentoCustomerAddressFragment}
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
const deleteCustomerAddress = gql `
|
|
146
|
+
mutation MagentoDeleteCustomerAddress($id: Int!) {
|
|
147
|
+
deleteCustomerAddress(id: $id)
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
|
|
87
151
|
const MAGENTO_UPDATE_CUSTOMER_QUERY_NAME = 'MagentoUpdateCustomer';
|
|
88
152
|
const updateCustomer = gql `
|
|
89
153
|
mutation ${MAGENTO_UPDATE_CUSTOMER_QUERY_NAME}($customer: CustomerUpdateInput!) {
|
|
@@ -120,8 +184,36 @@ const changePassword = gql `
|
|
|
120
184
|
}
|
|
121
185
|
`;
|
|
122
186
|
|
|
123
|
-
|
|
124
|
-
|
|
187
|
+
const DaffCustomerMagentoErrorMessageRegexMap = {
|
|
188
|
+
[DaffCustomerDriverErrorCodes.DEFAULT_SHIPPING_ADDRESS_DELETION]: /is set as default shipping address and can not be deleted/,
|
|
189
|
+
[DaffCustomerDriverErrorCodes.DEFAULT_BILLING_ADDRESS_DELETION]: /is set as default billing address and can not be deleted/,
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Transforms a single GraphQL error.
|
|
194
|
+
* Optionally accepts a request payload which can be used in certain cases
|
|
195
|
+
* to add supplemental info to the error.
|
|
196
|
+
*/
|
|
197
|
+
function transformMagentoCartGraphQlError(error, requestPayload) {
|
|
198
|
+
// TODO: readdress this when we move to eslint
|
|
199
|
+
// eslint-disable-next-line
|
|
200
|
+
for (const code in DaffCustomerMagentoErrorMessageRegexMap) {
|
|
201
|
+
const matchIndex = error.message.search(DaffCustomerMagentoErrorMessageRegexMap[code]);
|
|
202
|
+
if (matchIndex > -1 && DaffCustomerDriverErrorMap[code]) {
|
|
203
|
+
const errObj = new DaffCustomerDriverErrorMap[code](error.message);
|
|
204
|
+
return errObj;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return daffTransformMagentoError(error, {});
|
|
208
|
+
}
|
|
209
|
+
;
|
|
210
|
+
function transformMagentoReviewsError(error, requestPayload) {
|
|
211
|
+
if (error.graphQLErrors?.length) {
|
|
212
|
+
return transformMagentoCartGraphQlError(error.graphQLErrors[0], requestPayload);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
return daffTransformMagentoError(error, {}) || new DaffCustomerInvalidAPIResponseError(error.message);
|
|
216
|
+
}
|
|
125
217
|
}
|
|
126
218
|
|
|
127
219
|
const validateGetCustomerResponse = (response) => {
|
|
@@ -151,6 +243,42 @@ const validateChangePasswordResponse = (response) => {
|
|
|
151
243
|
}
|
|
152
244
|
};
|
|
153
245
|
|
|
246
|
+
const validateGetCustomerAddressesResponse = (response) => {
|
|
247
|
+
if (response.data.customer?.addresses) {
|
|
248
|
+
return response;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
throw new DaffCustomerInvalidAPIResponseError('Get customer address response does not contain addresses.');
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const validateCreateCustomerAddressResponse = (response) => {
|
|
256
|
+
if (response.data.createCustomerAddress?.id) {
|
|
257
|
+
return response;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
throw new DaffCustomerInvalidAPIResponseError('Create customer address response does not contain an address.');
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const validateUpdateCustomerAddressResponse = (response) => {
|
|
265
|
+
if (response.data.updateCustomerAddress?.id) {
|
|
266
|
+
return response;
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
throw new DaffCustomerInvalidAPIResponseError('Update customer address response does not contain an address.');
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const validateDeleteCustomerAddressResponse = (response) => {
|
|
274
|
+
if (response.data.deleteCustomerAddress) {
|
|
275
|
+
return response;
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
throw new DaffCustomerInvalidAPIResponseError('Delete customer address did not complete successfully.');
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
|
|
154
282
|
const validateUpdateCustomerResponse = (response) => {
|
|
155
283
|
if (response.data.updateCustomerV2.customer?.email) {
|
|
156
284
|
return response;
|
|
@@ -210,6 +338,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
210
338
|
}]
|
|
211
339
|
}], ctorParameters: function () { return [{ type: i1.Apollo }]; } });
|
|
212
340
|
|
|
341
|
+
/**
|
|
342
|
+
* A service for making Magento GraphQL queries for customers.
|
|
343
|
+
*
|
|
344
|
+
* @inheritdoc
|
|
345
|
+
*/
|
|
346
|
+
class DaffCustomerMagentoAddressService {
|
|
347
|
+
constructor(apollo, mutationQueue) {
|
|
348
|
+
this.apollo = apollo;
|
|
349
|
+
this.mutationQueue = mutationQueue;
|
|
350
|
+
}
|
|
351
|
+
add(address) {
|
|
352
|
+
return this.mutationQueue.mutate({
|
|
353
|
+
mutation: createCustomerAddress,
|
|
354
|
+
variables: {
|
|
355
|
+
input: magentoCustomerAddressInputTransform(address),
|
|
356
|
+
},
|
|
357
|
+
refetchQueries: [{
|
|
358
|
+
query: getCustomerAddresses,
|
|
359
|
+
}],
|
|
360
|
+
onQueryUpdated: () => true,
|
|
361
|
+
}).pipe(map(validateCreateCustomerAddressResponse),
|
|
362
|
+
// magento doesn't return address collection so make an additional request >:(
|
|
363
|
+
switchMap(() => this.listAddresses()), map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
364
|
+
}
|
|
365
|
+
delete(addressId) {
|
|
366
|
+
return this.mutationQueue.mutate({
|
|
367
|
+
mutation: deleteCustomerAddress,
|
|
368
|
+
variables: {
|
|
369
|
+
id: Number(addressId),
|
|
370
|
+
},
|
|
371
|
+
refetchQueries: [{
|
|
372
|
+
query: getCustomerAddresses,
|
|
373
|
+
}],
|
|
374
|
+
onQueryUpdated: (query) => true,
|
|
375
|
+
}).pipe(map(validateDeleteCustomerAddressResponse),
|
|
376
|
+
// magento doesn't return address collection so make an additional request >:(
|
|
377
|
+
switchMap(() => this.listAddresses()), map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
378
|
+
}
|
|
379
|
+
list() {
|
|
380
|
+
return this.listAddresses().pipe(map((response) => response.data.customer.addresses.map(magentoCustomerAddressTransform)), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
381
|
+
}
|
|
382
|
+
get(addressId) {
|
|
383
|
+
return this.listAddresses().pipe(map(({ data }) => {
|
|
384
|
+
const address = data.customer.addresses.find(({ id }) => String(id) === addressId);
|
|
385
|
+
if (!address) {
|
|
386
|
+
throw new DaffCustomerAddressNotFoundError(`Could not find an address with ID: ${addressId}`);
|
|
387
|
+
}
|
|
388
|
+
return address;
|
|
389
|
+
}), map(address => magentoCustomerAddressTransform(address)), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
390
|
+
}
|
|
391
|
+
update(address) {
|
|
392
|
+
return this.mutationQueue.mutate({
|
|
393
|
+
mutation: updateCustomerAddress,
|
|
394
|
+
variables: {
|
|
395
|
+
id: Number(address.id),
|
|
396
|
+
input: magentoCustomerAddressInputTransform(address),
|
|
397
|
+
},
|
|
398
|
+
refetchQueries: [{
|
|
399
|
+
query: getCustomerAddresses,
|
|
400
|
+
}],
|
|
401
|
+
onQueryUpdated: (query) => true,
|
|
402
|
+
}).pipe(map(validateUpdateCustomerAddressResponse), switchMap(() => this.listAddresses()), map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
403
|
+
}
|
|
404
|
+
listAddresses() {
|
|
405
|
+
return this.apollo.query({
|
|
406
|
+
query: getCustomerAddresses,
|
|
407
|
+
}).pipe(map(validateGetCustomerAddressesResponse), catchError(err => throwError(() => transformMagentoReviewsError(err))));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/** @nocollapse */ DaffCustomerMagentoAddressService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerMagentoAddressService, deps: [{ token: i1.Apollo }, { token: i2.DaffQueuedApollo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
411
|
+
/** @nocollapse */ DaffCustomerMagentoAddressService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerMagentoAddressService, providedIn: 'root' });
|
|
412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerMagentoAddressService, decorators: [{
|
|
413
|
+
type: Injectable,
|
|
414
|
+
args: [{
|
|
415
|
+
providedIn: 'root',
|
|
416
|
+
}]
|
|
417
|
+
}], ctorParameters: function () { return [{ type: i1.Apollo }, { type: i2.DaffQueuedApollo }]; } });
|
|
418
|
+
|
|
213
419
|
class DaffCustomerMagentoDriverModule {
|
|
214
420
|
static forRoot() {
|
|
215
421
|
return {
|
|
@@ -219,11 +425,20 @@ class DaffCustomerMagentoDriverModule {
|
|
|
219
425
|
provide: DaffCustomerDriver,
|
|
220
426
|
useExisting: DaffCustomerMagentoService,
|
|
221
427
|
},
|
|
428
|
+
{
|
|
429
|
+
provide: DaffCustomerAddressDriver,
|
|
430
|
+
useExisting: DaffCustomerMagentoAddressService,
|
|
431
|
+
},
|
|
222
432
|
{
|
|
223
433
|
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
224
434
|
useValue: MAGENTO_GET_CUSTOMER_QUERY_NAME,
|
|
225
435
|
multi: true,
|
|
226
436
|
},
|
|
437
|
+
{
|
|
438
|
+
provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,
|
|
439
|
+
useValue: MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME,
|
|
440
|
+
multi: true,
|
|
441
|
+
},
|
|
227
442
|
],
|
|
228
443
|
};
|
|
229
444
|
}
|
|
@@ -246,5 +461,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
246
461
|
* Generated bundle index. Do not edit.
|
|
247
462
|
*/
|
|
248
463
|
|
|
249
|
-
export { DaffCustomerMagentoDriverModule, DaffCustomerMagentoService, MAGENTO_CHANGE_PASSWORD_QUERY_NAME, MAGENTO_GET_CUSTOMER_QUERY_NAME, MAGENTO_UPDATE_CUSTOMER_QUERY_NAME, MAGENTO_UPDATE_EMAIL_QUERY_NAME, MagentoCustomerGender, changePassword, getCustomer, magentoCustomerAddressFragment, magentoCustomerAddressTransform, magentoCustomerFragment, magentoCustomerInputTransform, magentoCustomerTransform, transformMagentoReviewsError, updateCustomer, updateEmail, validateGetCustomerResponse };
|
|
464
|
+
export { DaffCustomerMagentoDriverModule, DaffCustomerMagentoService, MAGENTO_CHANGE_PASSWORD_QUERY_NAME, MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME, MAGENTO_GET_CUSTOMER_QUERY_NAME, MAGENTO_UPDATE_CUSTOMER_QUERY_NAME, MAGENTO_UPDATE_EMAIL_QUERY_NAME, MagentoCustomerGender, changePassword, createCustomerAddress, deleteCustomerAddress, getCustomer, getCustomerAddresses, magentoCustomerAddressFragment, magentoCustomerAddressInputTransform, magentoCustomerAddressTransform, magentoCustomerFragment, magentoCustomerInputTransform, magentoCustomerTransform, transformMagentoReviewsError, updateCustomer, updateCustomerAddress, updateEmail, validateChangeEmailResponse, validateChangePasswordResponse, validateCreateCustomerAddressResponse, validateDeleteCustomerAddressResponse, validateGetCustomerAddressesResponse, validateGetCustomerResponse, validateUpdateCustomerAddressResponse, validateUpdateCustomerResponse };
|
|
250
465
|
//# sourceMappingURL=daffodil-customer-driver-magento.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-driver-magento.mjs","sources":["../../../libs/customer/driver/magento/src/transforms/requests/customer-input.ts","../../../libs/customer/driver/magento/src/transforms/responses/customer-address.ts","../../../libs/customer/driver/magento/src/transforms/responses/customer.ts","../../../libs/customer/driver/magento/src/models/gender.enum.ts","../../../libs/customer/driver/magento/src/queries/fragments/customer-address.ts","../../../libs/customer/driver/magento/src/queries/fragments/customer.ts","../../../libs/customer/driver/magento/src/queries/get-customer.ts","../../../libs/customer/driver/magento/src/queries/update-customer.ts","../../../libs/customer/driver/magento/src/queries/update-email.ts","../../../libs/customer/driver/magento/src/queries/change-password.ts","../../../libs/customer/driver/magento/src/errors/transform.ts","../../../libs/customer/driver/magento/src/validators/get-customer.ts","../../../libs/customer/driver/magento/src/validators/change-email.ts","../../../libs/customer/driver/magento/src/validators/change-password.ts","../../../libs/customer/driver/magento/src/validators/update-customer.ts","../../../libs/customer/driver/magento/src/customer.service.ts","../../../libs/customer/driver/magento/src/customer-driver.module.ts","../../../libs/customer/driver/magento/src/daffodil-customer-driver-magento.ts"],"sourcesContent":["import { DaffCustomer } from '@daffodil/customer';\n\nimport { MagentoCustomerInput } from '../../models/public_api';\n\nexport const magentoCustomerInputTransform = (customer: Partial<DaffCustomer>): MagentoCustomerInput => ({\n firstname: customer.firstName,\n lastname: customer.lastName,\n is_subscribed: customer.isSubscribed,\n});\n","import { DaffCustomerAddress } from '@daffodil/customer';\n\nimport { MagentoCustomerAddress } from '../../models/public_api';\n\nexport const magentoCustomerAddressTransform = (address: MagentoCustomerAddress): DaffCustomerAddress => ({\n id: address.id,\n street: address.street[0],\n city: address.city,\n region: address.region.region_code,\n country: address.country_code,\n country_id: address.country_code,\n postcode: address.postcode,\n firstname: address.firstname,\n lastname: address.lastname,\n telephone: address.telephone,\n email: address.email,\n});\n","import { DaffCustomer } from '@daffodil/customer';\n\nimport { MagentoCustomer } from '../../models/public_api';\nimport { magentoCustomerAddressTransform } from './customer-address';\n\nexport const magentoCustomerTransform = (customer: MagentoCustomer): DaffCustomer => ({\n id: customer.email,\n email: customer.email,\n firstName: customer.firstname,\n lastName: customer.lastname,\n isSubscribed: customer.is_subscribed,\n addresses: customer.addresses.map(magentoCustomerAddressTransform),\n});\n","export enum MagentoCustomerGender {\n MALE = 1,\n FEMALE = 2\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoCustomerAddressFragment = gql`\n fragment magentoCustomerAddress on CustomerAddress {\n id\n city\n country_code\n firstname\n lastname\n postcode\n region {\n region_code\n region\n }\n street\n telephone\n company\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerAddressFragment } from './customer-address';\n\nexport const magentoCustomerFragment = gql`\n fragment magentoCustomer on Customer {\n email\n firstname\n lastname\n is_subscribed\n addresses {\n ...magentoCustomerAddress\n }\n }\n ${magentoCustomerAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_CUSTOMER_QUERY_NAME = 'MagentoGetCustomer';\n\nexport const getCustomer = gql`\n query ${MAGENTO_GET_CUSTOMER_QUERY_NAME} {\n customer {\n ...magentoCustomer\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_UPDATE_CUSTOMER_QUERY_NAME = 'MagentoUpdateCustomer';\n\nexport const updateCustomer = gql`\n mutation ${MAGENTO_UPDATE_CUSTOMER_QUERY_NAME}($customer: CustomerUpdateInput!) {\n updateCustomerV2(input: $customer) {\n customer {\n ...magentoCustomer\n }\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_UPDATE_EMAIL_QUERY_NAME = 'MagentoUpdateEmail';\n\nexport const updateEmail = gql`\n mutation ${MAGENTO_UPDATE_EMAIL_QUERY_NAME}($email: String!, $password: String!) {\n updateCustomerEmail(email: $email, password: $password) {\n customer {\n ...magentoCustomer\n }\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nexport const MAGENTO_CHANGE_PASSWORD_QUERY_NAME = 'MagentoChangePassword';\n\nexport const changePassword = gql`\n mutation ${MAGENTO_CHANGE_PASSWORD_QUERY_NAME}($old: String!, $new: String!) {\n changeCustomerPassword(\n currentPassword: $old\n newPassword: $new\n ) {\n email\n }\n }\n`;\n","import { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nexport function transformMagentoReviewsError(error: any) {\n return daffTransformMagentoError(error, {}) || new DaffCustomerInvalidAPIResponseError(error.message);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoGetCustomerResponse } from '../models/public_api';\n\nexport const validateGetCustomerResponse = (response: ApolloQueryResult<MagentoGetCustomerResponse>) => {\n if (response.data.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Get customer response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoChangeEmailResponse } from '../models/public_api';\n\nexport const validateChangeEmailResponse = (response: ApolloQueryResult<MagentoChangeEmailResponse>) => {\n if (response.data.updateCustomerEmail.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Update email response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoChangePasswordResponse } from '../models/public_api';\n\nexport const validateChangePasswordResponse = (response: ApolloQueryResult<MagentoChangePasswordResponse>) => {\n if (response.data.changeCustomerPassword?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Change password response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoUpdateCustomerResponse } from '../models/public_api';\n\nexport const validateUpdateCustomerResponse = (response: ApolloQueryResult<MagentoUpdateCustomerResponse>) => {\n if (response.data.updateCustomerV2.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Update customer response does not contain a valid customer.');\n }\n};\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerDriverInterface } from '@daffodil/customer/driver';\n\nimport { transformMagentoReviewsError } from './errors/transform';\nimport {\n MagentoChangeEmailResponse,\n MagentoChangePasswordResponse,\n MagentoGetCustomerResponse,\n MagentoUpdateCustomerResponse,\n} from './models/public_api';\nimport {\n changePassword,\n getCustomer,\n updateCustomer,\n updateEmail,\n} from './queries/public_api';\nimport {\n magentoCustomerInputTransform,\n magentoCustomerTransform,\n} from './transforms/public_api';\nimport { validateChangeEmailResponse } from './validators/change-email';\nimport { validateChangePasswordResponse } from './validators/change-password';\nimport { validateGetCustomerResponse } from './validators/public_api';\nimport { validateUpdateCustomerResponse } from './validators/update-customer';\n\n/**\n * A service for making Magento GraphQL queries for customers.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerMagentoService implements DaffCustomerDriverInterface {\n constructor(\n private apollo: Apollo,\n ) {}\n\n changeEmail(email: string, password: string): Observable<DaffCustomer> {\n return this.apollo.mutate<MagentoChangeEmailResponse>({\n mutation: updateEmail,\n variables: {\n email,\n password,\n },\n }).pipe(\n map(validateChangeEmailResponse),\n map(result => magentoCustomerTransform(result.data.updateCustomerEmail.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n changePassword(oldPassword: string, newPassword: string): Observable<void> {\n return this.apollo.mutate<MagentoChangePasswordResponse>({\n mutation: changePassword,\n variables: {\n old: oldPassword,\n new: newPassword,\n },\n }).pipe(\n map(validateChangePasswordResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n get(): Observable<DaffCustomer> {\n return this.apollo.query<MagentoGetCustomerResponse>({\n query: getCustomer,\n }).pipe(\n map(validateGetCustomerResponse),\n map(result => magentoCustomerTransform(result.data.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n update(customer: Partial<DaffCustomer>): Observable<DaffCustomer> {\n return this.apollo.mutate<MagentoUpdateCustomerResponse>({\n mutation: updateCustomer,\n variables: {\n customer: magentoCustomerInputTransform(customer),\n },\n }).pipe(\n map(validateUpdateCustomerResponse),\n map(result => magentoCustomerTransform(result.data.updateCustomerV2.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffCustomerDriver } from '@daffodil/customer/driver';\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from '@daffodil/driver/magento';\n\nimport { DaffCustomerMagentoService } from './customer.service';\nimport { MAGENTO_GET_CUSTOMER_QUERY_NAME } from './queries/public_api';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerMagentoDriverModule> {\n return {\n ngModule: DaffCustomerMagentoDriverModule,\n providers: [\n {\n provide: DaffCustomerDriver,\n useExisting: DaffCustomerMagentoService,\n },\n {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: MAGENTO_GET_CUSTOMER_QUERY_NAME,\n multi: true,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAIa,6BAA6B,GAAG,CAAC,QAA+B,MAA4B;IACvG,SAAS,EAAE,QAAQ,CAAC,SAAS;IAC7B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,aAAa,EAAE,QAAQ,CAAC,YAAY;AACrC,CAAA;;MCJY,+BAA+B,GAAG,CAAC,OAA+B,MAA2B;IACxG,EAAE,EAAE,OAAO,CAAC,EAAE;AACd,IAAA,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC,IAAI;AAClB,IAAA,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW;IAClC,OAAO,EAAE,OAAO,CAAC,YAAY;IAC7B,UAAU,EAAE,OAAO,CAAC,YAAY;IAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;AACrB,CAAA;;MCXY,wBAAwB,GAAG,CAAC,QAAyB,MAAoB;IACpF,EAAE,EAAE,QAAQ,CAAC,KAAK;IAClB,KAAK,EAAE,QAAQ,CAAC,KAAK;IACrB,SAAS,EAAE,QAAQ,CAAC,SAAS;IAC7B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,YAAY,EAAE,QAAQ,CAAC,aAAa;IACpC,SAAS,EAA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,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA/B,mBAAA,+BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAHxC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,mBAAA,+BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAJjC,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAL3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-customer-driver-magento.mjs","sources":["../../../libs/customer/driver/magento/src/transforms/requests/customer-input.ts","../../../libs/customer/driver/magento/src/transforms/requests/address-input.ts","../../../libs/customer/driver/magento/src/transforms/responses/customer-address.ts","../../../libs/customer/driver/magento/src/transforms/responses/customer.ts","../../../libs/customer/driver/magento/src/models/gender.enum.ts","../../../libs/customer/driver/magento/src/queries/fragments/customer-address.ts","../../../libs/customer/driver/magento/src/queries/fragments/customer.ts","../../../libs/customer/driver/magento/src/queries/get-customer.ts","../../../libs/customer/driver/magento/src/queries/get-customer-addresses.ts","../../../libs/customer/driver/magento/src/queries/create-customer-address.ts","../../../libs/customer/driver/magento/src/queries/update-customer-address.ts","../../../libs/customer/driver/magento/src/queries/delete-customer-address.ts","../../../libs/customer/driver/magento/src/queries/update-customer.ts","../../../libs/customer/driver/magento/src/queries/update-email.ts","../../../libs/customer/driver/magento/src/queries/change-password.ts","../../../libs/customer/driver/magento/src/errors/map.ts","../../../libs/customer/driver/magento/src/errors/transform.ts","../../../libs/customer/driver/magento/src/validators/get-customer.ts","../../../libs/customer/driver/magento/src/validators/change-email.ts","../../../libs/customer/driver/magento/src/validators/change-password.ts","../../../libs/customer/driver/magento/src/validators/get-customer-addresses.ts","../../../libs/customer/driver/magento/src/validators/create-customer-address.ts","../../../libs/customer/driver/magento/src/validators/update-customer-address.ts","../../../libs/customer/driver/magento/src/validators/delete-customer-address.ts","../../../libs/customer/driver/magento/src/validators/update-customer.ts","../../../libs/customer/driver/magento/src/customer.service.ts","../../../libs/customer/driver/magento/src/address.service.ts","../../../libs/customer/driver/magento/src/customer-driver.module.ts","../../../libs/customer/driver/magento/src/daffodil-customer-driver-magento.ts"],"sourcesContent":["import { DaffCustomer } from '@daffodil/customer';\n\nimport { MagentoCustomerInput } from '../../models/public_api';\n\nexport const magentoCustomerInputTransform = (customer: Partial<DaffCustomer>): MagentoCustomerInput => ({\n firstname: customer.firstName,\n lastname: customer.lastName,\n is_subscribed: customer.isSubscribed,\n});\n","import { DaffCustomerAddress } from '@daffodil/customer';\n\nimport { MagentoCustomerAddressInput } from '../../models/public_api';\n\nexport const magentoCustomerAddressInputTransform = (address: Partial<DaffCustomerAddress>): MagentoCustomerAddressInput => ({\n city: address.city,\n country_code: address.country,\n country_id: address.country,\n default_billing: address.defaultBilling,\n default_shipping: address.defaultShipping,\n firstname: address.firstname,\n lastname: address.lastname,\n middlename: address.middlename,\n postcode: address.postcode,\n prefix: address.prefix,\n region: {\n region_id: Number(address.region),\n },\n street: [\n address.street,\n ...(address.street2 ? [address.street2] : []),\n ],\n suffix: address.suffix,\n telephone: address.telephone,\n});\n","import { DaffCustomerAddress } from '@daffodil/customer';\n\nimport { MagentoCustomerAddress } from '../../models/public_api';\n\nexport const magentoCustomerAddressTransform = (address: MagentoCustomerAddress): DaffCustomerAddress => ({\n id: String(address.id),\n street: address.street[0],\n city: address.city,\n region: String(address.region.region_id),\n region_code: address.region.region_code,\n country: address.country_code,\n country_id: address.country_code,\n postcode: address.postcode,\n firstname: address.firstname,\n lastname: address.lastname,\n telephone: address.telephone,\n email: address.email,\n defaultBilling: address.default_billing,\n defaultShipping: address.default_shipping,\n});\n","import { DaffCustomer } from '@daffodil/customer';\n\nimport { MagentoCustomer } from '../../models/public_api';\nimport { magentoCustomerAddressTransform } from './customer-address';\n\nexport const magentoCustomerTransform = (customer: MagentoCustomer): DaffCustomer => ({\n id: customer.email,\n email: customer.email,\n firstName: customer.firstname,\n lastName: customer.lastname,\n isSubscribed: customer.is_subscribed,\n addresses: customer.addresses.map(magentoCustomerAddressTransform),\n});\n","export enum MagentoCustomerGender {\n MALE = 1,\n FEMALE = 2\n}\n","import { gql } from 'apollo-angular';\n\nexport const magentoCustomerAddressFragment = gql`\n fragment magentoCustomerAddress on CustomerAddress {\n id\n city\n country_code\n firstname\n lastname\n postcode\n region {\n region_code\n region_id\n }\n street\n telephone\n company\n default_billing\n default_shipping\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerAddressFragment } from './customer-address';\n\nexport const magentoCustomerFragment = gql`\n fragment magentoCustomer on Customer {\n email\n firstname\n lastname\n is_subscribed\n addresses {\n ...magentoCustomerAddress\n }\n }\n ${magentoCustomerAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_CUSTOMER_QUERY_NAME = 'MagentoGetCustomer';\n\nexport const getCustomer = gql`\n query ${MAGENTO_GET_CUSTOMER_QUERY_NAME} {\n customer {\n ...magentoCustomer\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerAddressFragment } from './fragments/public_api';\n\nexport const MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME = 'MagentoGetCustomerAddresses';\n\nexport const getCustomerAddresses = gql`\n query ${MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME} {\n customer {\n addresses {\n ...magentoCustomerAddress\n }\n }\n }\n ${magentoCustomerAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerAddressFragment } from './fragments/public_api';\n\nexport const createCustomerAddress = gql`\n mutation MagentoCreateCustomerAddress($input: CustomerAddressInput!) {\n createCustomerAddress(input: $input) {\n ...magentoCustomerAddress\n }\n }\n ${magentoCustomerAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerAddressFragment } from './fragments/public_api';\n\nexport const updateCustomerAddress = gql`\n mutation MagentoUpdateCustomerAddress($id: Int!, $input: CustomerAddressInput!) {\n updateCustomerAddress(id: $id, input: $input) {\n ...magentoCustomerAddress\n }\n }\n ${magentoCustomerAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nexport const deleteCustomerAddress = gql`\n mutation MagentoDeleteCustomerAddress($id: Int!) {\n deleteCustomerAddress(id: $id)\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_UPDATE_CUSTOMER_QUERY_NAME = 'MagentoUpdateCustomer';\n\nexport const updateCustomer = gql`\n mutation ${MAGENTO_UPDATE_CUSTOMER_QUERY_NAME}($customer: CustomerUpdateInput!) {\n updateCustomerV2(input: $customer) {\n customer {\n ...magentoCustomer\n }\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { magentoCustomerFragment } from './fragments/public_api';\n\nexport const MAGENTO_UPDATE_EMAIL_QUERY_NAME = 'MagentoUpdateEmail';\n\nexport const updateEmail = gql`\n mutation ${MAGENTO_UPDATE_EMAIL_QUERY_NAME}($email: String!, $password: String!) {\n updateCustomerEmail(email: $email, password: $password) {\n customer {\n ...magentoCustomer\n }\n }\n }\n ${magentoCustomerFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nexport const MAGENTO_CHANGE_PASSWORD_QUERY_NAME = 'MagentoChangePassword';\n\nexport const changePassword = gql`\n mutation ${MAGENTO_CHANGE_PASSWORD_QUERY_NAME}($old: String!, $new: String!) {\n changeCustomerPassword(\n currentPassword: $old\n newPassword: $new\n ) {\n email\n }\n }\n`;\n","import { DaffCustomerDriverErrorCodes } from '@daffodil/customer/driver';\n\nexport const DaffCustomerMagentoErrorMessageRegexMap = {\n [DaffCustomerDriverErrorCodes.DEFAULT_SHIPPING_ADDRESS_DELETION]: /is set as default shipping address and can not be deleted/,\n [DaffCustomerDriverErrorCodes.DEFAULT_BILLING_ADDRESS_DELETION]: /is set as default billing address and can not be deleted/,\n};\n","import { ApolloError } from '@apollo/client/core';\nimport { GraphQLError } from 'graphql';\n\nimport { DaffError } from '@daffodil/core';\nimport {\n DaffCustomerDriverErrorMap,\n DaffCustomerInvalidAPIResponseError,\n} from '@daffodil/customer/driver';\nimport { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffCustomerMagentoErrorMessageRegexMap } from './map';\n\n/**\n * Transforms a single GraphQL error.\n * Optionally accepts a request payload which can be used in certain cases\n * to add supplemental info to the error.\n */\nexport function transformMagentoCartGraphQlError(error: GraphQLError, requestPayload?: unknown): DaffError {\n // TODO: readdress this when we move to eslint\n // eslint-disable-next-line\n for (const code in DaffCustomerMagentoErrorMessageRegexMap) {\n const matchIndex = error.message.search(DaffCustomerMagentoErrorMessageRegexMap[code]);\n\n if (matchIndex > -1 && DaffCustomerDriverErrorMap[code]) {\n const errObj = new DaffCustomerDriverErrorMap[code](error.message);\n\n return errObj;\n }\n }\n\n return daffTransformMagentoError(error, {});\n};\n\nexport function transformMagentoReviewsError(error: any, requestPayload?: unknown) {\n if (error.graphQLErrors?.length) {\n return transformMagentoCartGraphQlError((<ApolloError>error).graphQLErrors[0], requestPayload);\n } else {\n return daffTransformMagentoError(error, {}) || new DaffCustomerInvalidAPIResponseError(error.message);\n }\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoGetCustomerResponse } from '../models/public_api';\n\nexport const validateGetCustomerResponse = (response: ApolloQueryResult<MagentoGetCustomerResponse>) => {\n if (response.data.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Get customer response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoChangeEmailResponse } from '../models/public_api';\n\nexport const validateChangeEmailResponse = (response: ApolloQueryResult<MagentoChangeEmailResponse>) => {\n if (response.data.updateCustomerEmail.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Update email response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoChangePasswordResponse } from '../models/public_api';\n\nexport const validateChangePasswordResponse = (response: ApolloQueryResult<MagentoChangePasswordResponse>) => {\n if (response.data.changeCustomerPassword?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Change password response does not contain a valid customer.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoGetCustomerAddressesResponse } from '../models/public_api';\n\nexport const validateGetCustomerAddressesResponse = (response: ApolloQueryResult<MagentoGetCustomerAddressesResponse>) => {\n if (response.data.customer?.addresses) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Get customer address response does not contain addresses.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoCreateCustomerAddressResponse } from '../models/public_api';\n\nexport const validateCreateCustomerAddressResponse = (response: ApolloQueryResult<MagentoCreateCustomerAddressResponse>) => {\n if (response.data.createCustomerAddress?.id) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Create customer address response does not contain an address.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoUpdateCustomerAddressResponse } from '../models/public_api';\n\nexport const validateUpdateCustomerAddressResponse = (response: ApolloQueryResult<MagentoUpdateCustomerAddressResponse>) => {\n if (response.data.updateCustomerAddress?.id) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Update customer address response does not contain an address.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoDeleteCustomerAddressResponse } from '../models/public_api';\n\nexport const validateDeleteCustomerAddressResponse = (response: ApolloQueryResult<MagentoDeleteCustomerAddressResponse>) => {\n if (response.data.deleteCustomerAddress) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Delete customer address did not complete successfully.');\n }\n};\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffCustomerInvalidAPIResponseError } from '@daffodil/customer/driver';\n\nimport { MagentoUpdateCustomerResponse } from '../models/public_api';\n\nexport const validateUpdateCustomerResponse = (response: ApolloQueryResult<MagentoUpdateCustomerResponse>) => {\n if (response.data.updateCustomerV2.customer?.email) {\n return response;\n } else {\n throw new DaffCustomerInvalidAPIResponseError('Update customer response does not contain a valid customer.');\n }\n};\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerDriverInterface } from '@daffodil/customer/driver';\n\nimport { transformMagentoReviewsError } from './errors/transform';\nimport {\n MagentoChangeEmailResponse,\n MagentoChangePasswordResponse,\n MagentoGetCustomerResponse,\n MagentoUpdateCustomerResponse,\n} from './models/public_api';\nimport {\n changePassword,\n getCustomer,\n updateCustomer,\n updateEmail,\n} from './queries/public_api';\nimport {\n magentoCustomerInputTransform,\n magentoCustomerTransform,\n} from './transforms/public_api';\nimport { validateChangeEmailResponse } from './validators/change-email';\nimport { validateChangePasswordResponse } from './validators/change-password';\nimport { validateGetCustomerResponse } from './validators/public_api';\nimport { validateUpdateCustomerResponse } from './validators/update-customer';\n\n/**\n * A service for making Magento GraphQL queries for customers.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerMagentoService implements DaffCustomerDriverInterface {\n constructor(\n private apollo: Apollo,\n ) {}\n\n changeEmail(email: string, password: string): Observable<DaffCustomer> {\n return this.apollo.mutate<MagentoChangeEmailResponse>({\n mutation: updateEmail,\n variables: {\n email,\n password,\n },\n }).pipe(\n map(validateChangeEmailResponse),\n map(result => magentoCustomerTransform(result.data.updateCustomerEmail.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n changePassword(oldPassword: string, newPassword: string): Observable<void> {\n return this.apollo.mutate<MagentoChangePasswordResponse>({\n mutation: changePassword,\n variables: {\n old: oldPassword,\n new: newPassword,\n },\n }).pipe(\n map(validateChangePasswordResponse),\n map(() => undefined),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n get(): Observable<DaffCustomer> {\n return this.apollo.query<MagentoGetCustomerResponse>({\n query: getCustomer,\n }).pipe(\n map(validateGetCustomerResponse),\n map(result => magentoCustomerTransform(result.data.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n update(customer: Partial<DaffCustomer>): Observable<DaffCustomer> {\n return this.apollo.mutate<MagentoUpdateCustomerResponse>({\n mutation: updateCustomer,\n variables: {\n customer: magentoCustomerInputTransform(customer),\n },\n }).pipe(\n map(validateUpdateCustomerResponse),\n map(result => magentoCustomerTransform(result.data.updateCustomerV2.customer)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { ApolloQueryResult } from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n Subject,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n switchMap,\n} from 'rxjs/operators';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffQueuedApollo } from '@daffodil/core/graphql';\nimport { DaffCustomerAddress } from '@daffodil/customer';\nimport {\n DaffCustomerAddressDriverInterface,\n DaffCustomerAddressNotFoundError,\n} from '@daffodil/customer/driver';\n\nimport { transformMagentoReviewsError } from './errors/transform';\nimport {\n MagentoCreateCustomerAddressResponse,\n MagentoDeleteCustomerAddressResponse,\n MagentoGetCustomerAddressesResponse,\n MagentoUpdateCustomerAddressResponse,\n} from './models/public_api';\nimport {\n createCustomerAddress,\n deleteCustomerAddress,\n getCustomerAddresses,\n updateCustomerAddress,\n} from './queries/public_api';\nimport {\n magentoCustomerAddressInputTransform,\n magentoCustomerAddressTransform,\n} from './transforms/public_api';\nimport {\n validateCreateCustomerAddressResponse,\n validateDeleteCustomerAddressResponse,\n validateGetCustomerAddressesResponse,\n validateUpdateCustomerAddressResponse,\n} from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for customers.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerMagentoAddressService implements DaffCustomerAddressDriverInterface {\n constructor(\n private apollo: Apollo,\n private mutationQueue: DaffQueuedApollo,\n ) {}\n\n add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]> {\n return this.mutationQueue.mutate<MagentoCreateCustomerAddressResponse>({\n mutation: createCustomerAddress,\n variables: {\n input: magentoCustomerAddressInputTransform(address),\n },\n refetchQueries: [{\n query: getCustomerAddresses,\n }],\n onQueryUpdated: () => true,\n }).pipe(\n map(validateCreateCustomerAddressResponse),\n // magento doesn't return address collection so make an additional request >:(\n switchMap(() => this.listAddresses()),\n map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n delete(addressId: DaffCustomerAddress['id']): Observable<DaffCustomerAddress[]> {\n return this.mutationQueue.mutate<MagentoDeleteCustomerAddressResponse>({\n mutation: deleteCustomerAddress,\n variables: {\n id: Number(addressId),\n },\n refetchQueries: [{\n query: getCustomerAddresses,\n }],\n onQueryUpdated: (query) => true,\n }).pipe(\n map(validateDeleteCustomerAddressResponse),\n // magento doesn't return address collection so make an additional request >:(\n switchMap(() => this.listAddresses()),\n map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n list(): Observable<DaffCustomerAddress[]> {\n return this.listAddresses().pipe(\n map((response) => response.data.customer.addresses.map(magentoCustomerAddressTransform)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n get(addressId: DaffCustomerAddress['id']): Observable<DaffCustomerAddress> {\n return this.listAddresses().pipe(\n map(({ data }) => {\n const address = data.customer.addresses.find(({ id }) => String(id) === addressId);\n if (!address) {\n throw new DaffCustomerAddressNotFoundError(`Could not find an address with ID: ${addressId}`);\n }\n return address;\n }),\n map(address => magentoCustomerAddressTransform(address)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]> {\n return this.mutationQueue.mutate<MagentoUpdateCustomerAddressResponse>({\n mutation: updateCustomerAddress,\n variables: {\n id: Number(address.id),\n input: magentoCustomerAddressInputTransform(address),\n },\n refetchQueries: [{\n query: getCustomerAddresses,\n }],\n onQueryUpdated: (query) => true,\n }).pipe(\n map(validateUpdateCustomerAddressResponse),\n switchMap(() => this.listAddresses()),\n map(({ data }) => data.customer.addresses.map(magentoCustomerAddressTransform)),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n\n protected listAddresses(): Observable<ApolloQueryResult<MagentoGetCustomerAddressesResponse>> {\n return this.apollo.query<MagentoGetCustomerAddressesResponse>({\n query: getCustomerAddresses,\n }).pipe(\n map(validateGetCustomerAddressesResponse),\n catchError(err => throwError(() => transformMagentoReviewsError(err))),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffCustomerAddressDriver,\n DaffCustomerDriver,\n} from '@daffodil/customer/driver';\nimport { DAFF_MAGENTO_CACHEABLE_OPERATIONS } from '@daffodil/driver/magento';\n\nimport { DaffCustomerMagentoAddressService } from './address.service';\nimport { DaffCustomerMagentoService } from './customer.service';\nimport {\n MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME,\n MAGENTO_GET_CUSTOMER_QUERY_NAME,\n} from './queries/public_api';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerMagentoDriverModule> {\n return {\n ngModule: DaffCustomerMagentoDriverModule,\n providers: [\n {\n provide: DaffCustomerDriver,\n useExisting: DaffCustomerMagentoService,\n },\n {\n provide: DaffCustomerAddressDriver,\n useExisting: DaffCustomerMagentoAddressService,\n },\n {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: MAGENTO_GET_CUSTOMER_QUERY_NAME,\n multi: true,\n },\n {\n provide: DAFF_MAGENTO_CACHEABLE_OPERATIONS,\n useValue: MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME,\n multi: true,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAIa,6BAA6B,GAAG,CAAC,QAA+B,MAA4B;IACvG,SAAS,EAAE,QAAQ,CAAC,SAAS;IAC7B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,aAAa,EAAE,QAAQ,CAAC,YAAY;AACrC,CAAA;;MCJY,oCAAoC,GAAG,CAAC,OAAqC,MAAmC;IAC3H,IAAI,EAAE,OAAO,CAAC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-1,10 +1,45 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable, NgModule } from '@angular/core';
|
|
4
|
-
import { DaffCustomerDriver } from '@daffodil/customer/driver';
|
|
4
|
+
import { DaffCustomerDriver, DaffCustomerAddressDriver } from '@daffodil/customer/driver';
|
|
5
5
|
import { of } from 'rxjs';
|
|
6
6
|
import * as i1 from '@daffodil/customer/testing';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* A basic customer driver that creates mock customer results of different kinds.
|
|
10
|
+
* For testing purposes.
|
|
11
|
+
*
|
|
12
|
+
* @inheritdoc
|
|
13
|
+
*/
|
|
14
|
+
class DaffCustomerAddressTestingDriver {
|
|
15
|
+
constructor(factory) {
|
|
16
|
+
this.factory = factory;
|
|
17
|
+
}
|
|
18
|
+
list() {
|
|
19
|
+
return of(this.factory.createMany(3));
|
|
20
|
+
}
|
|
21
|
+
get(addressId) {
|
|
22
|
+
return of(this.factory.create({ id: addressId }));
|
|
23
|
+
}
|
|
24
|
+
update(address) {
|
|
25
|
+
return of(this.factory.createMany(3));
|
|
26
|
+
}
|
|
27
|
+
add(address) {
|
|
28
|
+
return of(this.factory.createMany(3));
|
|
29
|
+
}
|
|
30
|
+
delete(addressId) {
|
|
31
|
+
return of(this.factory.createMany(3));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** @nocollapse */ DaffCustomerAddressTestingDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressTestingDriver, deps: [{ token: i1.DaffCustomerAddressFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
/** @nocollapse */ DaffCustomerAddressTestingDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressTestingDriver, providedIn: 'root' });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressTestingDriver, decorators: [{
|
|
37
|
+
type: Injectable,
|
|
38
|
+
args: [{
|
|
39
|
+
providedIn: 'root',
|
|
40
|
+
}]
|
|
41
|
+
}], ctorParameters: function () { return [{ type: i1.DaffCustomerAddressFactory }]; } });
|
|
42
|
+
|
|
8
43
|
/**
|
|
9
44
|
* A basic customer driver that creates mock customer results of different kinds.
|
|
10
45
|
* For testing purposes.
|
|
@@ -49,6 +84,10 @@ class DaffCustomerTestingDriverModule {
|
|
|
49
84
|
provide: DaffCustomerDriver,
|
|
50
85
|
useExisting: DaffCustomerTestingDriver,
|
|
51
86
|
},
|
|
87
|
+
{
|
|
88
|
+
provide: DaffCustomerAddressDriver,
|
|
89
|
+
useExisting: DaffCustomerAddressTestingDriver,
|
|
90
|
+
},
|
|
52
91
|
],
|
|
53
92
|
};
|
|
54
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-driver-testing.mjs","sources":["../../../libs/customer/driver/testing/src/drivers/customer.service.ts","../../../libs/customer/driver/testing/src/drivers/customer-driver.module.ts","../../../libs/customer/driver/testing/src/daffodil-customer-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerDriverInterface } from '@daffodil/customer/driver';\nimport { DaffCustomerFactory } from '@daffodil/customer/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerTestingDriver implements DaffCustomerDriverInterface {\n constructor(\n private customerFactory: DaffCustomerFactory,\n ) {}\n\n changeEmail(email: string, password: string): Observable<DaffCustomer> {\n return of(this.customerFactory.create({ email }));\n }\n\n changePassword(oldPassword: string, newPassword: string): Observable<void> {\n return of(undefined);\n }\n\n get(): Observable<DaffCustomer> {\n return of(this.customerFactory.create());\n }\n\n update(customer: Partial<DaffCustomer>): Observable<DaffCustomer> {\n return of(this.customerFactory.create(customer));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {
|
|
1
|
+
{"version":3,"file":"daffodil-customer-driver-testing.mjs","sources":["../../../libs/customer/driver/testing/src/drivers/address.service.ts","../../../libs/customer/driver/testing/src/drivers/customer.service.ts","../../../libs/customer/driver/testing/src/drivers/customer-driver.module.ts","../../../libs/customer/driver/testing/src/daffodil-customer-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffCustomerAddress } from '@daffodil/customer';\nimport { DaffCustomerAddressDriverInterface } from '@daffodil/customer/driver';\nimport { DaffCustomerAddressFactory } from '@daffodil/customer/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerAddressTestingDriver implements DaffCustomerAddressDriverInterface {\n constructor(\n private factory: DaffCustomerAddressFactory,\n ) {}\n\n list(): Observable<DaffCustomerAddress[]> {\n return of(this.factory.createMany(3));\n }\n\n get(addressId: string): Observable<DaffCustomerAddress> {\n return of(this.factory.create({ id: addressId }));\n }\n\n update(address: Partial<DaffCustomerAddress> & DaffIdentifiable): Observable<DaffCustomerAddress[]> {\n return of(this.factory.createMany(3));\n }\n\n add(address: DaffCustomerAddress): Observable<DaffCustomerAddress[]> {\n return of(this.factory.createMany(3));\n }\n\n delete(addressId: string): Observable<DaffCustomerAddress[]> {\n return of(this.factory.createMany(3));\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerDriverInterface } from '@daffodil/customer/driver';\nimport { DaffCustomerFactory } from '@daffodil/customer/testing';\n\n/**\n * A basic customer driver that creates mock customer results of different kinds.\n * For testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerTestingDriver implements DaffCustomerDriverInterface {\n constructor(\n private customerFactory: DaffCustomerFactory,\n ) {}\n\n changeEmail(email: string, password: string): Observable<DaffCustomer> {\n return of(this.customerFactory.create({ email }));\n }\n\n changePassword(oldPassword: string, newPassword: string): Observable<void> {\n return of(undefined);\n }\n\n get(): Observable<DaffCustomer> {\n return of(this.customerFactory.create());\n }\n\n update(customer: Partial<DaffCustomer>): Observable<DaffCustomer> {\n return of(this.customerFactory.create(customer));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport {\n DaffCustomerAddressDriver,\n DaffCustomerDriver,\n} from '@daffodil/customer/driver';\n\nimport { DaffCustomerAddressTestingDriver } from './address.service';\nimport { DaffCustomerTestingDriver } from './customer.service';\n\n/**\n * Provides the {@link DaffCustomerTestingDriver} as the {@link DaffCustomerDriver}.\n */\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffCustomerTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffCustomerTestingDriverModule> {\n return {\n ngModule: DaffCustomerTestingDriverModule,\n providers: [\n {\n provide: DaffCustomerDriver,\n useExisting: DaffCustomerTestingDriver,\n },\n {\n provide: DaffCustomerAddressDriver,\n useExisting: DaffCustomerAddressTestingDriver,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAWA;;;;;AAKG;MAIU,gCAAgC,CAAA;AAC3C,IAAA,WAAA,CACU,OAAmC,EAAA;QAAnC,IAAO,CAAA,OAAA,GAAP,OAAO,CAA4B;KACzC;IAEJ,IAAI,GAAA;QACF,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,C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;AACF,aAAA;SACF,CAAC;KACH;;+IAfU,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA/B,mBAAA,+BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,YAHxC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,mBAAA,+BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,+BAA+B,EAJjC,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAL3C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
|
|
@@ -6,6 +6,11 @@ import { DaffInheritableError } from '@daffodil/core';
|
|
|
6
6
|
*/
|
|
7
7
|
const DaffCustomerDriver = new InjectionToken('DaffCustomerDriver');
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* An injection token for the customer driver.
|
|
11
|
+
*/
|
|
12
|
+
const DaffCustomerAddressDriver = new InjectionToken('DaffCustomerAddressDriver');
|
|
13
|
+
|
|
9
14
|
const DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_INVALID_API_RESPONSE';
|
|
10
15
|
/**
|
|
11
16
|
* A general error indicating that the platform returned a response which cannot be processed.
|
|
@@ -18,16 +23,62 @@ class DaffCustomerInvalidAPIResponseError extends DaffInheritableError {
|
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
|
|
26
|
+
const DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE = 'DAFF_CUSTOMER_ADDRESS_NOT_FOUND';
|
|
27
|
+
/**
|
|
28
|
+
* An error indicating that the requested address cannot be found.
|
|
29
|
+
*/
|
|
30
|
+
class DaffCustomerAddressNotFoundError extends DaffInheritableError {
|
|
31
|
+
constructor(message) {
|
|
32
|
+
super(message);
|
|
33
|
+
this.message = message;
|
|
34
|
+
this.code = DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION';
|
|
39
|
+
/**
|
|
40
|
+
* An error indicating that a deletion of the customer's default billing address was attempted and failed.
|
|
41
|
+
*/
|
|
42
|
+
class DaffCustomerDefaultBillingAddressDeletionError extends DaffInheritableError {
|
|
43
|
+
constructor(message) {
|
|
44
|
+
super(message);
|
|
45
|
+
this.message = message;
|
|
46
|
+
this.code = DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION';
|
|
51
|
+
/**
|
|
52
|
+
* An error indicating that a deletion of the customer's default shipping address was attempted and failed.
|
|
53
|
+
*/
|
|
54
|
+
class DaffCustomerDefaultShippingAddressDeletionError extends DaffInheritableError {
|
|
55
|
+
constructor(message) {
|
|
56
|
+
super(message);
|
|
57
|
+
this.message = message;
|
|
58
|
+
this.code = DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
21
62
|
/**
|
|
22
63
|
* A mapping from error codes to error class constructors.
|
|
23
64
|
*/
|
|
24
65
|
const DaffCustomerDriverErrorMap = {
|
|
25
66
|
[DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,
|
|
67
|
+
[DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE]: DaffCustomerAddressNotFoundError,
|
|
68
|
+
[DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultBillingAddressDeletionError,
|
|
69
|
+
[DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultShippingAddressDeletionError,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const DaffCustomerDriverErrorCodes = {
|
|
73
|
+
ADDRESS_NOT_FOUND: DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,
|
|
74
|
+
DEFAULT_BILLING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,
|
|
75
|
+
DEFAULT_SHIPPING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE,
|
|
76
|
+
INVALID_API_RESPONSE: DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,
|
|
26
77
|
};
|
|
27
78
|
|
|
28
79
|
/**
|
|
29
80
|
* Generated bundle index. Do not edit.
|
|
30
81
|
*/
|
|
31
82
|
|
|
32
|
-
export { DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE, DaffCustomerDriver, DaffCustomerDriverErrorMap, DaffCustomerInvalidAPIResponseError };
|
|
83
|
+
export { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE, DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE, DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE, DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE, DaffCustomerAddressDriver, DaffCustomerAddressNotFoundError, DaffCustomerDefaultBillingAddressDeletionError, DaffCustomerDefaultShippingAddressDeletionError, DaffCustomerDriver, DaffCustomerDriverErrorCodes, DaffCustomerDriverErrorMap, DaffCustomerInvalidAPIResponseError };
|
|
33
84
|
//# sourceMappingURL=daffodil-customer-driver.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-driver.mjs","sources":["../../../libs/customer/driver/src/interfaces/customer-service.interface.ts","../../../libs/customer/driver/src/errors/invalid-api-response.ts","../../../libs/customer/driver/src/errors/map.ts","../../../libs/customer/driver/src/daffodil-customer-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerDriver = new InjectionToken<DaffCustomerDriverInterface>('DaffCustomerDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerDriverInterface<\n T extends DaffCustomer = DaffCustomer,\n> {\n /**\n * Get the currently logged-in customer.\n */\n get(): Observable<T>;\n\n /**\n * Update the currently logged-in customer.\n *\n * @param customer The customer info to update.\n */\n update(customer: Partial<T>): Observable<T>;\n\n /**\n * Change the currently logged-in customer's email.\n */\n changeEmail(email: string, password: string): Observable<T>;\n\n /**\n * Change the currently logged-in customer's password.\n */\n changePassword(oldPassword: string, newPassword: string): Observable<void>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffCustomerInvalidAPIResponseError,\n DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerDriverErrorMap = {\n [DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKA;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAA8B,oBAAoB;;
|
|
1
|
+
{"version":3,"file":"daffodil-customer-driver.mjs","sources":["../../../libs/customer/driver/src/interfaces/customer-service.interface.ts","../../../libs/customer/driver/src/interfaces/address-service.interface.ts","../../../libs/customer/driver/src/errors/invalid-api-response.ts","../../../libs/customer/driver/src/errors/address-not-found.ts","../../../libs/customer/driver/src/errors/default-billing-address-deletion.ts","../../../libs/customer/driver/src/errors/default-shipping-address-deletion.ts","../../../libs/customer/driver/src/errors/map.ts","../../../libs/customer/driver/src/errors/codes.ts","../../../libs/customer/driver/src/daffodil-customer-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerDriver = new InjectionToken<DaffCustomerDriverInterface>('DaffCustomerDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerDriverInterface<\n T extends DaffCustomer = DaffCustomer,\n> {\n /**\n * Get the currently logged-in customer.\n */\n get(): Observable<T>;\n\n /**\n * Update the currently logged-in customer.\n *\n * @param customer The customer info to update.\n */\n update(customer: Partial<T>): Observable<T>;\n\n /**\n * Change the currently logged-in customer's email.\n */\n changeEmail(email: string, password: string): Observable<T>;\n\n /**\n * Change the currently logged-in customer's password.\n */\n changePassword(oldPassword: string, newPassword: string): Observable<void>;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffCustomerAddress } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerAddressDriver = new InjectionToken<DaffCustomerAddressDriverInterface>('DaffCustomerAddressDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerAddressDriverInterface<\n T extends DaffCustomerAddress = DaffCustomerAddress,\n> {\n /**\n * Lists the customer's addresses.\n */\n list(): Observable<T[]>;\n\n /**\n * Get the specified address.\n */\n get(addressId: DaffCustomerAddress['id']): Observable<T>;\n\n /**\n * Update the passed address.\n */\n update(address: Partial<T> & DaffIdentifiable): Observable<T[]>;\n\n /**\n * Adds the passed address.\n */\n add(address: T): Observable<T[]>;\n\n /**\n * Deletes the specified address.\n */\n delete(addressId: DaffCustomerAddress['id']): Observable<T[]>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE = 'DAFF_CUSTOMER_ADDRESS_NOT_FOUND';\n\n/**\n * An error indicating that the requested address cannot be found.\n */\nexport class DaffCustomerAddressNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION';\n\n/**\n * An error indicating that a deletion of the customer's default billing address was attempted and failed.\n */\nexport class DaffCustomerDefaultBillingAddressDeletionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION';\n\n/**\n * An error indicating that a deletion of the customer's default shipping address was attempted and failed.\n */\nexport class DaffCustomerDefaultShippingAddressDeletionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,\n DaffCustomerAddressNotFoundError,\n} from './address-not-found';\nimport {\n DaffCustomerDefaultBillingAddressDeletionError,\n DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,\n} from './default-billing-address-deletion';\nimport {\n DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE,\n DaffCustomerDefaultShippingAddressDeletionError,\n} from './default-shipping-address-deletion';\nimport {\n DaffCustomerInvalidAPIResponseError,\n DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerDriverErrorMap = {\n [DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,\n [DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE]: DaffCustomerAddressNotFoundError,\n [DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultBillingAddressDeletionError,\n [DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultShippingAddressDeletionError,\n};\n","import { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE } from './address-not-found';\nimport { DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE } from './default-billing-address-deletion';\nimport { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE } from './default-shipping-address-deletion';\nimport { DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE } from './invalid-api-response';\n\nexport const DaffCustomerDriverErrorCodes = {\n ADDRESS_NOT_FOUND: DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,\n DEFAULT_BILLING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,\n DEFAULT_SHIPPING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE,\n INVALID_API_RESPONSE: DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKA;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAA8B,oBAAoB;;ACFtG;;AAEG;MACU,yBAAyB,GAAG,IAAI,cAAc,CAAqC,2BAA2B;;ACJpH,MAAM,6CAA6C,GAAG,qCAAqC;AAElG;;AAEG;AACG,MAAO,mCAAoC,SAAQ,oBAAoB,CAAA;AAG3E,IAAA,WAAA,CAAmB,OAAe,EAAA;Q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