@akinon/next 1.47.0-rc.8 → 1.47.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 (54) hide show
  1. package/CHANGELOG.md +2 -455
  2. package/api/client.ts +17 -50
  3. package/assets/styles/index.scss +26 -50
  4. package/components/index.ts +0 -1
  5. package/components/input.tsx +7 -21
  6. package/components/link.tsx +13 -17
  7. package/components/pagination.tsx +2 -1
  8. package/components/price.tsx +4 -11
  9. package/components/selected-payment-option-view.tsx +38 -26
  10. package/data/client/account.ts +9 -10
  11. package/data/client/address.ts +8 -32
  12. package/data/client/api.ts +2 -2
  13. package/data/client/b2b.ts +2 -35
  14. package/data/client/basket.ts +5 -6
  15. package/data/client/checkout.ts +4 -47
  16. package/data/client/user.ts +2 -3
  17. package/data/server/category.ts +2 -2
  18. package/data/server/list.ts +2 -2
  19. package/data/server/product.ts +13 -15
  20. package/data/server/special-page.ts +2 -2
  21. package/data/urls.ts +2 -9
  22. package/hooks/index.ts +1 -2
  23. package/hooks/use-payment-options.ts +1 -2
  24. package/lib/cache.ts +6 -18
  25. package/middlewares/default.ts +8 -91
  26. package/middlewares/locale.ts +30 -32
  27. package/middlewares/pretty-url.ts +0 -4
  28. package/middlewares/url-redirection.ts +0 -4
  29. package/package.json +4 -5
  30. package/plugins.d.ts +0 -1
  31. package/redux/middlewares/checkout.ts +11 -70
  32. package/redux/reducers/checkout.ts +5 -24
  33. package/redux/reducers/config.ts +0 -2
  34. package/types/commerce/account.ts +0 -1
  35. package/types/commerce/address.ts +1 -1
  36. package/types/commerce/b2b.ts +2 -12
  37. package/types/commerce/checkout.ts +0 -30
  38. package/types/commerce/misc.ts +0 -2
  39. package/types/commerce/order.ts +0 -12
  40. package/types/index.ts +2 -31
  41. package/utils/app-fetch.ts +3 -6
  42. package/utils/generate-commerce-search-params.ts +2 -6
  43. package/utils/index.ts +6 -27
  44. package/utils/menu-generator.ts +2 -2
  45. package/utils/server-translation.ts +1 -5
  46. package/utils/server-variables.ts +1 -2
  47. package/with-pz-config.js +1 -11
  48. package/assets/styles/index.css +0 -49
  49. package/assets/styles/index.css.map +0 -1
  50. package/components/file-input.tsx +0 -8
  51. package/hooks/use-message-listener.ts +0 -24
  52. package/lib/cache-handler.mjs +0 -33
  53. package/routes/pretty-url.tsx +0 -194
  54. package/utils/redirection-iframe.ts +0 -85
