@akinon/projectzero 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,9 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 1.117.0-rc.3
4
+
5
+ ## 1.117.0-rc.2
6
+
3
7
  ## 1.117.0-rc.1
4
8
 
5
9
  ## 1.117.0-rc.0
@@ -1,5 +1,74 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 1.117.0-rc.3
4
+
5
+ ### Minor Changes
6
+
7
+ - b59fdd1c: ZERO-4009: Add password reset token validation
8
+ - d76d3255: ZERO-4011: Refactor sitemap content generation to append locale suffix based on matched locale
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [b59fdd1c]
13
+ - @akinon/next@1.117.0-rc.3
14
+ - @akinon/pz-virtual-try-on@1.117.0-rc.3
15
+ - @akinon/pz-akifast@1.117.0-rc.3
16
+ - @akinon/pz-apple-pay@1.117.0-rc.3
17
+ - @akinon/pz-b2b@1.117.0-rc.3
18
+ - @akinon/pz-basket-gift-pack@1.117.0-rc.3
19
+ - @akinon/pz-bkm@1.117.0-rc.3
20
+ - @akinon/pz-checkout-gift-pack@1.117.0-rc.3
21
+ - @akinon/pz-click-collect@1.117.0-rc.3
22
+ - @akinon/pz-credit-payment@1.117.0-rc.3
23
+ - @akinon/pz-cybersource-uc@1.117.0-rc.3
24
+ - @akinon/pz-flow-payment@1.117.0-rc.3
25
+ - @akinon/pz-google-pay@1.117.0-rc.3
26
+ - @akinon/pz-gpay@1.117.0-rc.3
27
+ - @akinon/pz-haso@1.117.0-rc.3
28
+ - @akinon/pz-hepsipay@1.117.0-rc.3
29
+ - @akinon/pz-masterpass@1.117.0-rc.3
30
+ - @akinon/pz-masterpass-rest@1.117.0-rc.3
31
+ - @akinon/pz-multi-basket@1.117.0-rc.3
32
+ - @akinon/pz-one-click-checkout@1.117.0-rc.3
33
+ - @akinon/pz-otp@1.117.0-rc.3
34
+ - @akinon/pz-pay-on-delivery@1.117.0-rc.3
35
+ - @akinon/pz-saved-card@1.117.0-rc.3
36
+ - @akinon/pz-similar-products@1.117.0-rc.3
37
+ - @akinon/pz-tabby-extension@1.117.0-rc.3
38
+ - @akinon/pz-tamara-extension@1.117.0-rc.3
39
+
40
+ ## 1.117.0-rc.2
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [591e345e]
45
+ - @akinon/next@1.117.0-rc.2
46
+ - @akinon/pz-virtual-try-on@1.117.0-rc.2
47
+ - @akinon/pz-akifast@1.117.0-rc.2
48
+ - @akinon/pz-apple-pay@1.117.0-rc.2
49
+ - @akinon/pz-b2b@1.117.0-rc.2
50
+ - @akinon/pz-basket-gift-pack@1.117.0-rc.2
51
+ - @akinon/pz-bkm@1.117.0-rc.2
52
+ - @akinon/pz-checkout-gift-pack@1.117.0-rc.2
53
+ - @akinon/pz-click-collect@1.117.0-rc.2
54
+ - @akinon/pz-credit-payment@1.117.0-rc.2
55
+ - @akinon/pz-cybersource-uc@1.117.0-rc.2
56
+ - @akinon/pz-flow-payment@1.117.0-rc.2
57
+ - @akinon/pz-google-pay@1.117.0-rc.2
58
+ - @akinon/pz-gpay@1.117.0-rc.2
59
+ - @akinon/pz-haso@1.117.0-rc.2
60
+ - @akinon/pz-hepsipay@1.117.0-rc.2
61
+ - @akinon/pz-masterpass@1.117.0-rc.2
62
+ - @akinon/pz-masterpass-rest@1.117.0-rc.2
63
+ - @akinon/pz-multi-basket@1.117.0-rc.2
64
+ - @akinon/pz-one-click-checkout@1.117.0-rc.2
65
+ - @akinon/pz-otp@1.117.0-rc.2
66
+ - @akinon/pz-pay-on-delivery@1.117.0-rc.2
67
+ - @akinon/pz-saved-card@1.117.0-rc.2
68
+ - @akinon/pz-similar-products@1.117.0-rc.2
69
+ - @akinon/pz-tabby-extension@1.117.0-rc.2
70
+ - @akinon/pz-tamara-extension@1.117.0-rc.2
71
+
3
72
  ## 1.117.0-rc.1
4
73
 
