@akinon/next 2.0.0-beta.9 → 2.0.1

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 (121) hide show
  1. package/CHANGELOG.md +436 -23
  2. package/__tests__/next-config.test.ts +83 -0
  3. package/__tests__/tsconfig.json +23 -0
  4. package/api/auth.ts +367 -63
  5. package/api/barcode-search.ts +59 -0
  6. package/api/cache.ts +41 -5
  7. package/api/client.ts +21 -4
  8. package/api/form.ts +85 -0
  9. package/api/image-proxy.ts +75 -0
  10. package/api/product-categories.ts +53 -0
  11. package/api/similar-product-list.ts +63 -0
  12. package/api/similar-products.ts +111 -0
  13. package/api/virtual-try-on.ts +382 -0
  14. package/assets/styles/index.scss +84 -0
  15. package/babel.config.js +6 -0
  16. package/bin/pz-generate-routes.js +115 -0
  17. package/bin/pz-install-plugins.js +1 -1
  18. package/bin/pz-prebuild.js +1 -0
  19. package/bin/pz-predev.js +1 -0
  20. package/bin/pz-run-tests.js +99 -0
  21. package/components/accordion.tsx +21 -6
  22. package/components/client-root.tsx +119 -3
  23. package/components/file-input.tsx +65 -3
  24. package/components/index.ts +1 -0
  25. package/components/input.tsx +2 -2
  26. package/components/link.tsx +46 -16
  27. package/components/logger-popup.tsx +213 -0
  28. package/components/modal.tsx +32 -16
  29. package/components/plugin-module.tsx +62 -3
  30. package/components/price.tsx +2 -2
  31. package/components/select.tsx +3 -3
  32. package/components/selected-payment-option-view.tsx +21 -0
  33. package/data/client/account.ts +17 -2
  34. package/data/client/basket.ts +39 -0
  35. package/data/client/checkout.ts +336 -99
  36. package/data/client/misc.ts +13 -1
  37. package/data/server/category.ts +11 -9
  38. package/data/server/flatpage.ts +4 -1
  39. package/data/server/form.ts +4 -1
  40. package/data/server/landingpage.ts +4 -1
  41. package/data/server/list.ts +5 -4
  42. package/data/server/menu.ts +4 -1
  43. package/data/server/product.ts +97 -52
  44. package/data/server/seo.ts +4 -1
  45. package/data/server/special-page.ts +5 -4
  46. package/data/server/widget.ts +71 -1
  47. package/data/urls.ts +6 -3
  48. package/hocs/client/with-segment-defaults.tsx +2 -2
  49. package/hocs/server/with-segment-defaults.tsx +81 -20
  50. package/hooks/index.ts +3 -0
  51. package/hooks/use-localization.ts +24 -10
  52. package/hooks/use-logger-context.tsx +114 -0
  53. package/hooks/use-logger.ts +92 -0
  54. package/hooks/use-loyalty-availability.ts +21 -0
  55. package/hooks/use-payment-options.ts +2 -1
  56. package/hooks/use-pz-params.ts +37 -0
  57. package/hooks/use-router.ts +53 -19
  58. package/instrumentation/index.ts +0 -1
  59. package/instrumentation/node.ts +2 -20
  60. package/jest.config.js +25 -0
  61. package/lib/cache-handler.mjs +534 -16
  62. package/lib/cache.ts +269 -34
  63. package/localization/provider.tsx +2 -5
  64. package/middlewares/bfcache-headers.ts +18 -0
  65. package/middlewares/checkout-provider.ts +1 -1
  66. package/middlewares/complete-gpay.ts +32 -26
  67. package/middlewares/complete-masterpass.ts +33 -26
  68. package/middlewares/complete-wallet.ts +182 -0
  69. package/middlewares/default.ts +357 -203
  70. package/middlewares/index.ts +10 -2
  71. package/middlewares/locale.ts +5 -3
  72. package/middlewares/masterpass-rest-callback.ts +230 -0
  73. package/middlewares/oauth-login.ts +200 -57
  74. package/middlewares/pretty-url.ts +21 -8
  75. package/middlewares/redirection-payment.ts +32 -26
  76. package/middlewares/saved-card-redirection.ts +33 -26
  77. package/middlewares/three-d-redirection.ts +32 -26
  78. package/middlewares/url-redirection.ts +9 -15
  79. package/middlewares/wallet-complete-redirection.ts +206 -0
  80. package/package.json +24 -10
  81. package/plugins.d.ts +19 -4
  82. package/plugins.js +9 -1
  83. package/redux/actions.ts +47 -0
  84. package/redux/middlewares/checkout.ts +61 -8
  85. package/redux/middlewares/index.ts +14 -10
  86. package/redux/middlewares/pre-order/address.ts +1 -1
  87. package/redux/middlewares/pre-order/attribute-based-shipping-option.ts +1 -1
  88. package/redux/middlewares/pre-order/data-source-shipping-option.ts +1 -1
  89. package/redux/middlewares/pre-order/delivery-option.ts +1 -1
  90. package/redux/middlewares/pre-order/index.ts +3 -1
  91. package/redux/middlewares/pre-order/installment-option.ts +2 -1
  92. package/redux/middlewares/pre-order/payment-option-reset.ts +37 -0
  93. package/redux/middlewares/pre-order/payment-option.ts +1 -1
  94. package/redux/middlewares/pre-order/pre-order-validation.ts +4 -3
  95. package/redux/middlewares/pre-order/redirection.ts +2 -2
  96. package/redux/middlewares/pre-order/set-pre-order.ts +2 -2
  97. package/redux/middlewares/pre-order/shipping-option.ts +1 -1
  98. package/redux/middlewares/pre-order/shipping-step.ts +1 -1
  99. package/redux/reducers/checkout.ts +15 -1
  100. package/redux/reducers/index.ts +7 -1
  101. package/redux/reducers/widget.ts +80 -0
  102. package/sentry/index.ts +54 -17
  103. package/tailwind/content.js +16 -0
  104. package/types/commerce/checkout.ts +26 -1
  105. package/types/commerce/widget.ts +33 -0
  106. package/types/index.ts +114 -5
  107. package/types/next-auth.d.ts +2 -2
  108. package/types/widget.ts +80 -0
  109. package/utils/app-fetch.ts +7 -2
  110. package/utils/generate-commerce-search-params.ts +3 -2
  111. package/utils/get-checkout-path.ts +3 -0
  112. package/utils/get-root-hostname.ts +28 -0
  113. package/utils/index.ts +69 -18
  114. package/utils/mobile-3d-iframe.ts +8 -2
  115. package/utils/override-middleware.ts +1 -0
  116. package/utils/pz-segments.ts +92 -0
  117. package/utils/redirect-ignore.ts +35 -0
  118. package/utils/redirect.ts +9 -3
  119. package/utils/redirection-iframe.ts +8 -2
  120. package/utils/widget-styles.ts +107 -0
  121. package/with-pz-config.js +20 -7
