@akinon/next 1.56.0-rc.5 → 1.56.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 (59) hide show
  1. package/CHANGELOG.md +1 -550
  2. package/api/client.ts +9 -39
  3. package/assets/styles/index.scss +26 -50
  4. package/bin/pz-prebuild.js +0 -1
  5. package/bin/pz-predev.js +0 -1
  6. package/components/index.ts +0 -1
  7. package/components/input.tsx +7 -21
  8. package/components/link.tsx +13 -17
  9. package/components/price.tsx +4 -11
  10. package/components/pz-root.tsx +3 -15
  11. package/components/selected-payment-option-view.tsx +38 -26
  12. package/data/client/account.ts +9 -10
  13. package/data/client/api.ts +1 -1
  14. package/data/client/b2b.ts +2 -35
  15. package/data/client/basket.ts +5 -6
  16. package/data/client/checkout.ts +0 -37
  17. package/data/client/user.ts +2 -3
  18. package/data/server/category.ts +19 -43
  19. package/data/server/flatpage.ts +7 -29
  20. package/data/server/form.ts +11 -29
  21. package/data/server/landingpage.ts +7 -26
  22. package/data/server/list.ts +6 -16
  23. package/data/server/menu.ts +2 -15
  24. package/data/server/product.ts +13 -33
  25. package/data/server/seo.ts +24 -17
  26. package/data/server/special-page.ts +5 -15
  27. package/data/server/widget.ts +7 -14
  28. package/data/urls.ts +1 -8
  29. package/hocs/server/with-segment-defaults.tsx +1 -4
  30. package/hooks/index.ts +1 -2
  31. package/hooks/use-pagination.ts +2 -2
  32. package/hooks/use-payment-options.ts +1 -2
  33. package/lib/cache.ts +6 -8
  34. package/middlewares/default.ts +2 -46
  35. package/middlewares/pretty-url.ts +1 -11
  36. package/middlewares/url-redirection.ts +0 -4
  37. package/package.json +3 -4
  38. package/plugins.d.ts +0 -1
  39. package/redux/middlewares/checkout.ts +11 -71
  40. package/redux/reducers/checkout.ts +3 -23
  41. package/types/commerce/account.ts +0 -1
  42. package/types/commerce/address.ts +1 -1
  43. package/types/commerce/b2b.ts +2 -12
  44. package/types/commerce/checkout.ts +0 -30
  45. package/types/commerce/order.ts +0 -1
  46. package/types/index.ts +2 -17
  47. package/utils/app-fetch.ts +8 -16
  48. package/utils/generate-commerce-search-params.ts +1 -3
  49. package/utils/index.ts +6 -27
  50. package/utils/server-translation.ts +1 -11
  51. package/with-pz-config.js +2 -13
  52. package/assets/styles/index.css +0 -49
  53. package/assets/styles/index.css.map +0 -1
  54. package/bin/pz-generate-translations.js +0 -41
  55. package/components/file-input.tsx +0 -8
  56. package/hooks/use-message-listener.ts +0 -24
  57. package/lib/cache-handler.mjs +0 -33
  58. package/routes/pretty-url.tsx +0 -192
  59. package/utils/redirection-iframe.ts +0 -85
package/CHANGELOG.md CHANGED
@@ -1,129 +1,14 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.56.0-rc.5
3
+ ## 1.56.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - c416d18: ZERO-2915: Add delivery option null check for setAddress
8
-
9
- ## 1.56.0-rc.4
10
-
11
- ### Minor Changes
12
-
13
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
14
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
15
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
16
- - fda5b927: ZERO-2725: fix invalid import
17
- - 2d9b2b2c: ZERO-2816: Add segment to headers
18
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
19
7
  - d93a507: ZERO-2900: Fix pretty url rewrite
20
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
21
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
22
- - 3bf2dd9: ZERO-2551: Fix search page
23
- - e9541a13: ZERO-2816: Add headers to url
24
- - 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.
25
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
26
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
27
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
28
- - 7b05522: ZERO-2905: Fix resend and close button in otp package
29
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
30
- - d3474c64: ZERO-2655: Add data source shipping option
31
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
32
- - 29ead87: ZERO-2905: Fix resend and close button in otp package
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
8
  - 674badc: ZERO-2912: Fix selected payment option view to handle null values
