@akinon/next 1.117.0-rc.1 → 1.117.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,17 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.117.0-rc.3
4
+
5
+ ### Minor Changes
6
+
7
+ - b59fdd1c: ZERO-4009: Add password reset token validation
8
+
9
+ ## 1.117.0-rc.2
10
+
11
+ ### Minor Changes
12
+
13
+ - 591e345e: ZERO-3855: Enhance credit card payment handling in checkout middlewares
14
+
3
15
  ## 1.117.0-rc.1
4
16
 
5
17
  ### Minor Changes
@@ -77,6 +77,10 @@ interface LoyaltyTransactions {
77
77
  }[];
78
78
  }
79
79
 
80
+ interface PasswordResetValidateResponse {
81
+ validlink: boolean;
82
+ }
83
+
80
84
  const accountApi = api.injectEndpoints({
81
85
  endpoints: (builder) => ({
82
86
  updatePassword: builder.mutation<void, AccountChangePasswordFormType>({
@@ -221,6 +225,12 @@ const accountApi = api.injectEndpoints({
221
225
  }),
222
226
  getLoyaltyTransactions: builder.query<LoyaltyTransactions, void>({
223
227
  query: () => buildClientRequestUrl(account.loyaltyTransactions)
228
+ }),
229
+ getValidatePasswordResetToken: builder.query<
230
+ PasswordResetValidateResponse,
231
+ string
232
+ >({
233
+ query: (slug) => buildClientRequestUrl(account.passwordReset(slug))
224
234
  })
225
235
  }),
226
236
  overrideExisting: true
@@ -247,5 +257,6 @@ export const {
247
257
  usePasswordResetMutation,
248
258
  useAnonymizeMutation,
249
259
  useGetLoyaltyBalanceQuery,
250
- useGetLoyaltyTransactionsQuery
260
+ useGetLoyaltyTransactionsQuery,
261
+ useGetValidatePasswordResetTokenQuery
251
262
  } = accountApi;
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.117.0-rc.1",
4
+ "version": "1.117.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.117.0-rc.1",
38
+ "@akinon/eslint-plugin-projectzero": "1.117.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",
@@ -204,15 +204,25 @@ export const contextListMiddleware: Middleware = ({
204
204
  (ctx) => ctx.page_name === 'DeliveryOptionSelectionPage'
205
205
  )
206
206
  ) {
207
+ const isCreditCardPayment =
208
+ preOrder?.payment_option?.payment_type === 'credit_card' ||
209
+ preOrder?.payment_option?.payment_type === 'masterpass';
210
+
207
211
  if (context.page_context.card_type) {
208
212
  dispatch(setCardType(context.page_context.card_type));
213
+ } else if (isCreditCardPayment) {
214
+ dispatch(setCardType(null));
209
215
  }
210
216
 
211
217
  if (
212
218
  context.page_context.installments &&
213
219
  preOrder?.payment_option?.payment_type !== 'masterpass_rest'
214
220
  ) {
215
- dispatch(setInstallmentOptions(context.page_context.installments));
221
+ if (!isCreditCardPayment || context.page_context.card_type) {
222
+ dispatch(
223
+ setInstallmentOptions(context.page_context.installments)
224
+ );
225
+ }
216
226
  }
217
227
  }
218
228
 
@@ -14,9 +14,17 @@ export const installmentOptionMiddleware: Middleware = ({
14
14
  return result;
15
15
  }
16
16
 
17
- const { installmentOptions } = getState().checkout;
17
+ const { installmentOptions, cardType } = getState().checkout;
18
18
  const { endpoints: apiEndpoints } = checkoutApi;
19
19
 
20
+ const isCreditCardPayment =
21
+ preOrder?.payment_option?.payment_type === 'credit_card' ||
22
+ preOrder?.payment_option?.payment_type === 'masterpass';
23
+
24
+ if (isCreditCardPayment && !cardType) {
25
+ return result;
26
+ }
27
+
20
28
  if (
21
29
  !preOrder?.installment &&
22
30
  preOrder?.payment_option?.payment_type !== 'saved_card' &&