@akinon/next 1.119.0-rc.1 → 1.119.0-rc.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.119.0-rc.3
4
+
5
+ ### Minor Changes
6
+
7
+ - cd68a97a: ZERO-4126: Enhance error handling in appFetch and related data handlers to throw notFound on 404 and 422 errors
8
+
9
+ ## 1.119.0-rc.2
10
+
11
+ ### Minor Changes
12
+
13
+ - 31b4a266: ZERO-4102: Add support for post-checkout redirect in middleware
14
+ - d2c0e759: ZERO-3684: Handle cross-origin iframe access in iframeURLChange function
15
+ - aef81c5d: ZERO-4034: Refactor checkout API to use dynamic store imports for improved performance
16
+ - b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
17
+ - 8a7fd0f4: ZERO-4065: Add '[segment]' to skipSegments in route generation
18
+ - 36143125: ZERO-3987: Add barcode scanner functionality with modal and button
19
+ - 0754c835: ZERO-4063: Add support for optional Redis password in cache handlers
20
+ - f7e0f646: ZERO-4032: Add bfcache-headers middleware, integrate it into the default chain, and introduce a new environment variable for control.
21
+ - 94a86fcc: ZERO-4065: Expand skipSegments array to include additional segments for route generation
22
+ - 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
23
+ - 9f8cd3bc: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
24
+ - 49c82e1a: ZERO-4047: Remove Sentry configuration from default Next.js config
25
+ - a9f5cdb1: ZERO-4102: Fix post-checkout condition to additionally check for empty search parameters.
26
+ - d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
27
+ - d7e5178b: ZERO-3985: Add query string handling for orders redirection in middleware
28
+ - 591e345e: ZERO-3855: Enhance credit card payment handling in checkout middlewares
29
+ - 01ee41f1: ZERO-4102: Implement a post-checkout flow by dynamically determining checkout paths and managing a pz-post-checkout-flow cookie.
30
+ - 4de5303c: ZERO-2504: add cookie filter to api client request
31
+ - b59fdd1c: ZERO-4009: Add password reset token validation
32
+ - 95b139dc: ZERO-3795: Remove duplicate entry for SavedCard in PluginComponents map
33
+ - c6c5c1cd: ZERO-4128: Use cookies API for pz-pos-error to ensure delivery on 303 redirects
34
+ - 3909d322: Edit the duplicate Plugin.SimilarProducts in the plugin-module.
35
+
3
36
  ## 1.119.0-rc.1
4
37
 
5
38
  ### Minor Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.119.0-rc.1",
4
+ "version": "1.119.0-rc.3",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "set-cookie-parser": "2.6.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@akinon/eslint-plugin-projectzero": "1.119.0-rc.1",
38
+ "@akinon/eslint-plugin-projectzero": "1.119.0-rc.3",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
@@ -2,6 +2,7 @@ import Settings from 'settings';
2
2
  import logger from '../utils/log';
3
3
  import { headers, cookies } from 'next/headers';
4
4
  import { ServerVariables } from './server-variables';
5
+ import { notFound } from 'next/navigation';
5
6
 
6
7
  export enum FetchResponseType {
7
8
  JSON = 'json',
@@ -60,13 +61,15 @@ const appFetch = async <T>({
60
61
  status = req.status;
61
62
  logger.debug(`FETCH END ${url}`, { status: req.status, ip });
62
63
 
63
- if (responseType === FetchResponseType.JSON) {
64
- response = (await req.json()) as T;
65
- } else {
66
- response = (await req.text()) as unknown as T;
67
- }
64
+ if (req.ok) {
65
+ if (responseType === FetchResponseType.JSON) {
66
+ response = (await req.json()) as T;
67
+ } else {
68
+ response = (await req.text()) as unknown as T;
69
+ }
68
70
 
69
- logger.trace(`FETCH RESPONSE`, { url, response, ip });
71
+ logger.trace(`FETCH RESPONSE`, { url, response, ip });
72
+ }
70
73
  } catch (error) {
71
74
  const logType = status === 500 ? 'fatal' : 'error';
72
75
 
@@ -75,6 +78,10 @@ const appFetch = async <T>({
75
78
  }
76
79
  }
77
80
 
81
+ if (status === 422) {
82
+ notFound();
83
+ }
84
+
78
85
  return response;
79
86
  };
80
87