package/CHANGELOG.md CHANGED
@@ -1,151 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.47.0-rc.8
4
-
5
- ### Minor Changes
6
-
7
- - d93a507: ZERO-2900: Fix pretty url rewrite
8
-
9
- ## 1.47.0-rc.7
10
-
11
- ### Minor Changes
12
-
13
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
14
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
15
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
16
- - fda5b92: ZERO-2725: fix invalid import
17
- - 2d9b2b2: ZERO-2816: Add segment to headers
18
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
19
- - 8d9ac9a: ZERO-2794: Add field to order type
20
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
21
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
22
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
23
- - 3bf2dd9: ZERO-2551: Fix search page
24
- - e9541a1: ZERO-2816: Add headers to url
25
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
26
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
27
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
28
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
29
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
30
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
31
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
32
- - d3474c6: ZERO-2655: Add data source shipping option
33
- - 75080fd6: ZERO-2630: Add max limit to postcode area
34
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
35
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
36
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
37
- - bbe18b9f: ZERO-2575: Fix build error
38
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
39
- - 4920742: Disable getCachedTranslations
40
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
41
- - 7e56d6b: ZERO-2841: Update api tagTypes
42
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
43
- - 98bb8dc: ZERO-2706: Cache getTranlations method
44
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
45
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
46
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
47
- - fad2768: ZERO-2739: add gpay to payment plugin map
48
- - dff0d595: ZERO-2659: add formData support to proxy api requests
49
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
50
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
51
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
52
- - beb499e6: ZERO-2551: Add new tsconfig paths
53
- - 948eb42: ZERO-2852: Add out of stock endpoints
54
- - 146ea39: ZERO-2774: Update imports
55
- - f2c92d5: ZERO-2816: Update cookie name
56
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
57
- - c47be30: ZERO-2744: Update Order and OrderItem types
58
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
59
- - 040ec95: ZERO-2875: Add edit collection endpoints
60
- - f046f8e0: ZERO-2575: update version for react-number-format
61
- - b9273fd: ZERO-2889: add host headers to requests
62
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
63
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
64
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
65
-
66
- ## 1.47.0-rc.6
67
-
68
- ### Minor Changes
69
-
70
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
71
-
72
- ## 1.47.0-rc.5
73
-
74
- ### Minor Changes
75
-
76
- - b9273fd: ZERO-2889: add host headers to requests
77
-
78
- ## 1.47.0-rc.4
79
-
80
- ### Minor Changes
81
-
82
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
83
-
84
- ## 1.47.0-rc.3
85
-
86
- ## 1.47.0-rc.2
3
+ ## 1.47.0
87
4
 
88
5
  ### Minor Changes
89
6
 
90
- - 040ec95: ZERO-2875: Add edit collection endpoints
91
-
92
- ## 1.47.0-rc.1
93
-
94
- ### Minor Changes
95
-
96
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
97
-
98
- ## 1.47.0-rc.0
99
-
100
- ### Minor Changes
101
-
102
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
103
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
104
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
105
- - fda5b92: ZERO-2725: fix invalid import
106
- - 2d9b2b2: ZERO-2816: Add segment to headers
107
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
108
- - 8d9ac9a: ZERO-2794: Add field to order type
109
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
110
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
111
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
112
- - 3bf2dd9: ZERO-2551: Fix search page
113
- - e9541a1: ZERO-2816: Add headers to url
114
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
115
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
116
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
117
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
118
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
119
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
120
- - d3474c6: ZERO-2655: Add data source shipping option
121
- - 75080fd6: ZERO-2630: Add max limit to postcode area
122
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
123
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
124
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
125
- - bbe18b9f: ZERO-2575: Fix build error
126
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
127
- - 4920742: Disable getCachedTranslations
128
- - 7e56d6b: ZERO-2841: Update api tagTypes
129
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
130
- - 98bb8dc: ZERO-2706: Cache getTranlations method
131
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
132
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
133
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
134
- - fad2768: ZERO-2739: add gpay to payment plugin map
135
- - dff0d595: ZERO-2659: add formData support to proxy api requests
136
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
137
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
138
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
139
- - beb499e6: ZERO-2551: Add new tsconfig paths
140
7
  - 948eb42: ZERO-2852: Add out of stock endpoints
141
- - 146ea39: ZERO-2774: Update imports
142
- - f2c92d5: ZERO-2816: Update cookie name
143
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
144
- - c47be30: ZERO-2744: Update Order and OrderItem types
145
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
146
- - f046f8e0: ZERO-2575: update version for react-number-format
147
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
148
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
8
+ - 040ec95: ZERO-2875: Add edit collection endpoints
149
9
 
150
10
  ## 1.46.0
151
11
 
@@ -153,126 +13,7 @@
153
13
 
154
14
  ### Minor Changes
155
15
 
