@akinon/next 1.100.0-rc.72 → 1.101.0-rc.73

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,8 +1,6 @@
1
1
  # @akinon/next
2
2
 
3
- ## 1.100.0-rc.72
4
-
5
- ## 1.100.0-rc.71
3
+ ## 1.101.0-rc.73
6
4
 
7
5
  ### Minor Changes
8
6
 
@@ -15,7 +13,6 @@
15
13
  - 2d9b2b2c9: ZERO-2816: Add segment to headers
16
14
  - 5e1feca6: Revert "ZERO-3286: Add notFound handling for chunk URLs starting with \_next"
17
15
  - 40a46853: ZERO-3182: Optimize basket update mutation with optimistic update
18
- - 5f7edd6c: ZERO-3571: Enhance Jest configuration by adding base directory resolution and module name mapping
19
16
  - 68bbcb27: ZERO-3393: Fix error handling in checkout middleware to check for errors array length
20
17
  - d8be48fb: ZERO-3422: Update fetch method to use dynamic request method in wallet complete redirection middleware
21
18
  - b55acb76: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
@@ -51,9 +48,7 @@
51
48
  - 33377cfd: ZERO-3267: Refactor import statement for ROUTES in error-page component
52
49
  - 43c182ee: ZERO-3054: Update Redis variable checks to conditionally include CACHE_SECRET
53
50
  - c480272c: ZERO-3531: Refactor checkoutApi: Remove unnecessary invalidatesTags property from POST request from sample products
54
- - b00a90b1: ZERO-3436: Preserve query params on redirect
55
51
  - facf1ada: ZERO-3445: Add SameSite and Secure attributes
56
- - 26b2d0b7: ZERO-3571: Remove test script execution from prebuild and simplify Jest module name mapping
57
52
  - 3b255fe: ZERO-3629 :edit warnings in build
58
53
  - eeb20bea: Revert "ZERO-3054: Refactor cache handler to use custom Redis handler and implement key hashing"
59
54
  - 5b50079: ZERO-3634: iyzico saved card
@@ -71,6 +66,17 @@
71
66
  - 3f9b8d7e7: ZERO-2761: Update plugins.js for akinon-next
72
67
  - 0e823010: ZERO-3531: Add saveSampleProducts endpoint
73
68
 
69
+ ## 1.100.0
70
+
71
+ ### Minor Changes
72
+
73
+ - e57cd93: ZERO-3460: prevent installment loop on payment method switch
74
+ - 5f7edd6: ZERO-3571: Enhance Jest configuration by adding base directory resolution and module name mapping
75
+ - b00a90b: ZERO-3436: Preserve query params on redirect
76
+ - 26b2d0b: ZERO-3571: Remove test script execution from prebuild and simplify Jest module name mapping
77
+ - c51de38: ZERO-3637: Add action creators and RTK Query API endpoints to Redux store
78
+ - d1bb93a: ZERO-3460: fix installment request loop"
79
+
74
80
  ## 1.99.0
75
81
 
76
82
  ### 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.100.0-rc.72",
4
+ "version": "1.101.0-rc.73",
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.100.0-rc.72",
38
+ "@akinon/eslint-plugin-projectzero": "1.101.0-rc.73",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
package/plugins.d.ts CHANGED
@@ -13,6 +13,7 @@ declare module '@akinon/pz-masterpass/src/redux/reducer' {
13
13
  export const setError: any;
14
14
  export const setOtpModalVisible: any;
15
15
  export const setCvcRequired: any;
16
+ export const resetMasterpassState: any;
16
17
  }
17
18
 