5
74
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "1.117.0-rc.1",
3
+ "version": "1.117.0-rc.3",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -24,32 +24,32 @@
24
24
  "test:middleware": "jest middleware-matcher.test.ts --bail"
25
25
  },
26
26
  "dependencies": {
27
- "@akinon/next": "1.117.0-rc.1",
28
- "@akinon/pz-akifast": "1.117.0-rc.1",
29
- "@akinon/pz-apple-pay": "1.117.0-rc.1",
30
- "@akinon/pz-b2b": "1.117.0-rc.1",
31
- "@akinon/pz-basket-gift-pack": "1.117.0-rc.1",
32
- "@akinon/pz-bkm": "1.117.0-rc.1",
33
- "@akinon/pz-checkout-gift-pack": "1.117.0-rc.1",
34
- "@akinon/pz-click-collect": "1.117.0-rc.1",
35
- "@akinon/pz-credit-payment": "1.117.0-rc.1",
36
- "@akinon/pz-cybersource-uc": "1.117.0-rc.1",
37
- "@akinon/pz-flow-payment": "1.117.0-rc.1",
38
- "@akinon/pz-google-pay": "1.117.0-rc.1",
39
- "@akinon/pz-gpay": "1.117.0-rc.1",
40
- "@akinon/pz-haso": "1.117.0-rc.1",
41
- "@akinon/pz-hepsipay": "1.117.0-rc.1",
42
- "@akinon/pz-masterpass": "1.117.0-rc.1",
43
- "@akinon/pz-masterpass-rest": "1.117.0-rc.1",
44
- "@akinon/pz-multi-basket": "1.117.0-rc.1",
45
- "@akinon/pz-one-click-checkout": "1.117.0-rc.1",
46
- "@akinon/pz-otp": "1.117.0-rc.1",
47
- "@akinon/pz-pay-on-delivery": "1.117.0-rc.1",
48
- "@akinon/pz-saved-card": "1.117.0-rc.1",
49
- "@akinon/pz-similar-products": "1.117.0-rc.1",
50
- "@akinon/pz-tabby-extension": "1.117.0-rc.1",
51
- "@akinon/pz-tamara-extension": "1.117.0-rc.1",
52
- "@akinon/pz-virtual-try-on": "1.117.0-rc.1",
27
+ "@akinon/next": "1.117.0-rc.3",
28
+ "@akinon/pz-akifast": "1.117.0-rc.3",
29
+ "@akinon/pz-apple-pay": "1.117.0-rc.3",
30
+ "@akinon/pz-b2b": "1.117.0-rc.3",
31
+ "@akinon/pz-basket-gift-pack": "1.117.0-rc.3",
32
+ "@akinon/pz-bkm": "1.117.0-rc.3",
33
+ "@akinon/pz-checkout-gift-pack": "1.117.0-rc.3",
34
+ "@akinon/pz-click-collect": "1.117.0-rc.3",
35
+ "@akinon/pz-credit-payment": "1.117.0-rc.3",
36
+ "@akinon/pz-cybersource-uc": "1.117.0-rc.3",
37
+ "@akinon/pz-flow-payment": "1.117.0-rc.3",
38
+ "@akinon/pz-google-pay": "1.117.0-rc.3",
39
+ "@akinon/pz-gpay": "1.117.0-rc.3",
40
+ "@akinon/pz-haso": "1.117.0-rc.3",
41
+ "@akinon/pz-hepsipay": "1.117.0-rc.3",
42
+ "@akinon/pz-masterpass": "1.117.0-rc.3",
43
+ "@akinon/pz-masterpass-rest": "1.117.0-rc.3",
44
+ "@akinon/pz-multi-basket": "1.117.0-rc.3",
45
+ "@akinon/pz-one-click-checkout": "1.117.0-rc.3",
46
+ "@akinon/pz-otp": "1.117.0-rc.3",
47
+ "@akinon/pz-pay-on-delivery": "1.117.0-rc.3",
48
+ "@akinon/pz-saved-card": "1.117.0-rc.3",
49
+ "@akinon/pz-similar-products": "1.117.0-rc.3",
50
+ "@akinon/pz-tabby-extension": "1.117.0-rc.3",
51
+ "@akinon/pz-tamara-extension": "1.117.0-rc.3",
52
+ "@akinon/pz-virtual-try-on": "1.117.0-rc.3",
53
53
  "@hookform/resolvers": "2.9.0",
54
54
  "@next/third-parties": "14.1.0",
55
55
  "@react-google-maps/api": "2.17.1",
@@ -72,7 +72,7 @@
72
72
  "yup": "0.32.11"
73
73
  },
