@akinon/next 1.54.0-rc.0 → 1.54.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 (62) hide show
  1. package/CHANGELOG.md +7 -487
  2. package/api/client.ts +17 -50
  3. package/assets/styles/index.scss +26 -50
  4. package/bin/pz-prebuild.js +0 -1
  5. package/bin/pz-predev.js +0 -1
  6. package/components/index.ts +0 -1
  7. package/components/input.tsx +7 -21
  8. package/components/link.tsx +13 -17
  9. package/components/price.tsx +4 -11
  10. package/components/pz-root.tsx +3 -15
  11. package/components/selected-payment-option-view.tsx +38 -26
  12. package/data/client/account.ts +9 -10
  13. package/data/client/address.ts +8 -32
  14. package/data/client/api.ts +1 -1
  15. package/data/client/b2b.ts +2 -35
  16. package/data/client/basket.ts +5 -6
  17. package/data/client/checkout.ts +1 -38
  18. package/data/client/user.ts +2 -3
  19. package/data/server/category.ts +19 -43
  20. package/data/server/flatpage.ts +7 -29
  21. package/data/server/form.ts +11 -29
  22. package/data/server/landingpage.ts +7 -26
  23. package/data/server/list.ts +6 -16
  24. package/data/server/menu.ts +2 -15
  25. package/data/server/product.ts +13 -33
  26. package/data/server/seo.ts +24 -17
  27. package/data/server/special-page.ts +5 -15
  28. package/data/server/widget.ts +7 -14
  29. package/data/urls.ts +1 -8
  30. package/hocs/server/with-segment-defaults.tsx +1 -4
  31. package/hooks/index.ts +1 -2
  32. package/hooks/use-pagination.ts +2 -2
  33. package/hooks/use-payment-options.ts +1 -2
  34. package/lib/cache.ts +6 -8
  35. package/middlewares/default.ts +8 -87
  36. package/middlewares/pretty-url.ts +1 -11
  37. package/middlewares/url-redirection.ts +0 -4
  38. package/package.json +3 -4
  39. package/redux/middlewares/checkout.ts +11 -70
  40. package/redux/reducers/checkout.ts +5 -24
  41. package/redux/reducers/config.ts +0 -2
  42. package/types/commerce/account.ts +0 -1
  43. package/types/commerce/address.ts +1 -1
  44. package/types/commerce/b2b.ts +2 -12
  45. package/types/commerce/checkout.ts +0 -30
  46. package/types/commerce/misc.ts +0 -2
  47. package/types/commerce/order.ts +0 -1
  48. package/types/index.ts +2 -18
  49. package/utils/app-fetch.ts +8 -17
  50. package/utils/generate-commerce-search-params.ts +1 -3
  51. package/utils/index.ts +6 -27
  52. package/utils/server-translation.ts +1 -11
  53. package/utils/server-variables.ts +1 -2
  54. package/with-pz-config.js +2 -13
  55. package/assets/styles/index.css +0 -49
  56. package/assets/styles/index.css.map +0 -1
  57. package/bin/pz-generate-translations.js +0 -41
  58. package/components/file-input.tsx +0 -8
  59. package/hooks/use-message-listener.ts +0 -24
  60. package/lib/cache-handler.mjs +0 -33
  61. package/routes/pretty-url.tsx +0 -192
  62. package/utils/redirection-iframe.ts +0 -85
package/CHANGELOG.md CHANGED
@@ -1,58 +1,12 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.54.0-rc.0
4
-
5
- ### Minor Changes
6
-
7
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
8
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
9
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
10
- - fda5b927: ZERO-2725: fix invalid import
11
- - 2d9b2b2c: ZERO-2816: Add segment to headers
12
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
13
- - d93a507: ZERO-2900: Fix pretty url rewrite
14
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
15
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
16
- - 3bf2dd9: ZERO-2551: Fix search page
17
- - e9541a1: ZERO-2816: Add headers to url
18
- - 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.
19
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
20
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
21
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
22
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
23
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
24
- - d3474c64: ZERO-2655: Add data source shipping option
25
- - 75080fd6: ZERO-2630: Add max limit to postcode area
26
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
27
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
28
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
29
- - bbe18b9f: ZERO-2575: Fix build error
30
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
31
- - 4920742: Disable getCachedTranslations
32
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
33
- - 7e56d6b: ZERO-2841: Update api tagTypes
34
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
35
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
36
- - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
37
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
38
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
39
- - fad27689: ZERO-2739: add gpay to payment plugin map
40
- - dff0d595: ZERO-2659: add formData support to proxy api requests
41
- - fdd0b41: ZERO-2706: Add optimized translation support
42
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
43
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
44
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
45
- - beb499e6: ZERO-2551: Add new tsconfig paths
46
- - f2c92d5: ZERO-2816: Update cookie name
47
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
48
- - c47be30d: ZERO-2744: Update Order and OrderItem types
49
- - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
50
- - f046f8e0: ZERO-2575: update version for react-number-format
51
- - b9273fd: ZERO-2889: add host headers to requests
52
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
53
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
54
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
55
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
3
+ ## 1.54.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
8
+ - c47be30: ZERO-2744: Update Order and OrderItem types
9
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
56
10
 
