@akinon/next 2.0.0-beta.12 → 2.0.0-beta.14

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 (93) hide show
  1. package/CHANGELOG.md +290 -29
  2. package/api/auth.ts +99 -77
  3. package/api/cache.ts +41 -5
  4. package/api/client.ts +3 -3
  5. package/api/form.ts +85 -0
  6. package/api/image-proxy.ts +75 -0
  7. package/api/product-categories.ts +53 -0
  8. package/api/similar-product-list.ts +63 -0
  9. package/api/similar-products.ts +111 -0
  10. package/api/virtual-try-on.ts +382 -0
  11. package/bin/pz-generate-routes.js +105 -0
  12. package/bin/pz-prebuild.js +1 -1
  13. package/bin/pz-predev.js +1 -0
  14. package/components/accordion.tsx +21 -6
  15. package/components/button.tsx +1 -1
  16. package/components/file-input.tsx +65 -3
  17. package/components/input.tsx +2 -2
  18. package/components/modal.tsx +32 -16
  19. package/components/plugin-module.tsx +61 -3
  20. package/components/select.tsx +2 -2
  21. package/components/selected-payment-option-view.tsx +21 -0
  22. package/data/client/checkout.ts +130 -74
  23. package/data/server/category.ts +11 -9
  24. package/data/server/flatpage.ts +4 -1
  25. package/data/server/form.ts +4 -1
  26. package/data/server/landingpage.ts +4 -1
  27. package/data/server/list.ts +5 -4
  28. package/data/server/menu.ts +4 -1
  29. package/data/server/product.ts +97 -52
  30. package/data/server/seo.ts +4 -1
  31. package/data/server/special-page.ts +5 -4
  32. package/data/server/widget.ts +4 -1
  33. package/data/urls.ts +3 -2
  34. package/hocs/client/with-segment-defaults.tsx +2 -2
  35. package/hocs/server/with-segment-defaults.tsx +65 -20
  36. package/hooks/index.ts +1 -0
  37. package/hooks/use-loyalty-availability.ts +21 -0
  38. package/hooks/use-payment-options.ts +2 -1
  39. package/hooks/use-pz-params.ts +37 -0
  40. package/instrumentation/index.ts +0 -1
  41. package/instrumentation/node.ts +2 -20
  42. package/jest.config.js +7 -1
  43. package/lib/cache-handler.mjs +534 -16
  44. package/lib/cache.ts +268 -34
  45. package/localization/provider.tsx +2 -5
  46. package/middlewares/checkout-provider.ts +1 -1
  47. package/middlewares/complete-gpay.ts +32 -26
  48. package/middlewares/complete-masterpass.ts +33 -26
  49. package/middlewares/complete-wallet.ts +182 -0
  50. package/middlewares/default.ts +346 -235
  51. package/middlewares/index.ts +8 -2
  52. package/middlewares/locale.ts +0 -1
  53. package/middlewares/masterpass-rest-callback.ts +230 -0
  54. package/middlewares/pretty-url.ts +21 -8
  55. package/middlewares/redirection-payment.ts +32 -26
  56. package/middlewares/saved-card-redirection.ts +33 -26
  57. package/middlewares/three-d-redirection.ts +32 -26
  58. package/middlewares/url-redirection.ts +9 -15
  59. package/middlewares/wallet-complete-redirection.ts +206 -0
  60. package/package.json +20 -11
  61. package/plugins.d.ts +19 -4
  62. package/plugins.js +9 -1
  63. package/redux/actions.ts +47 -0
  64. package/redux/middlewares/checkout.ts +20 -8
  65. package/redux/middlewares/index.ts +12 -10
  66. package/redux/middlewares/pre-order/address.ts +1 -1
  67. package/redux/middlewares/pre-order/attribute-based-shipping-option.ts +1 -1
  68. package/redux/middlewares/pre-order/data-source-shipping-option.ts +1 -1
  69. package/redux/middlewares/pre-order/delivery-option.ts +1 -1
  70. package/redux/middlewares/pre-order/index.ts +3 -1
  71. package/redux/middlewares/pre-order/installment-option.ts +2 -1
  72. package/redux/middlewares/pre-order/payment-option-reset.ts +37 -0
  73. package/redux/middlewares/pre-order/payment-option.ts +1 -1
  74. package/redux/middlewares/pre-order/pre-order-validation.ts +4 -3
  75. package/redux/middlewares/pre-order/redirection.ts +2 -2
  76. package/redux/middlewares/pre-order/set-pre-order.ts +2 -2
  77. package/redux/middlewares/pre-order/shipping-option.ts +1 -1
  78. package/redux/middlewares/pre-order/shipping-step.ts +1 -1
  79. package/redux/reducers/checkout.ts +9 -1
  80. package/redux/reducers/index.ts +5 -1
  81. package/sentry/index.ts +54 -17
  82. package/types/commerce/checkout.ts +11 -1
  83. package/types/index.ts +96 -6
  84. package/types/next-auth.d.ts +2 -2
  85. package/utils/app-fetch.ts +2 -2
  86. package/utils/generate-commerce-search-params.ts +3 -2
  87. package/utils/get-checkout-path.ts +3 -0
  88. package/utils/index.ts +61 -11
  89. package/utils/override-middleware.ts +1 -0
  90. package/utils/pz-segments.ts +92 -0
  91. package/utils/redirect-ignore.ts +35 -0
  92. package/utils/redirect.ts +9 -3
  93. package/with-pz-config.js +10 -4