package/CHANGELOG.md CHANGED
@@ -1,60 +1,473 @@
1
1
  # @akinon/next
2
2
 
3
- ## 2.0.0-beta.9
3
+ ## 2.0.1
4
+
5
+ ## 2.0.0
4
6
 
5
7
  ### Minor Changes
6
8
 
7
- - 0fe7711: ZERO-3387: Upgrade nextjs, eslint-config-next
9
+ - cf3a9901: ZERO-3585: Fix cookie handling for widget builder in ClientRoot component
10
+ - 9076e50e: ZERO-3136: Refactor DynamicWidgetContainer and WidgetContent for improved styling and component tagging
11
+ - d0e1ef78: ZERO-3232: Integrate widget styles generation directly in WidgetPlaceholder
12
+ - 1d10dde2: ZERO-3553: Add alignment style for image components
13
+ - 74c6a237: ZERO-3060: Drag and drop functionality on the site implemented
14
+
15
+ ### Patch Changes
16
+
17
+ - 05c19ad0: ZERO-4365: Remove brand `@theme/*` alias imports from library packages
18
+ - 09ccd457: ZERO-4371: Restore `URLSearchParams` type for `PageProps.searchParams` (v1 brand backward compat)
19
+
20
+ In v1 (`@akinon/next` 1.x) `PageProps.searchParams` was typed as `URLSearchParams`. Beta v2 widened this to a `Record<string, string | string[]> | URLSearchParams` union, which broke v1 brand pages calling `new URLSearchParams(searchParams)` (TS rejects the `Record<string, string[]>` arm of the union).
21
+
22
+ This restores the v1 contract — `PageProps.searchParams: URLSearchParams` — and adds a defensive runtime normalizer in the server `withSegmentDefaults` HOC so Next 16's raw `Record<string, string | string[]>` is converted to a real `URLSearchParams` instance before brand components see it. v1 brands can keep using `.get()`/`.has()`/etc safely without code changes.
23
+
24
+ A new `RawSearchParams` type is exported for code at the middleware/HOC boundary that needs to handle the unnormalized Next 16 shape directly.
25
+
26
+ - 5d44ff77: ZERO-4312: Extract ThemePlaceholder system into new @akinon/pz-theme package and strip native widget code
27
+
28
+ Introduce a dedicated `@akinon/pz-theme` package that contains the ThemePlaceholder system (CMS-driven sections/blocks, designer features, utilities). Remove native widget registration infrastructure from both `@akinon/pz-theme` and `projectzeronext` so the beta branch can be merged to main with only stable ThemePlaceholder functionality. Native widget integrations will be reintroduced via `@akinon/pz-theme` once they stabilize on the `theme-editor` branch.
29
+
30
+ Consumers should update imports:
31
+
32
+ - `@akinon/next/components/theme-editor/*` -> `@akinon/pz-theme/src/*`
33
+ - Add `@akinon/pz-theme` to package.json dependencies (matching `@akinon/next` version)
34
+
35
+ ## 2.0.0-beta.27
36
+
37
+ ## 2.0.0-beta.26
38
+
39
+ ### Patch Changes
40
+
41
+ - 09ccd457: ZERO-4371: Restore `URLSearchParams` type for `PageProps.searchParams` (v1 brand backward compat)
42
+
43
+ In v1 (`@akinon/next` 1.x) `PageProps.searchParams` was typed as `URLSearchParams`. Beta v2 widened this to a `Record<string, string | string[]> | URLSearchParams` union, which broke v1 brand pages calling `new URLSearchParams(searchParams)` (TS rejects the `Record<string, string[]>` arm of the union).
44
+
45
+ This restores the v1 contract — `PageProps.searchParams: URLSearchParams` — and adds a defensive runtime normalizer in the server `withSegmentDefaults` HOC so Next 16's raw `Record<string, string | string[]>` is converted to a real `URLSearchParams` instance before brand components see it. v1 brands can keep using `.get()`/`.has()`/etc safely without code changes.
46
+
47
+ A new `RawSearchParams` type is exported for code at the middleware/HOC boundary that needs to handle the unnormalized Next 16 shape directly.
48
+
49
+ ## 2.0.0-beta.25
50
+
51
+ ### Patch Changes
52
+
53
+ - 05c19ad0: ZERO-4365: Remove brand `@theme/*` alias imports from library packages
54
+
55
+ ## 2.0.0-beta.24
56
+
57
+ ## 2.0.0-beta.23
8
58
 