57
11
  ## 1.53.0
58
12
 
@@ -82,128 +36,7 @@
82
36
 
83
37
  ### Minor Changes
84
38
 
85
- - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
86
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
87
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
88
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
89
- - fda5b927: ZERO-2725: fix invalid import
90
- - 2d9b2b2: ZERO-2816: Add segment to headers
91
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
92
- - d93a507: ZERO-2900: Fix pretty url rewrite
93
- - 8d9ac9a: ZERO-2794: Add field to order type
94
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
95
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
96
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
97
- - 3bf2dd9: ZERO-2551: Fix search page
98
- - e9541a1: ZERO-2816: Add headers to url
99
- - 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.
100
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
101
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
102
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
103
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
104
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
105
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
106
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
107
- - d3474c64: ZERO-2655: Add data source shipping option
108
- - 75080fd6: ZERO-2630: Add max limit to postcode area
109
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
110
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
111
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
112
- - bbe18b9f: ZERO-2575: Fix build error
113
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
114
- - 4920742: Disable getCachedTranslations
115
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
116
- - 7e56d6b: ZERO-2841: Update api tagTypes
117
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
118
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
119
- - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
120
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
121
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
122
- - fad27689: ZERO-2739: add gpay to payment plugin map
123
- - dff0d595: ZERO-2659: add formData support to proxy api requests
124
- - fdd0b41: ZERO-2706: Add optimized translation support
125
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
126
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
127
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
128
- - beb499e6: ZERO-2551: Add new tsconfig paths
129
- - 146ea391: ZERO-2774: Update imports
130
- - f2c92d5: ZERO-2816: Update cookie name
131
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
132
- - c47be30d: ZERO-2744: Update Order and OrderItem types
133
- - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
134
- - f046f8e0: ZERO-2575: update version for react-number-format
135
- - b9273fd: ZERO-2889: add host headers to requests
136
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
137
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
138
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
139
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
140
- - 3d35f70: ZERO-2908: Add cookie to redirect url
141
-
142
- ## 1.50.0-rc.1
143
-
144
- ### Minor Changes
145
-
146
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
147
-
148
- ## 1.50.0-rc.0
149
-
150
- ### Minor Changes
151
-
152
- - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
153
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
154
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
155
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
156
- - fda5b927: ZERO-2725: fix invalid import
157
- - 2d9b2b2: ZERO-2816: Add segment to headers
158
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
159
- - d93a507: ZERO-2900: Fix pretty url rewrite
160
- - 8d9ac9a: ZERO-2794: Add field to order type
161
39
  - eaf97d6: ZERO-2909: Add deleteCollectionItem query to wishlistApi
162
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
163
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
164
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
165
- - 3bf2dd9: ZERO-2551: Fix search page
166
- - e9541a1: ZERO-2816: Add headers to url
167
- - 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.
168
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
169
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
170
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
171
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
172
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
173
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
174
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
175
- - d3474c64: ZERO-2655: Add data source shipping option
176
- - 75080fd6: ZERO-2630: Add max limit to postcode area
177
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
178
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
179
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
180
- - bbe18b9f: ZERO-2575: Fix build error
181
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
182
- - 4920742: Disable getCachedTranslations
183
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
184
- - 7e56d6b: ZERO-2841: Update api tagTypes
185
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
186
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
187
- - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
188
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
189
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
190
- - fad27689: ZERO-2739: add gpay to payment plugin map
191
- - dff0d595: ZERO-2659: add formData support to proxy api requests
192
- - fdd0b41: ZERO-2706: Add optimized translation support
193
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
194
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
195
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
196
- - beb499e6: ZERO-2551: Add new tsconfig paths
197
- - 146ea391: ZERO-2774: Update imports
198
- - f2c92d5: ZERO-2816: Update cookie name
199
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
200
- - c47be30d: ZERO-2744: Update Order and OrderItem types
201
- - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
202
- - f046f8e0: ZERO-2575: update version for react-number-format
203
- - b9273fd: ZERO-2889: add host headers to requests
204
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
205
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
206
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
207
40
 
208
41
  ## 1.49.0
209
42
 
@@ -229,126 +62,7 @@
229
62
 
230
63
  ### Minor Changes
231
64
 
