@akinon/next 1.87.0 → 1.88.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.88.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c4f0568: ZERO-3293: Remove unnecessary pretty URL route check in Cache class method
8
+ - f3dcb1e: ZERO-3337 :Add support for cash register hook in middleware routing
9
+ - 8154859: ZERO-3337 :Add support for cash register pre-order hook in middleware
10
+
3
11
  ## 1.87.0
4
12
 
5
13
  ## 1.86.0
package/lib/cache.ts CHANGED
@@ -156,10 +156,6 @@ export class Cache {
156
156
  handler: () => Promise<T>,
157
157
  options?: CacheOptions
158
158
  ): Promise<T> {
159
- if (Settings.usePrettyUrlRoute) {
160
- return await handler();
161
- }
162
-
163
159
  const requiredVariables = [
164
160
  process.env.CACHE_HOST,
165
161
  process.env.CACHE_PORT,
@@ -178,6 +174,10 @@ export class Cache {
178
174
  const _options = Object.assign(defaultOptions, options);
179
175
  const formattedKey = Cache.formatKey(key, locale);
180
176
 
177
+ if (Settings.usePrettyUrlRoute) {
178
+ _options.expire = 120;
179
+ }
180
+
181
181
  logger.debug('Cache wrap', { key, formattedKey, _options });
182
182
 
183
183
  if (_options.cache) {
@@ -95,7 +95,9 @@ const withPzDefault =
95
95
 
96
96
  if (
97
97
  req.nextUrl.pathname.includes('/orders/hooks/') ||
98
- req.nextUrl.pathname.includes('/orders/checkout-with-token/')
98
+ req.nextUrl.pathname.includes('/orders/checkout-with-token/') ||
99
+ req.nextUrl.pathname.includes('/hooks/cash_register/complete/') ||
100
+ req.nextUrl.pathname.includes('/hooks/cash_register/pre_order/')
99
101
  ) {
100
102
  const queryString = searchParams.toString();
101
103
  const currency = searchParams.get('currency')?.toLowerCase();
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.87.0",
4
+ "version": "1.88.0",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "set-cookie-parser": "2.6.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@akinon/eslint-plugin-projectzero": "1.87.0",
34
+ "@akinon/eslint-plugin-projectzero": "1.88.0",
35
35
  "@types/react-redux": "7.1.30",
36
36
  "@types/set-cookie-parser": "2.4.7",
37
37
  "@typescript-eslint/eslint-plugin": "6.7.4",