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