package/CHANGELOG.md CHANGED
@@ -1,78 +1,339 @@
1
1
  # @akinon/next
2
2
 
3
- ## 2.0.0-beta.12
3
+ ## 2.0.0-beta.14
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - 1d79e32: ZERO-3540: Next.js Upgrade to 15.4.5
7
+ - aef81c5d: ZERO-4034: Refactor checkout API to use dynamic store imports for improved performance
8
+ - 0754c835: ZERO-4063: Add support for optional Redis password in cache handlers
9
+ - c6c5c1cd: ZERO-4128: Use cookies API for pz-pos-error to ensure delivery on 303 redirects
8
10
 
9
- ## 2.0.0-beta.11
11
+ ## 2.0.0-beta.13
10
12
 
11
13
  ### Minor Changes
12
14
 
13
- - ac783d6: ZERO-3482: Update tailwindcss to version 4.1.11 and enhance button cursor styles
15
+ - b12527ec: ZERO-4102: Add support for post-checkout redirect in middleware
16
+ - a9f5cdb1: ZERO-4102: Fix post-checkout condition to additionally check for empty search parameters.
17
+ - 01ee41f1: ZERO-4102: Implement a post-checkout flow by dynamically determining checkout paths and managing a pz-post-checkout-flow cookie.
14
18
 
15
- ## 2.0.0-beta.10
19
+ ## 1.118.0
16
20
 
17
21
  ### Minor Changes
18
22
 
19
- - 2806320: ZERO-3390: Update version tailwindcss, autoprefixer, tailwind-merge, postcss
23
+ - 729fe756: ZERO-3895: improve non-3D payment handling and error display
20
24
 
21
- ## 2.0.0-beta.9
25
+ ## 1.117.0
26
+
27
+ ## 1.116.0
28
+
29
+ ### Minor Changes
30
+
31
+ - d7ec6b08: ZERO-3988: Add Google Pay option to plugin selection
32
+ - 726491df: ZERO-3988: Add google pay integration
33
+
34
+ ## 1.115.0
22
35
 
23
36
  ### Minor Changes
24
37
 
25
- - 0fe7711: ZERO-3387: Upgrade nextjs, eslint-config-next
38
+ - b59bed4d: ZERO-3878: Reintegrated similar products and removed localStorage checks and implemented props based showing of buttons
39
+ - b5f9d75c: ZERO-3873: Refactor payment redirection middlewares to properly forward all set-cookie headers from upstream responses
40
+ - cbcfdf4d: ZERO-3859: Haso payment gateway implmeneted
41
+ - 71882722: ZERO-3897: Add compress option to default Next.js configuration
42
+ - 7056203a: ZERO-3875: removed shared_tags through stripTags function for unused keys
26
43
 