9
- ## 2.0.0-beta.8
59
+ ## 2.0.0-beta.22
60
+
61
+ ## 2.0.0-beta.21
62
+
63
+ ### Patch Changes
64
+
65
+ - 5d44ff77: ZERO-4312: Extract ThemePlaceholder system into new @akinon/pz-theme package and strip native widget code
66
+
67
+ Introduce a dedicated `@akinon/pz-theme` package that contains the ThemePlaceholder system (CMS-driven sections/blocks, designer features, utilities). Remove native widget registration infrastructure from both `@akinon/pz-theme` and `projectzeronext` so the beta branch can be merged to main with only stable ThemePlaceholder functionality. Native widget integrations will be reintroduced via `@akinon/pz-theme` once they stabilize on the `theme-editor` branch.
68
+
69
+ Consumers should update imports:
70
+
71
+ - `@akinon/next/components/theme-editor/*` -> `@akinon/pz-theme/src/*`
72
+ - Add `@akinon/pz-theme` to package.json dependencies (matching `@akinon/next` version)
73
+
74
+ ## 2.0.0-beta.20
10
75
 
11
76
  ### Minor Changes
12
77
 
13
- - 071d0f5: ZERO-3352: Resolve Single item size exceeds maxSize error and upgrade dependencies
78
+ - cf3a9901: ZERO-3585: Fix cookie handling for widget builder in ClientRoot component
79
+ - 9076e50e: ZERO-3136: Refactor DynamicWidgetContainer and WidgetContent for improved styling and component tagging
80
+ - d0e1ef78: ZERO-3232: Integrate widget styles generation directly in WidgetPlaceholder
81
+ - 1d10dde2: ZERO-3553: Add alignment style for image components
82
+ - 74c6a237: ZERO-3060: Drag and drop functionality on the site implemented
83
+
84
+ ## 1.126.0
85
+
86
+ ## 1.125.2
87
+
88
+ ## 1.125.1
89
+
90
+ ### Patch Changes
14
91
 
15
- ## 2.0.0-beta.7
92
+ - 06da9a95: ZERO-4241: Upgrade Next.js from 14.2.25 to 14.2.35 to fix security vulnerabilities (CVE-2025-55184, CVE-2025-67779)
16
93
 
17
- ## 2.0.0-beta.6
94
+ ## 1.125.0
18
95
 
19
96
  ### Minor Changes
20
97
 
21
- - 8f05f9b: ZERO-3250: Beta branch synchronized with Main branch
98
+ - cd68a97a: ZERO-4126: Enhance error handling in appFetch and related data handlers to throw notFound on 404 and 422 errors
22
99
 
