@akinon/next 1.47.0-rc.7 → 1.47.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 +2 -449
  2. package/api/client.ts +17 -50
  3. package/assets/styles/index.scss +26 -50
  4. package/components/index.ts +0 -1
  5. package/components/input.tsx +7 -21
  6. package/components/link.tsx +13 -17
  7. package/components/pagination.tsx +2 -1
  8. package/components/price.tsx +4 -11
  9. package/components/selected-payment-option-view.tsx +38 -26
  10. package/data/client/account.ts +9 -10
  11. package/data/client/address.ts +8 -32
  12. package/data/client/api.ts +2 -2
  13. package/data/client/b2b.ts +2 -35
  14. package/data/client/basket.ts +5 -6
  15. package/data/client/checkout.ts +4 -47
  16. package/data/client/user.ts +2 -3
  17. package/data/server/category.ts +2 -2
  18. package/data/server/list.ts +2 -2
  19. package/data/server/product.ts +13 -15
  20. package/data/server/special-page.ts +2 -2
  21. package/data/urls.ts +2 -9
  22. package/hooks/index.ts +1 -2
  23. package/hooks/use-payment-options.ts +1 -2
  24. package/lib/cache.ts +6 -18
  25. package/middlewares/default.ts +3 -69
  26. package/middlewares/locale.ts +30 -32
  27. package/middlewares/pretty-url.ts +0 -4
  28. package/middlewares/url-redirection.ts +0 -4
  29. package/package.json +4 -5
  30. package/plugins.d.ts +0 -1
  31. package/redux/middlewares/checkout.ts +11 -70
  32. package/redux/reducers/checkout.ts +5 -24
  33. package/redux/reducers/config.ts +0 -2
  34. package/types/commerce/account.ts +0 -1
  35. package/types/commerce/address.ts +1 -1
  36. package/types/commerce/b2b.ts +2 -12
  37. package/types/commerce/checkout.ts +0 -30
  38. package/types/commerce/misc.ts +0 -2
  39. package/types/commerce/order.ts +0 -12
  40. package/types/index.ts +2 -31
  41. package/utils/app-fetch.ts +3 -6
  42. package/utils/generate-commerce-search-params.ts +2 -6
  43. package/utils/index.ts +6 -27
  44. package/utils/menu-generator.ts +2 -2
  45. package/utils/server-translation.ts +1 -5
  46. package/utils/server-variables.ts +1 -2
  47. package/with-pz-config.js +1 -11
  48. package/assets/styles/index.css +0 -49
  49. package/assets/styles/index.css.map +0 -1
  50. package/components/file-input.tsx +0 -8
  51. package/hooks/use-message-listener.ts +0 -24
  52. package/lib/cache-handler.mjs +0 -33
  53. package/routes/pretty-url.tsx +0 -194
  54. package/utils/redirection-iframe.ts +0 -85
package/CHANGELOG.md CHANGED
@@ -1,145 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.47.0-rc.7
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
- - 8d9ac9a: ZERO-2794: Add field to order type
14
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
15
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
16
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
17
- - 3bf2dd9: ZERO-2551: Fix search page
18
- - e9541a1: ZERO-2816: Add headers to url
19
- - 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.
20
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
21
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
22
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
23
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
24
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
25
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
26
- - d3474c6: ZERO-2655: Add data source shipping option
27
- - 75080fd6: ZERO-2630: Add max limit to postcode area
28
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
29
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
30
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
31
- - bbe18b9f: ZERO-2575: Fix build error
32
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
33
- - 4920742: Disable getCachedTranslations
34
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
35
- - 7e56d6b: ZERO-2841: Update api tagTypes
36
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
37
- - 98bb8dc: ZERO-2706: Cache getTranlations method
38
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
39
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
40
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
41
- - fad2768: ZERO-2739: add gpay to payment plugin map
42
- - dff0d595: ZERO-2659: add formData support to proxy api requests
43
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
44
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
45
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
46
- - beb499e6: ZERO-2551: Add new tsconfig paths
47
- - 948eb42: ZERO-2852: Add out of stock endpoints
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
- - 040ec95: ZERO-2875: Add edit collection endpoints
54
- - f046f8e0: ZERO-2575: update version for react-number-format
55
- - b9273fd: ZERO-2889: add host headers to requests
56
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
57
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
58
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
59
-
60
- ## 1.47.0-rc.6
61
-
62
- ### Minor Changes
63
-
64
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
65
-
66
- ## 1.47.0-rc.5
67
-
68
- ### Minor Changes
69
-
70
- - b9273fd: ZERO-2889: add host headers to requests
71
-
72
- ## 1.47.0-rc.4
73
-
74
- ### Minor Changes
75
-
76
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
77
-
78
- ## 1.47.0-rc.3
79
-
80
- ## 1.47.0-rc.2
3
+ ## 1.47.0
81
4
 
