@akinon/next 1.49.0 → 1.50.0-rc.1

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 (66) hide show
  1. package/CHANGELOG.md +379 -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/pagination.tsx +1 -2
  14. package/components/price.tsx +11 -4
  15. package/components/pz-root.tsx +15 -3
  16. package/components/selected-payment-option-view.tsx +26 -38
  17. package/data/client/account.ts +10 -9
  18. package/data/client/address.ts +32 -8
  19. package/data/client/api.ts +2 -2
  20. package/data/client/b2b.ts +35 -2
  21. package/data/client/basket.ts +6 -5
  22. package/data/client/checkout.ts +47 -4
  23. package/data/client/user.ts +3 -2
  24. package/data/client/wishlist.ts +8 -1
  25. package/data/server/category.ts +43 -19
  26. package/data/server/flatpage.ts +29 -7
  27. package/data/server/form.ts +29 -11
  28. package/data/server/landingpage.ts +26 -7
  29. package/data/server/list.ts +16 -6
  30. package/data/server/menu.ts +15 -2
  31. package/data/server/product.ts +46 -21
  32. package/data/server/seo.ts +17 -24
  33. package/data/server/special-page.ts +15 -5
  34. package/data/server/widget.ts +14 -7
  35. package/data/urls.ts +10 -1
  36. package/hocs/server/with-segment-defaults.tsx +4 -1
  37. package/hooks/index.ts +2 -1
  38. package/hooks/use-message-listener.ts +24 -0
  39. package/hooks/use-pagination.ts +2 -2
  40. package/hooks/use-payment-options.ts +2 -1
  41. package/lib/cache-handler.mjs +33 -0
  42. package/lib/cache.ts +8 -6
  43. package/middlewares/default.ts +91 -8
  44. package/middlewares/pretty-url.ts +11 -1
  45. package/middlewares/url-redirection.ts +4 -0
  46. package/package.json +5 -4
  47. package/plugins.d.ts +1 -0
  48. package/redux/middlewares/checkout.ts +70 -11
  49. package/redux/reducers/checkout.ts +24 -5
  50. package/redux/reducers/config.ts +2 -0
  51. package/routes/pretty-url.tsx +192 -0
  52. package/types/commerce/account.ts +1 -0
  53. package/types/commerce/address.ts +1 -1
  54. package/types/commerce/b2b.ts +12 -2
  55. package/types/commerce/checkout.ts +30 -0
  56. package/types/commerce/misc.ts +2 -0
  57. package/types/commerce/order.ts +12 -0
  58. package/types/index.ts +37 -3
  59. package/utils/app-fetch.ts +21 -10
  60. package/utils/generate-commerce-search-params.ts +3 -1
  61. package/utils/index.ts +27 -6
  62. package/utils/menu-generator.ts +2 -2
  63. package/utils/redirection-iframe.ts +85 -0
  64. package/utils/server-translation.ts +11 -1
  65. package/utils/server-variables.ts +2 -1
  66. package/with-pz-config.js +13 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.50.0-rc.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
8
+
9
+ ## 1.50.0-rc.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
14
+ - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
15
+ - 5dfeea0: ZERO-2801: Revert ZERO-2801
16
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
17
+ - fda5b927: ZERO-2725: fix invalid import
18
+ - 2d9b2b2: ZERO-2816: Add segment to headers
19
+ - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
20
+ - d93a507: ZERO-2900: Fix pretty url rewrite
21
+ - 8d9ac9a: ZERO-2794: Add field to order type
22
+ - eaf97d6: ZERO-2909: Add deleteCollectionItem query to wishlistApi
23
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
24
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
25
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
26
+ - 3bf2dd9: ZERO-2551: Fix search page
27
+ - e9541a1: ZERO-2816: Add headers to url
28
+ - 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.
29
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
30
+ - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
31
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
32
+ - 0d3a913e: ZERO-2725: Update decimal scale in Price component
33
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
34
+ - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
35
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
36
+ - d3474c64: ZERO-2655: Add data source shipping option
37
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
38
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
39
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
40
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
41
+ - bbe18b9f: ZERO-2575: Fix build error
42
+ - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
43
+ - 4920742: Disable getCachedTranslations
44
+ - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
45
+ - 7e56d6b: ZERO-2841: Update api tagTypes
46
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
47
+ - 98bb8dcd: ZERO-2706: Cache getTranlations method
48
+ - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
49
+ - dcc8a150: ZERO-2694: added build step to RC branch pipeline
50
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
51
+ - fad27689: ZERO-2739: add gpay to payment plugin map
52
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
53
+ - fdd0b41: ZERO-2706: Add optimized translation support
54
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
55
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
56
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
57
+ - beb499e6: ZERO-2551: Add new tsconfig paths
58
+ - 146ea391: ZERO-2774: Update imports
59
+ - f2c92d5: ZERO-2816: Update cookie name
60
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
61
+ - c47be30d: ZERO-2744: Update Order and OrderItem types
62
+ - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
63
+ - f046f8e0: ZERO-2575: update version for react-number-format
64
+ - b9273fd: ZERO-2889: add host headers to requests
65
+ - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
66
+ - c670bd4: ZERO-2900: Add middleware rewrite functionality
67
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
68
+
3
69
  ## 1.49.0