23
- ## 2.0.0-beta.5
100
+ ## 1.124.0
24
101
 
25
102
  ### Minor Changes
26
103
 
27
- - e791eab: ZERO-3133: Add fallbackReducer for handling missing plugin reducers
104
+ - 929374c5: ZERO-3278: refactor variable names for better readability and consistency
105
+ - 71f8011d: ZERO-3271: remove code repetition in logger functions using closures
106
+ - 9be2c081: ZERO-3243: Improve basket update query handling with optimistic updates
107
+ - bd431e36: ZERO-3278: improve checkout validation error messages for better user guidance
108
+ - 54eac86b: ZERO-3271: add development logger system
109
+
110
+ ## 1.123.0
111
+
112
+ ### Minor Changes
28
113
 
29
- ## 2.0.0-beta.4
114
+ - 8218dafa: ZERO-4160: Refactor oauth-login middleware to use fetch for login and callback responses
115
+ - 2a8ddcf6: ZERO-4111: Add total balance field to store credit localization and update related components
116
+ - 8a7fd0f4: ZERO-4065: Add '[segment]' to skipSegments in route generation
117
+ - 36143125: ZERO-3987: Add barcode scanner functionality with modal and button
118
+ - f7e0f646: ZERO-4032: Add bfcache-headers middleware, integrate it into the default chain, and introduce a new environment variable for control.
119
+ - 94a86fcc: ZERO-4065: Expand skipSegments array to include additional segments for route generation
120
+ - bcaad120: ZERO-4158: Add logging for OAuth login and callback redirects
30
121
 
31
- ## 2.0.0-beta.3
122
+ ## 1.122.0
32
123
 
33
124
  ### Minor Changes
34
125
 
35
- - 5536b80: ZERO-3104: Add optional headers parameter
126
+ - 823d82f9: ZERO-3393: Enhance error handling in checkout middleware to ensure errors are checked for existence before processing
127
+ - d2c0e759: ZERO-3684: Handle cross-origin iframe access in iframeURLChange function
128
+ - 68bbcb27: ZERO-3393: Fix error handling in checkout middleware to check for errors array length
129
+ - 9b7d0de6: ZERO-3393: Improve error handling in checkout middleware to support both object and array error formats
130
+ - 5ec0faf8: ZERO-3355: Refactor Redis client creation to include optional password in configuration
36
131
 
37
- ## 2.0.0-beta.2
132
+ ## 1.121.0
38
133
 
39
134
  ### Minor Changes
40
135
 
