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