40
- - 7e56d6b: ZERO-2841: Update api tagTypes
41
- - 94b69285: ZERO-2551: Add cache handler check in url-redirection middleware
42
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
43
9
  - 207ac6e: ZERO-2917: Add OrderSelectionPage endpoint
44
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
45
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
46
- - fad27689: ZERO-2739: add gpay to payment plugin map
47
- - dff0d595: ZERO-2659: add formData support to proxy api requests
48
- - fdd0b41: ZERO-2706: Add optimized translation support
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
- - f2c92d5c: ZERO-2816: Update cookie name
53
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
54
- - f046f8e0: ZERO-2575: update version for react-number-format
55
10
  - b9273fd: ZERO-2889: add host headers to requests
56
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
57
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
58
11
  - c670bd4: ZERO-2900: Add middleware rewrite functionality
59
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
60
-
61
- ## 1.56.0-rc.3
62
-
63
- ### Minor Changes
64
-
65
- - 674badc: ZERO-2912: Fix selected payment option view to handle null values
66
-
67
- ## 1.56.0-rc.2
68
-
69
- ### Minor Changes
70
-
71
- - 7b05522: ZERO-2905: Fix resend and close button in otp package
72
- - 29ead87: ZERO-2905: Fix resend and close button in otp package
73
-
74
- ## 1.56.0-rc.1
75
-
76
- ### Minor Changes
77
-
78
- - 207ac6e: ZERO-2917: Add OrderSelectionPage endpoint
79
-
80
- ## 1.56.0-rc.0
81
-
82
- ### Minor Changes
83
-
84
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
85
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
86
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
87
- - fda5b927: ZERO-2725: fix invalid import
88
- - 2d9b2b2c: ZERO-2816: Add segment to headers
89
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
90
- - d93a507: ZERO-2900: Fix pretty url rewrite
91
- - 6c25f666: ZERO-2551: Check CACHE_HOST variable
92
- - bc2b4117: ZERO-2825: Add attribute-based shipping options to checkout page
93
- - 3bf2dd94: ZERO-2551: Fix search page
94
- - e9541a13: ZERO-2816: Add headers to url
95
- - 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.
96
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
97
- - 64699d3f: ZERO-2761: Fix invalid import for plugin module
98
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
99
- - d6edb1d0: ZERO-2551: Fix searchparams handling for list and other routes
100
- - d3474c64: ZERO-2655: Add data source shipping option
101
- - 17f87524: ZERO-2816: Make the incoming currency lowercase
102
- - c45b62c9: ZERO-2818: Add upload and download support for b2b package
103
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
104
- - bbe18b9f: ZERO-2575: Fix build error
105
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
106
- - 4920742c: Disable getCachedTranslations
107
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
108
- - 7e56d6b6: ZERO-2841: Update api tagTypes
109
- - 94b69285: ZERO-2551: Add cache handler check in url-redirection middleware
110
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
111
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
112
- - 8f47ccae: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
113
- - fad27689: ZERO-2739: add gpay to payment plugin map
114
- - dff0d595: ZERO-2659: add formData support to proxy api requests
115
- - fdd0b41: ZERO-2706: Add optimized translation support
116
- - f2c325c1: ZERO-2838: Move file input component into @akinon/next
117
- - 9e25a64b: ZERO-2835: Update category page layout with breadcrumb
118
- - beb499e6: ZERO-2551: Add new tsconfig paths
119
- - f2c92d5c: ZERO-2816: Update cookie name
120
- - 7bd3d992: ZERO-2801: Refactor locale middleware to handle single locale configuration
121
- - f046f8e0: ZERO-2575: update version for react-number-format
122
- - b9273fd3: ZERO-2889: add host headers to requests
123
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
124
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
125
- - c670bd48: ZERO-2900: Add middleware rewrite functionality
126
- - 3f9b8d7e: ZERO-2761: Update plugins.js for akinon-next
127
12
 
128
13
  ## 1.55.0
129
14
 
@@ -169,128 +54,7 @@
169
54
 
170
55
  ### Minor Changes
171
56
 