41
- - a006015: ZERO-3116: Add not-found page and update default middleware.
42
- - 999168d: ZERO-3104: Remove local cache handler from CacheHandler initialization
43
- - 1eeb3d8: ZERO-3116: Add not found page
44
- - 86a5a62: ZERO-3104: Add optional headers parameter to data fetching functions
45
- - dd69cc6: ZERO-3079: Modularize pre-order middleware
136
+ - 49c82e1a: ZERO-4047: Remove Sentry configuration from default Next.js config
137
+ - d7e5178b: ZERO-3985: Add query string handling for orders redirection in middleware
138
+ - b59fdd1c: ZERO-4009: Add password reset token validation
139
+
140
+ ## 1.120.0
141
+
142
+ ### Minor Changes
143
+
144
+ - b12527ec: ZERO-4102: Add support for post-checkout redirect in middleware
145
+ - aef81c5d: ZERO-4034: Refactor checkout API to use dynamic store imports for improved performance
146
+ - 0754c835: ZERO-4063: Add support for optional Redis password in cache handlers
147
+ - a9f5cdb1: ZERO-4102: Fix post-checkout condition to additionally check for empty search parameters.
148
+ - 01ee41f1: ZERO-4102: Implement a post-checkout flow by dynamically determining checkout paths and managing a pz-post-checkout-flow cookie.
149
+ - c6c5c1cd: ZERO-4128: Use cookies API for pz-pos-error to ensure delivery on 303 redirects
150
+
151
+ ## 1.119.0
152
+
153
+ ## 1.118.0
154
+
155
+ ### Minor Changes
156
+
157
+ - 729fe756: ZERO-3895: improve non-3D payment handling and error display
158
+
159
+ ## 1.117.0
160
+
161
+ ## 1.116.0
162
+
163
+ ### Minor Changes
164
+
165
+ - d7ec6b08: ZERO-3988: Add Google Pay option to plugin selection
166
+ - 726491df: ZERO-3988: Add google pay integration
167
+
168
+ ## 1.115.0
169
+
170
+ ### Minor Changes
171
+
172
+ - b59bed4d: ZERO-3878: Reintegrated similar products and removed localStorage checks and implemented props based showing of buttons
173
+ - b5f9d75c: ZERO-3873: Refactor payment redirection middlewares to properly forward all set-cookie headers from upstream responses
174
+ - cbcfdf4d: ZERO-3859: Haso payment gateway implmeneted
175
+ - 71882722: ZERO-3897: Add compress option to default Next.js configuration
176
+ - 7056203a: ZERO-3875: removed shared_tags through stripTags function for unused keys
177
+
178
+ ## 1.114.0
179
+
180
+ ### Minor Changes
181
+
182
+ - 65d3b862: ZERO-3054: Update headers in appFetch
183
+ - 43c182ee: ZERO-3054: Update Redis variable checks to conditionally include CACHE_SECRET
184
+ - eeb20bea: Revert "ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing"
185
+ - fdd255ee: ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing
186
+
187
+ ## 1.113.0
188
+
189
+ ## 1.112.0
190
+
191
+ ### Minor Changes
192
+
193
+ - 888fdec: ZERO-3792: Virtual Try On new features are implemented and also basket support implemented.
194
+
195
+ ## 1.111.0
196
+
197
+ ### Minor Changes
198
+
199
+ - c026300: ZERO-3833: fix masterpass rest conflicts
200
+ - b47b9d8: ZERO-3414: create masterpass-rest package
201
+
202
+ ## 1.110.0
203
+
204
+ ### Minor Changes
205
+
206
+ - fc752c9: ZERO-3795: Remove unnecessary redirection logic from payment middleware
207
+ - 757af4a: ZERO-3783: Update image remote patterns for security compliance
208
+
209
+ ## 1.109.0
210
+
211
+ ### Minor Changes
212
+
213
+ - fcbbea79: ZERO-3648: Add virtual try-on feature with localization support
214
+
215
+ ## 1.108.0
216
+
217
+ ### Minor Changes
218
+
219
+ - d8883ce6: ZERO-3640: Refactor wallet completion handling to accept additional parameters; update related API calls
220
+ - 59ed7a7e: ZERO-3640: Add order number state and update FlowPayment component for wallet payment response handling
221
+ - 31a2d35a: ZERO-3640: Refactor checkout API call to include useFormData option; update FlowPayment component for improved error handling and code readability
222
+
223
+ ## 1.107.0
224
+
225
+ ### Minor Changes
226
+
227
+ - 4ca44c78: ZERO-3634: add register_consumer_card
228
+ - 28c7ea79: ZERO-3427: Refactor redirect utility to handle undefined URL and improve locale handling
229
+ - b6e5b624: ZERO-3257: Enhance locale middleware to redirect using existing or default locale and support 303 status for POST requests
230
+ - 5b500797: ZERO-3634: iyzico saved card
231
+
232
+ ## 1.106.0
233
+
234
+ ### Minor Changes
235
+
236
+ - 9dc7298: ZERO-3416: Refactor Accordion component to enhance props and improve styling flexibility
237
+ - 2d3f178: ZERO-3417: Enhance FileInput component with additional props for customization
238
+
239
+ ## 1.105.0
240
+
241
+ ### Minor Changes
46
242
 