4
70
 
5
71
  ### Minor Changes
@@ -24,7 +90,126 @@
24
90
 
25
91
  ### Minor Changes
26
92
 
93
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
94
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
95
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
96
+ - fda5b92: ZERO-2725: fix invalid import
97
+ - 2d9b2b2: ZERO-2816: Add segment to headers
98
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
99
+ - 8d9ac9a: ZERO-2794: Add field to order type
100
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
101
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
102
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
103
+ - 3bf2dd9: ZERO-2551: Fix search page
104
+ - e9541a1: ZERO-2816: Add headers to url
105
+ - 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.
106
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
107
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
108
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
109
+ - 1448a96e: ZERO-2612: add errors type in CheckoutState
110
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
111
+ - d3474c6: ZERO-2655: Add data source shipping option
112
+ - 75080fd6: ZERO-2630: Add max limit to postcode area
113
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
114
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
115
+ - 91265bba: ZERO-2551: Improve pretty url and caching performance
116
+ - bbe18b9f: ZERO-2575: Fix build error
117
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
118
+ - 4920742: Disable getCachedTranslations
119
+ - 7e56d6b: ZERO-2841: Update api tagTypes
120
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
121
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
122
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
123
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
124
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
125
+ - fad2768: ZERO-2739: add gpay to payment plugin map
126
+ - dff0d595: ZERO-2659: add formData support to proxy api requests
127
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
128
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
129
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
130
+ - beb499e6: ZERO-2551: Add new tsconfig paths
131
+ - 948eb42: ZERO-2852: Add out of stock endpoints
132
+ - 146ea39: ZERO-2774: Update imports
133
+ - f2c92d5: ZERO-2816: Update cookie name
134
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
135
+ - c47be30: ZERO-2744: Update Order and OrderItem types
136
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
137
+ - f046f8e0: ZERO-2575: update version for react-number-format
138
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
139
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
140
+
141
+ ## 1.45.0-rc.4
142
+
143
+ ### Minor Changes
144
+
145
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
146
+
147
+ ## 1.45.0-rc.3
148
+
149
+ ### Minor Changes
150
+
151
+ - 948eb42: ZERO-2852: Add out of stock endpoints
152
+
153
+ ## 1.45.0-rc.2
154
+
155
+ ### Minor Changes
156
+
157
+ - c45b62c: ZERO-2818: Add upload and download support for b2b package
158
+ - f2c325c: ZERO-2838: Move file input component into @akinon/next
159
+
160
+ ## 1.45.0-rc.1
161
+
162
+ ### Minor Changes
163
+
164
+ - 7e56d6b: ZERO-2841: Update api tagTypes
165
+
166
+ ## 1.45.0-rc.0
167
+
168
+ ### Minor Changes
169
+
170
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
171
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
172
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
173
+ - fda5b92: ZERO-2725: fix invalid import
174
+ - 2d9b2b2: ZERO-2816: Add segment to headers
175
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
176
+ - 8d9ac9a: ZERO-2794: Add field to order type
177
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
178
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
179
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
180
+ - 3bf2dd9: ZERO-2551: Fix search page
181
+ - e9541a1: ZERO-2816: Add headers to url
182
+ - 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.
183
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
184
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
185
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
186
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
27
187
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
188
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
189
+ - d3474c6: ZERO-2655: Add data source shipping option
190
+ - 75080fd: ZERO-2630: Add max limit to postcode area
191
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
192
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
193
+ - bbe18b9: ZERO-2575: Fix build error
194
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
195
+ - 4920742: Disable getCachedTranslations
196
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
197
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
198
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
199
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
200
+ - fad2768: ZERO-2739: add gpay to payment plugin map
201
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
202
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
203
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
204
+ - beb499e: ZERO-2551: Add new tsconfig paths
205
+ - 146ea39: ZERO-2774: Update imports
206
+ - f2c92d5: ZERO-2816: Update cookie name
207
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
208
+ - c47be30: ZERO-2744: Update Order and OrderItem types
209
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
210
+ - f046f8e0: ZERO-2575: update version for react-number-format
211
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
212
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
28
213
 