172
- - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
173
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
174
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
175
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
176
- - fda5b927: ZERO-2725: fix invalid import
177
- - 2d9b2b2: ZERO-2816: Add segment to headers
178
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
179
- - d93a507: ZERO-2900: Fix pretty url rewrite
180
- - 8d9ac9a: ZERO-2794: Add field to order type
181
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
182
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
183
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
184
- - 3bf2dd9: ZERO-2551: Fix search page
185
- - e9541a1: ZERO-2816: Add headers to url
186
- - 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.
187
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
188
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
189
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
190
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
191
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
192
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
193
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
194
- - d3474c64: ZERO-2655: Add data source shipping option
195
- - 75080fd6: ZERO-2630: Add max limit to postcode area
196
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
197
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
198
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
199
- - bbe18b9f: ZERO-2575: Fix build error
200
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
201
- - 4920742: Disable getCachedTranslations
202
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
203
- - 7e56d6b: ZERO-2841: Update api tagTypes
204
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
205
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
206
- - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
207
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
208
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
209
- - fad27689: ZERO-2739: add gpay to payment plugin map
210
- - dff0d595: ZERO-2659: add formData support to proxy api requests
211
- - fdd0b41: ZERO-2706: Add optimized translation support
212
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
213
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
214
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
215
- - beb499e6: ZERO-2551: Add new tsconfig paths
216
- - 146ea391: ZERO-2774: Update imports
217
- - f2c92d5: ZERO-2816: Update cookie name
218
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
219
- - c47be30d: ZERO-2744: Update Order and OrderItem types
220
- - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
221
- - f046f8e0: ZERO-2575: update version for react-number-format
222
- - b9273fd: ZERO-2889: add host headers to requests
223
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
224
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
225
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
226
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
227
- - 3d35f70: ZERO-2908: Add cookie to redirect url
228
-
229
- ## 1.50.0-rc.1
230
-
231
- ### Minor Changes
232
-
233
- - 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
234
-
235
- ## 1.50.0-rc.0
236
-
237
- ### Minor Changes
238
-
239
- - 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
240
- - 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
241
- - 5dfeea0: ZERO-2801: Revert ZERO-2801
242
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
243
- - fda5b927: ZERO-2725: fix invalid import
244
- - 2d9b2b2: ZERO-2816: Add segment to headers
245
- - c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
246
- - d93a507: ZERO-2900: Fix pretty url rewrite
247
- - 8d9ac9a: ZERO-2794: Add field to order type
248
57
  - eaf97d6: ZERO-2909: Add deleteCollectionItem query to wishlistApi
249
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
250
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
251
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
252
- - 3bf2dd9: ZERO-2551: Fix search page
253
- - e9541a1: ZERO-2816: Add headers to url
254
- - 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.
255
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
256
- - 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
257
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
258
- - 0d3a913e: ZERO-2725: Update decimal scale in Price component
259
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
260
- - 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
261
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
262
- - d3474c64: ZERO-2655: Add data source shipping option
263
- - 75080fd6: ZERO-2630: Add max limit to postcode area
264
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
265
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
266
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
267
- - bbe18b9f: ZERO-2575: Fix build error
268
- - d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
269
- - 4920742: Disable getCachedTranslations
270
- - 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
271
- - 7e56d6b: ZERO-2841: Update api tagTypes
272
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
273
- - 98bb8dcd: ZERO-2706: Cache getTranlations method
274
- - 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
275
- - dcc8a150: ZERO-2694: added build step to RC branch pipeline
276
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
277
- - fad27689: ZERO-2739: add gpay to payment plugin map
278
- - dff0d595: ZERO-2659: add formData support to proxy api requests
279
- - fdd0b41: ZERO-2706: Add optimized translation support
280
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
281
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
282
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
283
- - beb499e6: ZERO-2551: Add new tsconfig paths
284
- - 146ea391: ZERO-2774: Update imports
285
- - f2c92d5: ZERO-2816: Update cookie name
286
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
287
- - c47be30d: ZERO-2744: Update Order and OrderItem types
288
- - e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
289
- - f046f8e0: ZERO-2575: update version for react-number-format
290
- - b9273fd: ZERO-2889: add host headers to requests
291
- - 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
292
- - c670bd4: ZERO-2900: Add middleware rewrite functionality
293
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
294
58
 
295
59
  ## 1.49.0