47
- ## 2.0.0-beta.1
243
+ - c39c700: ZERO-3420: Refactor Modal component
244
+ - d512ea2: ZERO-3656: update setLoyaltyData mutation to accept string type
245
+ - 3b255fe: ZERO-3629 :edit warnings in build
246
+
247
+ ## 1.104.0
248
+
249
+ ### Minor Changes
250
+
251
+ - 63774a6: ZERO-3351: Add commerce redirection ignore list functionality and related utility
252
+ - a2fbee6: ZERO-3651: Fix correct is Iframe property in contextListMiddleware
253
+ - 0de5573: ZERO-3418: Update remotePatterns hostname to allow all subdomains
254
+ - 5ad87ff: ZERO-3646: Refactor form submission API to handle form data and improve error responses
255
+
256
+ ## 1.103.0
257
+
258
+ ## 1.102.0
259
+
260
+ ### Minor Changes
261
+
262
+ - 6b949cb: ZERO-3615: Refactor product data handling and improve 404 error handling
263
+ - 9a3885b: ZERO-3660: skip catch-all not_found route in generate route script
264
+
265
+ ## 1.101.0
266
+
267
+ ### Minor Changes
268
+
269
+ - 4e863f7: ZERO-3654: add null check for resetMasterpassState in PaymentOptionResetMiddleware
270
+
271
+ ## 1.100.0
272
+
273
+ ### Minor Changes
274
+
275
+ - e57cd93: ZERO-3460: prevent installment loop on payment method switch
276
+ - 5f7edd6: ZERO-3571: Enhance Jest configuration by adding base directory resolution and module name mapping
277
+ - b00a90b: ZERO-3436: Preserve query params on redirect
278
+ - 26b2d0b: ZERO-3571: Remove test script execution from prebuild and simplify Jest module name mapping
279
+ - c51de38: ZERO-3637: Add action creators and RTK Query API endpoints to Redux store
280
+ - d1bb93a: ZERO-3460: fix installment request loop"
281
+
282
+ ## 1.99.0
283
+
284
+ ### Minor Changes
285
+
286
+ - 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.
287
+ - d58538b: ZERO-3638: Enhance RC pipeline: add fetch, merge, and pre-release setup with conditional commit
288
+ - 95a4cd1: ZERO-3631: add automatic route generation
289
+
290
+ ## 1.98.0
291
+
292
+ ### Minor Changes
293
+
294
+ - 67308f0: ZERO-3633: Revert IndexPage parameter from fetchCheckout request
295
+
296
+ ## 1.97.0
297
+
298
+ ### Minor Changes
299
+
300
+ - 0014305: ZERO-3629 :edit warnings in build
301
+
302
+ ## 1.96.0
303
+
304
+ ### Minor Changes
305
+
306
+ - af5c93a: ZERO-3617: Add pre-order middleware instruction file
307
+ - a420947: ZERO-3517: Fix optional chaining for rawData in error logging for category data handlers
308
+
309
+ ## 1.95.0
310
+
311
+ ### Minor Changes
312
+
313
+ - 35dfb8f: ZERO-3363: Refactor URL handling in checkout and redirection middlewares to use url.origin instead of process.env.NEXT_PUBLIC_URL
314
+ - 99b6e7b: ZERO-3421: Enhance Sentry error handling by adding network error detection logic and refining initialization options
315
+ - cbdb5c1: ZERO-3448: fix set cookie domain handling for subdomain locale strategy
316
+
317
+ ## 1.94.0
48
318
 
49
319
  ### Minor Changes
50
320
 
51
- - ZERO-3091: Upgrade Next.js to v15 and React to v19
321
+ - 6e6b0a9: ZERO-3422: Add pz-flow-payment package
322
+ - adf0eeb: ZERO-3597: Add copilot instruction files
323
+ - c806fad: ZERO-3422: Add Flow Payment plugin to the defined plugins list
324
+ - 0abde6b: ZERO-3422: Update fetch method to use dynamic request method in wallet complete redirection middleware
325
+ - 72ad7bb: ZERO-3422: Add Flow Payment to the list of available plugins
326
+ - e7cd3a5: ZERO-3435: Add Accept-Language to requestHeaders
327
+ - 17bfadc: ZERO-3275: Disable OpenTelemetry monitoring in production environment
328
+ - dfaceff: ZERO-3356: Add useLoyaltyAvailability hook and update checkout state management
329
+ - 86642cf: ZERO-3531: Add saveSampleProducts endpoint and update URLs in checkout
330
+ - 485e8ef: ZERO-3422: Refactor parameter handling in wallet complete redirection middleware to use forEach
331
+ - b434ac8: ZERO-3545: Update fetchCheckout API URL to include page parameter
332
+ - fee608d: ZERO-3422: Refactor body handling in wallet complete redirection middleware
333
+
334
+ ## 1.93.0
335
+
336
+ ### Minor Changes
337
+
338
+ - 185396f: ZERO-3569: Refactor logging in cache handler to use console_log instead of logger
339
+ - 0bdab12: ZERO-3569: Refactor cache handler to improve Redis connection management and logging
340
+ - 3e4aadc: ZERO-3569: Fix import statement for logger in cache handler
341
+
342
+ ## 1.92.0
343
+
344
+ ## 1.91.0
345
+
346
+ ### Minor Changes
347
+
348
+ - d8fad39: ZERO-3370: include plugins test to build stage
349
+ - 2552486: ZERO-3391: Add subdomain support to setLocale function
350
+ - f8e4cac: ZERO-3343: restrict root hostname to only locale subdomains
351
+ - 832bee3: ZERO-3343: add domain to cookie for subdomain locale strategy
352
+ - 28a59d4: ZERO-3400: refactor cookie domain logic using fallback host
353
+ - 8feabe9: ZERO-3343: add custom NextAuth options support
354
+ - bf354de: ZERO-3321: add babel compiler for akinon/next test
355
+ - 448adef: ZERO-3321: move csp test to akinon-next
356
+ - 6c3629c: ZERO-3321: fix jest tests in akinon-next for standalone projects
357
+ - 6bc260b: ZERO-3295: update default tailwind content list
358
+ - 943a239: ZERO-3370: add allowJs in akinon-next test tsconfig
359
+ - 068dc39: ZERO-3343: update get-root-hostname logic
360
+ - 942490f: ZERO-3295: move third party tailwind content list to akinon-next
361
+ - b6d5bda: ZERO-3343: update changeset config
362
+ - acf0320: ZERO-3321: remove babel config
363
+ - 387356b: ZERO-3323: Refactor locale filtering logic in URL matcher regex
364
+ - b2ee69b: ZERO-3321: delete unnecessary files
365
+ - 0cabbda: ZERO-3370: replace inline monorepo check with reusable utility
366
+
367
+ ## 1.90.0
368
+
369
+ ### Minor Changes
52
370
 
