@daffodil/customer 0.94.1 → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/fesm2022/daffodil-customer-driver-in-memory.mjs +344 -324
  2. package/fesm2022/daffodil-customer-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-customer-driver-magento-2.4.7-testing.mjs +116 -0
  4. package/fesm2022/daffodil-customer-driver-magento-2.4.7-testing.mjs.map +1 -0
  5. package/fesm2022/daffodil-customer-driver-magento-2.4.7.mjs +399 -0
  6. package/fesm2022/daffodil-customer-driver-magento-2.4.7.mjs.map +1 -0
  7. package/fesm2022/daffodil-customer-driver-magento-auto-testing.mjs +7 -0
  8. package/fesm2022/daffodil-customer-driver-magento-auto-testing.mjs.map +1 -0
  9. package/fesm2022/daffodil-customer-driver-magento-auto.mjs +7 -0
  10. package/fesm2022/daffodil-customer-driver-magento-auto.mjs.map +1 -0
  11. package/fesm2022/daffodil-customer-driver-testing.mjs +152 -105
  12. package/fesm2022/daffodil-customer-driver-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-customer-driver.mjs +45 -88
  14. package/fesm2022/daffodil-customer-driver.mjs.map +1 -1
  15. package/fesm2022/daffodil-customer-routing.mjs +86 -52
  16. package/fesm2022/daffodil-customer-routing.mjs.map +1 -1
  17. package/fesm2022/daffodil-customer-state-testing.mjs +176 -108
  18. package/fesm2022/daffodil-customer-state-testing.mjs.map +1 -1
  19. package/fesm2022/daffodil-customer-state.mjs +581 -718
  20. package/fesm2022/daffodil-customer-state.mjs.map +1 -1
  21. package/fesm2022/daffodil-customer-testing.mjs +102 -75
  22. package/fesm2022/daffodil-customer-testing.mjs.map +1 -1
  23. package/fesm2022/daffodil-customer.mjs +0 -4
  24. package/package.json +1 -1
  25. package/types/daffodil-customer-driver-in-memory.d.ts +102 -104
  26. package/types/daffodil-customer-driver-magento-2.4.7-testing.d.ts +33 -0
  27. package/types/daffodil-customer-driver-magento-2.4.7.d.ts +193 -0
  28. package/types/daffodil-customer-driver-magento-auto-testing.d.ts +1 -0
  29. package/types/daffodil-customer-driver-magento-auto.d.ts +1 -0
  30. package/types/daffodil-customer-driver-testing.d.ts +38 -37
  31. package/types/daffodil-customer-driver.d.ts +76 -90
  32. package/types/daffodil-customer-routing.d.ts +18 -22
  33. package/types/daffodil-customer-state-testing.d.ts +43 -43
  34. package/types/daffodil-customer-state.d.ts +240 -264
  35. package/types/daffodil-customer-testing.d.ts +27 -31
  36. package/types/daffodil-customer.d.ts +33 -37
  37. package/fesm2022/daffodil-customer-driver-magento-testing.mjs +0 -75
  38. package/fesm2022/daffodil-customer-driver-magento-testing.mjs.map +0 -1
  39. package/fesm2022/daffodil-customer-driver-magento.mjs +0 -448
  40. package/fesm2022/daffodil-customer-driver-magento.mjs.map +0 -1
  41. package/fesm2022/daffodil-customer.mjs.map +0 -1
  42. package/types/daffodil-customer-driver-magento-testing.d.ts +0 -37
  43. package/types/daffodil-customer-driver-magento.d.ts +0 -205
@@ -1,46 +1,42 @@
1
- import { DaffModelFactory } from '@daffodil/core/testing';
2
- import { DaffCustomerAddress, DaffCustomer } from '@daffodil/customer';
3
- import { MockDaffPersonalAddress } from '@daffodil/geography/testing';
4
- import * as i0 from '@angular/core';
5
-
1
+ import { DaffModelFactory } from "@daffodil/core/testing";
2
+ import { DaffCustomer, DaffCustomerAddress } from "@daffodil/customer";
3
+ import { MockDaffPersonalAddress } from "@daffodil/geography/testing";
4
+ import * as i0 from "@angular/core";
6
5
  /**
7
6
  * Mock class for {@link DaffCustomerAddress}.
8
7
  */