82
5
  ### Minor Changes
83
6
 
84
- - 040ec95: ZERO-2875: Add edit collection endpoints
85
-
86
- ## 1.47.0-rc.1
87
-
88
- ### Minor Changes
89
-
90
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
91
-
92
- ## 1.47.0-rc.0
93
-
94
- ### Minor Changes
95
-
96
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
97
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
98
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
99
- - fda5b92: ZERO-2725: fix invalid import
100
- - 2d9b2b2: ZERO-2816: Add segment to headers
101
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
102
- - 8d9ac9a: ZERO-2794: Add field to order type
103
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
104
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
105
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
106
- - 3bf2dd9: ZERO-2551: Fix search page
107
- - e9541a1: ZERO-2816: Add headers to url
108
- - 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.
109
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
110
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
111
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
112
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
113
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
114
- - d3474c6: ZERO-2655: Add data source shipping option
115
- - 75080fd6: ZERO-2630: Add max limit to postcode area
116
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
117
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
118
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
119
- - bbe18b9f: ZERO-2575: Fix build error
120
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
121
- - 4920742: Disable getCachedTranslations
122
- - 7e56d6b: ZERO-2841: Update api tagTypes
123
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
124
- - 98bb8dc: ZERO-2706: Cache getTranlations method
125
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
126
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
127
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
128
- - fad2768: ZERO-2739: add gpay to payment plugin map
129
- - dff0d595: ZERO-2659: add formData support to proxy api requests
130
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
131
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
132
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
133
- - beb499e6: ZERO-2551: Add new tsconfig paths
134
7
  - 948eb42: ZERO-2852: Add out of stock endpoints
135
- - 146ea39: ZERO-2774: Update imports
136
- - f2c92d5: ZERO-2816: Update cookie name
137
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
138
- - c47be30: ZERO-2744: Update Order and OrderItem types
139
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
140
- - f046f8e0: ZERO-2575: update version for react-number-format
141
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
142
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
8
+ - 040ec95: ZERO-2875: Add edit collection endpoints
143
9
 
144
10
  ## 1.46.0
145
11
 
@@ -147,126 +13,7 @@
147
13
 
148
14
  ### Minor Changes
149
15
 