53
- ## 2.0.0-beta.0
371
+ - e68e120: ZERO-3398: Add redirectUrlMiddleware to handle redirection based on checkout results
54
372
 
55
- ### Major Changes
373
+ ## 1.89.0
56
374
 
57
- - be6c09d: ZERO-3114: Create beta version.
375
+ ## 1.88.0
376
+
377
+ ### Minor Changes
378
+
379
+ - c4f0568: ZERO-3293: Remove unnecessary pretty URL route check in Cache class method
380
+ - f3dcb1e: ZERO-3337 :Add support for cash register hook in middleware routing
381
+ - 8154859: ZERO-3337 :Add support for cash register pre-order hook in middleware
382
+
383
+ ## 1.87.0
384
+
385
+ ## 1.86.0
386
+
387
+ ### Minor Changes
388
+
389
+ - 6fc8ac5: ZERO-3229: Implement mini basket query for basket total quantity
390
+ - ef75c03: ZERO-3267: Update error-page component to use ROUTES for link navigation
391
+ - e4761d2: Refactor import statement for ROUTES in error-page component
392
+ - e2c6d42: ZERO-2935: Add @sentry/nextjs dependency to akinon-next and remove from projectzeronext
393
+ - 4d3deb4: ZERO-2935: sentry 8 upgrade
394
+ - c3f8d4a: ZERO-3274: Adjust button styles
395
+ - 9abd011: ZERO-3267: Refactor error handling in ErrorPage component to set error details in Sentry scope
396
+ - c3b2f3f: ZERO-3267: Enable sentry client errors and filter them by log type
397
+ - 70bc0ae: ZERO-3284: Set tracesSampleRate in Sentry configuration
398
+ - ac65ca9: ZERO-3269: Enhance locale handling by adding Subdomain strategy and updating related functions
399
+ - 0cb3ec0: ZERO-3281: Remove prebuild tests script from pz-prebuild
400
+ - 2d305aa: ZERO-2935: Update Sentry configuration: remove hideSourceMaps option and add it to withPzConfig
401
+ - 2f3588f: ZERO-3287: Add user session handling in authentication flow
402
+ - e5529cd: ZERO-3267: Update error-page component to use root path for links instead of ROUTES
403
+
404
+ ## 1.85.0
405
+
406
+ ### Minor Changes
407
+
408
+ - 4167dcd: ZERO-3253: Update Content-Security-Policy to include akinoncloud.com
409
+ - 0b1bd07: ZERO-3240: Remove unused preOrderMiddleware
410
+
411
+ ## 1.84.0
412
+
413
+ ### Minor Changes
414
+
415
+ - 757ee53: ZERO-3207: Add SMS send & verify endpoints with state management
416
+ - c0c1962: ZERO-3258: Add new API endpoints for fetching Bukalemun image URL and bundle product data
417
+ - 0e05135: ZERO-3244: Encode URL search parameters
418
+
419
+ ## 1.83.0
420
+
421
+ ## 1.82.0
422
+
423
+ ### Minor Changes
424
+
425
+ - 2e0b7ff: ZERO-3226: Refactor checkoutApi to simplify request body structure by removing device_info parameter
426
+ - 778aabf: ZERO-3163: Add frontend ID header to authentication requests and forgot password mutation
427
+ - c0fef07: ZERO-3197: Refetch payment options after loyalty usage
428
+ - 2d2ab44: ZERO-3226: Add device_info param to WalletPaymentPage request
429
+ - 0200d56: ZERO-3163: Add frontendIds property to Settings interface
430
+ - 7d1b5af: ZERO-3206: Encode search parameters in product data URL
431
+ - aa05ed7: ZERO-3170: Add commerceRedirectionIgnoreList to settings and update URL redirection middleware
432
+
433
+ ## 1.81.0
434
+
435
+ ### Minor Changes
436
+
437
+ - fd4b74e: ZERO-3126: add reset checkout state query
438
+ - 4cc22c7: ZERO-3125: replace X-Frame-Options with CSP frame-ancestors
439
+ - 6a0a080: ZERO-3112: Update button
440
+
441
+ ## 1.80.0
442
+
443
+ ### Minor Changes
444
+
445
+ - 7ab9e2f: ZERO-3166: add tamara payment package
446
+
447
+ ## 1.79.0
448
+
449
+ ### Minor Changes
450
+
451
+ - 59fa21c: ZERO-3149: Add name-based mechanism for Redux middleware override
452
+
453
+ ## 1.78.0
454
+
455
+ ### Minor Changes
456
+
457
+ - e791eab: ZERO-3133: Add fallbackReducer for handling missing plugin reducers
458
+
459
+ ## 1.77.0
460
+
461
+ ### Minor Changes
462
+
463
+ - 999168d: ZERO-3104: Remove local cache handler from CacheHandler initialization
464
+ - 86a5a62: ZERO-3104: Add optional headers parameter to data fetching functions
465
+
466
+ ## 1.76.0
467
+
468
+ ### Minor Changes
469
+
470
+ - dd69cc6: ZERO-3079: Modularize pre-order middleware
58
471
 