27
- ## 2.0.0-beta.8
44
+ ## 1.114.0
28
45
 
29
46
  ### Minor Changes
30
47
 
31
- - 071d0f5: ZERO-3352: Resolve Single item size exceeds maxSize error and upgrade dependencies
48
+ - 65d3b862: ZERO-3054: Update headers in appFetch
49
+ - 43c182ee: ZERO-3054: Update Redis variable checks to conditionally include CACHE_SECRET
50
+ - eeb20bea: Revert "ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing"
51
+ - fdd255ee: ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing
32
52
 
33
- ## 2.0.0-beta.7
53
+ ## 1.113.0
34
54
 
35
- ## 2.0.0-beta.6
55
+ ## 1.112.0
36
56
 
37
57
  ### Minor Changes
38
58
 
39
- - 8f05f9b: ZERO-3250: Beta branch synchronized with Main branch
59
+ - 888fdec: ZERO-3792: Virtual Try On new features are implemented and also basket support implemented.
40
60
 
41
- ## 2.0.0-beta.5
61
+ ## 1.111.0
42
62
 
43
63
  ### Minor Changes
44
64
 
45
- - e791eab: ZERO-3133: Add fallbackReducer for handling missing plugin reducers
65
+ - c026300: ZERO-3833: fix masterpass rest conflicts
66
+ - b47b9d8: ZERO-3414: create masterpass-rest package
67
+
68
+ ## 1.110.0
69
+
70
+ ### Minor Changes
46
71
 
47
- ## 2.0.0-beta.4
72
+ - fc752c9: ZERO-3795: Remove unnecessary redirection logic from payment middleware
73
+ - 757af4a: ZERO-3783: Update image remote patterns for security compliance
48
74
 
49
- ## 2.0.0-beta.3
75
+ ## 1.109.0
50
76
 
51
77
  ### Minor Changes
52
78
 
53
- - 5536b80: ZERO-3104: Add optional headers parameter
79
+ - fcbbea79: ZERO-3648: Add virtual try-on feature with localization support
54
80
 
55
- ## 2.0.0-beta.2
81
+ ## 1.108.0
56
82
 
57
83
  ### Minor Changes
58
84
 