29
214
  ## 1.44.0
30
215
 
@@ -32,7 +217,201 @@
32
217
 
33
218
  ### Minor Changes
34
219
 
220
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
221
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
222
+ - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
223
+ - fda5b92: ZERO-2725: fix invalid import
224
+ - 2d9b2b2: ZERO-2816: Add segment to headers
225
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
226
+ - 8d9ac9a: ZERO-2794: Add field to order type
227
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
228
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
229
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
230
+ - 3bf2dd9: ZERO-2551: Fix search page
231
+ - e9541a1: ZERO-2816: Add headers to url
232
+ - 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.
233
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
234
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
235
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
236
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
237
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
238
+ - d3474c6: ZERO-2655: Add data source shipping option
239
+ - 75080fd: ZERO-2630: Add max limit to postcode area
240
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
241
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
242
+ - bbe18b9: ZERO-2575: Fix build error
243
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
244
+ - 4920742: Disable getCachedTranslations
245
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
246
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
247
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
248
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
249
+ - fad2768: ZERO-2739: add gpay to payment plugin map
250
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
251
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
252
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
253
+ - beb499e: ZERO-2551: Add new tsconfig paths
254
+ - 146ea39: ZERO-2774: Update imports
255
+ - f2c92d5: ZERO-2816: Update cookie name
256
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
257
+ - c47be30: ZERO-2744: Update Order and OrderItem types
258
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
259
+ - f046f8e0: ZERO-2575: update version for react-number-format
260
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
261
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
262
+
263
+ ## 1.43.0-rc.15
264
+
265
+ ## 1.43.0-rc.14
266
+
267
+ ### Minor Changes
268
+
269
+ - 3bf2dd9: ZERO-2551: Fix search page
270
+
271
+ ## 1.43.0-rc.13
272
+
273
+ ### Minor Changes
274
+
275
+ - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
276
+
277
+ ## 1.43.0-rc.12
278
+
279
+ ### Minor Changes
280
+
281
+ - 4920742: Disable getCachedTranslations
282
+
283
+ ## 1.43.0-rc.11
284
+
285
+ ### Minor Changes
286
+
287
+ - 6c25f66: ZERO-2551: Check CACHE_HOST variable
288
+
289
+ ## 1.43.0-rc.10
290
+
291
+ ### Minor Changes
292
+
293
+ - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
294
+
295
+ ## 1.43.0-rc.9
296
+
297
+ ### Minor Changes
298
+
299
+ - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
300
+
301
+ ## 1.43.0-rc.8
302
+
303
+ ### Minor Changes
304
+
305
+ - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
306
+ - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
307
+
308
+ ## 1.43.0-rc.7
309
+
310
+ ### Minor Changes
311
+
312
+ - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
313
+
314
+ ## 1.43.0-rc.6
315
+
316
+ ### Minor Changes
317
+
318
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
319
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
320
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
321
+ - fda5b92: ZERO-2725: fix invalid import
322
+ - 2d9b2b2: ZERO-2816: Add segment to headers
323
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
324
+ - 8d9ac9a: ZERO-2794: Add field to order type
325
+ - e9541a1: ZERO-2816: Add headers to url
326
+ - 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.
327
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
328
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
329
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
330
+ - d3474c6: ZERO-2655: Add data source shipping option
331
+ - 75080fd: ZERO-2630: Add max limit to postcode area
332
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
333
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
334
+ - bbe18b9: ZERO-2575: Fix build error
335
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
336
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
337
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
338
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
339
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
340
+ - fad2768: ZERO-2739: add gpay to payment plugin map
341
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
342
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
35
343
  - 4a163f2: ZERO-2761: Add condition for basket summary
