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