@eka-care/abha-stg 0.1.36 → 0.1.37

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.
Files changed (116) hide show
  1. package/{index.html → dist/index.html} +2 -1
  2. package/dist/sdk/abha/css/abha.css +1 -0
  3. package/dist/sdk/abha/js/abha.js +63 -0
  4. package/package.json +1 -1
  5. package/.turbo/daemon/7f0c6427972069cb-turbo.log.2025-11-12 +0 -0
  6. package/package/styles/pds2/border.ts +0 -69
  7. package/package/styles/pds2/colors.ts +0 -70
  8. package/package/styles/pds2/spacing.ts +0 -1007
  9. package/package/tailwind/tailwind.config.ts +0 -124
  10. package/postcss.config.js +0 -6
  11. package/scripts/build-purged-css.cjs +0 -70
  12. package/src/App.css +0 -0
  13. package/src/App.tsx +0 -43
  14. package/src/api-queries/aorta-go/v3/get-profile-patient.ts +0 -32
  15. package/src/api-queries/aorta-go/v3/get-profiles-phr-user.ts +0 -26
  16. package/src/api-queries/aorta-go/v3/post-auth-init-v2.ts +0 -34
  17. package/src/api-queries/aorta-go/v3/post-auth-logout-v2.ts +0 -32
  18. package/src/api-queries/aorta-go/v3/post-auth-verify-v2.ts +0 -38
  19. package/src/api-queries/aorta-go/v3/post-profile-switch.ts +0 -39
  20. package/src/api-queries/ndhm/get-abdm-register-suggest.ts +0 -37
  21. package/src/api-queries/ndhm/get-pincode-details.ts +0 -28
  22. package/src/api-queries/ndhm/post-abdm-login-init.ts +0 -37
  23. package/src/api-queries/ndhm/post-abdm-login-phr.ts +0 -37
  24. package/src/api-queries/ndhm/post-abdm-login-verify.ts +0 -37
  25. package/src/api-queries/ndhm/post-abdm-profile-eka-link-phr.ts +0 -40
  26. package/src/api-queries/ndhm/post-abdm-profile-eka.ts +0 -66
  27. package/src/api-queries/ndhm/post-abdm-register-abha-number-create-phr.ts +0 -37
  28. package/src/api-queries/ndhm/post-abdm-register-mobile-create-phr.ts +0 -66
  29. package/src/api-queries/ndhm/post-abdm-register-mobile-resend-otp.ts +0 -32
  30. package/src/api-queries/ndhm/post-abdm-register-mobile-verify.ts +0 -38
  31. package/src/api-queries/ndhm/post-abdm-register-phr-check.ts +0 -34
  32. package/src/api-queries/ndhm/post-register-aadhaar-create-phr.ts +0 -37
  33. package/src/api-queries/ndhm/post-register-aadhaar-init.ts +0 -34
  34. package/src/api-queries/ndhm/post-register-aadhaar-mobile-resend-otp.ts +0 -34
  35. package/src/api-queries/ndhm/post-register-aadhaar-mobile-verify.ts +0 -37
  36. package/src/api-queries/ndhm/post-register-aadhaar-resend-otp.ts +0 -34
  37. package/src/api-queries/ndhm/post-register-aadhaar-verify.ts +0 -40
  38. package/src/api-queries/ndhm/post-register-mobile-init.ts +0 -34
  39. package/src/api-queries/use-get-profiles-patient.ts +0 -12
  40. package/src/api-queries/use-get-profiles-phr-user.ts +0 -28
  41. package/src/api-queries/use-post-abdm-login-verify-v1.ts +0 -26
  42. package/src/api-queries/use-post-auth-verify-v2.ts +0 -50
  43. package/src/api-queries/use-post-profile-switch.ts +0 -58
  44. package/src/api-queries/use-post-register-mobile-create-phr.ts +0 -39
  45. package/src/api-queries/user-post-abdm-profile-login-phr.ts +0 -26
  46. package/src/assets/Success.json +0 -1
  47. package/src/assets/react.svg +0 -1
  48. package/src/atoms/button/custom-button.tsx +0 -32
  49. package/src/atoms/button/index.tsx +0 -40
  50. package/src/atoms/button/types.d.ts +0 -31
  51. package/src/atoms/header.tsx +0 -25
  52. package/src/atoms/input-field/index.tsx +0 -63
  53. package/src/atoms/input-field/patient-input-field.tsx +0 -16
  54. package/src/atoms/input-field/types.ts +0 -24
  55. package/src/atoms/pds2-otp-input/index.tsx +0 -35
  56. package/src/atoms/pds2-otp-input/types.d.ts +0 -3
  57. package/src/atoms/single-input-chip/index.tsx +0 -32
  58. package/src/atoms/single-input-chip/types.ts +0 -6
  59. package/src/atoms/spinner.tsx +0 -33
  60. package/src/atoms/text-separator.tsx +0 -11
  61. package/src/atoms/ui/spinner.tsx +0 -75
  62. package/src/constants/constants.ts +0 -376
  63. package/src/fetch-client/index.ts +0 -164
  64. package/src/index.css +0 -152
  65. package/src/main.tsx +0 -374
  66. package/src/molecules/abha/bottom-sheet/bottom-sheet-wrapper.tsx +0 -40
  67. package/src/molecules/abha/bottom-sheet/index.tsx +0 -66
  68. package/src/molecules/abha/spaced-input-component.tsx +0 -168
  69. package/src/molecules/copyright-year.tsx +0 -16
  70. package/src/molecules/exit-popup/index.tsx +0 -101
  71. package/src/molecules/pds2-otp-component/index.tsx +0 -147
  72. package/src/organisms/abha/abha-header.tsx +0 -25
  73. package/src/organisms/abha/abha-stepper.tsx +0 -83
  74. package/src/organisms/abha/error-bottom-sheet.tsx +0 -27
  75. package/src/organisms/abha/otp-card.tsx +0 -99
  76. package/src/organisms/abha/verification-status.tsx +0 -30
  77. package/src/organisms/choose-language/choose-language.tsx +0 -53
  78. package/src/organisms/choose-language/types.ts +0 -10
  79. package/src/organisms/screen-switcher/screen-switcher.tsx +0 -80
  80. package/src/routes/abha-aadhaar-verification-status-screen.tsx +0 -246
  81. package/src/routes/abha-created-screen.tsx +0 -45
  82. package/src/routes/abha-login-otp-verify-screen.tsx +0 -519
  83. package/src/routes/abha-mobile-linking-status-screen.tsx +0 -267
  84. package/src/routes/abha-otp-and-mobile-screen.tsx +0 -435
  85. package/src/routes/abha-phone-number-verification-screen.tsx +0 -388
  86. package/src/routes/create-abha-address-screen.tsx +0 -928
  87. package/src/routes/create-abha-with-aadhaar-screen.tsx +0 -986
  88. package/src/routes/create-eka-profile-screen.tsx +0 -831
  89. package/src/routes/get-all-profiles-screen.tsx +0 -161
  90. package/src/routes/login-or-create-abha-address-screen.tsx +0 -1056
  91. package/src/routes/login-with-abha-screen.tsx +0 -454
  92. package/src/routes/select-abha-from-list-screen.tsx +0 -792
  93. package/src/routes/select-eka-profile-screen.tsx +0 -446
  94. package/src/routes/utils/trackAbhaEvent.ts +0 -41
  95. package/src/stores/auth-abha-store/index.ts +0 -152
  96. package/src/stores/auth-abha-store/types.ts +0 -217
  97. package/src/utils/mock-auth-response.ts +0 -29
  98. package/src/utils/send-event-utils.ts +0 -76
  99. package/src/utils/validations.ts +0 -89
  100. package/src/vite-env.d.ts +0 -1
  101. package/tailwind.config.ts +0 -9
  102. package/tsconfig.json +0 -25
  103. package/tsconfig.node.json +0 -10
  104. package/tsconfig.node.tsbuildinfo +0 -1
  105. package/tsconfig.tsbuildinfo +0 -1
  106. package/vite.config.d.ts +0 -2
  107. package/vite.config.js +0 -30
  108. package/vite.config.ts +0 -35
  109. /package/{public → dist}/images/adhaar.webp +0 -0
  110. /package/{public → dist}/images/at-the-rate.webp +0 -0
  111. /package/{public → dist}/images/avatar.webp +0 -0
  112. /package/{public → dist}/images/ayushman-bharat.webp +0 -0
  113. /package/{public → dist}/images/circle-checkmark.webp +0 -0
  114. /package/{public → dist}/images/link-abha.webp +0 -0
  115. /package/{public → dist}/images/national-authority.webp +0 -0
  116. /package/{public → dist}/images/three-dots.webp +0 -0