296
60
 
@@ -316,126 +80,7 @@
316
80
 
317
81
  ### Minor Changes
318
82
 
319
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
320
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
321
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
322
- - fda5b92: ZERO-2725: fix invalid import
323
- - 2d9b2b2: ZERO-2816: Add segment to headers
324
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
325
- - 8d9ac9a: ZERO-2794: Add field to order type
326
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
327
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
328
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
329
- - 3bf2dd9: ZERO-2551: Fix search page
330
- - e9541a1: ZERO-2816: Add headers to url
331
- - 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.
332
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
333
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
334
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
335
- - 1448a96e: ZERO-2612: add errors type in CheckoutState
336
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
337
- - d3474c6: ZERO-2655: Add data source shipping option
338
- - 75080fd6: ZERO-2630: Add max limit to postcode area
339
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
340
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
341
- - 91265bba: ZERO-2551: Improve pretty url and caching performance
342
- - bbe18b9f: ZERO-2575: Fix build error
343
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
344
- - 4920742: Disable getCachedTranslations
345
- - 7e56d6b: ZERO-2841: Update api tagTypes
346
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
347
- - 98bb8dc: ZERO-2706: Cache getTranlations method
348
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
349
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
350
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
351
- - fad2768: ZERO-2739: add gpay to payment plugin map
352
- - dff0d595: ZERO-2659: add formData support to proxy api requests
353
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
354
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
355
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
356
- - beb499e6: ZERO-2551: Add new tsconfig paths
357
- - 948eb42: ZERO-2852: Add out of stock endpoints
358
- - 146ea39: ZERO-2774: Update imports
359
- - f2c92d5: ZERO-2816: Update cookie name
360
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
361
- - c47be30: ZERO-2744: Update Order and OrderItem types
362
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
363
- - f046f8e0: ZERO-2575: update version for react-number-format
364
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
365
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
366
-
367
- ## 1.45.0-rc.4
368
-
369
- ### Minor Changes
370
-
371
- - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
372
-
373
- ## 1.45.0-rc.3
374
-
375
- ### Minor Changes
376
-
377
- - 948eb42: ZERO-2852: Add out of stock endpoints
378
-
379
- ## 1.45.0-rc.2
380
-
381
- ### Minor Changes
382
-
383
- - c45b62c: ZERO-2818: Add upload and download support for b2b package
384
- - f2c325c: ZERO-2838: Move file input component into @akinon/next
385
-
386
- ## 1.45.0-rc.1
387
-
388
- ### Minor Changes
389
-
390
- - 7e56d6b: ZERO-2841: Update api tagTypes
391
-
392
- ## 1.45.0-rc.0
393
-
394
- ### Minor Changes
395
-
396
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
397
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
398
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
399
- - fda5b92: ZERO-2725: fix invalid import
400
- - 2d9b2b2: ZERO-2816: Add segment to headers
401
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
402
- - 8d9ac9a: ZERO-2794: Add field to order type
403
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
404
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
405
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
406
- - 3bf2dd9: ZERO-2551: Fix search page
407
- - e9541a1: ZERO-2816: Add headers to url
408
- - 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.
409
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
410
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
411
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
412
- - 1448a96: ZERO-2612: add errors type in CheckoutState
413
83
  - 2ab6e08: ZERO-2841: Update getBasketDetail query
414
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
415
- - d3474c6: ZERO-2655: Add data source shipping option
416
- - 75080fd: ZERO-2630: Add max limit to postcode area
417
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
418
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
419
- - bbe18b9: ZERO-2575: Fix build error
420
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
421
- - 4920742: Disable getCachedTranslations
422
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
423
- - 98bb8dc: ZERO-2706: Cache getTranlations method
424
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
425
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
426
- - fad2768: ZERO-2739: add gpay to payment plugin map
427
- - dff0d59: ZERO-2659: add formData support to proxy api requests
428
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
429
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
430
- - beb499e: ZERO-2551: Add new tsconfig paths
431
- - 146ea39: ZERO-2774: Update imports
432
- - f2c92d5: ZERO-2816: Update cookie name
433
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
434
- - c47be30: ZERO-2744: Update Order and OrderItem types
435
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
436
- - f046f8e0: ZERO-2575: update version for react-number-format
437
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
438
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
439
84
 
440
85
  ## 1.44.0
441
86
 
@@ -443,201 +88,7 @@
443
88
 
444
89
  ### Minor Changes
445
90
 
446
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
447
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
448
- - a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
449
- - fda5b92: ZERO-2725: fix invalid import
450
- - 2d9b2b2: ZERO-2816: Add segment to headers
451
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
452
- - 8d9ac9a: ZERO-2794: Add field to order type
453
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
454
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
455
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
456
- - 3bf2dd9: ZERO-2551: Fix search page
457
- - e9541a1: ZERO-2816: Add headers to url
458
- - 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.
459
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
460
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
461
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
462
- - 1448a96: ZERO-2612: add errors type in CheckoutState
463
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
464
- - d3474c6: ZERO-2655: Add data source shipping option
465
- - 75080fd: ZERO-2630: Add max limit to postcode area
466
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
467
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
468
- - bbe18b9: ZERO-2575: Fix build error
469
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
470
- - 4920742: Disable getCachedTranslations
471
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
472
- - 98bb8dc: ZERO-2706: Cache getTranlations method
473
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
474
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
475
- - fad2768: ZERO-2739: add gpay to payment plugin map
476
- - dff0d59: ZERO-2659: add formData support to proxy api requests
477
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
478
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
479
- - beb499e: ZERO-2551: Add new tsconfig paths
480
- - 146ea39: ZERO-2774: Update imports
481
- - f2c92d5: ZERO-2816: Update cookie name
482
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
483
- - c47be30: ZERO-2744: Update Order and OrderItem types
484
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
485
- - f046f8e0: ZERO-2575: update version for react-number-format
486
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
487
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
488
-
489
- ## 1.43.0-rc.15
490
-
491
- ## 1.43.0-rc.14
492
-
493
- ### Minor Changes
494
-
495
- - 3bf2dd9: ZERO-2551: Fix search page
496
-
497
- ## 1.43.0-rc.13
498
-
499
- ### Minor Changes
500
-
501
- - 9e25a64: ZERO-2835: Update category page layout with breadcrumb
502
-
503
- ## 1.43.0-rc.12
504
-
505
- ### Minor Changes
506
-
507
- - 4920742: Disable getCachedTranslations
508
-
509
- ## 1.43.0-rc.11
510
-
511
- ### Minor Changes
512
-
513
- - 6c25f66: ZERO-2551: Check CACHE_HOST variable
514
-
515
- ## 1.43.0-rc.10
516
-
517
- ### Minor Changes
518
-
519
- - d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
520
-
521
- ## 1.43.0-rc.9
522
-
523
- ### Minor Changes
524
-
525
- - bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
526
-
527
- ## 1.43.0-rc.8
528
-
529
- ### Minor Changes
530
-
531
- - 70279e7: ZERO-2817: Add metrics endpoint in default middleware
532
- - 9d94f7e: ZERO-2820: update parent pk usage for menu generator
533
-
534
- ## 1.43.0-rc.7
535
-
536
- ### Minor Changes
537
-
538
- - 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
539
-
540
- ## 1.43.0-rc.6
541
-
542
- ### Minor Changes
543
-
544
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
545
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
546
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
547
- - fda5b92: ZERO-2725: fix invalid import
548
- - 2d9b2b2: ZERO-2816: Add segment to headers
549
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
550
- - 8d9ac9a: ZERO-2794: Add field to order type
551
- - e9541a1: ZERO-2816: Add headers to url
552
- - 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.
553
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
554
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
555
- - 1448a96: ZERO-2612: add errors type in CheckoutState
556
- - d3474c6: ZERO-2655: Add data source shipping option
557
- - 75080fd: ZERO-2630: Add max limit to postcode area
558
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
559
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
560
- - bbe18b9: ZERO-2575: Fix build error
561
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
562
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
563
- - 98bb8dc: ZERO-2706: Cache getTranlations method
564
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
565
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
566
- - fad2768: ZERO-2739: add gpay to payment plugin map
567
- - dff0d59: ZERO-2659: add formData support to proxy api requests
568
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
569
91
  - 4a163f2: ZERO-2761: Add condition for basket summary