156
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
157
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
158
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
159
- - fda5b92: ZERO-2725: fix invalid import
160
- - 2d9b2b2: ZERO-2816: Add segment to headers
161
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
162
- - 8d9ac9a: ZERO-2794: Add field to order type
163
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
164
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
165
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
166
- - 3bf2dd9: ZERO-2551: Fix search page
167
- - e9541a1: ZERO-2816: Add headers to url
168
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
169
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
170
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
171
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
172
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
173
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
174
- - d3474c6: ZERO-2655: Add data source shipping option
175
- - 75080fd6: ZERO-2630: Add max limit to postcode area
176
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
177
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
178
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
179
- - bbe18b9f: ZERO-2575: Fix build error
180
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
181
- - 4920742: Disable getCachedTranslations
182
- - 7e56d6b: ZERO-2841: Update api tagTypes
183
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
184
- - 98bb8dc: ZERO-2706: Cache getTranlations method
185
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
186
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
187
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
188
- - fad2768: ZERO-2739: add gpay to payment plugin map
189
- - dff0d595: ZERO-2659: add formData support to proxy api requests
190
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
191
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
192
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
193
- - beb499e6: ZERO-2551: Add new tsconfig paths
194
- - 948eb42: ZERO-2852: Add out of stock endpoints
195
- - 146ea39: ZERO-2774: Update imports
196
- - f2c92d5: ZERO-2816: Update cookie name
197
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
198
- - c47be30: ZERO-2744: Update Order and OrderItem types
199
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
200
- - f046f8e0: ZERO-2575: update version for react-number-format
201
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
202
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
203
-
204
- ## 1.45.0-rc.4
205
-
206
- ### Minor Changes
207
-
208
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
209
-
210
- ## 1.45.0-rc.3
211
-
212
- ### Minor Changes
213
-
214
- - 948eb42: ZERO-2852: Add out of stock endpoints
215
-
216
- ## 1.45.0-rc.2
217
-
218
- ### Minor Changes
219
-
220
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
221
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
222
-
223
- ## 1.45.0-rc.1
224
-
225
- ### Minor Changes
226
-
227
- - 7e56d6b: ZERO-2841: Update api tagTypes
228
-
229
- ## 1.45.0-rc.0
230
-
231
- ### Minor Changes
232
-
233
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
234
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
235
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
236
- - fda5b92: ZERO-2725: fix invalid import
237
- - 2d9b2b2: ZERO-2816: Add segment to headers
238
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
239
- - 8d9ac9a: ZERO-2794: Add field to order type
240
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
241
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
242
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
243
- - 3bf2dd9: ZERO-2551: Fix search page
244
- - e9541a1: ZERO-2816: Add headers to url
245
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
246
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
247
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
248
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
249
- - 1448a96: ZERO-2612: add errors type in CheckoutState
250
16
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
251
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
252
- - d3474c6: ZERO-2655: Add data source shipping option
253
- - 75080fd: ZERO-2630: Add max limit to postcode area
254
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
255
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
256
- - bbe18b9: ZERO-2575: Fix build error
257
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
258
- - 4920742: Disable getCachedTranslations
259
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
260
- - 98bb8dc: ZERO-2706: Cache getTranlations method
261
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
262
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
263
- - fad2768: ZERO-2739: add gpay to payment plugin map
264
- - dff0d59: ZERO-2659: add formData support to proxy api requests
265
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
266
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
267
- - beb499e: ZERO-2551: Add new tsconfig paths
268
- - 146ea39: ZERO-2774: Update imports
269
- - f2c92d5: ZERO-2816: Update cookie name
270
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
271
- - c47be30: ZERO-2744: Update Order and OrderItem types
272
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
273
- - f046f8e0: ZERO-2575: update version for react-number-format
274
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
275
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
276
17
 
277
18
  ## 1.44.0
278
19
 
@@ -280,201 +21,7 @@
280
21
 
281
22
  ### Minor Changes
282
23
 
