@eka-care/abha-stg 0.0.40 → 0.1.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/.eslintignore +3 -0
- package/.eslintrc +29 -0
- package/.prettierrc +7 -0
- package/.turbo/daemon/da13e0828a6aedf8-turbo.log.2025-10-30 +0 -0
- package/{dist/index.html → index.html} +1 -2
- package/package/styles/pds2/border.ts +69 -0
- package/package/styles/pds2/colors.ts +70 -0
- package/package/styles/pds2/spacing.ts +1007 -0
- package/package/tailwind/tailwind.config.ts +124 -0
- package/package.json +9 -8
- package/postcss.config.js +6 -0
- package/scripts/build-purged-css.cjs +70 -0
- package/src/App.css +0 -0
- package/src/App.tsx +43 -0
- package/src/api-queries/aorta-go/v3/get-profile-patient.ts +32 -0
- package/src/api-queries/aorta-go/v3/get-profiles-phr-user.ts +26 -0
- package/src/api-queries/aorta-go/v3/post-auth-init-v2.ts +34 -0
- package/src/api-queries/aorta-go/v3/post-auth-logout-v2.ts +32 -0
- package/src/api-queries/aorta-go/v3/post-auth-verify-v2.ts +38 -0
- package/src/api-queries/aorta-go/v3/post-profile-switch.ts +39 -0
- package/src/api-queries/ndhm/get-abdm-register-suggest.ts +37 -0
- package/src/api-queries/ndhm/get-pincode-details.ts +28 -0
- package/src/api-queries/ndhm/post-abdm-login-init.ts +37 -0
- package/src/api-queries/ndhm/post-abdm-login-phr.ts +37 -0
- package/src/api-queries/ndhm/post-abdm-login-verify.ts +37 -0
- package/src/api-queries/ndhm/post-abdm-profile-eka-link-phr.ts +40 -0
- package/src/api-queries/ndhm/post-abdm-profile-eka.ts +66 -0
- package/src/api-queries/ndhm/post-abdm-register-abha-number-create-phr.ts +37 -0
- package/src/api-queries/ndhm/post-abdm-register-mobile-create-phr.ts +66 -0
- package/src/api-queries/ndhm/post-abdm-register-mobile-resend-otp.ts +32 -0
- package/src/api-queries/ndhm/post-abdm-register-mobile-verify.ts +38 -0
- package/src/api-queries/ndhm/post-abdm-register-phr-check.ts +34 -0
- package/src/api-queries/ndhm/post-register-aadhaar-create-phr.ts +37 -0
- package/src/api-queries/ndhm/post-register-aadhaar-init.ts +34 -0
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-resend-otp.ts +34 -0
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-verify.ts +37 -0
- package/src/api-queries/ndhm/post-register-aadhaar-resend-otp.ts +34 -0
- package/src/api-queries/ndhm/post-register-aadhaar-verify.ts +40 -0
- package/src/api-queries/ndhm/post-register-mobile-init.ts +34 -0
- package/src/api-queries/use-get-profiles-patient.ts +12 -0
- package/src/api-queries/use-get-profiles-phr-user.ts +28 -0
- package/src/api-queries/use-post-abdm-login-verify-v1.ts +26 -0
- package/src/api-queries/use-post-auth-verify-v2.ts +50 -0
- package/src/api-queries/use-post-profile-switch.ts +58 -0
- package/src/api-queries/use-post-register-mobile-create-phr.ts +39 -0
- package/src/api-queries/user-post-abdm-profile-login-phr.ts +26 -0
- package/src/assets/Success.json +1 -0
- package/src/assets/react.svg +1 -0
- package/src/atoms/button/custom-button.tsx +32 -0
- package/src/atoms/button/index.tsx +40 -0
- package/src/atoms/button/types.d.ts +31 -0
- package/src/atoms/header.tsx +25 -0
- package/src/atoms/input-field/index.tsx +63 -0
- package/src/atoms/input-field/patient-input-field.tsx +16 -0
- package/src/atoms/input-field/types.ts +24 -0
- package/src/atoms/pds2-otp-input/index.tsx +35 -0
- package/src/atoms/pds2-otp-input/types.d.ts +3 -0
- package/src/atoms/single-input-chip/index.tsx +32 -0
- package/src/atoms/single-input-chip/types.ts +6 -0
- package/src/atoms/spinner.tsx +33 -0
- package/src/atoms/text-separator.tsx +11 -0
- package/src/atoms/ui/spinner.tsx +75 -0
- package/src/constants/constants.ts +376 -0
- package/src/fetch-client/index.ts +164 -0
- package/src/index.css +152 -0
- package/src/main.tsx +374 -0
- package/src/molecules/abha/bottom-sheet/bottom-sheet-wrapper.tsx +40 -0
- package/src/molecules/abha/bottom-sheet/index.tsx +66 -0
- package/src/molecules/abha/spaced-input-component.tsx +168 -0
- package/src/molecules/copyright-year.tsx +16 -0
- package/src/molecules/exit-popup/index.tsx +101 -0
- package/src/molecules/pds2-otp-component/index.tsx +147 -0
- package/src/organisms/abha/abha-header.tsx +25 -0
- package/src/organisms/abha/abha-stepper.tsx +83 -0
- package/src/organisms/abha/error-bottom-sheet.tsx +27 -0
- package/src/organisms/abha/otp-card.tsx +99 -0
- package/src/organisms/abha/verification-status.tsx +30 -0
- package/src/organisms/choose-language/choose-language.tsx +53 -0
- package/src/organisms/choose-language/types.ts +10 -0
- package/src/organisms/screen-switcher/screen-switcher.tsx +80 -0
- package/src/routes/abha-aadhaar-verification-status-screen.tsx +246 -0
- package/src/routes/abha-created-screen.tsx +45 -0
- package/src/routes/abha-login-otp-verify-screen.tsx +519 -0
- package/src/routes/abha-mobile-linking-status-screen.tsx +267 -0
- package/src/routes/abha-otp-and-mobile-screen.tsx +435 -0
- package/src/routes/abha-phone-number-verification-screen.tsx +388 -0
- package/src/routes/create-abha-address-screen.tsx +928 -0
- package/src/routes/create-abha-with-aadhaar-screen.tsx +986 -0
- package/src/routes/create-eka-profile-screen.tsx +831 -0
- package/src/routes/get-all-profiles-screen.tsx +161 -0
- package/src/routes/login-or-create-abha-address-screen.tsx +1056 -0
- package/src/routes/login-with-abha-screen.tsx +454 -0
- package/src/routes/select-abha-from-list-screen.tsx +792 -0
- package/src/routes/select-eka-profile-screen.tsx +446 -0
- package/src/routes/utils/trackAbhaEvent.ts +41 -0
- package/src/stores/auth-abha-store/index.ts +152 -0
- package/src/stores/auth-abha-store/types.ts +217 -0
- package/src/utils/mock-auth-response.ts +29 -0
- package/src/utils/send-event-utils.ts +76 -0
- package/src/utils/validations.ts +89 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.ts +9 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +10 -0
- package/tsconfig.node.tsbuildinfo +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite.config.d.ts +2 -0
- package/vite.config.js +45 -0
- package/vite.config.ts +50 -0
- package/dist/sdk/abha/css/abha.css +0 -1
- package/dist/sdk/abha/js/abha.js +0 -146
- /package/{dist → public}/images/adhaar.webp +0 -0
- /package/{dist → public}/images/at-the-rate.webp +0 -0
- /package/{dist → public}/images/avatar.webp +0 -0
- /package/{dist → public}/images/ayushman-bharat.webp +0 -0
- /package/{dist → public}/images/circle-checkmark.webp +0 -0
- /package/{dist → public}/images/link-abha.webp +0 -0
- /package/{dist → public}/images/national-authority.webp +0 -0
- /package/{dist → public}/images/three-dots.webp +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostAbdmProfileEkaLinkPhrResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmProfileEkaLinkPhr({
|
|
5
|
+
abha_address,
|
|
6
|
+
oid,
|
|
7
|
+
// token,
|
|
8
|
+
}: {
|
|
9
|
+
abha_address: string;
|
|
10
|
+
oid: string;
|
|
11
|
+
// token?: string;
|
|
12
|
+
}): Promise<TPostAbdmProfileEkaLinkPhrResponse> {
|
|
13
|
+
const myHeaders = new Headers();
|
|
14
|
+
myHeaders.append("Content-Type", "application/json");
|
|
15
|
+
// if (token) myHeaders.append("auth", token);
|
|
16
|
+
const raw = JSON.stringify({
|
|
17
|
+
abha_address,
|
|
18
|
+
oid,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const requestOptions: RequestInit = {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: myHeaders,
|
|
24
|
+
body: raw,
|
|
25
|
+
redirect: "follow",
|
|
26
|
+
credentials: "include",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
31
|
+
const response = await fetch(
|
|
32
|
+
`${NDHM_HOST}/abdm/v1/profile/eka/link-phr`,
|
|
33
|
+
requestOptions
|
|
34
|
+
);
|
|
35
|
+
return await response.json();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error("postAbdmProfileLinkPhr ==>", error);
|
|
38
|
+
}
|
|
39
|
+
return {} as TPostAbdmProfileEkaLinkPhrResponse;
|
|
40
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostAbdmRegisterCreatePhrResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmProfileEka({
|
|
5
|
+
abha_address,
|
|
6
|
+
address,
|
|
7
|
+
first_name,
|
|
8
|
+
last_name,
|
|
9
|
+
day_of_birth,
|
|
10
|
+
month_of_birth,
|
|
11
|
+
year_of_birth,
|
|
12
|
+
gender,
|
|
13
|
+
middle_name,
|
|
14
|
+
pincode,
|
|
15
|
+
// token,
|
|
16
|
+
}: {
|
|
17
|
+
abha_address: string;
|
|
18
|
+
address?: string;
|
|
19
|
+
day_of_birth: number;
|
|
20
|
+
first_name: string;
|
|
21
|
+
gender: string;
|
|
22
|
+
last_name: string;
|
|
23
|
+
month_of_birth: number;
|
|
24
|
+
pincode: string;
|
|
25
|
+
year_of_birth: number;
|
|
26
|
+
middle_name?: string;
|
|
27
|
+
// token?: string;
|
|
28
|
+
}): Promise<TPostAbdmRegisterCreatePhrResponse> {
|
|
29
|
+
const myHeaders = new Headers();
|
|
30
|
+
myHeaders.append("Content-Type", "application/json");
|
|
31
|
+
// if (token) myHeaders.append("auth", token);
|
|
32
|
+
const raw = JSON.stringify({
|
|
33
|
+
abha_address,
|
|
34
|
+
profile: {
|
|
35
|
+
address,
|
|
36
|
+
day_of_birth,
|
|
37
|
+
first_name,
|
|
38
|
+
gender,
|
|
39
|
+
last_name,
|
|
40
|
+
middle_name,
|
|
41
|
+
month_of_birth,
|
|
42
|
+
pincode,
|
|
43
|
+
year_of_birth,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const requestOptions: RequestInit = {
|
|
48
|
+
method: "POST",
|
|
49
|
+
headers: myHeaders,
|
|
50
|
+
body: raw,
|
|
51
|
+
redirect: "follow",
|
|
52
|
+
credentials: "include",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
57
|
+
const response = await fetch(
|
|
58
|
+
`${NDHM_HOST}/abdm/v1/profile/eka`,
|
|
59
|
+
requestOptions
|
|
60
|
+
);
|
|
61
|
+
return await response.json();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error("postAbdmProfileEka error =>", error);
|
|
64
|
+
}
|
|
65
|
+
return {} as TPostAbdmRegisterCreatePhrResponse;
|
|
66
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostAbdmRegisterCreatePhrResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmRegisterAbhaNumberCreatePhr({
|
|
5
|
+
abha_address,
|
|
6
|
+
txn_id,
|
|
7
|
+
}: {
|
|
8
|
+
abha_address: string;
|
|
9
|
+
txn_id: string;
|
|
10
|
+
}): Promise<TPostAbdmRegisterCreatePhrResponse> {
|
|
11
|
+
const myHeaders = new Headers();
|
|
12
|
+
myHeaders.append("Content-Type", "application/json");
|
|
13
|
+
const raw = JSON.stringify({
|
|
14
|
+
abha_address,
|
|
15
|
+
txn_id,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const requestOptions: RequestInit = {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: myHeaders,
|
|
21
|
+
body: raw,
|
|
22
|
+
redirect: "follow",
|
|
23
|
+
credentials: "include",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
28
|
+
const response = await fetch(
|
|
29
|
+
`${NDHM_HOST}/abdm/na/v1/registration/abha-number/create-phr`,
|
|
30
|
+
requestOptions
|
|
31
|
+
);
|
|
32
|
+
return await response.json();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("postAbdmRegisterAbhaNumberCreatePhr ==>", error);
|
|
35
|
+
}
|
|
36
|
+
return {} as TPostAbdmRegisterCreatePhrResponse;
|
|
37
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import fetch from "../../fetch-client";
|
|
2
|
+
import { GET_NDHM_HOST, TPostAbdmRegisterCreatePhrResponse } from '../../constants/constants';
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmRegisterMobileCreatePhr({
|
|
5
|
+
abha_address,
|
|
6
|
+
address,
|
|
7
|
+
first_name,
|
|
8
|
+
last_name,
|
|
9
|
+
day_of_birth,
|
|
10
|
+
month_of_birth,
|
|
11
|
+
year_of_birth,
|
|
12
|
+
gender,
|
|
13
|
+
middle_name,
|
|
14
|
+
pincode,
|
|
15
|
+
txn_id,
|
|
16
|
+
}: {
|
|
17
|
+
abha_address: string;
|
|
18
|
+
address?: string;
|
|
19
|
+
day_of_birth: number;
|
|
20
|
+
first_name: string;
|
|
21
|
+
gender: string;
|
|
22
|
+
last_name: string;
|
|
23
|
+
month_of_birth: number;
|
|
24
|
+
pincode: string;
|
|
25
|
+
year_of_birth: number;
|
|
26
|
+
middle_name?: string;
|
|
27
|
+
txn_id: string;
|
|
28
|
+
}): Promise<TPostAbdmRegisterCreatePhrResponse> {
|
|
29
|
+
const myHeaders = new Headers();
|
|
30
|
+
myHeaders.append('Content-Type', 'application/json');
|
|
31
|
+
const raw = JSON.stringify({
|
|
32
|
+
abha_address,
|
|
33
|
+
profile: {
|
|
34
|
+
address,
|
|
35
|
+
day_of_birth,
|
|
36
|
+
first_name,
|
|
37
|
+
gender,
|
|
38
|
+
last_name,
|
|
39
|
+
middle_name,
|
|
40
|
+
month_of_birth,
|
|
41
|
+
pincode,
|
|
42
|
+
year_of_birth,
|
|
43
|
+
},
|
|
44
|
+
txn_id,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const requestOptions: RequestInit = {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
headers: myHeaders,
|
|
50
|
+
body: raw,
|
|
51
|
+
redirect: 'follow',
|
|
52
|
+
credentials: "include",
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
57
|
+
const response = await fetch(
|
|
58
|
+
`${NDHM_HOST}/abdm/na/v1/registration/mobile/create-phr`,
|
|
59
|
+
requestOptions
|
|
60
|
+
);
|
|
61
|
+
return await response.json();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.error('postAbdmRegisterMobileCreatePhr error =>', error);
|
|
64
|
+
}
|
|
65
|
+
return {} as TPostAbdmRegisterCreatePhrResponse;
|
|
66
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { GET_NDHM_HOST, TPostRegisterInitResponse } from "../../constants/constants";
|
|
3
|
+
import fetch from "../../fetch-client";
|
|
4
|
+
|
|
5
|
+
export default async function postAbdmRegisterMobileResendOtp({
|
|
6
|
+
txn_id,
|
|
7
|
+
}: {
|
|
8
|
+
txn_id: string;
|
|
9
|
+
}): Promise<TPostRegisterInitResponse> {
|
|
10
|
+
const myHeaders = new Headers();
|
|
11
|
+
myHeaders.append("Content-Type", "application/json");
|
|
12
|
+
|
|
13
|
+
const requestOptions: RequestInit = {
|
|
14
|
+
method: "POST",
|
|
15
|
+
headers: myHeaders,
|
|
16
|
+
body: JSON.stringify({ txn_id }),
|
|
17
|
+
redirect: "follow",
|
|
18
|
+
credentials: "include",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
23
|
+
const response = await fetch(
|
|
24
|
+
`${NDHM_HOST}/abdm/na/v1/registration/mobile/resend`,
|
|
25
|
+
requestOptions
|
|
26
|
+
);
|
|
27
|
+
return await response.json();
|
|
28
|
+
} catch (error) {
|
|
29
|
+
// console.error(error);
|
|
30
|
+
}
|
|
31
|
+
return {} as TPostRegisterInitResponse;
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterVerifyResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmRegisterMobileVerify({
|
|
5
|
+
txn_id,
|
|
6
|
+
otp,
|
|
7
|
+
}: {
|
|
8
|
+
txn_id: string;
|
|
9
|
+
otp: string;
|
|
10
|
+
}): Promise<TPostRegisterVerifyResponse> {
|
|
11
|
+
const myHeaders = new Headers();
|
|
12
|
+
myHeaders.append("Content-Type", "application/json");
|
|
13
|
+
|
|
14
|
+
const raw = JSON.stringify({
|
|
15
|
+
txn_id,
|
|
16
|
+
otp,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const requestOptions: RequestInit = {
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers: myHeaders,
|
|
22
|
+
body: raw,
|
|
23
|
+
redirect: "follow",
|
|
24
|
+
credentials: "include",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
29
|
+
const response = await fetch(
|
|
30
|
+
`${NDHM_HOST}/abdm/na/v1/registration/mobile/verify`,
|
|
31
|
+
requestOptions
|
|
32
|
+
);
|
|
33
|
+
return await response.json();
|
|
34
|
+
} catch (error) {
|
|
35
|
+
// console.error(error);
|
|
36
|
+
}
|
|
37
|
+
return {} as TPostRegisterVerifyResponse;
|
|
38
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostAbdmRegisterPhrCheckResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postAbdmRegisterPhrCheck({
|
|
5
|
+
abha_address,
|
|
6
|
+
}: {
|
|
7
|
+
abha_address: string;
|
|
8
|
+
}): Promise<TPostAbdmRegisterPhrCheckResponse> {
|
|
9
|
+
const myHeaders = new Headers();
|
|
10
|
+
myHeaders.append("Content-Type", "application/json");
|
|
11
|
+
const raw = JSON.stringify({
|
|
12
|
+
abha_address,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const requestOptions: RequestInit = {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: myHeaders,
|
|
18
|
+
body: raw,
|
|
19
|
+
redirect: "follow",
|
|
20
|
+
credentials: "include",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
25
|
+
const response = await fetch(
|
|
26
|
+
`${NDHM_HOST}/abdm/na/v1/registration/phr/check`,
|
|
27
|
+
requestOptions
|
|
28
|
+
);
|
|
29
|
+
return await response.json();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("postAbdmRegisterPhrCheck ==>", error);
|
|
32
|
+
}
|
|
33
|
+
return {} as TPostAbdmRegisterPhrCheckResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterAddressCreatePhrResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarCreatePhr({
|
|
5
|
+
abha_address,
|
|
6
|
+
txn_id,
|
|
7
|
+
}: {
|
|
8
|
+
abha_address: string;
|
|
9
|
+
txn_id: string;
|
|
10
|
+
}): Promise<TPostRegisterAddressCreatePhrResponse> {
|
|
11
|
+
const myHeaders = new Headers();
|
|
12
|
+
myHeaders.append("Content-Type", "application/json");
|
|
13
|
+
const raw = JSON.stringify({
|
|
14
|
+
abha_address,
|
|
15
|
+
txn_id,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const requestOptions: RequestInit = {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: myHeaders,
|
|
21
|
+
body: raw,
|
|
22
|
+
redirect: "follow",
|
|
23
|
+
credentials: "include",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
28
|
+
const response = await fetch(
|
|
29
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/create-phr`,
|
|
30
|
+
requestOptions
|
|
31
|
+
);
|
|
32
|
+
return await response.json();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("postRegisterAadhaarCreatePhr ==>", error);
|
|
35
|
+
}
|
|
36
|
+
return {} as TPostRegisterAddressCreatePhrResponse;
|
|
37
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterInitResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarInit({
|
|
5
|
+
aadhaar_number,
|
|
6
|
+
}: {
|
|
7
|
+
aadhaar_number: string;
|
|
8
|
+
}): Promise<TPostRegisterInitResponse> {
|
|
9
|
+
const myHeaders = new Headers();
|
|
10
|
+
myHeaders.append("Content-Type", "application/json");
|
|
11
|
+
const raw = JSON.stringify({
|
|
12
|
+
aadhaar_number,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const requestOptions: RequestInit = {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: myHeaders,
|
|
18
|
+
body: raw,
|
|
19
|
+
redirect: "follow",
|
|
20
|
+
credentials: "include",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
25
|
+
const response = await fetch(
|
|
26
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/init`,
|
|
27
|
+
requestOptions
|
|
28
|
+
);
|
|
29
|
+
return await response.json();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// console.error(error);
|
|
32
|
+
}
|
|
33
|
+
return {} as TPostRegisterInitResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterInitResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarMobileResendOtp({
|
|
5
|
+
txn_id,
|
|
6
|
+
}: {
|
|
7
|
+
txn_id: string;
|
|
8
|
+
}): Promise<TPostRegisterInitResponse> {
|
|
9
|
+
const myHeaders = new Headers();
|
|
10
|
+
myHeaders.append("Content-Type", "application/json");
|
|
11
|
+
const raw = JSON.stringify({
|
|
12
|
+
txn_id,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const requestOptions: RequestInit = {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: myHeaders,
|
|
18
|
+
body: raw,
|
|
19
|
+
redirect: "follow",
|
|
20
|
+
credentials: "include",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
25
|
+
const response = await fetch(
|
|
26
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/mobile/resend`,
|
|
27
|
+
requestOptions
|
|
28
|
+
);
|
|
29
|
+
return await response.json();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// console.error(error);
|
|
32
|
+
}
|
|
33
|
+
return {} as TPostRegisterInitResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterVerifyResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarMobileVerify({
|
|
5
|
+
txn_id,
|
|
6
|
+
otp,
|
|
7
|
+
}: {
|
|
8
|
+
txn_id: string;
|
|
9
|
+
otp: string;
|
|
10
|
+
}): Promise<TPostRegisterVerifyResponse> {
|
|
11
|
+
const myHeaders = new Headers();
|
|
12
|
+
myHeaders.append("Content-Type", "application/json");
|
|
13
|
+
const raw = JSON.stringify({
|
|
14
|
+
txn_id,
|
|
15
|
+
otp,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const requestOptions: RequestInit = {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: myHeaders,
|
|
21
|
+
body: raw,
|
|
22
|
+
redirect: "follow",
|
|
23
|
+
credentials: "include",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
28
|
+
const response = await fetch(
|
|
29
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/mobile/verify`,
|
|
30
|
+
requestOptions
|
|
31
|
+
);
|
|
32
|
+
return await response.json();
|
|
33
|
+
} catch (error) {
|
|
34
|
+
// console.error(error);
|
|
35
|
+
}
|
|
36
|
+
return {} as TPostRegisterVerifyResponse;
|
|
37
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterInitResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarResendOtp({
|
|
5
|
+
txn_id,
|
|
6
|
+
}: {
|
|
7
|
+
txn_id: string;
|
|
8
|
+
}): Promise<TPostRegisterInitResponse> {
|
|
9
|
+
const myHeaders = new Headers();
|
|
10
|
+
myHeaders.append("Content-Type", "application/json");
|
|
11
|
+
const raw = JSON.stringify({
|
|
12
|
+
txn_id,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const requestOptions: RequestInit = {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: myHeaders,
|
|
18
|
+
body: raw,
|
|
19
|
+
redirect: "follow",
|
|
20
|
+
credentials: "include",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
25
|
+
const response = await fetch(
|
|
26
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/resend`,
|
|
27
|
+
requestOptions
|
|
28
|
+
);
|
|
29
|
+
return await response.json();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
// console.error(error);
|
|
32
|
+
}
|
|
33
|
+
return {} as TPostRegisterInitResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterVerifyResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterAadhaarVerify({
|
|
5
|
+
txn_id,
|
|
6
|
+
mobile,
|
|
7
|
+
otp,
|
|
8
|
+
}: {
|
|
9
|
+
txn_id: string;
|
|
10
|
+
mobile: string;
|
|
11
|
+
otp: string;
|
|
12
|
+
}): Promise<TPostRegisterVerifyResponse> {
|
|
13
|
+
const myHeaders = new Headers();
|
|
14
|
+
myHeaders.append("Content-Type", "application/json");
|
|
15
|
+
const raw = JSON.stringify({
|
|
16
|
+
txn_id,
|
|
17
|
+
mobile,
|
|
18
|
+
otp,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const requestOptions: RequestInit = {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: myHeaders,
|
|
24
|
+
body: raw,
|
|
25
|
+
redirect: "follow",
|
|
26
|
+
credentials: "include",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
31
|
+
const response = await fetch(
|
|
32
|
+
`${NDHM_HOST}/abdm/na/v1/registration/aadhaar/verify`,
|
|
33
|
+
requestOptions
|
|
34
|
+
);
|
|
35
|
+
return await response.json();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
// console.error(error);
|
|
38
|
+
}
|
|
39
|
+
return {} as TPostRegisterVerifyResponse;
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GET_NDHM_HOST, TPostRegisterInitResponse } from "../../constants/constants";
|
|
2
|
+
import fetch from "../../fetch-client";
|
|
3
|
+
|
|
4
|
+
export default async function postRegisterMobileInit({
|
|
5
|
+
mobile_number,
|
|
6
|
+
}: {
|
|
7
|
+
mobile_number: string;
|
|
8
|
+
}): Promise<TPostRegisterInitResponse> {
|
|
9
|
+
const myHeaders = new Headers();
|
|
10
|
+
myHeaders.append("Content-Type", "application/json");
|
|
11
|
+
const raw = JSON.stringify({
|
|
12
|
+
mobile_number,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const requestOptions: RequestInit = {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: myHeaders,
|
|
18
|
+
body: raw,
|
|
19
|
+
redirect: "follow",
|
|
20
|
+
credentials: "include",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const NDHM_HOST = GET_NDHM_HOST();
|
|
25
|
+
const response = await fetch(
|
|
26
|
+
`${NDHM_HOST}/abdm/na/v1/registration/mobile/init`,
|
|
27
|
+
requestOptions
|
|
28
|
+
);
|
|
29
|
+
return await response.json();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error(error);
|
|
32
|
+
}
|
|
33
|
+
return {} as TPostRegisterInitResponse;
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import getProfilesPatient from './aorta-go/v3/get-profile-patient';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const useGetProfilesPatient = () => {
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: ['profilesPatientResponse'],
|
|
8
|
+
queryFn: getProfilesPatient,
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default useGetProfilesPatient;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { TGetProfilesPhrResponse } from '../constants/constants';
|
|
3
|
+
import getProfilePhrUser from './aorta-go/v3/get-profiles-phr-user';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const useGetProfilesPhrUser = () => {
|
|
7
|
+
return useQuery({
|
|
8
|
+
queryKey: ['profilesPhrUserResponse'],
|
|
9
|
+
queryFn: async () => {
|
|
10
|
+
const profilesPhrUserResponse = await getProfilePhrUser();
|
|
11
|
+
var filteredProfilesResponse: TGetProfilesPhrResponse;
|
|
12
|
+
if (Array.isArray(profilesPhrUserResponse)) {
|
|
13
|
+
filteredProfilesResponse = profilesPhrUserResponse?.filter(
|
|
14
|
+
(res) => !res['health-ids'] || res['health-ids'].length === 0
|
|
15
|
+
);
|
|
16
|
+
} else {
|
|
17
|
+
filteredProfilesResponse = [];
|
|
18
|
+
}
|
|
19
|
+
const updatedProfilesPhrResponse = {
|
|
20
|
+
profiles: filteredProfilesResponse,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return updatedProfilesPhrResponse;
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default useGetProfilesPhrUser;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useMutation } from '@tanstack/react-query';
|
|
2
|
+
|
|
3
|
+
import { queryClient } from '../App';
|
|
4
|
+
import useAuthAbhaStore from '../stores/auth-abha-store';
|
|
5
|
+
import postAbdmLoginVerify from './ndhm/post-abdm-login-verify';
|
|
6
|
+
|
|
7
|
+
const usePostAbdmLoginVerify = () => {
|
|
8
|
+
const setSelectedAbhaAddress = useAuthAbhaStore((state) => state.setSelectedAbhaAddress);
|
|
9
|
+
return useMutation({
|
|
10
|
+
mutationFn: ({ txn_id, otp }: { txn_id: string; otp: string }) => {
|
|
11
|
+
return postAbdmLoginVerify({
|
|
12
|
+
otp,
|
|
13
|
+
txn_id,
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
onSuccess(profileLoginVerifyResponse) {
|
|
17
|
+
if (profileLoginVerifyResponse.profile) {
|
|
18
|
+
queryClient.setQueryData(['abdmProfilePhrResponse'], profileLoginVerifyResponse.profile);
|
|
19
|
+
setSelectedAbhaAddress(profileLoginVerifyResponse.profile.abha_address);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default usePostAbdmLoginVerify;
|