232
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
233
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
234
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
235
- - fda5b92: ZERO-2725: fix invalid import
236
- - 2d9b2b2: ZERO-2816: Add segment to headers
237
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
238
- - 8d9ac9a: ZERO-2794: Add field to order type
239
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
240
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
241
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
242
- - 3bf2dd9: ZERO-2551: Fix search page
243
- - e9541a1: ZERO-2816: Add headers to url
244
- - 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.
245
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
246
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
247
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
248
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
249
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
250
- - d3474c6: ZERO-2655: Add data source shipping option
251
- - 75080fd6: ZERO-2630: Add max limit to postcode area
252
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
253
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
254
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
255
- - bbe18b9f: ZERO-2575: Fix build error
256
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
257
- - 4920742: Disable getCachedTranslations
258
- - 7e56d6b: ZERO-2841: Update api tagTypes
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
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
264
- - fad2768: ZERO-2739: add gpay to payment plugin map
265
- - dff0d595: ZERO-2659: add formData support to proxy api requests
266
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
267
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
268
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
269
- - beb499e6: ZERO-2551: Add new tsconfig paths
270
- - 948eb42: ZERO-2852: Add out of stock endpoints
271
- - 146ea39: ZERO-2774: Update imports
272
- - f2c92d5: ZERO-2816: Update cookie name
273
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
274
- - c47be30: ZERO-2744: Update Order and OrderItem types
275
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
276
- - f046f8e0: ZERO-2575: update version for react-number-format
277
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
278
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
279
-
280
- ## 1.45.0-rc.4
281
-
282
- ### Minor Changes
283
-
284
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
285
-
286
- ## 1.45.0-rc.3
287
-
288
- ### Minor Changes
289
-
290
- - 948eb42: ZERO-2852: Add out of stock endpoints
291
-
292
- ## 1.45.0-rc.2
293
-
294
- ### Minor Changes
295
-
296
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
297
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
298
-
299
- ## 1.45.0-rc.1
300
-
301
- ### Minor Changes
302
-
303
- - 7e56d6b: ZERO-2841: Update api tagTypes
304
-
305
- ## 1.45.0-rc.0
306
-
307
- ### Minor Changes
308
-
309
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
310
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
311
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
312
- - fda5b92: ZERO-2725: fix invalid import
313
- - 2d9b2b2: ZERO-2816: Add segment to headers
314
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
315
- - 8d9ac9a: ZERO-2794: Add field to order type
316
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
317
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
318
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
319
- - 3bf2dd9: ZERO-2551: Fix search page
320
- - e9541a1: ZERO-2816: Add headers to url
321
- - 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.
322
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
323
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
324
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
325
- - 1448a96: ZERO-2612: add errors type in CheckoutState
326
65
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
327
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
328
- - d3474c6: ZERO-2655: Add data source shipping option
329
- - 75080fd: ZERO-2630: Add max limit to postcode area
330
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
331
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
332
- - bbe18b9: ZERO-2575: Fix build error
333
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
334
- - 4920742: Disable getCachedTranslations
335
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
336
- - 98bb8dc: ZERO-2706: Cache getTranlations method
337
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
338
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
339
- - fad2768: ZERO-2739: add gpay to payment plugin map
340
- - dff0d59: ZERO-2659: add formData support to proxy api requests
341
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
342
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
343
- - beb499e: ZERO-2551: Add new tsconfig paths
344
- - 146ea39: ZERO-2774: Update imports
345
- - f2c92d5: ZERO-2816: Update cookie name
346
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
347
- - c47be30: ZERO-2744: Update Order and OrderItem types
348
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
349
- - f046f8e0: ZERO-2575: update version for react-number-format
350
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
351
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
352
66
 
353
67
  ## 1.44.0
354
68
 
@@ -356,201 +70,7 @@
356
70
 
357
71
  ### Minor Changes
358
72
 