150
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
151
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
152
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
153
- - fda5b92: ZERO-2725: fix invalid import
154
- - 2d9b2b2: ZERO-2816: Add segment to headers
155
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
156
- - 8d9ac9a: ZERO-2794: Add field to order type
157
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
158
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
159
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
160
- - 3bf2dd9: ZERO-2551: Fix search page
161
- - e9541a1: ZERO-2816: Add headers to url
162
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
163
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
164
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
165
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
166
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
167
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
168
- - d3474c6: ZERO-2655: Add data source shipping option
169
- - 75080fd6: ZERO-2630: Add max limit to postcode area
170
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
171
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
172
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
173
- - bbe18b9f: ZERO-2575: Fix build error
174
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
175
- - 4920742: Disable getCachedTranslations
176
- - 7e56d6b: ZERO-2841: Update api tagTypes
177
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
178
- - 98bb8dc: ZERO-2706: Cache getTranlations method
179
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
180
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
181
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
182
- - fad2768: ZERO-2739: add gpay to payment plugin map
183
- - dff0d595: ZERO-2659: add formData support to proxy api requests
184
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
185
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
186
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
187
- - beb499e6: ZERO-2551: Add new tsconfig paths
188
- - 948eb42: ZERO-2852: Add out of stock endpoints
189
- - 146ea39: ZERO-2774: Update imports
190
- - f2c92d5: ZERO-2816: Update cookie name
191
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
192
- - c47be30: ZERO-2744: Update Order and OrderItem types
193
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
194
- - f046f8e0: ZERO-2575: update version for react-number-format
195
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
196
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
197
-
198
- ## 1.45.0-rc.4
199
-
200
- ### Minor Changes
201
-
202
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
203
-
204
- ## 1.45.0-rc.3
205
-
206
- ### Minor Changes
207
-
208
- - 948eb42: ZERO-2852: Add out of stock endpoints
209
-
210
- ## 1.45.0-rc.2
211
-
212
- ### Minor Changes
213
-
214
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
215
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
216
-
217
- ## 1.45.0-rc.1
218
-
219
- ### Minor Changes
220
-
221
- - 7e56d6b: ZERO-2841: Update api tagTypes
222
-
223
- ## 1.45.0-rc.0
224
-
225
- ### Minor Changes
226
-
227
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
228
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
229
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
230
- - fda5b92: ZERO-2725: fix invalid import
231
- - 2d9b2b2: ZERO-2816: Add segment to headers
232
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
233
- - 8d9ac9a: ZERO-2794: Add field to order type
234
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
235
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
236
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
237
- - 3bf2dd9: ZERO-2551: Fix search page
238
- - e9541a1: ZERO-2816: Add headers to url
239
- - c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
240
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
241
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
242
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
243
- - 1448a96: ZERO-2612: add errors type in CheckoutState
244
16
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
245
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
246
- - d3474c6: ZERO-2655: Add data source shipping option
247
- - 75080fd: ZERO-2630: Add max limit to postcode area
248
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
249
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
250
- - bbe18b9: ZERO-2575: Fix build error
251
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
252
- - 4920742: Disable getCachedTranslations
253
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
254
- - 98bb8dc: ZERO-2706: Cache getTranlations method
255
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
256
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
257
- - fad2768: ZERO-2739: add gpay to payment plugin map
258
- - dff0d59: ZERO-2659: add formData support to proxy api requests
259
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
260
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
261
- - beb499e: ZERO-2551: Add new tsconfig paths
262
- - 146ea39: ZERO-2774: Update imports
263
- - f2c92d5: ZERO-2816: Update cookie name
264
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
265
- - c47be30: ZERO-2744: Update Order and OrderItem types
266
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
267
- - f046f8e0: ZERO-2575: update version for react-number-format
268
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
269
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
270
17
 
271
18
  ## 1.44.0
272
19
 
@@ -274,201 +21,7 @@
274
21
 
275
22
  ### Minor Changes
276
23
 
