@eka-care/abha-stg 0.1.0 → 0.1.1
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/{index.html → dist/index.html} +2 -1
- package/dist/sdk/abha/css/abha.css +1 -0
- package/dist/sdk/abha/js/abha.js +63 -0
- package/package.json +1 -1
- package/.eslintignore +0 -3
- package/.eslintrc +0 -29
- package/.prettierrc +0 -7
- package/.turbo/daemon/da13e0828a6aedf8-turbo.log.2025-10-30 +0 -0
- package/package/styles/pds2/border.ts +0 -69
- package/package/styles/pds2/colors.ts +0 -70
- package/package/styles/pds2/spacing.ts +0 -1007
- package/package/tailwind/tailwind.config.ts +0 -124
- package/postcss.config.js +0 -6
- package/scripts/build-purged-css.cjs +0 -70
- package/src/App.css +0 -0
- package/src/App.tsx +0 -43
- package/src/api-queries/aorta-go/v3/get-profile-patient.ts +0 -32
- package/src/api-queries/aorta-go/v3/get-profiles-phr-user.ts +0 -26
- package/src/api-queries/aorta-go/v3/post-auth-init-v2.ts +0 -34
- package/src/api-queries/aorta-go/v3/post-auth-logout-v2.ts +0 -32
- package/src/api-queries/aorta-go/v3/post-auth-verify-v2.ts +0 -38
- package/src/api-queries/aorta-go/v3/post-profile-switch.ts +0 -39
- package/src/api-queries/ndhm/get-abdm-register-suggest.ts +0 -37
- package/src/api-queries/ndhm/get-pincode-details.ts +0 -28
- package/src/api-queries/ndhm/post-abdm-login-init.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-login-phr.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-login-verify.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-profile-eka-link-phr.ts +0 -40
- package/src/api-queries/ndhm/post-abdm-profile-eka.ts +0 -66
- package/src/api-queries/ndhm/post-abdm-register-abha-number-create-phr.ts +0 -37
- package/src/api-queries/ndhm/post-abdm-register-mobile-create-phr.ts +0 -66
- package/src/api-queries/ndhm/post-abdm-register-mobile-resend-otp.ts +0 -32
- package/src/api-queries/ndhm/post-abdm-register-mobile-verify.ts +0 -38
- package/src/api-queries/ndhm/post-abdm-register-phr-check.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-create-phr.ts +0 -37
- package/src/api-queries/ndhm/post-register-aadhaar-init.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-resend-otp.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-mobile-verify.ts +0 -37
- package/src/api-queries/ndhm/post-register-aadhaar-resend-otp.ts +0 -34
- package/src/api-queries/ndhm/post-register-aadhaar-verify.ts +0 -40
- package/src/api-queries/ndhm/post-register-mobile-init.ts +0 -34
- package/src/api-queries/use-get-profiles-patient.ts +0 -12
- package/src/api-queries/use-get-profiles-phr-user.ts +0 -28
- package/src/api-queries/use-post-abdm-login-verify-v1.ts +0 -26
- package/src/api-queries/use-post-auth-verify-v2.ts +0 -50
- package/src/api-queries/use-post-profile-switch.ts +0 -58
- package/src/api-queries/use-post-register-mobile-create-phr.ts +0 -39
- package/src/api-queries/user-post-abdm-profile-login-phr.ts +0 -26
- package/src/assets/Success.json +0 -1
- package/src/assets/react.svg +0 -1
- package/src/atoms/button/custom-button.tsx +0 -32
- package/src/atoms/button/index.tsx +0 -40
- package/src/atoms/button/types.d.ts +0 -31
- package/src/atoms/header.tsx +0 -25
- package/src/atoms/input-field/index.tsx +0 -63
- package/src/atoms/input-field/patient-input-field.tsx +0 -16
- package/src/atoms/input-field/types.ts +0 -24
- package/src/atoms/pds2-otp-input/index.tsx +0 -35
- package/src/atoms/pds2-otp-input/types.d.ts +0 -3
- package/src/atoms/single-input-chip/index.tsx +0 -32
- package/src/atoms/single-input-chip/types.ts +0 -6
- package/src/atoms/spinner.tsx +0 -33
- package/src/atoms/text-separator.tsx +0 -11
- package/src/atoms/ui/spinner.tsx +0 -75
- package/src/constants/constants.ts +0 -376
- package/src/fetch-client/index.ts +0 -164
- package/src/index.css +0 -152
- package/src/main.tsx +0 -374
- package/src/molecules/abha/bottom-sheet/bottom-sheet-wrapper.tsx +0 -40
- package/src/molecules/abha/bottom-sheet/index.tsx +0 -66
- package/src/molecules/abha/spaced-input-component.tsx +0 -168
- package/src/molecules/copyright-year.tsx +0 -16
- package/src/molecules/exit-popup/index.tsx +0 -101
- package/src/molecules/pds2-otp-component/index.tsx +0 -147
- package/src/organisms/abha/abha-header.tsx +0 -25
- package/src/organisms/abha/abha-stepper.tsx +0 -83
- package/src/organisms/abha/error-bottom-sheet.tsx +0 -27
- package/src/organisms/abha/otp-card.tsx +0 -99
- package/src/organisms/abha/verification-status.tsx +0 -30
- package/src/organisms/choose-language/choose-language.tsx +0 -53
- package/src/organisms/choose-language/types.ts +0 -10
- package/src/organisms/screen-switcher/screen-switcher.tsx +0 -80
- package/src/routes/abha-aadhaar-verification-status-screen.tsx +0 -246
- package/src/routes/abha-created-screen.tsx +0 -45
- package/src/routes/abha-login-otp-verify-screen.tsx +0 -519
- package/src/routes/abha-mobile-linking-status-screen.tsx +0 -267
- package/src/routes/abha-otp-and-mobile-screen.tsx +0 -435
- package/src/routes/abha-phone-number-verification-screen.tsx +0 -388
- package/src/routes/create-abha-address-screen.tsx +0 -928
- package/src/routes/create-abha-with-aadhaar-screen.tsx +0 -986
- package/src/routes/create-eka-profile-screen.tsx +0 -831
- package/src/routes/get-all-profiles-screen.tsx +0 -161
- package/src/routes/login-or-create-abha-address-screen.tsx +0 -1056
- package/src/routes/login-with-abha-screen.tsx +0 -454
- package/src/routes/select-abha-from-list-screen.tsx +0 -792
- package/src/routes/select-eka-profile-screen.tsx +0 -446
- package/src/routes/utils/trackAbhaEvent.ts +0 -41
- package/src/stores/auth-abha-store/index.ts +0 -152
- package/src/stores/auth-abha-store/types.ts +0 -217
- package/src/utils/mock-auth-response.ts +0 -29
- package/src/utils/send-event-utils.ts +0 -76
- package/src/utils/validations.ts +0 -89
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.ts +0 -9
- package/tsconfig.json +0 -25
- package/tsconfig.node.json +0 -10
- package/tsconfig.node.tsbuildinfo +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- package/vite.config.d.ts +0 -2
- package/vite.config.js +0 -45
- package/vite.config.ts +0 -50
- /package/{public → dist}/images/adhaar.webp +0 -0
- /package/{public → dist}/images/at-the-rate.webp +0 -0
- /package/{public → dist}/images/avatar.webp +0 -0
- /package/{public → dist}/images/ayushman-bharat.webp +0 -0
- /package/{public → dist}/images/circle-checkmark.webp +0 -0
- /package/{public → dist}/images/link-abha.webp +0 -0
- /package/{public → dist}/images/national-authority.webp +0 -0
- /package/{public → dist}/images/three-dots.webp +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { ABHA_V3_SKIP_STATES, GET_EXTRA_HEADERS } from '../constants/constants';
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import useGetProfilesPhrUser from '../api-queries/use-get-profiles-phr-user';
|
|
4
|
-
import AbhaVerificationStatus from '../organisms/abha/verification-status';
|
|
5
|
-
import useAuthAbhaStore from '../stores/auth-abha-store';
|
|
6
|
-
import { SCREEN_NAMES } from '../stores/auth-abha-store/types';
|
|
7
|
-
|
|
8
|
-
import handleSendEvent from '../utils/send-event-utils';
|
|
9
|
-
|
|
10
|
-
const GetAllProfilesScreen = () => {
|
|
11
|
-
const setScreen = useAuthAbhaStore((state) => state.setScreen);
|
|
12
|
-
const screen = useAuthAbhaStore((state) => state.screen);
|
|
13
|
-
const goBackLoginScreen = useAuthAbhaStore((state) => state.goBackLoginScreen);
|
|
14
|
-
const clearAbhaAuthStore = useAuthAbhaStore((state) => state.clearAbhaAuthStore);
|
|
15
|
-
const [loadingStatus, setLoadingStatus] = useState<boolean>(false);
|
|
16
|
-
const [targetScreen, setTargetScreen] = useState('');
|
|
17
|
-
const clientId = useAuthAbhaStore((state) => state.clientId);
|
|
18
|
-
const aadhaarVerificationSkipStateStatus = useAuthAbhaStore(
|
|
19
|
-
(state) => state.aadhaarVerificationSkipStateStatus
|
|
20
|
-
);
|
|
21
|
-
const isEkaAppLogin = useAuthAbhaStore((state) => state.isEkaAppLogin);
|
|
22
|
-
const isNewLoginOrCreateFlow = useAuthAbhaStore((state) => state.isNewLoginOrCreateFlow);
|
|
23
|
-
const txnId = useAuthAbhaStore((state) => state.txnId);
|
|
24
|
-
const extra_headers = GET_EXTRA_HEADERS();
|
|
25
|
-
const selectedMethod = useAuthAbhaStore((state) => state.abhaAuthFlowMethod);
|
|
26
|
-
|
|
27
|
-
const trackAbhaEvent = ({ name, data = {} }: { name: string; data?: Record<string, any> }) => {
|
|
28
|
-
const baseProps = {
|
|
29
|
-
login_platform: clientId,
|
|
30
|
-
is_eka_app_login: isEkaAppLogin ? 'true' : 'false',
|
|
31
|
-
is_new_login_or_create_flow: isNewLoginOrCreateFlow ? 'true' : 'false',
|
|
32
|
-
txn_id: txnId || 'missing txnId',
|
|
33
|
-
oid: extra_headers?.['X-User-ID'] ? 'true' : 'false',
|
|
34
|
-
access_token: extra_headers?.['auth'] ? 'true' : 'false',
|
|
35
|
-
flow: selectedMethod ?? ""
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const eventData = {
|
|
39
|
-
...baseProps,
|
|
40
|
-
...data,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
handleSendEvent({
|
|
44
|
-
eventName: name,
|
|
45
|
-
eventData,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
window.curio?.pushToMixpanel?.(name, eventData);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
// If the client is a doctor, redirect to CREATE_EKA_PROFILE screen directly
|
|
53
|
-
if (clientId === 'doctor') {
|
|
54
|
-
// Track page view event for doctor clients
|
|
55
|
-
trackAbhaEvent({
|
|
56
|
-
name: 'page_view',
|
|
57
|
-
data: {
|
|
58
|
-
platform: clientId,
|
|
59
|
-
page_view: 'get-all-profiles-screen',
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
// Redirect to Eka profile creation screen
|
|
63
|
-
trackAbhaEvent({
|
|
64
|
-
name: 'redirect_to_create_eka_profile_screen',
|
|
65
|
-
data: {
|
|
66
|
-
type: 'next',
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
setScreen(SCREEN_NAMES.CREATE_EKA_PROFILE);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
}, [clientId]);
|
|
73
|
-
|
|
74
|
-
// Determine if profiles should be fetched based on client type and login context
|
|
75
|
-
// if the isEkaAppLogin is false, and client is not doc, then fetch profiles
|
|
76
|
-
let shouldFetchProfiles = false;
|
|
77
|
-
|
|
78
|
-
if (isEkaAppLogin) {
|
|
79
|
-
// If the login is from Eka app, do not fetch profiles
|
|
80
|
-
shouldFetchProfiles = false;
|
|
81
|
-
} else if (!isEkaAppLogin) {
|
|
82
|
-
if (clientId === 'doctor') {
|
|
83
|
-
// If the client is doctor, do not fetch profiles
|
|
84
|
-
shouldFetchProfiles = false;
|
|
85
|
-
} else {
|
|
86
|
-
// All other clients (not Eka, not doctor) should fetch profiles
|
|
87
|
-
shouldFetchProfiles = true;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Fetch PHR profiles conditionally
|
|
92
|
-
const {
|
|
93
|
-
data: profilePhrResponse,
|
|
94
|
-
error: phrError,
|
|
95
|
-
isLoading,
|
|
96
|
-
} = shouldFetchProfiles ? useGetProfilesPhrUser() : { data: null, error: null, isLoading: false };
|
|
97
|
-
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
// Skip the effect logic for doctor clients
|
|
100
|
-
if (clientId === 'doctor') {
|
|
101
|
-
return; // prevent overriding screen logic for doc clients
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const fetchProfileResponse = async () => {
|
|
105
|
-
// Wait for API loading to complete and data to be available
|
|
106
|
-
if (!isLoading && profilePhrResponse) {
|
|
107
|
-
setLoadingStatus(true); // Start showing loading spinner
|
|
108
|
-
|
|
109
|
-
// Optional 2-second delay to create smoother UI transitions
|
|
110
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
111
|
-
|
|
112
|
-
setLoadingStatus(false); // Hide loading spinner
|
|
113
|
-
|
|
114
|
-
// If no profiles exist, determine where to redirect
|
|
115
|
-
if (!profilePhrResponse.profiles || profilePhrResponse.profiles.length < 1) {
|
|
116
|
-
if (aadhaarVerificationSkipStateStatus === ABHA_V3_SKIP_STATES.ABHA_END) {
|
|
117
|
-
// Create both PHR and Eka profile
|
|
118
|
-
trackAbhaEvent({
|
|
119
|
-
name: 'redirect_to_create_phr_eka_profile_screen',
|
|
120
|
-
data: {
|
|
121
|
-
type: 'next',
|
|
122
|
-
skip_state: aadhaarVerificationSkipStateStatus,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
setScreen(SCREEN_NAMES.CREATE_PHR_EKA_PROFILE);
|
|
126
|
-
} else {
|
|
127
|
-
// Create only Eka profile
|
|
128
|
-
trackAbhaEvent({
|
|
129
|
-
name: 'redirect_to_create_eka_profile_screen',
|
|
130
|
-
data: {
|
|
131
|
-
type: 'next',
|
|
132
|
-
skip_state: aadhaarVerificationSkipStateStatus,
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
setScreen(SCREEN_NAMES.CREATE_EKA_PROFILE);
|
|
136
|
-
}
|
|
137
|
-
} else {
|
|
138
|
-
// Profiles exist, redirect to profile selection screen
|
|
139
|
-
trackAbhaEvent({
|
|
140
|
-
name: 'redirect_to_select_eka_profile_screen',
|
|
141
|
-
data: {
|
|
142
|
-
type: 'next',
|
|
143
|
-
skip_state: aadhaarVerificationSkipStateStatus,
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
setScreen(SCREEN_NAMES.SELECT_EKA_PROFILE);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
// Invoke the response handler
|
|
151
|
-
fetchProfileResponse();
|
|
152
|
-
}, [isLoading, profilePhrResponse]);
|
|
153
|
-
|
|
154
|
-
// If loading status is active, show verification screen with spinner
|
|
155
|
-
if (loadingStatus) {
|
|
156
|
-
return <AbhaVerificationStatus loading={true} loadingText="In progress..." successText="" />;
|
|
157
|
-
}
|
|
158
|
-
// If nothing to render (e.g., waiting for redirect), return null
|
|
159
|
-
return null;
|
|
160
|
-
};
|
|
161
|
-
export default GetAllProfilesScreen;
|