59
- - a006015: ZERO-3116: Add not-found page and update default middleware.
60
- - 999168d: ZERO-3104: Remove local cache handler from CacheHandler initialization
61
- - 1eeb3d8: ZERO-3116: Add not found page
62
- - 86a5a62: ZERO-3104: Add optional headers parameter to data fetching functions
63
- - dd69cc6: ZERO-3079: Modularize pre-order middleware
85
+ - d8883ce6: ZERO-3640: Refactor wallet completion handling to accept additional parameters; update related API calls
86
+ - 59ed7a7e: ZERO-3640: Add order number state and update FlowPayment component for wallet payment response handling
87
+ - 31a2d35a: ZERO-3640: Refactor checkout API call to include useFormData option; update FlowPayment component for improved error handling and code readability
88
+
89
+ ## 1.107.0
90
+
91
+ ### Minor Changes
92
+
93
+ - 4ca44c78: ZERO-3634: add register_consumer_card
94
+ - 28c7ea79: ZERO-3427: Refactor redirect utility to handle undefined URL and improve locale handling
95
+ - b6e5b624: ZERO-3257: Enhance locale middleware to redirect using existing or default locale and support 303 status for POST requests
96
+ - 5b500797: ZERO-3634: iyzico saved card
97
+
98
+ ## 1.106.0
99
+
100
+ ### Minor Changes
101
+
102
+ - 9dc7298: ZERO-3416: Refactor Accordion component to enhance props and improve styling flexibility
103
+ - 2d3f178: ZERO-3417: Enhance FileInput component with additional props for customization
104
+
105
+ ## 1.105.0
106
+
107
+ ### Minor Changes
108
+
109
+ - c39c700: ZERO-3420: Refactor Modal component
110
+ - d512ea2: ZERO-3656: update setLoyaltyData mutation to accept string type
111
+ - 3b255fe: ZERO-3629 :edit warnings in build
112
+
113
+ ## 1.104.0
114
+
115
+ ### Minor Changes
116
+
117
+ - 63774a6: ZERO-3351: Add commerce redirection ignore list functionality and related utility
118
+ - a2fbee6: ZERO-3651: Fix correct is Iframe property in contextListMiddleware
119
+ - 0de5573: ZERO-3418: Update remotePatterns hostname to allow all subdomains
120
+ - 5ad87ff: ZERO-3646: Refactor form submission API to handle form data and improve error responses
121
+
122
+ ## 1.103.0
123
+
124
+ ## 1.102.0
125
+
126
+ ### Minor Changes
127
+
128
+ - 6b949cb: ZERO-3615: Refactor product data handling and improve 404 error handling
129
+ - 9a3885b: ZERO-3660: skip catch-all not_found route in generate route script
130
+
131
+ ## 1.101.0
132
+
133
+ ### Minor Changes
134
+
135
+ - 4e863f7: ZERO-3654: add null check for resetMasterpassState in PaymentOptionResetMiddleware
136
+
137
+ ## 1.100.0
138
+
139
+ ### Minor Changes
140
+
141
+ - e57cd93: ZERO-3460: prevent installment loop on payment method switch
142
+ - 5f7edd6: ZERO-3571: Enhance Jest configuration by adding base directory resolution and module name mapping
143
+ - b00a90b: ZERO-3436: Preserve query params on redirect
144
+ - 26b2d0b: ZERO-3571: Remove test script execution from prebuild and simplify Jest module name mapping
145
+ - c51de38: ZERO-3637: Add action creators and RTK Query API endpoints to Redux store
146
+ - d1bb93a: ZERO-3460: fix installment request loop"
147
+
148
+ ## 1.99.0
149
+
150
+ ### Minor Changes
151
+
152
+ - cf90355: ZERO-3586_2: Enhance caching functionality by adding support for compressed data storage and retrieval, along with a new method for setting multiple key-value pairs.
153
+ - d58538b: ZERO-3638: Enhance RC pipeline: add fetch, merge, and pre-release setup with conditional commit
154
+ - 95a4cd1: ZERO-3631: add automatic route generation
155
+
156
+ ## 1.98.0
157
+
158
+ ### Minor Changes
159
+
160
+ - 67308f0: ZERO-3633: Revert IndexPage parameter from fetchCheckout request
161
+
162
+ ## 1.97.0
163
+
164
+ ### Minor Changes
165
+
166
+ - 0014305: ZERO-3629 :edit warnings in build
167
+
168
+ ## 1.96.0
169
+
170
+ ### Minor Changes
171
+
172
+ - af5c93a: ZERO-3617: Add pre-order middleware instruction file
173
+ - a420947: ZERO-3517: Fix optional chaining for rawData in error logging for category data handlers
174
+
175
+ ## 1.95.0
176
+
177
+ ### Minor Changes
178
+
179
+ - 35dfb8f: ZERO-3363: Refactor URL handling in checkout and redirection middlewares to use url.origin instead of process.env.NEXT_PUBLIC_URL
180
+ - 99b6e7b: ZERO-3421: Enhance Sentry error handling by adding network error detection logic and refining initialization options
181
+ - cbdb5c1: ZERO-3448: fix set cookie domain handling for subdomain locale strategy
64
182
 
65
- ## 2.0.0-beta.1
183
+ ## 1.94.0
66
184
 
67
185
  ### Minor Changes
68
186
 