283
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
284
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
285
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
286
- - fda5b92: ZERO-2725: fix invalid import
287
- - 2d9b2b2: ZERO-2816: Add segment to headers
288
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
289
- - 8d9ac9a: ZERO-2794: Add field to order type
290
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
291
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
292
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
293
- - 3bf2dd9: ZERO-2551: Fix search page
294
- - e9541a1: ZERO-2816: Add headers to url
295
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
296
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
297
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
298
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
299
- - 1448a96: ZERO-2612: add errors type in CheckoutState
300
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
301
- - d3474c6: ZERO-2655: Add data source shipping option
302
- - 75080fd: ZERO-2630: Add max limit to postcode area
303
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
304
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
305
- - bbe18b9: ZERO-2575: Fix build error
306
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
307
- - 4920742: Disable getCachedTranslations
308
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
309
- - 98bb8dc: ZERO-2706: Cache getTranlations method
310
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
311
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
312
- - fad2768: ZERO-2739: add gpay to payment plugin map
313
- - dff0d59: ZERO-2659: add formData support to proxy api requests
314
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
315
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
316
- - beb499e: ZERO-2551: Add new tsconfig paths
317
- - 146ea39: ZERO-2774: Update imports
318
- - f2c92d5: ZERO-2816: Update cookie name
319
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
320
- - c47be30: ZERO-2744: Update Order and OrderItem types
321
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
322
- - f046f8e0: ZERO-2575: update version for react-number-format
323
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
324
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
325
-
326
- ## 1.43.0-rc.15
327
-
328
- ## 1.43.0-rc.14
329
-
330
- ### Minor Changes
331
-
332
- - 3bf2dd9: ZERO-2551: Fix search page
333
-
334
- ## 1.43.0-rc.13
335
-
336
- ### Minor Changes
337
-
338
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
339
-
340
- ## 1.43.0-rc.12
341
-
342
- ### Minor Changes
343
-
344
- - 4920742: Disable getCachedTranslations
345
-
346
- ## 1.43.0-rc.11
347
-
348
- ### Minor Changes
349
-
350
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
351
-
352
- ## 1.43.0-rc.10
353
-
354
- ### Minor Changes
355
-
356
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
357
-
358
- ## 1.43.0-rc.9
359
-
360
- ### Minor Changes
361
-
362
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
363
-
364
- ## 1.43.0-rc.8
365
-
366
- ### Minor Changes
367
-
368
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
369
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
370
-
371
- ## 1.43.0-rc.7
372
-
373
- ### Minor Changes
374
-
375
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
376
-
377
- ## 1.43.0-rc.6
378
-
379
- ### Minor Changes
380
-
381
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
382
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
383
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
384
- - fda5b92: ZERO-2725: fix invalid import
385
- - 2d9b2b2: ZERO-2816: Add segment to headers
386
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
387
- - 8d9ac9a: ZERO-2794: Add field to order type
388
- - e9541a1: ZERO-2816: Add headers to url
389
- - c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
390
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
391
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
392
- - 1448a96: ZERO-2612: add errors type in CheckoutState
393
- - d3474c6: ZERO-2655: Add data source shipping option
394
- - 75080fd: ZERO-2630: Add max limit to postcode area
395
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
396
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
397
- - bbe18b9: ZERO-2575: Fix build error
398
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
399
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
400
- - 98bb8dc: ZERO-2706: Cache getTranlations method
401
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
402
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
403
- - fad2768: ZERO-2739: add gpay to payment plugin map
404
- - dff0d59: ZERO-2659: add formData support to proxy api requests
405
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
406
24
  - 4a163f2: ZERO-2761: Add condition for basket summary