344
+ - beb499e: ZERO-2551: Add new tsconfig paths
345
+ - 146ea39: ZERO-2774: Update imports
346
+ - f2c92d5: ZERO-2816: Update cookie name
347
+ - c47be30: ZERO-2744: Update Order and OrderItem types
348
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
349
+ - f046f8e: 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
+
353
+ ## 1.43.0-rc.5
354
+
355
+ ### Minor Changes
356
+
357
+ - 17f8752: ZERO-2816: Make the incoming currency lowercase
358
+
359
+ ## 1.43.0-rc.4
360
+
361
+ ### Minor Changes
362
+
363
+ - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
364
+
365
+ ## 1.43.0-rc.3
366
+
367
+ ### Minor Changes
368
+
369
+ - 64699d3: ZERO-2761: Fix invalid import for plugin module
370
+
371
+ ## 1.43.0-rc.2
372
+
373
+ ### Minor Changes
374
+
375
+ - f2c92d5: ZERO-2816: Update cookie name
376
+
377
+ ## 1.43.0-rc.1
378
+
379
+ ### Minor Changes
380
+
381
+ - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
382
+
383
+ ## 1.43.0-rc.0
384
+
385
+ ### Minor Changes
386
+
387
+ - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
388
+ - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
389
+ - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
390
+ - fda5b92: ZERO-2725: fix invalid import
391
+ - 2d9b2b2: ZERO-2816: Add segment to headers
392
+ - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
393
+ - 8d9ac9a: ZERO-2794: Add field to order type
394
+ - e9541a1: ZERO-2816: Add headers to url
395
+ - 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.
396
+ - 0d3a913: ZERO-2725: Update decimal scale in Price component
397
+ - 1448a96: ZERO-2612: add errors type in CheckoutState
398
+ - d3474c6: ZERO-2655: Add data source shipping option
399
+ - 75080fd: ZERO-2630: Add max limit to postcode area
400
+ - 91265bb: ZERO-2551: Improve pretty url and caching performance
401
+ - bbe18b9: ZERO-2575: Fix build error
402
+ - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
403
+ - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
404
+ - 98bb8dc: ZERO-2706: Cache getTranlations method
405
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
406
+ - dcc8a15: ZERO-2694: added build step to RC branch pipeline
407
+ - fad2768: ZERO-2739: add gpay to payment plugin map
408
+ - dff0d59: ZERO-2659: add formData support to proxy api requests
409
+ - beb499e: ZERO-2551: Add new tsconfig paths
410
+ - 146ea39: ZERO-2774: Update imports
411
+ - c47be30: ZERO-2744: Update Order and OrderItem types
412
+ - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
413
+ - f046f8e: ZERO-2575: update version for react-number-format
414
+ - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
36
415
 
37
416
  ## 1.42.0
38
417
 
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"}
@@ -1,29 +1,53 @@
1
1
  .checkout-payment-iframe-wrapper {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 100%;
7
- border: none;
8
- z-index: 1000;
9
- background-color: white;
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ border: none;
8
+ z-index: 1000;
9
+ background-color: white;
10
10
 
11
- iframe {
12
- width: 100%;
13
- height: 100%;
14
- border: none;
15
- background-color: white;
16
- }
11
+ iframe {
12
+ width: 100%;
13
+ height: 100%;
14
+ border: none;
15
+ background-color: white;
16
+ }
17
17
 
18
- .close-button {
19
- position: fixed;
20
- top: 16px;
21
- right: 16px;
22
- width: 32px;
23
- height: 32px;
24
- display: flex;
25
- align-items: center;
26
- justify-content: center;
27
- z-index: 1001;
28
- }
29
- }
18
+ .close-button {
19
+ position: fixed;
20
+ top: 16px;
21
+ right: 16px;
22
+ width: 32px;
23
+ height: 32px;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ z-index: 1001;
28
+ }
29
+ }
30
+
31
+ .checkout-payment-redirection-iframe-wrapper {
32
+ width: 100%;
33
+ position: relative;
34
+
35
+ iframe {
36
+ width: 100%;
37
+ height: 100%;
38
+ border: none;
39
+ background-color: white;
40
+ }
41
+
42
+ .close-button {
43
+ position: absolute;
44
+ top: 16px;
45
+ right: 16px;
46
+ width: 32px;
47
+ height: 32px;
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ z-index: 1001;
52
+ }
53
+ }