9
- declare class MockDaffCustomerAddress extends MockDaffPersonalAddress implements DaffCustomerAddress {
10
- id: string;
11
- defaultBilling: boolean;
12
- defaultShipping: boolean;
8
+ export declare class MockDaffCustomerAddress extends MockDaffPersonalAddress implements DaffCustomerAddress {
9
+ id: string;
10
+ defaultBilling: boolean;
11
+ defaultShipping: boolean;
13
12
  }
14
13
  /**
15
14
  * Model factory for {@link DaffCustomerAddress}.
16
15
  */
17
- declare class DaffCustomerAddressFactory extends DaffModelFactory<DaffCustomerAddress> {
18
- constructor();
19
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressFactory, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerAddressFactory>;
16
+ export declare class DaffCustomerAddressFactory extends DaffModelFactory<DaffCustomerAddress> {
17
+ constructor();
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerAddressFactory, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
21
20
  }
22
-
23
21
  /**
24
22
  * Mock class for {@link DaffCustomer}.
25
23
  */
26
- declare class MockDaffCustomer implements DaffCustomer {
27
- private addressFactory;
28
- id: string;
29
- email: string;
30
- firstName: string;
31
- lastName: string;
32
- isSubscribed: boolean;
33
- addresses: DaffCustomerAddress[];
34
- constructor(addressFactory: DaffCustomerAddressFactory);
35
- private createAddresses;
24
+ export declare class MockDaffCustomer implements DaffCustomer {
25
+ private addressFactory;
26
+ id: string;
27
+ email: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ isSubscribed: boolean;
31
+ addresses: DaffCustomerAddress[];
32
+ constructor(addressFactory: DaffCustomerAddressFactory);
33
+ private createAddresses;
36
34
  }
37
35
  /**
38
36
  * Model factory for {@link DaffCustomer}.
39
37
  */
40
- declare class DaffCustomerFactory extends DaffModelFactory<DaffCustomer> {
41
- constructor(addressFactory: DaffCustomerAddressFactory);
42
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerFactory, never>;
43
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerFactory>;
44
- }
45
-
46
- export { DaffCustomerAddressFactory, DaffCustomerFactory, MockDaffCustomer, MockDaffCustomerAddress };
38
+ export declare class DaffCustomerFactory extends DaffModelFactory<DaffCustomer> {
39
+ constructor(addressFactory: DaffCustomerAddressFactory);
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerFactory, never>;
41
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
42
+ }
@@ -1,44 +1,40 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffPersonalAddress } from '@daffodil/geography';
3
-
1
+ import { DaffIdentifiable } from "@daffodil/core";
2
+ import { DaffPersonalAddress } from "@daffodil/geography";
4
3
  /**
5
4
  * An address that belongs to a {@link DaffCustomer}
6
5
  */
7
- interface DaffCustomerAddress extends DaffPersonalAddress, DaffIdentifiable {
8
- /**
9
- * Whether this address is the customer's default billing address.
10
- */
11
- defaultBilling: boolean;
12
- /**
13
- * Whether this address is the customer's default shipping address.
14
- */
15
- defaultShipping: boolean;
6
+ export interface DaffCustomerAddress extends DaffPersonalAddress, DaffIdentifiable {
7
+ /**
8
+ * Whether this address is the customer's default billing address.
9
+ */
10
+ defaultBilling: boolean;
11
+ /**
12
+ * Whether this address is the customer's default shipping address.
13
+ */
14
+ defaultShipping: boolean;
16
15
  }
17
-
18
16
  /**
19
17
  * A customer.
20
18
  */
21
- interface DaffCustomer extends DaffIdentifiable {
22
- /**
23
- * The customer's email.
24
- */
25
- email: string;
26
- /**
27
- * The customer's first or birth name.
28
- */
29
- firstName: string;
30
- /**
31
- * The customer's last or family name.
32
- */
33
- lastName: string;
34
- /**
35
- * Whether the customer is subscribed to the newsletter.
36
- */
37
- isSubscribed: boolean;
38
- /**
39
- * A list of the customer's stored addresses.
40
- */
41
- addresses: DaffCustomerAddress[];
42
- }
43
-
44
- export type { DaffCustomer, DaffCustomerAddress };
19
+ export interface DaffCustomer extends DaffIdentifiable {
20
+ /**
21
+ * The customer's email.
22
+ */
23
+ email: string;
24
+ /**
25
+ * The customer's first or birth name.
26
+ */
27
+ firstName: string;
28
+ /**
29
+ * The customer's last or family name.
30
+ */
31
+ lastName: string;
32
+ /**
33
+ * Whether the customer is subscribed to the newsletter.
34
+ */
35
+ isSubscribed: boolean;
36
+ /**
37
+ * A list of the customer's stored addresses.
38
+ */
39
+ addresses: DaffCustomerAddress[];
40
+ }
@@ -1,75 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable } from '@angular/core';
3
- import { faker } from '@faker-js/faker/locale/en_US';
4
- import { enforceUnique, DaffModelFactory } from '@daffodil/core/testing';
5
-
6
- class MockMagentoCustomerAddress {
7
- constructor() {
8
- this.__typename = 'CustomerAddress';
9
- this.id = enforceUnique(faker.number.int);
10
- this.region = {
11
- __typename: 'CustomerAddressRegion',
12
- region_code: faker.location.state({ abbreviated: true }),
13
- region_id: enforceUnique(faker.number.int),
14
- };
15
- this.country_code = faker.location.countryCode();
16
- this.street = [faker.location.streetAddress()];
17
- this.company = faker.company.name();
18
- this.telephone = faker.phone.number();
19
- this.postcode = faker.location.zipCode();
20
- this.city = faker.location.city();
21
- this.firstname = faker.person.firstName();
22
- this.lastname = faker.person.lastName();
23
- this.email = faker.internet.email();
24
- this.default_billing = faker.datatype.boolean();
25
- this.default_shipping = faker.datatype.boolean();
26
- }
27
- }
28
- class MagentoCustomerAddressFactory extends DaffModelFactory {
29
- constructor() {
30
- super(MockMagentoCustomerAddress);
31
- }
32
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
33
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerAddressFactory, providedIn: 'root' }); }
34
- }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerAddressFactory, decorators: [{
36
- type: Injectable,
37
- args: [{
38
- providedIn: 'root',
39
- }]
40
- }], ctorParameters: () => [] });
41
-
42
- class MockMagentoCustomer {
43
- constructor(addressFactory) {
44
- this.addressFactory = addressFactory;
45
- this.__typename = 'Customer';
46
- this.email = faker.internet.email();
47
- this.firstname = faker.person.firstName();
48
- this.lastname = faker.person.lastName();
49
- this.is_subscribed = faker.datatype.boolean();
50
- this.addresses = this.createAddresses();
51
- }
52
- createAddresses() {
53
- return this.addressFactory.createMany(faker.number.int({ min: 3, max: 5 }));
54
- }
55
- }
56
- class MagentoCustomerFactory extends DaffModelFactory {
57
- constructor(addressFactory) {
58
- super(MockMagentoCustomer, addressFactory);
59
- }
60
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerFactory, deps: [{ token: MagentoCustomerAddressFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
61
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerFactory, providedIn: 'root' }); }
62
- }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoCustomerFactory, decorators: [{
64
- type: Injectable,
65
- args: [{
66
- providedIn: 'root',
67
- }]
68
- }], ctorParameters: () => [{ type: MagentoCustomerAddressFactory }] });
69
-
70
- /**
71
- * Generated bundle index. Do not edit.
72
- */
73
-
74
- export { MagentoCustomerAddressFactory, MagentoCustomerFactory, MockMagentoCustomerAddress };
75
- //# sourceMappingURL=daffodil-customer-driver-magento-testing.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daffodil-customer-driver-magento-testing.mjs","sources":["../../../libs/customer/driver/magento/testing/src/factories/address.factory.ts","../../../libs/customer/driver/magento/testing/src/factories/customer.factory.ts","../../../libs/customer/driver/magento/testing/src/daffodil-customer-driver-magento-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffModelFactory,\n enforceUnique,\n} from '@daffodil/core/testing';\nimport { MagentoCustomerAddress } from '@daffodil/customer/driver/magento';\n\nexport class MockMagentoCustomerAddress implements MagentoCustomerAddress {\n __typename = 'CustomerAddress';\n id = enforceUnique(faker.number.int);\n region = {\n __typename: 'CustomerAddressRegion',\n region_code: faker.location.state({ abbreviated: true }),\n region_id: enforceUnique(faker.number.int),\n };\n country_code = faker.location.countryCode();\n street = [faker.location.streetAddress()];\n company = faker.company.name();\n telephone = faker.phone.number();\n postcode = faker.location.zipCode();\n city = faker.location.city();\n firstname = faker.person.firstName();\n lastname = faker.person.lastName();\n email = faker.internet.email();\n default_billing = faker.datatype.boolean();\n default_shipping = faker.datatype.boolean();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoCustomerAddressFactory extends DaffModelFactory<MagentoCustomerAddress> {\n constructor() {\n super(MockMagentoCustomerAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport {\n MagentoCustomer,\n MagentoCustomerAddress,\n} from '@daffodil/customer/driver/magento';\n\nimport { MagentoCustomerAddressFactory } from './address.factory';\n\nclass MockMagentoCustomer implements MagentoCustomer {\n __typename = <const>'Customer';\n email = faker.internet.email();\n firstname = faker.person.firstName();\n lastname = faker.person.lastName();\n is_subscribed = faker.datatype.boolean();\n addresses = this.createAddresses();\n\n constructor(\n private addressFactory: MagentoCustomerAddressFactory,\n ) {}\n\n private createAddresses(): MagentoCustomerAddress[] {\n return this.addressFactory.createMany(faker.number.int({ min: 3, max: 5 }));\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MagentoCustomerFactory extends DaffModelFactory<MagentoCustomer> {\n constructor(\n addressFactory: MagentoCustomerAddressFactory,\n ) {\n super(MockMagentoCustomer, addressFactory);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.MagentoCustomerAddressFactory"],"mappings":";;;;;MASa,0BAA0B,CAAA;AAAvC,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,UAAU,GAAG,iBAAiB;QAC9B,IAAA,CAAA,EAAE,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