407
- - beb499e: ZERO-2551: Add new tsconfig paths
408
- - 146ea39: ZERO-2774: Update imports
409
- - f2c92d5: ZERO-2816: Update cookie name
410
- - c47be30: ZERO-2744: Update Order and OrderItem types
411
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
412
- - f046f8e: ZERO-2575: update version for react-number-format
413
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
414
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
415
-
416
- ## 1.43.0-rc.5
417
-
418
- ### Minor Changes
419
-
420
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
421
-
422
- ## 1.43.0-rc.4
423
-
424
- ### Minor Changes
425
-
426
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
427
-
428
- ## 1.43.0-rc.3
429
-
430
- ### Minor Changes
431
-
432
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
433
-
434
- ## 1.43.0-rc.2
435
-
436
- ### Minor Changes
437
-
438
- - f2c92d5: ZERO-2816: Update cookie name
439
-
440
- ## 1.43.0-rc.1
441
-
442
- ### Minor Changes
443
-
444
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
445
-
446
- ## 1.43.0-rc.0
447
-
448
- ### Minor Changes
449
-
450
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
451
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
452
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
453
- - fda5b92: ZERO-2725: fix invalid import
454
- - 2d9b2b2: ZERO-2816: Add segment to headers
455
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
456
- - 8d9ac9a: ZERO-2794: Add field to order type
457
- - e9541a1: ZERO-2816: Add headers to url
458
- - c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
459
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
460
- - 1448a96: ZERO-2612: add errors type in CheckoutState
461
- - d3474c6: ZERO-2655: Add data source shipping option
462
- - 75080fd: ZERO-2630: Add max limit to postcode area
463
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
464
- - bbe18b9: ZERO-2575: Fix build error
465
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
466
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
467
- - 98bb8dc: ZERO-2706: Cache getTranlations method
468
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
469
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
470
- - fad2768: ZERO-2739: add gpay to payment plugin map
471
- - dff0d59: ZERO-2659: add formData support to proxy api requests
472
- - beb499e: ZERO-2551: Add new tsconfig paths
473
- - 146ea39: ZERO-2774: Update imports
474
- - c47be30: ZERO-2744: Update Order and OrderItem types
475
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
476
- - f046f8e: ZERO-2575: update version for react-number-format
477
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
478
25
 
479
26
  ## 1.42.0
480
27
 
package/api/client.ts CHANGED
@@ -4,7 +4,6 @@ import settings from 'settings';
4
4
  import logger from '../utils/log';
5
5
  import formatCookieString from '../utils/format-cookie-string';
6
6
  import cookieParser from 'set-cookie-parser';
7
- import { cookies } from 'next/headers';
8
7
 