69
- - ZERO-3091: Upgrade Next.js to v15 and React to v19
187
+ - 6e6b0a9: ZERO-3422: Add pz-flow-payment package
188
+ - adf0eeb: ZERO-3597: Add copilot instruction files
189
+ - c806fad: ZERO-3422: Add Flow Payment plugin to the defined plugins list
190
+ - 0abde6b: ZERO-3422: Update fetch method to use dynamic request method in wallet complete redirection middleware
191
+ - 72ad7bb: ZERO-3422: Add Flow Payment to the list of available plugins
192
+ - e7cd3a5: ZERO-3435: Add Accept-Language to requestHeaders
193
+ - 17bfadc: ZERO-3275: Disable OpenTelemetry monitoring in production environment
194
+ - dfaceff: ZERO-3356: Add useLoyaltyAvailability hook and update checkout state management
195
+ - 86642cf: ZERO-3531: Add saveSampleProducts endpoint and update URLs in checkout
196
+ - 485e8ef: ZERO-3422: Refactor parameter handling in wallet complete redirection middleware to use forEach
197
+ - b434ac8: ZERO-3545: Update fetchCheckout API URL to include page parameter
198
+ - fee608d: ZERO-3422: Refactor body handling in wallet complete redirection middleware
70
199
 
71
- ## 2.0.0-beta.0
200
+ ## 1.93.0
72
201
 
73
- ### Major Changes
202
+ ### Minor Changes
203
+
204
+ - 185396f: ZERO-3569: Refactor logging in cache handler to use console_log instead of logger
205
+ - 0bdab12: ZERO-3569: Refactor cache handler to improve Redis connection management and logging
206
+ - 3e4aadc: ZERO-3569: Fix import statement for logger in cache handler
207
+
208
+ ## 1.92.0
209
+
210
+ ## 1.91.0
211
+
212
+ ### Minor Changes
213
+
214
+ - d8fad39: ZERO-3370: include plugins test to build stage
215
+ - 2552486: ZERO-3391: Add subdomain support to setLocale function
216
+ - f8e4cac: ZERO-3343: restrict root hostname to only locale subdomains
217
+ - 832bee3: ZERO-3343: add domain to cookie for subdomain locale strategy
218
+ - 28a59d4: ZERO-3400: refactor cookie domain logic using fallback host
219
+ - 8feabe9: ZERO-3343: add custom NextAuth options support
220
+ - bf354de: ZERO-3321: add babel compiler for akinon/next test
221
+ - 448adef: ZERO-3321: move csp test to akinon-next
222
+ - 6c3629c: ZERO-3321: fix jest tests in akinon-next for standalone projects
223
+ - 6bc260b: ZERO-3295: update default tailwind content list
224
+ - 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
225
+ - 068dc39: ZERO-3343: update get-root-hostname logic
226
+ - 942490f: ZERO-3295: move third party tailwind content list to akinon-next
227
+ - b6d5bda: ZERO-3343: update changeset config
228
+ - acf0320: ZERO-3321: remove babel config
229
+ - 387356b: ZERO-3323: Refactor locale filtering logic in URL matcher regex
230
+ - b2ee69b: ZERO-3321: delete unnecessary files
231
+ - 0cabbda: ZERO-3370: replace inline monorepo check with reusable utility
232
+
233
+ ## 1.90.0
234
+
235
+ ### Minor Changes
236
+
237
+ - e68e120: ZERO-3398: Add redirectUrlMiddleware to handle redirection based on checkout results
238
+
239
+ ## 1.89.0
240
+
241
+ ## 1.88.0
242
+
243
+ ### Minor Changes
244
+
245
+ - c4f0568: ZERO-3293: Remove unnecessary pretty URL route check in Cache class method
246
+ - f3dcb1e: ZERO-3337 :Add support for cash register hook in middleware routing
247
+ - 8154859: ZERO-3337 :Add support for cash register pre-order hook in middleware
248
+
249
+ ## 1.87.0
250
+
251
+ ## 1.86.0
252
+
253
+ ### Minor Changes
254
+
255
+ - 6fc8ac5: ZERO-3229: Implement mini basket query for basket total quantity
256
+ - ef75c03: ZERO-3267: Update error-page component to use ROUTES for link navigation
257
+ - e4761d2: Refactor import statement for ROUTES in error-page component
258
+ - e2c6d42: ZERO-2935: Add @sentry/nextjs dependency to akinon-next and remove from projectzeronext
259
+ - 4d3deb4: ZERO-2935: sentry 8 upgrade
260
+ - c3f8d4a: ZERO-3274: Adjust button styles
261
+ - 9abd011: ZERO-3267: Refactor error handling in ErrorPage component to set error details in Sentry scope
262
+ - c3b2f3f: ZERO-3267: Enable sentry client errors and filter them by log type
263
+ - 70bc0ae: ZERO-3284: Set tracesSampleRate in Sentry configuration
264
+ - ac65ca9: ZERO-3269: Enhance locale handling by adding Subdomain strategy and updating related functions
265
+ - 0cb3ec0: ZERO-3281: Remove prebuild tests script from pz-prebuild
266
+ - 2d305aa: ZERO-2935: Update Sentry configuration: remove hideSourceMaps option and add it to withPzConfig
267
+ - 2f3588f: ZERO-3287: Add user session handling in authentication flow
268
+ - e5529cd: ZERO-3267: Update error-page component to use root path for links instead of ROUTES
269
+
270
+ ## 1.85.0
271
+
272
+ ### Minor Changes
273
+
274
+ - 4167dcd: ZERO-3253: Update Content-Security-Policy to include akinoncloud.com
275
+ - 0b1bd07: ZERO-3240: Remove unused preOrderMiddleware
276
+
277
+ ## 1.84.0
278
+
279
+ ### Minor Changes
280
+
281
+ - 757ee53: ZERO-3207: Add SMS send & verify endpoints with state management
282
+ - c0c1962: ZERO-3258: Add new API endpoints for fetching Bukalemun image URL and bundle product data
283
+ - 0e05135: ZERO-3244: Encode URL search parameters
284
+
285
+ ## 1.83.0
286
+
287
+ ## 1.82.0
74
288
 
