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