277
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
278
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
279
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
280
- - fda5b92: ZERO-2725: fix invalid import
281
- - 2d9b2b2: ZERO-2816: Add segment to headers
282
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
283
- - 8d9ac9a: ZERO-2794: Add field to order type
284
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
285
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
286
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
287
- - 3bf2dd9: ZERO-2551: Fix search page
288
- - e9541a1: ZERO-2816: Add headers to url
289
- - 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.
290
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
291
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
292
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
293
- - 1448a96: ZERO-2612: add errors type in CheckoutState
294
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
295
- - d3474c6: ZERO-2655: Add data source shipping option
296
- - 75080fd: ZERO-2630: Add max limit to postcode area
297
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
298
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
299
- - bbe18b9: ZERO-2575: Fix build error
300
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
301
- - 4920742: Disable getCachedTranslations
302
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
303
- - 98bb8dc: ZERO-2706: Cache getTranlations method
304
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
305
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
306
- - fad2768: ZERO-2739: add gpay to payment plugin map
307
- - dff0d59: ZERO-2659: add formData support to proxy api requests
308
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
309
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
310
- - beb499e: ZERO-2551: Add new tsconfig paths
311
- - 146ea39: ZERO-2774: Update imports
312
- - f2c92d5: ZERO-2816: Update cookie name
313
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
314
- - c47be30: ZERO-2744: Update Order and OrderItem types
315
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
316
- - f046f8e0: ZERO-2575: update version for react-number-format
317
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
318
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
319
-
320
- ## 1.43.0-rc.15
321
-
322
- ## 1.43.0-rc.14
323
-
324
- ### Minor Changes
325
-
326
- - 3bf2dd9: ZERO-2551: Fix search page
327
-
328
- ## 1.43.0-rc.13
329
-
330
- ### Minor Changes
331
-
332
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
333
-
334
- ## 1.43.0-rc.12
335
-
336
- ### Minor Changes
337
-
338
- - 4920742: Disable getCachedTranslations
339
-
340
- ## 1.43.0-rc.11
341
-
342
- ### Minor Changes
343
-
344
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
345
-
346
- ## 1.43.0-rc.10
347
-
348
- ### Minor Changes
349
-
350
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
351
-
352
- ## 1.43.0-rc.9
353
-
354
- ### Minor Changes
355
-
356
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
357
-
358
- ## 1.43.0-rc.8
359
-
360
- ### Minor Changes
361
-
362
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
363
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
364
-
365
- ## 1.43.0-rc.7
366
-
367
- ### Minor Changes
368
-
369
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
370
-
371
- ## 1.43.0-rc.6
372
-
373
- ### Minor Changes
374
-
375
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
376
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
377
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
378
- - fda5b92: ZERO-2725: fix invalid import
379
- - 2d9b2b2: ZERO-2816: Add segment to headers
380
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
381
- - 8d9ac9a: ZERO-2794: Add field to order type
382
- - e9541a1: ZERO-2816: Add headers to url
383
- - 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.
384
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
385
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
386
- - 1448a96: ZERO-2612: add errors type in CheckoutState
387
- - d3474c6: ZERO-2655: Add data source shipping option
388
- - 75080fd: ZERO-2630: Add max limit to postcode area
389
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
390
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
391
- - bbe18b9: ZERO-2575: Fix build error
392
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
393
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
394
- - 98bb8dc: ZERO-2706: Cache getTranlations method
395
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
396
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
397
- - fad2768: ZERO-2739: add gpay to payment plugin map
398
- - dff0d59: ZERO-2659: add formData support to proxy api requests
399
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
400
24
  - 4a163f2: ZERO-2761: Add condition for basket summary
401
- - beb499e: ZERO-2551: Add new tsconfig paths
402
- - 146ea39: ZERO-2774: Update imports
403
- - f2c92d5: ZERO-2816: Update cookie name
404
- - c47be30: ZERO-2744: Update Order and OrderItem types
405
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
406
- - f046f8e: ZERO-2575: update version for react-number-format
407
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
408
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
409
-
410
- ## 1.43.0-rc.5
411
-
412
- ### Minor Changes
413
-
414
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
415
-
416
- ## 1.43.0-rc.4
417
-
418
- ### Minor Changes
419
-
420
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
421
-
422
- ## 1.43.0-rc.3
423
-
424
- ### Minor Changes
425
-
426
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
427
-
428
- ## 1.43.0-rc.2
429
-
430
- ### Minor Changes
431
-
432
- - f2c92d5: ZERO-2816: Update cookie name
433
-
434
- ## 1.43.0-rc.1
435
-
436
- ### Minor Changes
437
-
438
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
439
-
440
- ## 1.43.0-rc.0
441
-
442
- ### Minor Changes
443
-
444
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
445
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
446
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
447
- - fda5b92: ZERO-2725: fix invalid import
448
- - 2d9b2b2: ZERO-2816: Add segment to headers
449
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
450
- - 8d9ac9a: ZERO-2794: Add field to order type
451
- - e9541a1: ZERO-2816: Add headers to url
452
- - 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.
453
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
454
- - 1448a96: ZERO-2612: add errors type in CheckoutState
455
- - d3474c6: ZERO-2655: Add data source shipping option
456
- - 75080fd: ZERO-2630: Add max limit to postcode area
457
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
458
- - bbe18b9: ZERO-2575: Fix build error
459
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
460
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
461
- - 98bb8dc: ZERO-2706: Cache getTranlations method
462
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
463
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
464
- - fad2768: ZERO-2739: add gpay to payment plugin map
465
- - dff0d59: ZERO-2659: add formData support to proxy api requests
466
- - beb499e: ZERO-2551: Add new tsconfig paths
467
- - 146ea39: ZERO-2774: Update imports
468
- - c47be30: ZERO-2744: Update Order and OrderItem types
469
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
470
- - f046f8e: ZERO-2575: update version for react-number-format
471
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
472
25
 
