@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,205 +0,0 @@
1
- import { DaffCustomer, DaffCustomerAddress } from '@daffodil/customer';
2
- import * as apollo_angular from 'apollo-angular';
3
- import { Apollo } from 'apollo-angular';
4
- import { DaffError } from '@daffodil/core';
5
- import { DaffCustomerInvalidAPIResponseError, DaffCustomerDriverInterface } from '@daffodil/customer/driver';
6
- import { Observable } from 'rxjs';
7
- import * as i0 from '@angular/core';
8
- import { ModuleWithProviders } from '@angular/core';
9
- import * as i1 from '@angular/common';
10
-
11
- declare enum MagentoCustomerGender {
12
- MALE = 1,
13
- FEMALE = 2
14
- }
15
-
16
- interface MagentoCustomerInput {
17
- allow_remote_shopping_assistance?: boolean;
18
- date_of_birth?: string;
19
- firstname?: string;
20
- gender?: MagentoCustomerGender;
21
- is_subscribed?: boolean;
22
- lastname?: string;
23
- middlename?: string;
24
- password?: string;
25
- prefix?: string;
26
- suffix?: string;
27
- taxvat?: string;
28
- }
29
-
30
- interface MagentoCustomerAddressAttributeInput {
31
- attribute_code?: string;
32
- value?: string;
33
- }
34
-
35
- interface MagentoCustomerAddressRegionInput {
36
- region?: string;
37
- region_code?: string;
38
- /**
39
- * Note that this is always required for US addresses even though the schema does not enforce it.
40
- */
41
- region_id?: number;
42
- }
43
-
44
- interface MagentoCustomerAddressInput {
45
- city?: string;
46
- company?: string;
47
- country_code?: string;
48
- country_id?: string;
49
- custom_attributes?: MagentoCustomerAddressAttributeInput;
50
- default_billing?: boolean;
51
- default_shipping?: boolean;
52
- fax?: string;
53
- firstname?: string;
54
- lastname?: string;
55
- middlename?: string;
56
- postcode?: string;
57
- prefix?: string;
58
- region?: MagentoCustomerAddressRegionInput;
59
- street?: string[];
60
- suffix?: string;
61
- telephone?: string;
62
- vat_id?: string;
63
- }
64
-
65
- interface MagentoCustomerAddress {
66
- id?: number;
67
- region: {
68
- region_code: string;
69
- region_id: number;
70
- };
71
- country_code?: string;
72
- street?: string[];
73
- company?: string;
74
- telephone?: string;
75
- postcode?: string;
76
- city?: string;
77
- firstname?: string;
78
- lastname?: string;
79
- email?: string;
80
- default_billing?: boolean;
81
- default_shipping?: boolean;
82
- }
83
-
84
- interface MagentoCustomer {
85
- email: string;
86
- firstname: string;
87
- lastname: string;
88
- is_subscribed: boolean;
89
- addresses: MagentoCustomerAddress[];
90
- }
91
-
92
- interface MagentoGetCustomerResponse {
93
- customer: MagentoCustomer;
94
- }
95
-
96
- interface MagentoChangeEmailResponse {
97
- updateCustomerEmail: {
98
- customer: MagentoCustomer;
99
- };
100
- }
101
-
102
- interface MagentoChangePasswordResponse {
103
- changeCustomerPassword: {
104
- email: string;
105
- };
106
- }
107
-
108
- interface MagentoUpdateCustomerResponse {
109
- updateCustomerV2: {
110
- customer: MagentoCustomer;
111
- };
112
- }
113
-
114
- interface MagentoGetCustomerAddressesResponse {
115
- customer: Pick<MagentoCustomer, 'addresses'>;
116
- }
117
-
118
- interface MagentoCreateCustomerAddressResponse {
119
- createCustomerAddress: MagentoCustomerAddress;
120
- }
121
-
122
- interface MagentoUpdateCustomerAddressResponse {
123
- updateCustomerAddress: MagentoCustomerAddress;
124
- }
125
-
126
- interface MagentoDeleteCustomerAddressResponse {
127
- deleteCustomerAddress: boolean;
128
- }
129
-
130
- declare const magentoCustomerInputTransform: (customer: Partial<DaffCustomer>) => MagentoCustomerInput;
131
-
132
- declare const magentoCustomerAddressInputTransform: (address: Partial<DaffCustomerAddress>) => MagentoCustomerAddressInput;
133
-
134
- declare const magentoCustomerTransform: (customer: MagentoCustomer) => DaffCustomer;
135
-
136
- declare const magentoCustomerAddressTransform: (address: MagentoCustomerAddress) => DaffCustomerAddress;
137
-
138
- declare const magentoCustomerFragment: apollo_angular.TypedDocumentNode<unknown, unknown>;
139
-
140
- declare const magentoCustomerAddressFragment: apollo_angular.TypedDocumentNode<unknown, unknown>;
141
-
142
- declare const MAGENTO_GET_CUSTOMER_QUERY_NAME = "MagentoGetCustomer";
143
- declare const getCustomer: apollo_angular.TypedDocumentNode<unknown, unknown>;
144
-
145
- declare const MAGENTO_GET_CUSTOMER_ADDRESSES_QUERY_NAME = "MagentoGetCustomerAddresses";
146
- declare const getCustomerAddresses: apollo_angular.TypedDocumentNode<unknown, unknown>;
147
-
148
- declare const createCustomerAddress: apollo_angular.TypedDocumentNode<unknown, unknown>;
149
-
150
- declare const updateCustomerAddress: apollo_angular.TypedDocumentNode<unknown, unknown>;
151
-
152
- declare const deleteCustomerAddress: apollo_angular.TypedDocumentNode<unknown, unknown>;
153
-
154
- declare const MAGENTO_UPDATE_CUSTOMER_QUERY_NAME = "MagentoUpdateCustomer";
155
- declare const updateCustomer: apollo_angular.TypedDocumentNode<unknown, unknown>;
156
-
157
- declare const MAGENTO_UPDATE_EMAIL_QUERY_NAME = "MagentoUpdateEmail";
158
- declare const updateEmail: apollo_angular.TypedDocumentNode<unknown, unknown>;
159
-
160
- declare const MAGENTO_CHANGE_PASSWORD_QUERY_NAME = "MagentoChangePassword";
161
- declare const changePassword: apollo_angular.TypedDocumentNode<unknown, unknown>;
162
-
163
- declare function transformMagentoReviewsError(error: any, requestPayload?: unknown): DaffError | DaffCustomerInvalidAPIResponseError;
164
-
165
- declare const validateGetCustomerResponse: (response: Apollo.QueryResult<MagentoGetCustomerResponse>) => Apollo.QueryResult<MagentoGetCustomerResponse>;
166
-
167
- declare const validateChangeEmailResponse: (response: Apollo.QueryResult<MagentoChangeEmailResponse>) => Apollo.QueryResult<MagentoChangeEmailResponse>;
168
-
169
- declare const validateChangePasswordResponse: (response: Apollo.QueryResult<MagentoChangePasswordResponse>) => Apollo.QueryResult<MagentoChangePasswordResponse>;
170
-
171
- declare const validateGetCustomerAddressesResponse: (response: Apollo.QueryResult<MagentoGetCustomerAddressesResponse>) => Apollo.QueryResult<MagentoGetCustomerAddressesResponse>;
172
-
173
- declare const validateCreateCustomerAddressResponse: (response: Apollo.QueryResult<MagentoCreateCustomerAddressResponse>) => Apollo.QueryResult<MagentoCreateCustomerAddressResponse>;
174
-
175
- declare const validateUpdateCustomerAddressResponse: (response: Apollo.QueryResult<MagentoUpdateCustomerAddressResponse>) => Apollo.QueryResult<MagentoUpdateCustomerAddressResponse>;
176
-
177
- declare const validateDeleteCustomerAddressResponse: (response: Apollo.QueryResult<MagentoDeleteCustomerAddressResponse>) => Apollo.QueryResult<MagentoDeleteCustomerAddressResponse>;
178
-
179
- declare const validateUpdateCustomerResponse: (response: Apollo.QueryResult<MagentoUpdateCustomerResponse>) => Apollo.QueryResult<MagentoUpdateCustomerResponse>;
180
-
181
- /**
182
- * A service for making Magento GraphQL queries for customers.
183
- *
184
- * @inheritdoc
185
- */
186
- declare class DaffCustomerMagentoService implements DaffCustomerDriverInterface {
187
- private apollo;
188
- constructor(apollo: Apollo);
189
- changeEmail(email: string, password: string): Observable<DaffCustomer>;
190
- changePassword(oldPassword: string, newPassword: string): Observable<void>;
191
- get(): Observable<DaffCustomer>;
192
- update(customer: Partial<DaffCustomer>): Observable<DaffCustomer>;
193
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerMagentoService, never>;
194
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffCustomerMagentoService>;
195
- }
196
-
197
- declare class DaffCustomerMagentoDriverModule {
198
- static forRoot(): ModuleWithProviders<DaffCustomerMagentoDriverModule>;
199
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerMagentoDriverModule, never>;
200
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerMagentoDriverModule, never, [typeof i1.CommonModule], never>;
201
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerMagentoDriverModule>;
202
- }
203
-
204
- 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 };
205
- export type { MagentoChangeEmailResponse, MagentoChangePasswordResponse, MagentoCreateCustomerAddressResponse, MagentoCustomer, MagentoCustomerAddress, MagentoCustomerAddressAttributeInput, MagentoCustomerAddressInput, MagentoCustomerAddressRegionInput, MagentoCustomerInput, MagentoDeleteCustomerAddressResponse, MagentoGetCustomerAddressesResponse, MagentoGetCustomerResponse, MagentoUpdateCustomerAddressResponse, MagentoUpdateCustomerResponse };