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