570
- - beb499e: ZERO-2551: Add new tsconfig paths
571
- - 146ea39: ZERO-2774: Update imports
572
- - f2c92d5: ZERO-2816: Update cookie name
573
- - c47be30: ZERO-2744: Update Order and OrderItem types
574
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
575
- - f046f8e: ZERO-2575: update version for react-number-format
576
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
577
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
578
-
579
- ## 1.43.0-rc.5
580
-
581
- ### Minor Changes
582
-
583
- - 17f8752: ZERO-2816: Make the incoming currency lowercase
584
-
585
- ## 1.43.0-rc.4
586
-
587
- ### Minor Changes
588
-
589
- - 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
590
-
591
- ## 1.43.0-rc.3
592
-
593
- ### Minor Changes
594
-
595
- - 64699d3: ZERO-2761: Fix invalid import for plugin module
596
-
597
- ## 1.43.0-rc.2
598
-
599
- ### Minor Changes
600
-
601
- - f2c92d5: ZERO-2816: Update cookie name
602
-
603
- ## 1.43.0-rc.1
604
-
605
- ### Minor Changes
606
-
607
- - eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
608
-
609
- ## 1.43.0-rc.0
610
-
611
- ### Minor Changes
612
-
613
- - 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
614
- - 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
615
- - a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
616
- - fda5b92: ZERO-2725: fix invalid import
617
- - 2d9b2b2: ZERO-2816: Add segment to headers
618
- - c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
619
- - 8d9ac9a: ZERO-2794: Add field to order type
620
- - e9541a1: ZERO-2816: Add headers to url
621
- - 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.
622
- - 0d3a913: ZERO-2725: Update decimal scale in Price component
623
- - 1448a96: ZERO-2612: add errors type in CheckoutState
624
- - d3474c6: ZERO-2655: Add data source shipping option
625
- - 75080fd: ZERO-2630: Add max limit to postcode area
626
- - 91265bb: ZERO-2551: Improve pretty url and caching performance
627
- - bbe18b9: ZERO-2575: Fix build error
628
- - d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
629
- - 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
630
- - 98bb8dc: ZERO-2706: Cache getTranlations method
631
- - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
632
- - dcc8a15: ZERO-2694: added build step to RC branch pipeline
633
- - fad2768: ZERO-2739: add gpay to payment plugin map
634
- - dff0d59: ZERO-2659: add formData support to proxy api requests
635
- - beb499e: ZERO-2551: Add new tsconfig paths
636
- - 146ea39: ZERO-2774: Update imports
637
- - c47be30: ZERO-2744: Update Order and OrderItem types
638
- - e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
639
- - f046f8e: ZERO-2575: update version for react-number-format
640
- - 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
641
92
 
642
93
  ## 1.42.0
643
94
 
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: {
@@ -81,33 +80,16 @@ async function proxyRequest(...args) {
81
80
  }
82
81
  } as RequestInit;
83
82
 
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
83
  if (options.contentType) {
99
84
  fetchOptions.headers['Content-Type'] = options.contentType;
100
85
  }
101
86
 
102
- const isMultipartFormData = req.headers
103
- .get('content-type')
104
- ?.includes('multipart/form-data;');
105
-
106
87
  if (req.method !== 'GET') {
107
- let body: Record<string, any> | FormData = {};
88
+ const formData = new URLSearchParams();
89
+ let body = {};
108
90
 
109
91
  try {
110
- body = isMultipartFormData ? await req.formData() : await req.json();
92
+ body = await req.json();
111
93
  } catch (error) {
112
94
  logger.error(
113
95
  `Client Proxy Request - Error while parsing request body to JSON`,
@@ -118,25 +100,13 @@ async function proxyRequest(...args) {
118
100
  );
119
101
  }
120
102
 
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
- });
103
+ Object.keys(body ?? {}).forEach((key) => {
104
+ if (body[key]) {
105
+ formData.append(key, body[key]);
106
+ }
107
+ });
135
108
 
136
- fetchOptions.body = !options.useFormData
137
- ? JSON.stringify(body)
138
- : formData;
139
- }
109
+ fetchOptions.body = !options.useFormData ? JSON.stringify(body) : formData;
140
110
  }
141
111
 
142
112
  let url = `${commerceUrl}/${slug.replace(/,/g, '/')}`;