359
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
360
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
361
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
362
- - fda5b92: ZERO-2725: fix invalid import
363
- - 2d9b2b2: ZERO-2816: Add segment to headers
364
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
365
- - 8d9ac9a: ZERO-2794: Add field to order type
366
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
367
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
368
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
369
- - 3bf2dd9: ZERO-2551: Fix search page
370
- - e9541a1: ZERO-2816: Add headers to url
371
- - 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.
372
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
373
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
374
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
375
- - 1448a96: ZERO-2612: add errors type in CheckoutState
376
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
377
- - d3474c6: ZERO-2655: Add data source shipping option
378
- - 75080fd: ZERO-2630: Add max limit to postcode area
379
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
380
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
381
- - bbe18b9: ZERO-2575: Fix build error
382
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
383
- - 4920742: Disable getCachedTranslations
384
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
385
- - 98bb8dc: ZERO-2706: Cache getTranlations method
386
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
387
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
388
- - fad2768: ZERO-2739: add gpay to payment plugin map
389
- - dff0d59: ZERO-2659: add formData support to proxy api requests
390
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
391
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
392
- - beb499e: ZERO-2551: Add new tsconfig paths
393
- - 146ea39: ZERO-2774: Update imports
394
- - f2c92d5: ZERO-2816: Update cookie name
395
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
396
- - c47be30: ZERO-2744: Update Order and OrderItem types
397
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
398
- - f046f8e0: ZERO-2575: update version for react-number-format
399
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
400
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
401
-
402
- ## 1.43.0-rc.15
403
-
404
- ## 1.43.0-rc.14
405
-
406
- ### Minor Changes
407
-
408
- - 3bf2dd9: ZERO-2551: Fix search page
409
-
410
- ## 1.43.0-rc.13
411
-
412
- ### Minor Changes
413
-
414
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
415
-
416
- ## 1.43.0-rc.12
417
-
418
- ### Minor Changes
419
-
420
- - 4920742: Disable getCachedTranslations
421
-
422
- ## 1.43.0-rc.11
423
-
424
- ### Minor Changes
425
-
426
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
427
-
428
- ## 1.43.0-rc.10
429
-
430
- ### Minor Changes
431
-
432
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
433
-
434
- ## 1.43.0-rc.9
435
-
436
- ### Minor Changes
437
-
438
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
439
-
440
- ## 1.43.0-rc.8
441
-
442
- ### Minor Changes
443
-
444
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
445
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
446
-
447
- ## 1.43.0-rc.7
448
-
449
- ### Minor Changes
450
-
451
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
452
-
453
- ## 1.43.0-rc.6
454
-
455
- ### Minor Changes
456
-
457
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
458
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
459
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
460
- - fda5b92: ZERO-2725: fix invalid import
461
- - 2d9b2b2: ZERO-2816: Add segment to headers
462
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
463
- - 8d9ac9a: ZERO-2794: Add field to order type
464
- - e9541a1: ZERO-2816: Add headers to url
465
- - 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.
466
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
467
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
468
- - 1448a96: ZERO-2612: add errors type in CheckoutState
469
- - d3474c6: ZERO-2655: Add data source shipping option
470
- - 75080fd: ZERO-2630: Add max limit to postcode area
471
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
472
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
473
- - bbe18b9: ZERO-2575: Fix build error
474
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
475
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
476
- - 98bb8dc: ZERO-2706: Cache getTranlations method
477
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
478
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
479
- - fad2768: ZERO-2739: add gpay to payment plugin map
480
- - dff0d59: ZERO-2659: add formData support to proxy api requests
481
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
482
73
  - 4a163f2: ZERO-2761: Add condition for basket summary
483
- - beb499e: ZERO-2551: Add new tsconfig paths
484
- - 146ea39: ZERO-2774: Update imports
485
- - f2c92d5: ZERO-2816: Update cookie name
486
- - c47be30: ZERO-2744: Update Order and OrderItem types
487
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
488
- - f046f8e: ZERO-2575: update version for react-number-format
489
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
490
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
491
-
492
- ## 1.43.0-rc.5
493
-
494
- ### Minor Changes
495
-
496
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
497
-
498
- ## 1.43.0-rc.4
499
-
500
- ### Minor Changes
501
-
502
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
503
-
504
- ## 1.43.0-rc.3
505
-
506
- ### Minor Changes
507
-
508
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
509
-
510
- ## 1.43.0-rc.2
511
-
512
- ### Minor Changes
513
-
514
- - f2c92d5: ZERO-2816: Update cookie name
515
-
516
- ## 1.43.0-rc.1
517
-
518
- ### Minor Changes
519
-
520
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
521
-
522
- ## 1.43.0-rc.0
523
-
524
- ### Minor Changes
525
-
526
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
527
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
528
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
529
- - fda5b92: ZERO-2725: fix invalid import
530
- - 2d9b2b2: ZERO-2816: Add segment to headers
531
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
532
- - 8d9ac9a: ZERO-2794: Add field to order type
533
- - e9541a1: ZERO-2816: Add headers to url
534
- - 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.
535
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
536
- - 1448a96: ZERO-2612: add errors type in CheckoutState
537
- - d3474c6: ZERO-2655: Add data source shipping option
538
- - 75080fd: ZERO-2630: Add max limit to postcode area
539
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
540
- - bbe18b9: ZERO-2575: Fix build error
541
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
542
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
543
- - 98bb8dc: ZERO-2706: Cache getTranlations method
544
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
545
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
546
- - fad2768: ZERO-2739: add gpay to payment plugin map
547
- - dff0d59: ZERO-2659: add formData support to proxy api requests
548
- - beb499e: ZERO-2551: Add new tsconfig paths
549
- - 146ea39: ZERO-2774: Update imports
550
- - c47be30: ZERO-2744: Update Order and OrderItem types
551
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
552
- - f046f8e: ZERO-2575: update version for react-number-format
553
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
554
74
 
555
75
  ## 1.42.0
556
76
 
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;