59
472
  ## 1.75.0
60
473
 
@@ -0,0 +1,83 @@
1
+ import { resolve } from 'path';
2
+ import type { NextConfig } from 'next';
3
+
4
+ function findBaseDir() {
5
+ const insideNodeModules = __dirname.includes('node_modules');
6
+
7
+ if (insideNodeModules) {
8
+ return resolve(__dirname, '../../../../');
9
+ } else {
10
+ return resolve(__dirname, '../../../apps/projectzeronext');
11
+ }
12
+ }
13
+
14
+ const baseDir = findBaseDir();
15
+
16
+ jest.mock('next-pwa', () => {
17
+ return () => (config: NextConfig) => config;
18
+ });
19
+
20
+ jest.mock('@sentry/nextjs', () => ({
21
+ withSentryConfig: (config: NextConfig) => config
22
+ }));
23
+
24
+ jest.mock('../with-pz-config.js', () => {
25
+ return (config: NextConfig) => {
26
+ const originalHeaders = config.headers;
27
+
28
+ config.headers = async () => {
29
+ const originalHeadersResult = (await originalHeaders?.()) ?? [];
30
+
31
+ return [
32
+ {
33
+ source: '/(.*)',
34
+ headers: [
35
+ {
36
+ key: 'Content-Security-Policy',
37
+ value: 'https://*.akifast.com akifast.com'
38
+ }
39
+ ]
40
+ },
41
+ ...originalHeadersResult
42
+ ];
43
+ };
44
+ return config;
45
+ };
46
+ });
47
+
48
+ interface Header {
49
+ key: string;
50
+ value: string;
51
+ }
52
+
53
+ interface HeaderGroup {
54
+ source: string;
55
+ headers: Header[];
56
+ }
57
+
58
+ const nextConfigPath = resolve(baseDir, 'next.config.mjs');
59
+ let nextConfig: any;
60
+
61
+ beforeAll(async () => {
62
+ nextConfig = await import(nextConfigPath);
63
+ });
64
+
65
+ describe('Next.js Configuration', () => {
66
+ it('should contain Content-Security-Policy header with akifast domain values', async () => {
67
+ const headers = nextConfig.default.headers;
68
+ expect(headers).toBeDefined();
69
+
70
+ const headersResult = await headers();
71
+
72
+ const cspHeaders = headersResult
73
+ .flatMap((headerGroup: HeaderGroup) => headerGroup.headers)
74
+ .filter((header: Header) => header.key === 'Content-Security-Policy');
75
+
76
+ expect(cspHeaders.length).toBeGreaterThan(0);
77
+
78
+ const lastCspHeader = cspHeaders[cspHeaders.length - 1];
79
+
80
+ expect(lastCspHeader.value).toContain('akifast.com');
81
+ expect(lastCspHeader.value).toContain('https://*.akifast.com');
82
+ });
83
+ });
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Default",
4
+ "compilerOptions": {
5
+ "composite": false,
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "inlineSources": false,
11
+ "isolatedModules": true,
12
+ "moduleResolution": "node",
13
+ "noUnusedLocals": false,
14
+ "noUnusedParameters": false,
15
+ "preserveWatchOutput": true,
16
+ "skipLibCheck": true,
17
+ "strict": true,
18
+ "jsx": "react-jsx",
19
+ "allowJs": true
20
+ },
21
+ "exclude": ["node_modules"],
22
+ "include": [".", "../."]
23
+ }