473
26
  ## 1.42.0
474
27
 
package/api/client.ts CHANGED
@@ -4,7 +4,6 @@ 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';
8
7
 
9
8
  interface RouteParams {
10
9
  params: {
@@ -52,24 +51,18 @@ async function proxyRequest(...args) {
52
51
  extraHeaders[key.toLowerCase()] = value;
53
52
  }
54
53
 
55
- const excludedHeaders = [
54
+ [
56
55
  'x-forwarded-host',
57
56
  'x-forwarded-proto',
58
57
  'x-forwarded-port',
59
58
  'x-requested-with',
60
59
  'origin',
60
+ 'host',
61
61
  'referer',
62
62
  'accept',
63
63
  'content-length',
64
- 'content-type',
65
- 'host'
66
- ];
67
-
68
- excludedHeaders.forEach((header) => {
69
- if (!settings.includedProxyHeaders?.includes(header)) {
70
- delete extraHeaders[header];
71
- }
72
- });
64
+ 'content-type'
65
+ ].forEach((header) => delete extraHeaders[header]);
73
66
 
74
67
  const fetchOptions = {
75
68
  method: req.method,
@@ -81,33 +74,16 @@ async function proxyRequest(...args) {
81
74
  }
82
75
  } as RequestInit;
83
76
 
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
-
98
77
  if (options.contentType) {
99
78
  fetchOptions.headers['Content-Type'] = options.contentType;
100
79
  }
101
80
 
102
- const isMultipartFormData = req.headers
103
- .get('content-type')
104
- ?.includes('multipart/form-data;');
105
-
106
81
  if (req.method !== 'GET') {
107
- let body: Record<string, any> | FormData = {};
82
+ const formData = new URLSearchParams();
83
+ let body = {};
108
84
 
109
85
  try {
110
- body = isMultipartFormData ? await req.formData() : await req.json();
86
+ body = await req.json();
111
87
  } catch (error) {
112
88
  logger.error(
113
89
  `Client Proxy Request - Error while parsing request body to JSON`,
@@ -118,25 +94,13 @@ async function proxyRequest(...args) {
118
94
  );
119
95
  }
120
96
 
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
- });
97
+ Object.keys(body ?? {}).forEach((key) => {
98
+ if (body[key]) {
99
+ formData.append(key, body[key]);
100
+ }
101
+ });
135
102
 
136
- fetchOptions.body = !options.useFormData
137
- ? JSON.stringify(body)
138
- : formData;
139
- }
103
+ fetchOptions.body = !options.useFormData ? JSON.stringify(body) : formData;
140
104
  }
141
105
 
142
106
  let url = `${commerceUrl}/${slug.replace(/,/g, '/')}`;
@@ -152,8 +116,11 @@ async function proxyRequest(...args) {
152
116
  try {
153
117
  const request = await fetch(url, fetchOptions);
154
118
 
119
+ // Using NextResponse.json with status 204 will cause an error
155
120
  if (request.status === 204) {
156
- return new Response(null, { status: 204 });
121
+ return new Response(null, {
122
+ status: 204
123
+ });
157
124
  }
158
125
 
159
126
  let response = {} as any;
@@ -1,53 +1,29 @@
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
- }
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
- }
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
+ }
@@ -19,4 +19,3 @@ export * from './trans';
19
19
  export * from './link';
20
20
  export * from './pagination';
21
21
  export * from './live-commerce';
22
- export * from './file-input';