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