@@ -1,124 +0,0 @@
1
- import type { Config } from 'tailwindcss';
2
- import colors from "./../styles/pds2/colors";
3
- import border from "./../styles/pds2/border";
4
- import spacing from "./../styles/pds2/spacing";
5
-
6
- export default {
7
- prefix: 'pds2-',
8
- content: [],
9
- theme: {
10
- colors: {
11
- transparent: 'transparent',
12
- ...colors,
13
- platformBgColor: 'var(--platform-bg-color)',
14
- platformTextColor: 'var(--platform-text-color)',
15
- platformBorderColor: 'var(--platform-border-color)',
16
- red: '#FF0000',
17
- },
18
- backgroundColor: ({ theme }) => ({
19
- ...theme('colors'),
20
- inherit: 'inherit',
21
- }),
22
- fill: ({ theme }) => ({ ...theme('colors'), current: 'currentColor' }),
23
- spacing: { ...spacing },
24
- fontSize: ({ theme }) => ({ ...theme('spacing') }),
25
- lineHeight: ({ theme }) => ({ ...theme('spacing') }),
26
- padding: ({ theme }) => ({ ...theme('spacing') }),
27
- borderWidth: {
28
- ...border,
29
- },
30
- borderRadius: ({ theme }) => ({ ...theme('borderWidth') }),
31
- boxShadow: {
32
- none: 'none',
33
- 'elevation-5': '0px 1px 3px 0px rgba(0, 0, 0, 0.10)',
34
- 'elevation-10': '0px 3px 9px 0px rgba(0, 59, 168, 0.10)',
35
- 'elevation-50': '-4px 4px 8px 0px rgba(0, 0, 0, 0.12)',
36
- 'elevation-100': '0px 12px 36px 0px rgba(0, 0, 0, 0.25)',
37
- 'elevation-200': '0px 2px 8px 0px rgba(0, 0, 0, 0.16)',
38
- 'elevation-300': '12px 0px 50px 0px rgba(0, 0, 0, 0.15)',
39
- 'elevation-600': '0px -2px 4px 0px rgba(0, 0, 0, 0.16)',
40
- 'elevation-900': '0px 12px 50px 0px rgba(0, 0, 0, 0.15)',
41
- 'elevation-1000': '0px 0px 8px 0px rgba(0, 0, 0, 0.16)',
42
- 'elevation-1100': '0px 12px 16px 0px rgba(0, 0, 0, 0.16)',
43
- 'elevation-only-top': '0px -4px 14.8px 0px rgba(0, 0, 0, 0.05)',
44
- 'M3-1': '0px 4px 4px 0px rgba(0, 0, 0, 0.25), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)',
45
- },
46
- fontWeight: {
47
- 300: '300',
48
- 400: '400',
49
- 500: '500',
50
- 600: '600',
51
- 700: '700',
52
- 800: '800',
53
- 900: '900',
54
- },
55
- opacity: {
56
- 0: '0',
57
- 5: '0.05',
58
- 10: '0.1',
59
- 20: '0.2',
60
- 25: '0.25',
61
- 30: '0.3',
62
- 40: '0.4',
63
- 50: '0.5',
64
- 60: '0.6',
65
- 65: '0.65',
66
- 70: '0.7',
67
- 75: '0.75',
68
- 80: '0.8',
69
- 85: '0.85',
70
- 90: '0.9',
71
- 95: '0.95',
72
- 100: '1',
73
- },
74
- outlineWidth: ({ theme }) => ({ ...theme('spacing') }),
75
- fontFamily: {
76
- lato: ['Lato', 'sans-serif'],
77
- },
78
- maxWidth: ({ theme, breakpoints }) => ({
79
- none: 'none',
80
- '3/5': '60%',
81
- half: '50%',
82
- full: '100%',
83
- min: 'min-content',
84
- max: 'max-content',
85
- ...breakpoints(theme('screens')),
86
- ...theme('spacing'),
87
- }),
88
- minWidth: ({ theme }) => ({
89
- ...theme('spacing'),
90
- half: '50%',
91
- full: '100%',
92
- screen: '100vw',
93
- min: 'min-content',
94
- max: 'max-content',
95
- auto: 'auto',
96
- }),
97
- keyframes: {
98
- spin: {
99
- to: {
100
- transform: 'rotate(360deg)',
101
- },
102
- },
103
- 'fade-in': {
104
- '0%': { opacity: '0' },
105
- '100%': { opacity: '1' },
106
- },
107
- 'slide-up': {
108
- '0%': { transform: 'translateY(10px)' },
109
- '100%': { transform: 'translateY(0)' },
110
- },
111
- },
112
- animation: {
113
- spin: 'spin 1s linear infinite',
114
- 'fade-in': 'fade-in 0.2s ease-out',
115
- 'slide-up': 'slide-up 0.2s ease-out',
116
- },
117
- extend: {
118
- maxHeight: {
119
- '1/2': '50vh',
120
- },
121
- },
122
- },
123
- plugins: [],
124
- } satisfies Config;
package/postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- export default {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
@@ -1,70 +0,0 @@
1
- const path = require('path');
2
- const glob = require('glob-all');
3
- const { PurgeCSS } = require('purgecss');
4
- const fs = require('fs');
5
- const minify = require('@node-minify/core');
6
- const cleanCSS = require('@node-minify/clean-css');
7
-
8
- const moduleName = 'abha';
9
- const paths = [];
10
- const cssPath = path.resolve(__dirname, '../dist/sdk/abha/css/abha.css');
11
- const outputPath = path.resolve(__dirname, '../dist/sdk/abha/css/abha.css');
12
- const finalOutputPath = path.resolve(__dirname, '../dist/sdk/abha/css/abha.css');
13
-
14
- // Collect all relevant files for the abha module
15
- const modulePath = path.resolve(__dirname, `../../${moduleName}`);
16
- paths.push(path.resolve(modulePath, 'public/index.html'));
17
- paths.push(
18
- ...glob.sync(`${path.resolve(modulePath, 'src')}/**/*`, { nodir: true })
19
- );
20
-
21
- // Tailwind extractor to match class names
22
- const TailwindExtractor = (content) => {
23
- return content.match(/[\w-/:]+(?<!:)/g) || [];
24
- };
25
-
26
- async function purgeCss() {
27
- console.log('Purging unused CSS for abha module...');
28
-
29
- const result = await new PurgeCSS().purge({
30
- content: [...paths],
31
- keyframes: true,
32
- extractors: [
33
- {
34
- extractor: TailwindExtractor,
35
- extensions: ['html', 'js', 'php', 'vue', 'tsx', 'ts'],
36
- },
37
- ],
38
- safelist: {
39
- standard: [], // Remove all safelisted patterns
40
- deep: [],
41
- greedy: [],
42
- },
43
- css: [cssPath],
44
- });
45
-
46
- // Write the purged CSS to a file
47
- fs.writeFileSync(outputPath, result[0].css);
48
- console.log('Purged CSS written to ' + outputPath);
49
-
50
- // Minify the purged CSS
51
- await new Promise((resolve, reject) =>
52
- minify({
53
- compressor: cleanCSS,
54
- input: outputPath,
55
- output: finalOutputPath,
56
- callback: function (err, min) {
57
- if (err) {
58
- reject(err);
59
- return;
60
- }
61
- console.log('Minified CSS written to ' + finalOutputPath);
62
- resolve();
63
- },
64
- })
65
- );
66
- }
67
-
68
- purgeCss().catch((err) => {
69
- console.error('Error during CSS purging:', err);
70
- });
package/src/App.css DELETED
File without changes
package/src/App.tsx DELETED
@@ -1,43 +0,0 @@
1
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
2
- import { useEffect } from 'react';
3
- import './App.css';
4
- import { unMount } from './main';
5
- import ScreenStack from './organisms/screen-switcher/screen-switcher';
6
- import { GET_CLIENT_ID } from './constants/constants';
7
-
8
-
9
- export const queryClient = new QueryClient();
10
-
11
- function App() {
12
- useEffect(() => {
13
- return () => {
14
- unMount();
15
- };
16
- }, []);
17
-
18
- return (
19
- <QueryClientProvider client={queryClient}>
20
- <div
21
- className="pds2-h-full pds2-w-full pds2-bg-bg-white"
22
- style={{
23
- borderRadius: GET_CLIENT_ID() === 'www-eka' ? '1.5rem' : undefined,
24
- position: 'relative',
25
- height:
26
- GET_CLIENT_ID() === 'www-eka'
27
- ? '75vh'
28
- : GET_CLIENT_ID() === 'doc-web'
29
- ? '100%'
30
- : '100vh',
31
- overflowY: 'auto',
32
- paddingTop :(GET_CLIENT_ID() === 'androiddoc' ||
33
- GET_CLIENT_ID() === 'doctor-app-ios' ||
34
- GET_CLIENT_ID() === 'doctor-ipad-ios') ? "1rem" :"0rem",
35
- }}
36
- >
37
- <ScreenStack />
38
- </div>
39
- </QueryClientProvider>
40
- );
41
- }
42
-
43
- export default App;
@@ -1,32 +0,0 @@
1
-
2
- import { GET_AORTA_GO_HOST, GET_EXTRA_HEADERS, TGetProfilesPatientResponse } from "../../../constants/constants";
3
- import fetch from "../../../fetch-client";
4
-
5
- export default async function getProfilesPatient(): Promise<TGetProfilesPatientResponse> {
6
- const myHeaders = new Headers();
7
- myHeaders.append("Content-Type", "application/json");
8
- const requestOptions: RequestInit = {
9
- method: "GET",
10
- headers: myHeaders,
11
- redirect: "follow",
12
- credentials: "include",
13
- };
14
-
15
- const extraHeaders = GET_EXTRA_HEADERS();
16
- const oid = extraHeaders?.["X-User-ID"];
17
-
18
- if (!oid) return {} as TGetProfilesPatientResponse;
19
-
20
- try {
21
- const AORTA_GO_HOST = GET_AORTA_GO_HOST();
22
- const response = await fetch(
23
- `${AORTA_GO_HOST}/profiles/v1/patient/${oid}`,
24
- requestOptions
25
- );
26
-
27
- return await response.json();
28
- } catch (error) {
29
- console.error("profilePhrUser error =>", error);
30
- return {} as TGetProfilesPatientResponse;
31
- }
32
- }
@@ -1,26 +0,0 @@
1
- import { GET_AORTA_GO_HOST, TGetProfilesPhrResponse } from "../../../constants/constants";
2
- import fetch from "../../../fetch-client";
3
-
4
-
5
- export default async function getProfilePhrUser(): Promise<TGetProfilesPhrResponse> {
6
- const myHeaders = new Headers();
7
- myHeaders.append("Content-Type", "application/json");
8
- const requestOptions: RequestInit = {
9
- method: "GET",
10
- headers: myHeaders,
11
- redirect: "follow",
12
- credentials: "include",
13
- };
14
-
15
- try {
16
- const AORTA_GO_HOST = GET_AORTA_GO_HOST();
17
- const response = await fetch(
18
- `${AORTA_GO_HOST}/profiles/v1/patient`,
19
- requestOptions
20
- );
21
- return await response.json();
22
- } catch (error) {
23
- console.error("profilePhrUser error =>", error);
24
- return [] as TGetProfilesPhrResponse;
25
- }
26
- }
@@ -1,34 +0,0 @@
1
- import { AUTH_METHOD, GET_AORTA_GO_HOST, TAuthInitV2Response } from "../../../constants/constants";
2
- import fetch from "../../../fetch-client";
3
-
4
- export default async function postAuthInitV2({
5
- method,
6
- identifier,
7
- }: {
8
- method: AUTH_METHOD;
9
- identifier?: string;
10
- }): Promise<TAuthInitV2Response> {
11
- const myHeaders = new Headers();
12
- myHeaders.append("Content-Type", "application/json");
13
- const raw = JSON.stringify({
14
- method,
15
- identifier,
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 AORTA_GO_HOST = GET_AORTA_GO_HOST();
28
- const response = await fetch(`${AORTA_GO_HOST}/v2/auth/init`, requestOptions);
29
- return await response.json();
30
- } catch (error) {
31
- console.error(error);
32
- }
33
- return {} as TAuthInitV2Response;
34
- }
@@ -1,32 +0,0 @@
1
-
2
- import { GET_AORTA_GO_HOST } from "../../../constants/constants";
3
- import fetch from "../../../fetch-client";
4
-
5
- export default async function postAuthLogoutV2() {
6
- console.log('inside postAuthLogoutV2 api call');
7
- const myHeaders = new Headers();
8
- myHeaders.append("Content-Type", "application/json");
9
- const raw = JSON.stringify({});
10
- const AORTA_GO_HOST = GET_AORTA_GO_HOST();
11
- const url = `${AORTA_GO_HOST}/v2/auth/logout`;
12
-
13
- const requestOptions: RequestInit = {
14
- method: "POST",
15
- headers: myHeaders,
16
- body: raw,
17
- redirect: "follow",
18
- credentials: "include",
19
- };
20
-
21
- try {
22
- const response = await fetch(url, requestOptions);
23
- if (!response.ok) {
24
- console.log("Logout failed with status", response?.status);
25
- return false;
26
- }
27
- return true; // success
28
- } catch (error) {
29
- console.error("Logout API failed:", error);
30
- return false;
31
- }
32
- }
@@ -1,38 +0,0 @@
1
-
2
- import { GET_AORTA_GO_HOST, TAuthVerifyV2Request, TAuthVerifyV2Response } from "../../../constants/constants";
3
- import fetch from "../../../fetch-client";
4
-
5
-
6
- export default async function postAuthVerifyV2({
7
- txn_id,
8
- code,
9
- token,
10
- }: TAuthVerifyV2Request): Promise<TAuthVerifyV2Response> {
11
- const myHeaders = new Headers();
12
- myHeaders.append("Content-Type", "application/json");
13
- const raw = JSON.stringify({
14
- txn_id,
15
- ...(code ? { code } : {}),
16
- ...(token ? { token } : {}),
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 AORTA_GO_HOST = GET_AORTA_GO_HOST();
29
- const response = await fetch(
30
- `${AORTA_GO_HOST}/v2/auth/verify`,
31
- requestOptions
32
- );
33
- return await response.json();
34
- } catch (error) {
35
- console.error(error);
36
- }
37
- return {} as TAuthVerifyV2Response;
38
- }
@@ -1,39 +0,0 @@
1
-
2
- import { GET_AORTA_GO_HOST, TProfileSwitchResponse } from "../../../constants/constants";
3
- import fetch from "../../../fetch-client";
4
-
5
-
6
- export default async function postProfileSwitch({
7
- oid,
8
- // token,
9
- }: {
10
- oid: string;
11
- // token?: string;
12
- }): Promise<TProfileSwitchResponse> {
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
- oid,
18
- });
19
-
20
- const requestOptions: RequestInit = {
21
- method: "POST",
22
- headers: myHeaders,
23
- body: raw,
24
- redirect: "follow",
25
- credentials: "include",
26
- };
27
-
28
- try {
29
- const AORTA_GO_HOST = GET_AORTA_GO_HOST();
30
- const response = await fetch(
31
- `${AORTA_GO_HOST}/v1/profile/switch`,
32
- requestOptions
33
- );
34
- return await response.json();
35
- } catch (error) {
36
- console.error("postProfileSwitchError: ", error);
37
- }
38
- return {} as TProfileSwitchResponse;
39
- }
@@ -1,37 +0,0 @@
1
- import { GET_NDHM_HOST, TGetAbdmRegisterSuggestResponse } from "../../constants/constants";
2
- import fetch from "../../fetch-client";
3
-
4
- export default async function getAbdmRegisterSuggest({
5
- txn_id,
6
- fn,
7
- mn,
8
- ln,
9
- dob,
10
- }: {
11
- txn_id: string;
12
- fn?: string;
13
- mn?: string;
14
- ln?: string;
15
- dob?: string;
16
- }): Promise<TGetAbdmRegisterSuggestResponse> {
17
- const myHeaders = new Headers();
18
- myHeaders.append("Content-Type", "application/json");
19
- const requestOptions: RequestInit = {
20
- method: "GET",
21
- headers: myHeaders,
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/suggest?transactionId=${txn_id}&fn=${fn || ""}&mn=${mn || ""}&ln=${ln || ""}&dob=${dob || ""}`,
30
- requestOptions
31
- );
32
- return await response.json();
33
- } catch (error) {
34
- console.error("postAbdmLoginVerify error =>", error);
35
- }
36
- return {} as TGetAbdmRegisterSuggestResponse;
37
- }
@@ -1,28 +0,0 @@
1
-
2
- import { GET_NDHM_HOST, TGetAbdhmPincodeDetailsResponse } from "../../constants/constants";
3
- import fetch from "../../fetch-client";
4
-
5
- export default async function getPincodeDetails({
6
- pincode,
7
- }: {
8
- pincode: number;
9
- }): Promise<TGetAbdhmPincodeDetailsResponse> {
10
- const NDHM_HOST = GET_NDHM_HOST();
11
- const url = `${NDHM_HOST}/abdm/na/v1/registration/pincode/${pincode}`;
12
- const myHeaders = new Headers();
13
- myHeaders.append("Content-Type", "application/json");
14
- const requestOptions: RequestInit = {
15
- method: "GET",
16
- headers: myHeaders,
17
- redirect: "follow",
18
- credentials: "include",
19
- };
20
-
21
- try {
22
- const response = await fetch(url, requestOptions);
23
- return await response.json();
24
- } catch (error) {
25
- console.error(error);
26
- }
27
- return {} as any;
28
- }
@@ -1,37 +0,0 @@
1
- import fetch from "../../fetch-client";
2
- import { ABHA_AUTH_FLOW_METHOD, GET_NDHM_HOST, TPostAbdmLoginInitResponse } from "../../constants/constants";
3
-
4
- export default async function postAbdmLoginInit({
5
- method,
6
- identifier,
7
- }: {
8
- method: ABHA_AUTH_FLOW_METHOD;
9
- identifier: string;
10
- }): Promise<TPostAbdmLoginInitResponse> {
11
- const myHeaders = new Headers();
12
- myHeaders.append("Content-Type", "application/json");
13
- const raw = JSON.stringify({
14
- method,
15
- identifier,
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/profile/login/init`,
30
- requestOptions
31
- );
32
- return await response.json();
33
- } catch (error) {
34
- console.error("postAbdmLoginInit error =>", error);
35
- }
36
- return {} as TPostAbdmLoginInitResponse;
37
- }
@@ -1,37 +0,0 @@
1
- import fetch from "../../fetch-client";
2
- import { GET_NDHM_HOST, TPostAbdmProfileLoginPhrResponse } from "../../constants/constants";
3
-
4
- export default async function postAbdmProfileLoginPhr({
5
- txn_id,
6
- phr_address,
7
- }: {
8
- txn_id: string;
9
- phr_address: string;
10
- }): Promise<TPostAbdmProfileLoginPhrResponse> {
11
- const myHeaders = new Headers();
12
- myHeaders.append("Content-Type", "application/json");
13
- const raw = JSON.stringify({
14
- txn_id,
15
- phr_address,
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/profile/login/phr`,
30
- requestOptions
31
- );
32
- return await response.json();
33
- } catch (error) {
34
- console.error("postAbdmProfileLoginPhr error =>", error);
35
- }
36
- return {} as TPostAbdmProfileLoginPhrResponse;
37
- }
@@ -1,37 +0,0 @@
1
- import fetch from "../../fetch-client";
2
- import { GET_NDHM_HOST, TPostAbdmLoginVerifyResponse } from "../../constants/constants";
3
-
4
- export default async function postAbdmLoginVerify({
5
- txn_id,
6
- otp,
7
- }: {
8
- txn_id: string;
9
- otp: string;
10
- }): Promise<TPostAbdmLoginVerifyResponse> {
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/profile/login/verify`,
30
- requestOptions
31
- );
32
- return await response.json();
33
- } catch (error) {
34
- console.error("postAbdmLoginVerify error =>", error);
35
- }
36
- return {} as TPostAbdmLoginVerifyResponse;
37
- }
@@ -1,40 +0,0 @@
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
- }