75
- - be6c09d: ZERO-3114: Create beta version.
289
+ ### Minor Changes
290
+
291
+ - 2e0b7ff: ZERO-3226: Refactor checkoutApi to simplify request body structure by removing device_info parameter
292
+ - 778aabf: ZERO-3163: Add frontend ID header to authentication requests and forgot password mutation
293
+ - c0fef07: ZERO-3197: Refetch payment options after loyalty usage
294
+ - 2d2ab44: ZERO-3226: Add device_info param to WalletPaymentPage request
295
+ - 0200d56: ZERO-3163: Add frontendIds property to Settings interface
296
+ - 7d1b5af: ZERO-3206: Encode search parameters in product data URL
297
+ - aa05ed7: ZERO-3170: Add commerceRedirectionIgnoreList to settings and update URL redirection middleware
298
+
299
+ ## 1.81.0
300
+
301
+ ### Minor Changes
302
+
303
+ - fd4b74e: ZERO-3126: add reset checkout state query
304
+ - 4cc22c7: ZERO-3125: replace X-Frame-Options with CSP frame-ancestors
305
+ - 6a0a080: ZERO-3112: Update button
306
+
307
+ ## 1.80.0
308
+
309
+ ### Minor Changes
310
+
311
+ - 7ab9e2f: ZERO-3166: add tamara payment package
312
+
313
+ ## 1.79.0
314
+
315
+ ### Minor Changes
316
+
317
+ - 59fa21c: ZERO-3149: Add name-based mechanism for Redux middleware override
318
+
319
+ ## 1.78.0
320
+
321
+ ### Minor Changes
322
+
323
+ - e791eab: ZERO-3133: Add fallbackReducer for handling missing plugin reducers
324
+
325
+ ## 1.77.0
326
+
327
+ ### Minor Changes
328
+
329
+ - 999168d: ZERO-3104: Remove local cache handler from CacheHandler initialization
330
+ - 86a5a62: ZERO-3104: Add optional headers parameter to data fetching functions
331
+
332
+ ## 1.76.0
333
+
334
+ ### Minor Changes
335
+
336
+ - dd69cc6: ZERO-3079: Modularize pre-order middleware
76
337
 
77
338
  ## 1.75.0
78
339