@daffodil/customer 0.48.2
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 +9 -0
- package/daffodil-customer.d.ts +5 -0
- package/driver/daffodil-customer-driver.d.ts +5 -0
- package/driver/errors/invalid-api-response.d.ts +10 -0
- package/driver/errors/map.d.ts +7 -0
- package/driver/errors/public_api.d.ts +2 -0
- package/driver/in-memory/backend/customer.service.d.ts +39 -0
- package/driver/in-memory/daffodil-customer-driver-in-memory.d.ts +5 -0
- package/driver/in-memory/driver/customer-driver.module.d.ts +12 -0
- package/driver/in-memory/driver/customer.service.d.ts +24 -0
- package/driver/in-memory/index.d.ts +1 -0
- package/driver/in-memory/package.json +10 -0
- package/driver/in-memory/public_api.d.ts +3 -0
- package/driver/index.d.ts +1 -0
- package/driver/interfaces/customer-service.interface.d.ts +30 -0
- package/driver/magento/customer-driver.module.d.ts +9 -0
- package/driver/magento/customer.service.d.ts +20 -0
- package/driver/magento/daffodil-customer-driver-magento.d.ts +5 -0
- package/driver/magento/errors/public_api.d.ts +1 -0
- package/driver/magento/errors/transform.d.ts +1 -0
- package/driver/magento/index.d.ts +1 -0
- package/driver/magento/models/gender.enum.d.ts +4 -0
- package/driver/magento/models/public_api.d.ts +3 -0
- package/driver/magento/models/requests/customer-input.type.d.ts +14 -0
- package/driver/magento/models/requests/public_api.d.ts +1 -0
- package/driver/magento/models/responses/change-email.type.d.ts +6 -0
- package/driver/magento/models/responses/change-password.type.d.ts +5 -0
- package/driver/magento/models/responses/customer-address.type.d.ts +16 -0
- package/driver/magento/models/responses/customer.type.d.ts +8 -0
- package/driver/magento/models/responses/get-customer.type.d.ts +4 -0
- package/driver/magento/models/responses/public_api.d.ts +6 -0
- package/driver/magento/models/responses/update-customer.type.d.ts +6 -0
- package/driver/magento/package.json +10 -0
- package/driver/magento/public_api.d.ts +7 -0
- package/driver/magento/queries/change-password.d.ts +2 -0
- package/driver/magento/queries/fragments/customer-address.d.ts +1 -0
- package/driver/magento/queries/fragments/customer.d.ts +1 -0
- package/driver/magento/queries/fragments/public_api.d.ts +2 -0
- package/driver/magento/queries/get-customer.d.ts +2 -0
- package/driver/magento/queries/public_api.d.ts +5 -0
- package/driver/magento/queries/update-customer.d.ts +2 -0
- package/driver/magento/queries/update-email.d.ts +2 -0
- package/driver/magento/testing/daffodil-customer-driver-magento-testing.d.ts +5 -0
- package/driver/magento/testing/factories/address.factory.d.ts +26 -0
- package/driver/magento/testing/factories/customer.factory.d.ts +9 -0
- package/driver/magento/testing/factories/public_api.d.ts +2 -0
- package/driver/magento/testing/index.d.ts +1 -0
- package/driver/magento/testing/package.json +10 -0
- package/driver/magento/testing/public_api.d.ts +1 -0
- package/driver/magento/transforms/public_api.d.ts +2 -0
- package/driver/magento/transforms/requests/customer-input.d.ts +3 -0
- package/driver/magento/transforms/requests/public_api.d.ts +1 -0
- package/driver/magento/transforms/responses/customer-address.d.ts +3 -0
- package/driver/magento/transforms/responses/customer.d.ts +3 -0
- package/driver/magento/transforms/responses/public_api.d.ts +2 -0
- package/driver/magento/validators/change-email.d.ts +3 -0
- package/driver/magento/validators/change-password.d.ts +3 -0
- package/driver/magento/validators/get-customer.d.ts +3 -0
- package/driver/magento/validators/public_api.d.ts +1 -0
- package/driver/magento/validators/update-customer.d.ts +3 -0
- package/driver/package.json +10 -0
- package/driver/public_api.d.ts +2 -0
- package/driver/testing/daffodil-customer-driver-testing.d.ts +5 -0
- package/driver/testing/drivers/customer-driver.module.d.ts +12 -0
- package/driver/testing/drivers/customer.service.d.ts +21 -0
- package/driver/testing/drivers/public_api.d.ts +2 -0
- package/driver/testing/index.d.ts +1 -0
- package/driver/testing/package.json +10 -0
- package/driver/testing/public_api.d.ts +1 -0
- package/esm2020/daffodil-customer.mjs +5 -0
- package/esm2020/driver/daffodil-customer-driver.mjs +5 -0
- package/esm2020/driver/errors/invalid-api-response.mjs +13 -0
- package/esm2020/driver/errors/map.mjs +8 -0
- package/esm2020/driver/errors/public_api.mjs +3 -0
- package/esm2020/driver/in-memory/backend/customer.service.mjs +108 -0
- package/esm2020/driver/in-memory/daffodil-customer-driver-in-memory.mjs +5 -0
- package/esm2020/driver/in-memory/driver/customer-driver.module.mjs +35 -0
- package/esm2020/driver/in-memory/driver/customer.service.mjs +40 -0
- package/esm2020/driver/in-memory/index.mjs +2 -0
- package/esm2020/driver/in-memory/public_api.mjs +4 -0
- package/esm2020/driver/index.mjs +2 -0
- package/esm2020/driver/interfaces/customer-service.interface.mjs +6 -0
- package/esm2020/driver/magento/customer-driver.module.mjs +39 -0
- package/esm2020/driver/magento/customer.service.mjs +63 -0
- package/esm2020/driver/magento/daffodil-customer-driver-magento.mjs +5 -0
- package/esm2020/driver/magento/errors/public_api.mjs +2 -0
- package/esm2020/driver/magento/errors/transform.mjs +6 -0
- package/esm2020/driver/magento/index.mjs +2 -0
- package/esm2020/driver/magento/models/gender.enum.mjs +6 -0
- package/esm2020/driver/magento/models/public_api.mjs +4 -0
- package/esm2020/driver/magento/models/requests/customer-input.type.mjs +2 -0
- package/esm2020/driver/magento/models/requests/public_api.mjs +2 -0
- package/esm2020/driver/magento/models/responses/change-email.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/change-password.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/customer-address.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/customer.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/get-customer.type.mjs +2 -0
- package/esm2020/driver/magento/models/responses/public_api.mjs +2 -0
- package/esm2020/driver/magento/models/responses/update-customer.type.mjs +2 -0
- package/esm2020/driver/magento/public_api.mjs +8 -0
- package/esm2020/driver/magento/queries/change-password.mjs +13 -0
- package/esm2020/driver/magento/queries/fragments/customer-address.mjs +19 -0
- package/esm2020/driver/magento/queries/fragments/customer.mjs +15 -0
- package/esm2020/driver/magento/queries/fragments/public_api.mjs +3 -0
- package/esm2020/driver/magento/queries/get-customer.mjs +12 -0
- package/esm2020/driver/magento/queries/public_api.mjs +6 -0
- package/esm2020/driver/magento/queries/update-customer.mjs +14 -0
- package/esm2020/driver/magento/queries/update-email.mjs +14 -0
- package/esm2020/driver/magento/testing/daffodil-customer-driver-magento-testing.mjs +5 -0
- package/esm2020/driver/magento/testing/factories/address.factory.mjs +38 -0
- package/esm2020/driver/magento/testing/factories/customer.factory.mjs +34 -0
- package/esm2020/driver/magento/testing/factories/public_api.mjs +3 -0
- package/esm2020/driver/magento/testing/index.mjs +2 -0
- package/esm2020/driver/magento/testing/public_api.mjs +2 -0
- package/esm2020/driver/magento/transforms/public_api.mjs +3 -0
- package/esm2020/driver/magento/transforms/requests/customer-input.mjs +6 -0
- package/esm2020/driver/magento/transforms/requests/public_api.mjs +2 -0
- package/esm2020/driver/magento/transforms/responses/customer-address.mjs +14 -0
- package/esm2020/driver/magento/transforms/responses/customer.mjs +10 -0
- package/esm2020/driver/magento/transforms/responses/public_api.mjs +3 -0
- package/esm2020/driver/magento/validators/change-email.mjs +10 -0
- package/esm2020/driver/magento/validators/change-password.mjs +10 -0
- package/esm2020/driver/magento/validators/get-customer.mjs +10 -0
- package/esm2020/driver/magento/validators/public_api.mjs +2 -0
- package/esm2020/driver/magento/validators/update-customer.mjs +10 -0
- package/esm2020/driver/public_api.mjs +3 -0
- package/esm2020/driver/testing/daffodil-customer-driver-testing.mjs +5 -0
- package/esm2020/driver/testing/drivers/customer-driver.module.mjs +35 -0
- package/esm2020/driver/testing/drivers/customer.service.mjs +37 -0
- package/esm2020/driver/testing/drivers/public_api.mjs +3 -0
- package/esm2020/driver/testing/index.mjs +2 -0
- package/esm2020/driver/testing/public_api.mjs +2 -0
- package/esm2020/index.mjs +2 -0
- package/esm2020/injection-tokens/error-matcher.token.mjs +8 -0
- package/esm2020/injection-tokens/public_api.mjs +2 -0
- package/esm2020/models/address.type.mjs +2 -0
- package/esm2020/models/customer.type.mjs +2 -0
- package/esm2020/models/public_api.mjs +2 -0
- package/esm2020/public_api.mjs +3 -0
- package/esm2020/routing/daffodil-customer-routing.mjs +5 -0
- package/esm2020/routing/guards/clear-errors.guard.mjs +24 -0
- package/esm2020/routing/guards/public_api.mjs +2 -0
- package/esm2020/routing/index.mjs +2 -0
- package/esm2020/routing/public_api.mjs +3 -0
- package/esm2020/routing/resolvers/customer.resolver.mjs +26 -0
- package/esm2020/routing/resolvers/public_api.mjs +2 -0
- package/esm2020/state/actions/customer.actions.mjs +144 -0
- package/esm2020/state/customer.module.mjs +34 -0
- package/esm2020/state/daffodil-customer-state.mjs +5 -0
- package/esm2020/state/effects/customer.effects.mjs +44 -0
- package/esm2020/state/facades/customer/facade.mjs +36 -0
- package/esm2020/state/facades/customer/interface.mjs +2 -0
- package/esm2020/state/facades/public_api.mjs +2 -0
- package/esm2020/state/index.mjs +2 -0
- package/esm2020/state/public_api.mjs +6 -0
- package/esm2020/state/reducers/customer/adapter.mjs +13 -0
- package/esm2020/state/reducers/customer/initial-state.mjs +9 -0
- package/esm2020/state/reducers/customer/interface.mjs +2 -0
- package/esm2020/state/reducers/customer/public_api.mjs +4 -0
- package/esm2020/state/reducers/customer/reducer.mjs +33 -0
- package/esm2020/state/reducers/public_api.mjs +4 -0
- package/esm2020/state/reducers/reducers.interface.mjs +2 -0
- package/esm2020/state/reducers/store-feature-key.mjs +5 -0
- package/esm2020/state/reducers/token/extra.token.mjs +30 -0
- package/esm2020/state/reducers/token/public_api.mjs +2 -0
- package/esm2020/state/reducers/token/reducers.token.mjs +21 -0
- package/esm2020/state/selectors/customer.selector.mjs +20 -0
- package/esm2020/state/selectors/feature.selector.mjs +9 -0
- package/esm2020/state/selectors/public_api.mjs +2 -0
- package/esm2020/state/testing/customer-testing.module.mjs +23 -0
- package/esm2020/state/testing/daffodil-customer-state-testing.mjs +5 -0
- package/esm2020/state/testing/index.mjs +2 -0
- package/esm2020/state/testing/mock-customer-facade.mjs +26 -0
- package/esm2020/state/testing/public_api.mjs +3 -0
- package/esm2020/testing/daffodil-customer-testing.mjs +5 -0
- package/esm2020/testing/factories/customer-address.factory.mjs +32 -0
- package/esm2020/testing/factories/customer.factory.mjs +41 -0
- package/esm2020/testing/factories/public_api.mjs +3 -0
- package/esm2020/testing/index.mjs +2 -0
- package/esm2020/testing/public_api.mjs +2 -0
- package/fesm2015/daffodil-customer-driver-in-memory.mjs +180 -0
- package/fesm2015/daffodil-customer-driver-in-memory.mjs.map +1 -0
- package/fesm2015/daffodil-customer-driver-magento-testing.mjs +73 -0
- package/fesm2015/daffodil-customer-driver-magento-testing.mjs.map +1 -0
- package/fesm2015/daffodil-customer-driver-magento.mjs +254 -0
- package/fesm2015/daffodil-customer-driver-magento.mjs.map +1 -0
- package/fesm2015/daffodil-customer-driver-testing.mjs +75 -0
- package/fesm2015/daffodil-customer-driver-testing.mjs.map +1 -0
- package/fesm2015/daffodil-customer-driver.mjs +33 -0
- package/fesm2015/daffodil-customer-driver.mjs.map +1 -0
- package/fesm2015/daffodil-customer-routing.mjs +53 -0
- package/fesm2015/daffodil-customer-routing.mjs.map +1 -0
- package/fesm2015/daffodil-customer-state-testing.mjs +53 -0
- package/fesm2015/daffodil-customer-state-testing.mjs.map +1 -0
- package/fesm2015/daffodil-customer-state.mjs +368 -0
- package/fesm2015/daffodil-customer-state.mjs.map +1 -0
- package/fesm2015/daffodil-customer-testing.mjs +74 -0
- package/fesm2015/daffodil-customer-testing.mjs.map +1 -0
- package/fesm2015/daffodil-customer.mjs +15 -0
- package/fesm2015/daffodil-customer.mjs.map +1 -0
- package/fesm2020/daffodil-customer-driver-in-memory.mjs +183 -0
- package/fesm2020/daffodil-customer-driver-in-memory.mjs.map +1 -0
- package/fesm2020/daffodil-customer-driver-magento-testing.mjs +73 -0
- package/fesm2020/daffodil-customer-driver-magento-testing.mjs.map +1 -0
- package/fesm2020/daffodil-customer-driver-magento.mjs +250 -0
- package/fesm2020/daffodil-customer-driver-magento.mjs.map +1 -0
- package/fesm2020/daffodil-customer-driver-testing.mjs +75 -0
- package/fesm2020/daffodil-customer-driver-testing.mjs.map +1 -0
- package/fesm2020/daffodil-customer-driver.mjs +33 -0
- package/fesm2020/daffodil-customer-driver.mjs.map +1 -0
- package/fesm2020/daffodil-customer-routing.mjs +53 -0
- package/fesm2020/daffodil-customer-routing.mjs.map +1 -0
- package/fesm2020/daffodil-customer-state-testing.mjs +53 -0
- package/fesm2020/daffodil-customer-state-testing.mjs.map +1 -0
- package/fesm2020/daffodil-customer-state.mjs +376 -0
- package/fesm2020/daffodil-customer-state.mjs.map +1 -0
- package/fesm2020/daffodil-customer-testing.mjs +74 -0
- package/fesm2020/daffodil-customer-testing.mjs.map +1 -0
- package/fesm2020/daffodil-customer.mjs +15 -0
- package/fesm2020/daffodil-customer.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/injection-tokens/error-matcher.token.d.ts +7 -0
- package/injection-tokens/public_api.d.ts +1 -0
- package/models/address.type.d.ts +7 -0
- package/models/customer.type.d.ts +27 -0
- package/models/public_api.d.ts +2 -0
- package/package.json +125 -0
- package/public_api.d.ts +2 -0
- package/routing/daffodil-customer-routing.d.ts +5 -0
- package/routing/guards/clear-errors.guard.d.ts +14 -0
- package/routing/guards/public_api.d.ts +1 -0
- package/routing/index.d.ts +1 -0
- package/routing/package.json +10 -0
- package/routing/public_api.d.ts +2 -0
- package/routing/resolvers/customer.resolver.d.ts +14 -0
- package/routing/resolvers/public_api.d.ts +1 -0
- package/state/actions/customer.actions.d.ts +133 -0
- package/state/customer.module.d.ts +11 -0
- package/state/daffodil-customer-state.d.ts +5 -0
- package/state/effects/customer.effects.d.ts +30 -0
- package/state/facades/customer/facade.d.ts +26 -0
- package/state/facades/customer/interface.d.ts +13 -0
- package/state/facades/public_api.d.ts +2 -0
- package/state/index.d.ts +1 -0
- package/state/package.json +10 -0
- package/state/public_api.d.ts +5 -0
- package/state/reducers/customer/adapter.d.ts +7 -0
- package/state/reducers/customer/initial-state.d.ts +5 -0
- package/state/reducers/customer/interface.d.ts +9 -0
- package/state/reducers/customer/public_api.d.ts +4 -0
- package/state/reducers/customer/reducer.d.ts +7 -0
- package/state/reducers/public_api.d.ts +4 -0
- package/state/reducers/reducers.interface.d.ts +15 -0
- package/state/reducers/store-feature-key.d.ts +4 -0
- package/state/reducers/token/extra.token.d.ts +22 -0
- package/state/reducers/token/public_api.d.ts +1 -0
- package/state/reducers/token/reducers.token.d.ts +11 -0
- package/state/selectors/customer.selector.d.ts +14 -0
- package/state/selectors/feature.selector.d.ts +10 -0
- package/state/selectors/public_api.d.ts +1 -0
- package/state/testing/customer-testing.module.d.ts +9 -0
- package/state/testing/daffodil-customer-state-testing.d.ts +5 -0
- package/state/testing/index.d.ts +1 -0
- package/state/testing/mock-customer-facade.d.ts +20 -0
- package/state/testing/package.json +10 -0
- package/state/testing/public_api.d.ts +2 -0
- package/testing/daffodil-customer-testing.d.ts +5 -0
- package/testing/factories/customer-address.factory.d.ts +18 -0
- package/testing/factories/customer.factory.d.ts +26 -0
- package/testing/factories/public_api.d.ts +2 -0
- package/testing/index.d.ts +1 -0
- package/testing/package.json +10 -0
- package/testing/public_api.d.ts +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as faker from '@faker-js/faker/locale/en_US';
|
|
4
|
+
import { DaffModelFactory } from '@daffodil/core/testing';
|
|
5
|
+
import { MockDaffPersonalAddress } from '@daffodil/geography/testing';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Mock class for {@link DaffCustomerAddress}.
|
|
9
|
+
*/
|
|
10
|
+
class MockDaffCustomerAddress extends MockDaffPersonalAddress {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.id = faker.datatype.uuid();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
;
|
|
17
|
+
/**
|
|
18
|
+
* Model factory for {@link DaffCustomerAddress}.
|
|
19
|
+
*/
|
|
20
|
+
class DaffCustomerAddressFactory extends DaffModelFactory {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(MockDaffCustomerAddress);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** @nocollapse */ DaffCustomerAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
26
|
+
/** @nocollapse */ DaffCustomerAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressFactory, providedIn: 'root' });
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressFactory, decorators: [{
|
|
28
|
+
type: Injectable,
|
|
29
|
+
args: [{
|
|
30
|
+
providedIn: 'root',
|
|
31
|
+
}]
|
|
32
|
+
}], ctorParameters: function () { return []; } });
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Mock class for {@link DaffCustomer}.
|
|
36
|
+
*/
|
|
37
|
+
class MockDaffCustomer {
|
|
38
|
+
constructor(addressFactory) {
|
|
39
|
+
this.addressFactory = addressFactory;
|
|
40
|
+
this.id = faker.datatype.uuid();
|
|
41
|
+
this.email = faker.internet.email();
|
|
42
|
+
this.firstName = faker.name.firstName();
|
|
43
|
+
this.lastName = faker.name.lastName();
|
|
44
|
+
this.isSubscribed = faker.datatype.boolean();
|
|
45
|
+
this.addresses = this.createAddresses();
|
|
46
|
+
}
|
|
47
|
+
createAddresses() {
|
|
48
|
+
return this.addressFactory.createMany(faker.datatype.number({ min: 1, max: 4 }));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
;
|
|
52
|
+
/**
|
|
53
|
+
* Model factory for {@link DaffCustomer}.
|
|
54
|
+
*/
|
|
55
|
+
class DaffCustomerFactory extends DaffModelFactory {
|
|
56
|
+
constructor(addressFactory) {
|
|
57
|
+
super(MockDaffCustomer, addressFactory);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** @nocollapse */ DaffCustomerFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerFactory, deps: [{ token: DaffCustomerAddressFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
61
|
+
/** @nocollapse */ DaffCustomerFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerFactory, providedIn: 'root' });
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerFactory, decorators: [{
|
|
63
|
+
type: Injectable,
|
|
64
|
+
args: [{
|
|
65
|
+
providedIn: 'root',
|
|
66
|
+
}]
|
|
67
|
+
}], ctorParameters: function () { return [{ type: DaffCustomerAddressFactory }]; } });
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Generated bundle index. Do not edit.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export { DaffCustomerAddressFactory, DaffCustomerFactory, MockDaffCustomer, MockDaffCustomerAddress };
|
|
74
|
+
//# sourceMappingURL=daffodil-customer-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-customer-testing.mjs","sources":["../../../libs/customer/testing/src/factories/customer-address.factory.ts","../../../libs/customer/testing/src/factories/customer.factory.ts","../../../libs/customer/testing/src/daffodil-customer-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerAddress } from '@daffodil/customer';\nimport { MockDaffPersonalAddress } from '@daffodil/geography/testing';\n\n/**\n * Mock class for {@link DaffCustomerAddress}.\n */\nexport class MockDaffCustomerAddress extends MockDaffPersonalAddress implements DaffCustomerAddress {\n id = faker.datatype.uuid();\n};\n\n/**\n * Model factory for {@link DaffCustomerAddress}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerAddressFactory extends DaffModelFactory<DaffCustomerAddress>{\n constructor() {\n super(MockDaffCustomerAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n DaffCustomer,\n DaffCustomerAddress,\n} from '@daffodil/customer';\n\nimport { DaffCustomerAddressFactory } from './customer-address.factory';\n\n/**\n * Mock class for {@link DaffCustomer}.\n */\nexport class MockDaffCustomer implements DaffCustomer {\n id = faker.datatype.uuid();\n email = faker.internet.email();\n firstName = faker.name.firstName();\n lastName = faker.name.lastName();\n isSubscribed = faker.datatype.boolean();\n addresses = this.createAddresses();\n\n constructor(\n private addressFactory: DaffCustomerAddressFactory,\n ) {}\n\n private createAddresses(): DaffCustomerAddress[] {\n return this.addressFactory.createMany(faker.datatype.number({ min: 1, max: 4 }));\n }\n};\n\n/**\n * Model factory for {@link DaffCustomer}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerFactory extends DaffModelFactory<DaffCustomer>{\n constructor(\n addressFactory: DaffCustomerAddressFactory,\n ) {\n super(MockDaffCustomer, addressFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffCustomerAddressFactory"],"mappings":";;;;;;AAOA;;AAEG;AACG,MAAO,uBAAwB,SAAQ,uBAAuB,CAAA;AAApE,IAAA,WAAA,GAAA;;AACE,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KAC5B;AAAA,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,0BAA2B,SAAQ,gBAAqC,CAAA;AACnF,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAChC;;0IAHU,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,mBAAA,0BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;2FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACRD;;AAEG;MACU,gBAAgB,CAAA;AAQ3B,IAAA,WAAA,CACU,cAA0C,EAAA;QAA1C,IAAc,CAAA,cAAA,GAAd,cAAc,CAA4B;AARpD,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;AAC/B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;AACjC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;AACxC,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;KAI/B;IAEI,eAAe,GAAA;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;KAClF;AACF,CAAA;AAAA,CAAC;AAEF;;AAEG;AAIG,MAAO,mBAAoB,SAAQ,gBAA8B,CAAA;AACrE,IAAA,WAAA,CACE,cAA0C,EAAA;AAE1C,QAAA,KAAK,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;KACzC;;mIALU,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,0BAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,mBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACpCD;;AAEG;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
6
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
7
|
+
*/
|
|
8
|
+
const DAFF_CUSTOMER_ERROR_MATCHER = new InjectionToken('DAFF_CUSTOMER_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError });
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generated bundle index. Do not edit.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export { DAFF_CUSTOMER_ERROR_MATCHER };
|
|
15
|
+
//# sourceMappingURL=daffodil-customer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-customer.mjs","sources":["../../../libs/customer/src/injection-tokens/error-matcher.token.ts","../../../libs/customer/src/daffodil-customer.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_CUSTOMER_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_CUSTOMER_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;AAGG;AACU,MAAA,2BAA2B,GAAG,IAAI,cAAc,CAC3D,6BAA6B,EAC7B,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACVnD;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { daffTransformErrorToStateError } from '@daffodil/core/state';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
|
|
5
|
+
* Can be used to further refine Daffodil errors into more specific app errors.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DAFF_CUSTOMER_ERROR_MATCHER: InjectionToken<typeof daffTransformErrorToStateError>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DAFF_CUSTOMER_ERROR_MATCHER } from './error-matcher.token';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DaffIdentifiable } from '@daffodil/core';
|
|
2
|
+
import { DaffCustomerAddress } from './address.type';
|
|
3
|
+
/**
|
|
4
|
+
* A customer.
|
|
5
|
+
*/
|
|
6
|
+
export interface DaffCustomer extends DaffIdentifiable {
|
|
7
|
+
/**
|
|
8
|
+
* The customer's email.
|
|
9
|
+
*/
|
|
10
|
+
email: string;
|
|
11
|
+
/**
|
|
12
|
+
* The customer's first or birth name.
|
|
13
|
+
*/
|
|
14
|
+
firstName: string;
|
|
15
|
+
/**
|
|
16
|
+
* The customer's last or family name.
|
|
17
|
+
*/
|
|
18
|
+
lastName: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the customer is subscribed to the newsletter.
|
|
21
|
+
*/
|
|
22
|
+
isSubscribed: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A list of the customer's stored addresses.
|
|
25
|
+
*/
|
|
26
|
+
addresses: DaffCustomerAddress[];
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/customer",
|
|
3
|
+
"version": "0.48.2",
|
|
4
|
+
"description": "A client-side Angular package for managing ecommerce customers agnostic to the ecommerce platform.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/graycoreio/daffodil"
|
|
8
|
+
},
|
|
9
|
+
"author": "Graycore LLC",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/graycoreio/daffodil/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/graycoreio/daffodil",
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@angular/common": "^13.0.0",
|
|
17
|
+
"@angular/core": "^13.0.0",
|
|
18
|
+
"@daffodil/geography": "0.48.2",
|
|
19
|
+
"@daffodil/core": "0.48.2",
|
|
20
|
+
"@ngrx/effects": "^13.0.0",
|
|
21
|
+
"@ngrx/store": "^13.0.0",
|
|
22
|
+
"rxjs": "7.5.5"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@apollo/client": "^3.0.0",
|
|
26
|
+
"@daffodil/driver": "0.48.2",
|
|
27
|
+
"apollo-angular": "^3.0.1",
|
|
28
|
+
"@faker-js/faker": "^5.5.3"
|
|
29
|
+
},
|
|
30
|
+
"module": "fesm2015/daffodil-customer.mjs",
|
|
31
|
+
"es2020": "fesm2020/daffodil-customer.mjs",
|
|
32
|
+
"esm2020": "esm2020/daffodil-customer.mjs",
|
|
33
|
+
"fesm2020": "fesm2020/daffodil-customer.mjs",
|
|
34
|
+
"fesm2015": "fesm2015/daffodil-customer.mjs",
|
|
35
|
+
"typings": "daffodil-customer.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
"./package.json": {
|
|
38
|
+
"default": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./daffodil-customer.d.ts",
|
|
42
|
+
"esm2020": "./esm2020/daffodil-customer.mjs",
|
|
43
|
+
"es2020": "./fesm2020/daffodil-customer.mjs",
|
|
44
|
+
"es2015": "./fesm2015/daffodil-customer.mjs",
|
|
45
|
+
"node": "./fesm2015/daffodil-customer.mjs",
|
|
46
|
+
"default": "./fesm2020/daffodil-customer.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./driver/in-memory": {
|
|
49
|
+
"types": "./driver/in-memory/daffodil-customer-driver-in-memory.d.ts",
|
|
50
|
+
"esm2020": "./esm2020/driver/in-memory/daffodil-customer-driver-in-memory.mjs",
|
|
51
|
+
"es2020": "./fesm2020/daffodil-customer-driver-in-memory.mjs",
|
|
52
|
+
"es2015": "./fesm2015/daffodil-customer-driver-in-memory.mjs",
|
|
53
|
+
"node": "./fesm2015/daffodil-customer-driver-in-memory.mjs",
|
|
54
|
+
"default": "./fesm2020/daffodil-customer-driver-in-memory.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./driver/magento": {
|
|
57
|
+
"types": "./driver/magento/daffodil-customer-driver-magento.d.ts",
|
|
58
|
+
"esm2020": "./esm2020/driver/magento/daffodil-customer-driver-magento.mjs",
|
|
59
|
+
"es2020": "./fesm2020/daffodil-customer-driver-magento.mjs",
|
|
60
|
+
"es2015": "./fesm2015/daffodil-customer-driver-magento.mjs",
|
|
61
|
+
"node": "./fesm2015/daffodil-customer-driver-magento.mjs",
|
|
62
|
+
"default": "./fesm2020/daffodil-customer-driver-magento.mjs"
|
|
63
|
+
},
|
|
64
|
+
"./driver/magento/testing": {
|
|
65
|
+
"types": "./driver/magento/testing/daffodil-customer-driver-magento-testing.d.ts",
|
|
66
|
+
"esm2020": "./esm2020/driver/magento/testing/daffodil-customer-driver-magento-testing.mjs",
|
|
67
|
+
"es2020": "./fesm2020/daffodil-customer-driver-magento-testing.mjs",
|
|
68
|
+
"es2015": "./fesm2015/daffodil-customer-driver-magento-testing.mjs",
|
|
69
|
+
"node": "./fesm2015/daffodil-customer-driver-magento-testing.mjs",
|
|
70
|
+
"default": "./fesm2020/daffodil-customer-driver-magento-testing.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./driver": {
|
|
73
|
+
"types": "./driver/daffodil-customer-driver.d.ts",
|
|
74
|
+
"esm2020": "./esm2020/driver/daffodil-customer-driver.mjs",
|
|
75
|
+
"es2020": "./fesm2020/daffodil-customer-driver.mjs",
|
|
76
|
+
"es2015": "./fesm2015/daffodil-customer-driver.mjs",
|
|
77
|
+
"node": "./fesm2015/daffodil-customer-driver.mjs",
|
|
78
|
+
"default": "./fesm2020/daffodil-customer-driver.mjs"
|
|
79
|
+
},
|
|
80
|
+
"./driver/testing": {
|
|
81
|
+
"types": "./driver/testing/daffodil-customer-driver-testing.d.ts",
|
|
82
|
+
"esm2020": "./esm2020/driver/testing/daffodil-customer-driver-testing.mjs",
|
|
83
|
+
"es2020": "./fesm2020/daffodil-customer-driver-testing.mjs",
|
|
84
|
+
"es2015": "./fesm2015/daffodil-customer-driver-testing.mjs",
|
|
85
|
+
"node": "./fesm2015/daffodil-customer-driver-testing.mjs",
|
|
86
|
+
"default": "./fesm2020/daffodil-customer-driver-testing.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./routing": {
|
|
89
|
+
"types": "./routing/daffodil-customer-routing.d.ts",
|
|
90
|
+
"esm2020": "./esm2020/routing/daffodil-customer-routing.mjs",
|
|
91
|
+
"es2020": "./fesm2020/daffodil-customer-routing.mjs",
|
|
92
|
+
"es2015": "./fesm2015/daffodil-customer-routing.mjs",
|
|
93
|
+
"node": "./fesm2015/daffodil-customer-routing.mjs",
|
|
94
|
+
"default": "./fesm2020/daffodil-customer-routing.mjs"
|
|
95
|
+
},
|
|
96
|
+
"./state": {
|
|
97
|
+
"types": "./state/daffodil-customer-state.d.ts",
|
|
98
|
+
"esm2020": "./esm2020/state/daffodil-customer-state.mjs",
|
|
99
|
+
"es2020": "./fesm2020/daffodil-customer-state.mjs",
|
|
100
|
+
"es2015": "./fesm2015/daffodil-customer-state.mjs",
|
|
101
|
+
"node": "./fesm2015/daffodil-customer-state.mjs",
|
|
102
|
+
"default": "./fesm2020/daffodil-customer-state.mjs"
|
|
103
|
+
},
|
|
104
|
+
"./state/testing": {
|
|
105
|
+
"types": "./state/testing/daffodil-customer-state-testing.d.ts",
|
|
106
|
+
"esm2020": "./esm2020/state/testing/daffodil-customer-state-testing.mjs",
|
|
107
|
+
"es2020": "./fesm2020/daffodil-customer-state-testing.mjs",
|
|
108
|
+
"es2015": "./fesm2015/daffodil-customer-state-testing.mjs",
|
|
109
|
+
"node": "./fesm2015/daffodil-customer-state-testing.mjs",
|
|
110
|
+
"default": "./fesm2020/daffodil-customer-state-testing.mjs"
|
|
111
|
+
},
|
|
112
|
+
"./testing": {
|
|
113
|
+
"types": "./testing/daffodil-customer-testing.d.ts",
|
|
114
|
+
"esm2020": "./esm2020/testing/daffodil-customer-testing.mjs",
|
|
115
|
+
"es2020": "./fesm2020/daffodil-customer-testing.mjs",
|
|
116
|
+
"es2015": "./fesm2015/daffodil-customer-testing.mjs",
|
|
117
|
+
"node": "./fesm2015/daffodil-customer-testing.mjs",
|
|
118
|
+
"default": "./fesm2020/daffodil-customer-testing.mjs"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"sideEffects": false,
|
|
122
|
+
"dependencies": {
|
|
123
|
+
"tslib": "^2.3.0"
|
|
124
|
+
}
|
|
125
|
+
}
|
package/public_api.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CanDeactivate, UrlTree } from '@angular/router';
|
|
2
|
+
import { Store } from '@ngrx/store';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* A guard that will clear customer state errors before allowing route deactivation.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffClearErrorsGuard implements CanDeactivate<unknown> {
|
|
9
|
+
private store;
|
|
10
|
+
constructor(store: Store<any>);
|
|
11
|
+
canDeactivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffClearErrorsGuard, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffClearErrorsGuard>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DaffClearErrorsGuard } from './clear-errors.guard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/customer/routing",
|
|
3
|
+
"module": "../fesm2015/daffodil-customer-routing.mjs",
|
|
4
|
+
"es2020": "../fesm2020/daffodil-customer-routing.mjs",
|
|
5
|
+
"esm2020": "../esm2020/routing/daffodil-customer-routing.mjs",
|
|
6
|
+
"fesm2020": "../fesm2020/daffodil-customer-routing.mjs",
|
|
7
|
+
"fesm2015": "../fesm2015/daffodil-customer-routing.mjs",
|
|
8
|
+
"typings": "daffodil-customer-routing.d.ts",
|
|
9
|
+
"sideEffects": false
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Resolve } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffCustomerPageFacade } from '@daffodil/customer/state';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Dispatches customer load.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DaffCustomerResolver implements Resolve<Observable<boolean>> {
|
|
9
|
+
private facade;
|
|
10
|
+
constructor(facade: DaffCustomerPageFacade);
|
|
11
|
+
resolve(): Observable<boolean>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerResolver, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerResolver>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DaffCustomerResolver } from './customer.resolver';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Action } from '@ngrx/store';
|
|
2
|
+
import { DaffStateError } from '@daffodil/core/state';
|
|
3
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
4
|
+
/**
|
|
5
|
+
* The customer action types enum.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DaffCustomerActionTypes {
|
|
8
|
+
CustomerLoadAction = "[@daffodil/customer] Customer Load Action",
|
|
9
|
+
CustomerLoadSuccessAction = "[@daffodil/customer] Customer Load Success Action",
|
|
10
|
+
CustomerLoadFailureAction = "[@daffodil/customer] Customer Load Failure Action",
|
|
11
|
+
CustomerUpdateAction = "[@daffodil/customer] Customer Update Action",
|
|
12
|
+
CustomerUpdateSuccessAction = "[@daffodil/customer] Customer Update Success Action",
|
|
13
|
+
CustomerUpdateFailureAction = "[@daffodil/customer] Customer Update Failure Action",
|
|
14
|
+
CustomerChangeEmailAction = "[@daffodil/customer] Customer Change Email Action",
|
|
15
|
+
CustomerChangeEmailSuccessAction = "[@daffodil/customer] Customer Change Email Success Action",
|
|
16
|
+
CustomerChangeEmailFailureAction = "[@daffodil/customer] Customer Change Email Failure Action",
|
|
17
|
+
CustomerChangePasswordAction = "[@daffodil/customer] Customer Change Password Action",
|
|
18
|
+
CustomerChangePasswordSuccessAction = "[@daffodil/customer] Customer Change Password Success Action",
|
|
19
|
+
CustomerChangePasswordFailureAction = "[@daffodil/customer] Customer Change Password Failure Action",
|
|
20
|
+
CustomerClearErrorsAction = "[@daffodil/customer] Customer Clear Errors Action"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Loads the currently logged-in customer.
|
|
24
|
+
*
|
|
25
|
+
* @param query The customer query.
|
|
26
|
+
*/
|
|
27
|
+
export declare class DaffCustomerLoad implements Action {
|
|
28
|
+
readonly type = DaffCustomerActionTypes.CustomerLoadAction;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Indicates a successful load of the currently logged-in customer.
|
|
32
|
+
*/
|
|
33
|
+
export declare class DaffCustomerLoadSuccess<T extends DaffCustomer = DaffCustomer> implements Action {
|
|
34
|
+
payload: T;
|
|
35
|
+
readonly type = DaffCustomerActionTypes.CustomerLoadSuccessAction;
|
|
36
|
+
constructor(payload: T);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A failed customer load with the error message.
|
|
40
|
+
*/
|
|
41
|
+
export declare class DaffCustomerLoadFailure implements Action {
|
|
42
|
+
payload: DaffStateError;
|
|
43
|
+
readonly type = DaffCustomerActionTypes.CustomerLoadFailureAction;
|
|
44
|
+
constructor(payload: DaffStateError);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Updates the currently logged-in customer.
|
|
48
|
+
*
|
|
49
|
+
* @param query The customer query.
|
|
50
|
+
*/
|
|
51
|
+
export declare class DaffCustomerUpdate<T extends DaffCustomer = DaffCustomer> implements Action {
|
|
52
|
+
customer: Partial<T>;
|
|
53
|
+
readonly type = DaffCustomerActionTypes.CustomerUpdateAction;
|
|
54
|
+
constructor(customer: Partial<T>);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Indicates a successful update of the currently logged-in customer.
|
|
58
|
+
*/
|
|
59
|
+
export declare class DaffCustomerUpdateSuccess<T extends DaffCustomer = DaffCustomer> implements Action {
|
|
60
|
+
payload: T;
|
|
61
|
+
readonly type = DaffCustomerActionTypes.CustomerUpdateSuccessAction;
|
|
62
|
+
constructor(payload: T);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A failed customer update with the error message.
|
|
66
|
+
*/
|
|
67
|
+
export declare class DaffCustomerUpdateFailure implements Action {
|
|
68
|
+
payload: DaffStateError;
|
|
69
|
+
readonly type = DaffCustomerActionTypes.CustomerUpdateFailureAction;
|
|
70
|
+
constructor(payload: DaffStateError);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Changes the email of the currently logged-in customer.
|
|
74
|
+
*
|
|
75
|
+
* @param query The customer query.
|
|
76
|
+
*/
|
|
77
|
+
export declare class DaffCustomerChangeEmail implements Action {
|
|
78
|
+
email: string;
|
|
79
|
+
password: string;
|
|
80
|
+
readonly type = DaffCustomerActionTypes.CustomerChangeEmailAction;
|
|
81
|
+
constructor(email: string, password: string);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Indicates a successful email change of the currently logged-in customer.
|
|
85
|
+
*/
|
|
86
|
+
export declare class DaffCustomerChangeEmailSuccess<T extends DaffCustomer = DaffCustomer> implements Action {
|
|
87
|
+
payload: T;
|
|
88
|
+
readonly type = DaffCustomerActionTypes.CustomerChangeEmailSuccessAction;
|
|
89
|
+
constructor(payload: T);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A failed customer email change with the error message.
|
|
93
|
+
*/
|
|
94
|
+
export declare class DaffCustomerChangeEmailFailure implements Action {
|
|
95
|
+
payload: DaffStateError;
|
|
96
|
+
readonly type = DaffCustomerActionTypes.CustomerChangeEmailFailureAction;
|
|
97
|
+
constructor(payload: DaffStateError);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Changes the password of the currently logged-in customer.
|
|
101
|
+
*
|
|
102
|
+
* @param query The customer query.
|
|
103
|
+
*/
|
|
104
|
+
export declare class DaffCustomerChangePassword implements Action {
|
|
105
|
+
newPassword: string;
|
|
106
|
+
oldPassword: string;
|
|
107
|
+
readonly type = DaffCustomerActionTypes.CustomerChangePasswordAction;
|
|
108
|
+
constructor(newPassword: string, oldPassword: string);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Indicates a successful password change of the currently logged-in customer.
|
|
112
|
+
*/
|
|
113
|
+
export declare class DaffCustomerChangePasswordSuccess implements Action {
|
|
114
|
+
readonly type = DaffCustomerActionTypes.CustomerChangePasswordSuccessAction;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A failed customer password change with the error message.
|
|
118
|
+
*/
|
|
119
|
+
export declare class DaffCustomerChangePasswordFailure implements Action {
|
|
120
|
+
payload: DaffStateError;
|
|
121
|
+
readonly type = DaffCustomerActionTypes.CustomerChangePasswordFailureAction;
|
|
122
|
+
constructor(payload: DaffStateError);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* An action to clear all customer errors in state.
|
|
126
|
+
*/
|
|
127
|
+
export declare class DaffCustomerClearErrors implements Action {
|
|
128
|
+
readonly type = DaffCustomerActionTypes.CustomerClearErrorsAction;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* A union of the customer action types.
|
|
132
|
+
*/
|
|
133
|
+
export declare type DaffCustomerActions<T extends DaffCustomer = DaffCustomer> = DaffCustomerLoad | DaffCustomerLoadSuccess<T> | DaffCustomerLoadFailure | DaffCustomerUpdate | DaffCustomerUpdateSuccess<T> | DaffCustomerUpdateFailure | DaffCustomerChangeEmail | DaffCustomerChangeEmailSuccess<T> | DaffCustomerChangeEmailFailure | DaffCustomerChangePassword | DaffCustomerChangePasswordSuccess | DaffCustomerChangePasswordFailure | DaffCustomerClearErrors;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@ngrx/store";
|
|
3
|
+
import * as i2 from "@ngrx/effects";
|
|
4
|
+
/**
|
|
5
|
+
* Creates the customer feature store.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DaffCustomerStateModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStateModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStateModule, never, [typeof i1.StoreFeatureModule, typeof i2.EffectsFeatureModule], never>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStateModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Actions } from '@ngrx/effects';
|
|
2
|
+
import { ErrorTransformer } from '@daffodil/core/state';
|
|
3
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
4
|
+
import { DaffCustomerDriverInterface } from '@daffodil/customer/driver';
|
|
5
|
+
import { DaffCustomerLoadSuccess, DaffCustomerLoadFailure, DaffCustomerUpdateFailure, DaffCustomerUpdateSuccess, DaffCustomerChangeEmailFailure, DaffCustomerChangeEmailSuccess, DaffCustomerChangePasswordFailure, DaffCustomerChangePasswordSuccess } from '../actions/customer.actions';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class DaffCustomerEffects<T extends DaffCustomer = DaffCustomer> {
|
|
8
|
+
private actions$;
|
|
9
|
+
private driver;
|
|
10
|
+
private errorMatcher;
|
|
11
|
+
constructor(actions$: Actions, driver: DaffCustomerDriverInterface<T>, errorMatcher: ErrorTransformer);
|
|
12
|
+
/**
|
|
13
|
+
* An effect for the loading of an customer.
|
|
14
|
+
*/
|
|
15
|
+
get$: import("rxjs").Observable<DaffCustomerLoadFailure | DaffCustomerLoadSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
|
|
16
|
+
/**
|
|
17
|
+
* An effect for the updating of an customer.
|
|
18
|
+
*/
|
|
19
|
+
update$: import("rxjs").Observable<DaffCustomerUpdateFailure | DaffCustomerUpdateSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
|
|
20
|
+
/**
|
|
21
|
+
* An effect for changing a customer email.
|
|
22
|
+
*/
|
|
23
|
+
changeEmail$: import("rxjs").Observable<DaffCustomerChangeEmailFailure | DaffCustomerChangeEmailSuccess<T>> & import("@ngrx/effects").CreateEffectMetadata;
|
|
24
|
+
/**
|
|
25
|
+
* An effect for changing a customer password.
|
|
26
|
+
*/
|
|
27
|
+
changePassword$: import("rxjs").Observable<DaffCustomerChangePasswordSuccess | DaffCustomerChangePasswordFailure> & import("@ngrx/effects").CreateEffectMetadata;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerEffects<any>, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerEffects<any>>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Store, Action } from '@ngrx/store';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
4
|
+
import { DaffCustomerReducerState, DaffCustomerStateRootSlice } from '../../reducers/public_api';
|
|
5
|
+
import { DaffCustomerPageFacadeInterface } from './interface';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*
|
|
10
|
+
* Serves as the base for a customer facade.
|
|
11
|
+
* Extend this class and pass in the selectors for the specific state you wish to target.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DaffCustomerPageFacade<T extends DaffCustomer = DaffCustomer> implements DaffCustomerPageFacadeInterface<T> {
|
|
14
|
+
private store;
|
|
15
|
+
customer$: Observable<T>;
|
|
16
|
+
loadingState$: Observable<DaffCustomerReducerState<T>['loading']>;
|
|
17
|
+
loading$: Observable<boolean>;
|
|
18
|
+
resolving$: Observable<boolean>;
|
|
19
|
+
mutating$: Observable<boolean>;
|
|
20
|
+
errors$: Observable<DaffCustomerReducerState<T>['errors']>;
|
|
21
|
+
hasErrors$: Observable<boolean>;
|
|
22
|
+
constructor(store: Store<DaffCustomerStateRootSlice>);
|
|
23
|
+
dispatch(action: Action): void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerPageFacade<any>, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerPageFacade<any>>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DaffOperationStateFacadeInterface } from '@daffodil/core/state';
|
|
3
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
4
|
+
import { DaffCustomerReducerState } from '../../public_api';
|
|
5
|
+
/**
|
|
6
|
+
* Exposes the customer state selectors.
|
|
7
|
+
*/
|
|
8
|
+
export interface DaffCustomerPageFacadeInterface<T extends DaffCustomer = DaffCustomer> extends DaffOperationStateFacadeInterface<DaffCustomerReducerState<T>> {
|
|
9
|
+
/**
|
|
10
|
+
* Whether there is a pending customer operation.
|
|
11
|
+
*/
|
|
12
|
+
customer$: Observable<T>;
|
|
13
|
+
}
|
package/state/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public_api';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@daffodil/customer/state",
|
|
3
|
+
"module": "../fesm2015/daffodil-customer-state.mjs",
|
|
4
|
+
"es2020": "../fesm2020/daffodil-customer-state.mjs",
|
|
5
|
+
"esm2020": "../esm2020/state/daffodil-customer-state.mjs",
|
|
6
|
+
"fesm2020": "../fesm2020/daffodil-customer-state.mjs",
|
|
7
|
+
"fesm2015": "../fesm2015/daffodil-customer-state.mjs",
|
|
8
|
+
"typings": "daffodil-customer-state.d.ts",
|
|
9
|
+
"sideEffects": false
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
2
|
+
import { DaffCustomerReducerState } from './interface';
|
|
3
|
+
/**
|
|
4
|
+
* Stores the customer in state.
|
|
5
|
+
* Sets loading to false and resets errors.
|
|
6
|
+
*/
|
|
7
|
+
export declare function daffCustomerStateStoreCustomer<T extends DaffCustomer = DaffCustomer>(customer: T, state: DaffCustomerReducerState<T>): DaffCustomerReducerState<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DaffOperationState } from '@daffodil/core/state';
|
|
2
|
+
import { DaffCustomer } from '@daffodil/customer';
|
|
3
|
+
/**
|
|
4
|
+
* The main customer state.
|
|
5
|
+
* Contains info about the current or most recent customer operation.
|
|
6
|
+
*/
|
|
7
|
+
export interface DaffCustomerReducerState<T extends DaffCustomer = DaffCustomer> extends DaffOperationState {
|
|
8
|
+
customer: T;
|
|
9
|
+
}
|