18
19
  declare module '@akinon/pz-otp' {
@@ -0,0 +1,47 @@
1
+ // Re-export all action creators from slice modules
2
+ export * from './reducers/root';
3
+ export * from './reducers/header';
4
+ export * from './reducers/checkout';
5
+ export * from './reducers/config';
6
+
7
+ // Import RTK Query APIs
8
+ import { basketApi } from '../data/client/basket';
9
+ import { productApi } from '../data/client/product';
10
+ import { miscApi } from '../data/client/misc';
11
+ import { checkoutApi } from '../data/client/checkout';
12
+ import { wishlistApi } from '../data/client/wishlist';
13
+
14
+ // Create RTK Query action creators
15
+ export const rtkApiActionCreators = {
16
+ // RTK Query API endpoints
17
+ ...Object.fromEntries(
18
+ Object.entries(basketApi.endpoints).map(([key, endpoint]) => [
19
+ `api_basket_${key}`,
20
+ endpoint.initiate
21
+ ])
22
+ ),
23
+ ...Object.fromEntries(
24
+ Object.entries(productApi.endpoints).map(([key, endpoint]) => [
25
+ `api_product_${key}`,
26
+ endpoint.initiate
27
+ ])
28
+ ),
29
+ ...Object.fromEntries(
30
+ Object.entries(miscApi.endpoints).map(([key, endpoint]) => [
31
+ `api_misc_${key}`,
32
+ endpoint.initiate
33
+ ])
34
+ ),
35
+ ...Object.fromEntries(
36
+ Object.entries(checkoutApi.endpoints).map(([key, endpoint]) => [
37
+ `api_checkout_${key}`,
38
+ endpoint.initiate
39
+ ])
40
+ ),
41
+ ...Object.fromEntries(
42
+ Object.entries(wishlistApi.endpoints).map(([key, endpoint]) => [
43
+ `api_wishlist_${key}`,
44
+ endpoint.initiate
45
+ ])
46
+ )
47
+ } as any;
@@ -8,15 +8,17 @@ import { dataSourceShippingOptionMiddleware } from './data-source-shipping-optio
8
8
  import { attributeBasedShippingOptionMiddleware } from './attribute-based-shipping-option';
9
9
  import { paymentOptionMiddleware } from './payment-option';
10
10
  import { installmentOptionMiddleware } from './installment-option';
11
+ import { paymentOptionResetMiddleware } from './payment-option-reset';
11
12
  import { shippingStepMiddleware } from './shipping-step';
12
13
 
13
14
  // ⚠️ WARNING: Redux Toolkit applies middlewares in reverse order (from last to first).
14
- // This list is written **in reverse execution order** to ensure they run in the correct sequence.
15
+ // This list is written **in reverse execution order** to ensure they run in the correct sequence.
15
16
  // If you add a new middleware, make sure to insert it **in reverse order** based on execution priority.
16
17
 
17
18
  export const preOrderMiddlewares = [
18
19
  shippingStepMiddleware,
19
20
  installmentOptionMiddleware,
21
+ paymentOptionResetMiddleware,
20
22
  paymentOptionMiddleware,
21
23
  attributeBasedShippingOptionMiddleware,
22
24
  dataSourceShippingOptionMiddleware,
@@ -0,0 +1,34 @@
1
+ import { Middleware } from '@reduxjs/toolkit';
2
+ import { CheckoutResult, MiddlewareParams } from '../../../types';
3
+ import {
4
+ setBankAccounts,
5
+ setCardType,
6
+ setInstallmentOptions,
7
+ setSelectedBankAccountPk
8
+ } from '../../reducers/checkout';
9
+ import { resetMasterpassState } from '@akinon/pz-masterpass/src/redux/reducer';
10
+
11
+ export const paymentOptionResetMiddleware: Middleware = ({
12
+ dispatch
13
+ }: MiddlewareParams) => {
14
+ return (next) => (action) => {
15
+ const result: CheckoutResult = next(action);
16
+
17
+ if (
18
+ action.type === 'api/executeMutation/fulfilled' &&
19
+ action.meta?.arg?.endpointName === 'setPaymentOption'
20
+ ) {
21
+ dispatch(setInstallmentOptions([]));
22
+ dispatch(setBankAccounts([]));
23
+ dispatch(setSelectedBankAccountPk(null));
24
+ dispatch(setCardType(null));
25
+ dispatch(resetMasterpassState());
26
+ }
27
+
28
+ return result;
29
+ };
30
+ };
31
+
32
+ Object.defineProperty(paymentOptionResetMiddleware, 'name', {
33
+ value: 'paymentOptionResetMiddleware'
34
+ });
@@ -10,6 +10,7 @@ export enum MiddlewareNames {
10
10
  DataSourceShippingOptionMiddleware = 'dataSourceShippingOptionMiddleware',
11
11
  AttributeBasedShippingOptionMiddleware = 'attributeBasedShippingOptionMiddleware',
12
12
  PaymentOptionMiddleware = 'paymentOptionMiddleware',
13
+ PaymentOptionResetMiddleware = 'paymentOptionResetMiddleware',
13
14
  InstallmentOptionMiddleware = 'installmentOptionMiddleware',
14
15
  ShippingStepMiddleware = 'shippingStepMiddleware'
15
16
  }