9
8
  interface RouteParams {
10
9
  params: {
@@ -52,24 +51,18 @@ async function proxyRequest(...args) {
52
51
  extraHeaders[key.toLowerCase()] = value;
53
52
  }
54
53
 
55
- const excludedHeaders = [
54
+ [
56
55
  'x-forwarded-host',
57
56
  'x-forwarded-proto',
58
57
  'x-forwarded-port',
59
58
  'x-requested-with',
60
59
  'origin',
60
+ 'host',
61
61
  'referer',
62
62
  'accept',
63
63
  'content-length',
64
- 'content-type',
65
- 'host'
66
- ];
67
-
68
- excludedHeaders.forEach((header) => {
69
- if (!settings.includedProxyHeaders?.includes(header)) {
70
- delete extraHeaders[header];
71
- }
72
- });
64
+ 'content-type'
65
+ ].forEach((header) => delete extraHeaders[header]);
73
66
 
74
67
  const fetchOptions = {
75
68
  method: req.method,
@@ -81,33 +74,16 @@ async function proxyRequest(...args) {
81
74
  }
82
75
  } as RequestInit;
83
76
 
84
- const nextCookies = cookies();
85
- const segment = nextCookies.get('pz-segment')?.value;
86
- const currency = nextCookies.get('pz-external-currency')?.value;
87
-
88
- if (segment) {
89
- fetchOptions.headers['X-Segment-Id'] = segment;
90
- }
91
-
92
- if (currency) {
93
- fetchOptions.headers = Object.assign({}, fetchOptions.headers, {
94
- 'x-currency': currency
95
- });
96
- }
97
-
98
77
  if (options.contentType) {
99
78
  fetchOptions.headers['Content-Type'] = options.contentType;
100
79
  }
101
80
 
102
- const isMultipartFormData = req.headers
103
- .get('content-type')
104
- ?.includes('multipart/form-data;');
105
-
106
81
  if (req.method !== 'GET') {
107
- let body: Record<string, any> | FormData = {};
82
+ const formData = new URLSearchParams();
83
+ let body = {};
108
84
 
109
85
  try {
110
- body = isMultipartFormData ? await req.formData() : await req.json();
86
+ body = await req.json();
111
87
  } catch (error) {
112
88
  logger.error(
113
89
  `Client Proxy Request - Error while parsing request body to JSON`,
@@ -118,25 +94,13 @@ async function proxyRequest(...args) {
118
94
  );
119
95
  }
120
96
 
121
- if (isMultipartFormData) {
122
- fetchOptions.body = body as FormData;
123
- } else {
124
- const formData = new FormData();
125
-
126
- Object.keys(body ?? {}).forEach((key) => {
127
- if (body[key]) {
128
- if (typeof body[key] === 'object' && body[key] !== null) {
129
- formData.append(key, JSON.stringify(body[key]));
130
- } else {
131
- formData.append(key, body[key]);
132
- }
133
- }
134
- });
97
+ Object.keys(body ?? {}).forEach((key) => {
98
+ if (body[key]) {
99
+ formData.append(key, body[key]);
100
+ }
101
+ });
135
102
 
136
- fetchOptions.body = !options.useFormData
137
- ? JSON.stringify(body)
138
- : formData;
139
- }
103
+ fetchOptions.body = !options.useFormData ? JSON.stringify(body) : formData;
140
104
  }
141
105
 
142
106
  let url = `${commerceUrl}/${slug.replace(/,/g, '/')}`;
@@ -152,8 +116,11 @@ async function proxyRequest(...args) {
152
116
  try {
153
117
  const request = await fetch(url, fetchOptions);
154
118
 
119
+ // Using NextResponse.json with status 204 will cause an error
155
120
  if (request.status === 204) {
156
- return new Response(null, { status: 204 });
121
+ return new Response(null, {
122
+ status: 204
123
+ });
157
124
  }
158
125
 
159
126
  let response = {} as any;
@@ -1,53 +1,29 @@
1
1
  .checkout-payment-iframe-wrapper {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 100%;
7
- border: none;
8
- z-index: 1000;
9
- background-color: white;
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ border: none;
8
+ z-index: 1000;
9
+ background-color: white;
10
10
 
11
- iframe {
12
- width: 100%;
13
- height: 100%;
14
- border: none;
15
- background-color: white;
16
- }
11
+ iframe {
12
+ width: 100%;
13
+ height: 100%;
14
+ border: none;
15
+ background-color: white;
16
+ }
17
17
 
18
- .close-button {
19
- position: fixed;
20
- top: 16px;
21
- right: 16px;
22
- width: 32px;
23
- height: 32px;
24
- display: flex;
25
- align-items: center;
26
- justify-content: center;
27
- z-index: 1001;
28
- }
29
- }
30
-
31
- .checkout-payment-redirection-iframe-wrapper {
32
- width: 100%;
33
- position: relative;
34
-
35
- iframe {
36
- width: 100%;
37
- height: 100%;
38
- border: none;
39
- background-color: white;
40
- }
41
-
42
- .close-button {
43
- position: absolute;
44
- top: 16px;
45
- right: 16px;
46
- width: 32px;
47
- height: 32px;
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- z-index: 1001;
52
- }
53
- }
18
+ .close-button {
19
+ position: fixed;
20
+ top: 16px;
21
+ right: 16px;
22
+ width: 32px;
23
+ height: 32px;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ z-index: 1001;
28
+ }
29
+ }
@@ -19,4 +19,3 @@ export * from './trans';
19
19
  export * from './link';
20
20
  export * from './pagination';
21
21
  export * from './live-commerce';
22
- export * from './file-input';