@akinon/next 1.119.0-rc.0 → 1.119.0-rc.2

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.2
4
+
5
+ ### Minor Changes
6
+
7
+ - 31b4a266: ZERO-4102: Add support for post-checkout redirect in middleware
8
+ - d2c0e759: ZERO-3684: Handle cross-origin iframe access in iframeURLChange function
9
+ - aef81c5d: ZERO-4034: Refactor checkout API to use dynamic store imports for improved performance
10
+ - b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
11
+ - 8a7fd0f4: ZERO-4065: Add '[segment]' to skipSegments in route generation
12
+ - 36143125: ZERO-3987: Add barcode scanner functionality with modal and button
13
+ - 0754c835: ZERO-4063: Add support for optional Redis password in cache handlers
14
+ - f7e0f646: ZERO-4032: Add bfcache-headers middleware, integrate it into the default chain, and introduce a new environment variable for control.
15
+ - 94a86fcc: ZERO-4065: Expand skipSegments array to include additional segments for route generation
16
+ - 143be2b9: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
17
+ - 9f8cd3bc: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
18
+ - 49c82e1a: ZERO-4047: Remove Sentry configuration from default Next.js config
19
+ - a9f5cdb1: ZERO-4102: Fix post-checkout condition to additionally check for empty search parameters.
20
+ - d99a6a7d: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
21
+ - d7e5178b: ZERO-3985: Add query string handling for orders redirection in middleware
22
+ - 591e345e: ZERO-3855: Enhance credit card payment handling in checkout middlewares
23
+ - 01ee41f1: ZERO-4102: Implement a post-checkout flow by dynamically determining checkout paths and managing a pz-post-checkout-flow cookie.
24
+ - 4de5303c: ZERO-2504: add cookie filter to api client request
25
+ - b59fdd1c: ZERO-4009: Add password reset token validation
26
+ - 95b139dc: ZERO-3795: Remove duplicate entry for SavedCard in PluginComponents map
27
+ - c6c5c1cd: ZERO-4128: Use cookies API for pz-pos-error to ensure delivery on 303 redirects
28
+ - 3909d322: Edit the duplicate Plugin.SimilarProducts in the plugin-module.
29
+
30
+ ## 1.119.0-rc.1
31
+
32
+ ### Minor Changes
33
+
34
+ - c6c5c1cd: ZERO-4128: Use cookies API for pz-pos-error to ensure delivery on 303 redirects
35
+
3
36
  ## 1.119.0-rc.0
4
37
 
5
38
  ### Minor Changes
@@ -110,10 +110,9 @@ const withCompleteGpay =
110
110
  });
111
111
 
112
112
  // Add error cookie
113
- errorResponse.headers.append(
114
- 'Set-Cookie',
115
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
116
- );
113
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
114
+ path: '/'
115
+ });
117
116
 
118
117
  return errorResponse;
119
118
  }
@@ -111,10 +111,9 @@ const withCompleteMasterpass =
111
111
  });
112
112
 
113
113
  // Add error cookie
114
- errorResponse.headers.append(
115
- 'Set-Cookie',
116
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
117
- );
114
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
115
+ path: '/'
116
+ });
118
117
 
119
118
  return errorResponse;
120
119
  }
@@ -107,10 +107,9 @@ const withCompleteWallet =
107
107
  });
108
108
 
109
109
  // Add error cookie
110
- errorResponse.headers.append(
111
- 'Set-Cookie',
112
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
113
- );
110
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
111
+ path: '/'
112
+ });
114
113
 
115
114
  return errorResponse;
116
115
  }
@@ -59,18 +59,20 @@ const withMasterpassRestCallback =
59
59
  ip
60
60
  });
61
61
 
62
- return NextResponse.redirect(
62
+ const errorResponse = NextResponse.redirect(
63
63
  `${url.origin}${getUrlPathWithLocale(
64
64
  '/orders/checkout/',
65
65
  req.cookies.get('pz-locale')?.value
66
66
  )}`,
67
- {
68
- status: 303,
69
- headers: {
70
- 'Set-Cookie': `pz-pos-error=${encodeURIComponent(JSON.stringify(errors))}; path=/;`
71
- }
72
- }
67
+ 303
73
68
  );
69
+
70
+ // Add error cookie
71
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
72
+ path: '/'
73
+ });
74
+
75
+ return errorResponse;
74
76
  }
75
77
 
76
78
  const redirectUrl =
@@ -111,10 +111,9 @@ const withRedirectionPayment =
111
111
  });
112
112
 
113
113
  // Add error cookie
114
- errorResponse.headers.append(
115
- 'Set-Cookie',
116
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
117
- );
114
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
115
+ path: '/'
116
+ });
118
117
 
119
118
  return errorResponse;
120
119
  }
@@ -111,10 +111,9 @@ const withSavedCardRedirection =
111
111
  });
112
112
 
113
113
  // Add error cookie
114
- errorResponse.headers.append(
115
- 'Set-Cookie',
116
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
117
- );
114
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
115
+ path: '/'
116
+ });
118
117
 
119
118
  return errorResponse;
120
119
  }
@@ -110,10 +110,9 @@ const withThreeDRedirection =
110
110
  });
111
111
 
112
112
  // Add error cookie
113
- errorResponse.headers.append(
114
- 'Set-Cookie',
115
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
116
- );
113
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
114
+ path: '/'
115
+ });
117
116
 
118
117
  return errorResponse;
119
118
  }
@@ -131,10 +131,9 @@ const withWalletCompleteRedirection =
131
131
  });
132
132
 
133
133
  // Add error cookie
134
- errorResponse.headers.append(
135
- 'Set-Cookie',
136
- `pz-pos-error=${JSON.stringify(errors)}; path=/;`
137
- );
134
+ errorResponse.cookies.set('pz-pos-error', JSON.stringify(errors), {
135
+ path: '/'
136
+ });
138
137
 
139
138
  return errorResponse;
140
139
  }
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.0",
4
+ "version": "1.119.0-rc.2",
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.0",
38
+ "@akinon/eslint-plugin-projectzero": "1.119.0-rc.2",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
package/utils/index.ts CHANGED
@@ -195,7 +195,9 @@ export const urlLocaleMatcherRegex = new RegExp(
195
195
 
196
196
  export const getPosError = () => {
197
197
  const cookieValue = getCookie('pz-pos-error');
198
- const error = JSON.parse(cookieValue ? decodeURIComponent(cookieValue) : '{}');
198
+ const error = JSON.parse(
199
+ cookieValue ? decodeURIComponent(cookieValue) : '{}'
200
+ );
199
201
 
200
202
  // delete 'pz-pos-error' cookie when refreshing or closing page
201
203
  window.addEventListener('beforeunload', () => {