74
74
  "devDependencies": {
75
- "@akinon/eslint-plugin-projectzero": "1.117.0-rc.1",
75
+ "@akinon/eslint-plugin-projectzero": "1.117.0-rc.3",
76
76
  "@semantic-release/changelog": "6.0.2",
77
77
  "@semantic-release/exec": "6.0.3",
78
78
  "@semantic-release/git": "10.0.1",
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
 
3
- import { Button, Input, Link } from '@theme/components';
3
+ import { Button, Input, Link, LoaderSpinner } from '@theme/components';
4
4
  import { useForm, SubmitHandler } from 'react-hook-form';
5
5
  import { yupResolver } from '@hookform/resolvers/yup';
6
6
  import * as yup from 'yup';
7
7
  import {
8
8
  usePasswordResetMutation,
9
+ useGetValidatePasswordResetTokenQuery,
9
10
  PasswordResetType
10
11
  } from '@akinon/next/data/client/account';
11
12
  import { useLocalization } from '@akinon/next/hooks';
@@ -15,6 +16,16 @@ export default function NewPassword({ params: { id } }) {
15
16
  const { t } = useLocalization();
16
17
  const [newPassword, { isSuccess: formSuccess }] = usePasswordResetMutation();
17
18
 
19
+ const token = id?.join('/');
20
+
21
+ const {
22
+ data: validationData,
23
+ isLoading: isValidating,
24
+ error: validationError
25
+ } = useGetValidatePasswordResetTokenQuery(token, {
26
+ skip: !token
27
+ });
28
+
18
29
  const newPasswordFormSchema = (t) =>
19
30
  yup.object().shape({
20
31
  password: yup
@@ -24,7 +35,10 @@ export default function NewPassword({ params: { id } }) {
24
35
  /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{6,}$/,
25
36
  t('forgot_password.create_new_password.form.error.password_rule')
26
37
  )
27
- .max(50, t('forgot_password.create_new_password.form.error.password_max')),
38
+ .max(
39
+ 50,
40
+ t('forgot_password.create_new_password.form.error.password_max')
41
+ ),
28
42
  repeatPassword: yup
29
43
  .string()
30
44
  .required(t('forgot_password.create_new_password.form.error.required'))
@@ -45,6 +59,31 @@ export default function NewPassword({ params: { id } }) {
45
59
  newPassword(data);
46
60
  };
47
61
 
62
+ if (isValidating) {
63
+ return (
64
+ <div className="container my-12 flex flex-col items-center px-4">
65
+ <div className="w-full xl:w-5/12 text-center">
66
+ <LoaderSpinner />
67
+ </div>
68
+ </div>
69
+ );
70
+ }
71
+
72
+ if (validationError || !validationData?.validlink) {
73
+ return (
74
+ <div className="container my-12 flex flex-col items-center px-4">
75
+ <div className="w-full xl:w-5/12 text-center">
76
+ <div className="text-2xl mb-4 text-error">
77
+ {t('account.password_reset.expired_link_message')}
78
+ </div>
79
+ <Link href="/users/password/reset" className="underline text-primary">
80
+ {t('account.password_reset.continue_password_reset')}
81
+ </Link>
82
+ </div>
83
+ </div>
84
+ );
85
+ }
86
+
48
87
  return (
49
88
  <div className="container my-12 flex flex-col items-center px-4">
50
89
  <div className="w-full xl:w-5/12 text-center">
@@ -79,7 +118,10 @@ export default function NewPassword({ params: { id } }) {
79
118
  required
80
119
  />
81
120
 
82
- <PasswordRulesFeedback password={passwordValue} isVisible={errors?.password ? true : false}/>
121
+ <PasswordRulesFeedback
122
+ password={passwordValue}
123
+ isVisible={errors?.password ? true : false}
124
+ />
83
125
  </div>
84
126
 
85
127
  <div className="mb-2 text-left">
@@ -58,10 +58,12 @@ export async function GET(request: Request, context: { params }) {
58
58
 
59
59
  let sitemapContent = await sitemap.text();
60
60
 
61
- sitemapContent = sitemapContent.replace(
62
- /\.com/g,
63
- `.com${matchedLocale?.[0] ?? ''}`
64
- );
61
+ if (matchedLocale?.[0]) {
62
+ const localeSuffix = matchedLocale[0];
63
+ const domainRegex = /(?<=<loc>\s*)https?:\/\/[^/<\s]+/g;
64
+
65
+ sitemapContent = sitemapContent.replace(domainRegex, `$&${localeSuffix}`);
66
+ }
65
67
 
66
68
  return new Response(sitemapContent, {
67
69
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "1.117.0-rc.1",
3
+ "version": "1.117.0-rc.3",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {