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