medos-sdk 1.0.1 → 1.0.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/README.md +208 -73
- package/dist/client/MedosClient.d.ts +1 -1
- package/dist/client/MedosClient.js +1 -1
- package/dist/components/AppointmentCalender.d.ts +1 -4
- package/dist/components/AppointmentCalender.js +282 -486
- package/dist/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/components/AppointmentDateTimeModal.js +206 -0
- package/dist/components/ConfigurableCard.d.ts +12 -0
- package/dist/components/ConfigurableCard.js +29 -0
- package/dist/components/DoctorSelectModal.d.ts +7 -0
- package/dist/components/DoctorSelectModal.js +80 -0
- package/dist/components/Icons/Check.d.ts +6 -0
- package/dist/components/Icons/Check.js +2 -0
- package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/components/Icons/ChevronDownIcon.js +2 -0
- package/dist/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/components/Icons/ChevronLeft.js +3 -0
- package/dist/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/components/Icons/ChevronRight.js +3 -0
- package/dist/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/components/Icons/ConfirmationCheck.js +9 -0
- package/dist/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/components/Icons/ConsultationType.js +2 -0
- package/dist/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/components/Icons/Date&TimeIcon.js +2 -0
- package/dist/components/Icons/MapIcon.d.ts +1 -0
- package/dist/components/Icons/MapIcon.js +2 -0
- package/dist/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/components/Icons/PaymentMethodIcon.js +2 -0
- package/dist/components/Icons/UserIcon.d.ts +1 -0
- package/dist/components/Icons/UserIcon.js +2 -0
- package/dist/components/PatientDetailsStep.d.ts +3 -0
- package/dist/components/PatientDetailsStep.js +76 -0
- package/dist/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/components/PhoneVerificationStep.js +39 -0
- package/dist/components/SuccessStep.d.ts +3 -0
- package/dist/components/SuccessStep.js +17 -0
- package/dist/components/custom-calendar.d.ts +5 -0
- package/dist/components/custom-calendar.js +153 -0
- package/dist/components/styles.d.ts +6 -0
- package/dist/components/styles.js +257 -0
- package/dist/components/types.d.ts +182 -0
- package/dist/components/types.js +55 -0
- package/dist/components/ui/select.d.ts +10 -0
- package/dist/components/ui/select.js +21 -0
- package/dist/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/components/uiComponents/SelectDropdown.js +302 -0
- package/dist/components/utils.d.ts +5 -0
- package/dist/components/utils.js +15 -0
- package/dist/components/validation.d.ts +2 -0
- package/dist/components/validation.js +7 -0
- package/dist/context/TemplateContext.d.ts +12 -0
- package/dist/context/TemplateContext.js +19 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +8 -0
- package/dist/lib/templateUtils.d.ts +3 -0
- package/dist/lib/templateUtils.js +28 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/services/AppointmentService.d.ts +9 -10
- package/dist/services/AppointmentService.js +12 -10
- package/dist/templates/registry.d.ts +12 -0
- package/dist/templates/registry.js +58 -0
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +41 -0
- package/dist/vanilla/AppointmentCalendarWidget.js +848 -0
- package/dist/vanilla/appointment-calendar/provider.d.ts +13 -0
- package/dist/vanilla/appointment-calendar/types.d.ts +144 -0
- package/dist/vanilla/appointments/provider.d.ts +13 -0
- package/dist/vanilla/appointments/types.d.ts +81 -0
- package/dist/vanilla/client/MedosClient.d.ts +32 -0
- package/dist/vanilla/components/AppointmentCalender.d.ts +3 -0
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +14 -0
- package/dist/vanilla/components/ConfigurableCard.d.ts +12 -0
- package/dist/vanilla/components/DoctorSelectModal.d.ts +7 -0
- package/dist/vanilla/components/Icons/Check.d.ts +6 -0
- package/dist/vanilla/components/Icons/ChevronDownIcon.d.ts +4 -0
- package/dist/vanilla/components/Icons/ChevronLeft.d.ts +3 -0
- package/dist/vanilla/components/Icons/ChevronRight.d.ts +3 -0
- package/dist/vanilla/components/Icons/ConfirmationCheck.d.ts +1 -0
- package/dist/vanilla/components/Icons/ConsultationType.d.ts +1 -0
- package/dist/vanilla/components/Icons/Date&TimeIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/MapIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/PaymentMethodIcon.d.ts +1 -0
- package/dist/vanilla/components/Icons/UserIcon.d.ts +1 -0
- package/dist/vanilla/components/PatientDetailsStep.d.ts +3 -0
- package/dist/vanilla/components/PhoneVerificationStep.d.ts +3 -0
- package/dist/vanilla/components/SuccessStep.d.ts +3 -0
- package/dist/vanilla/components/custom-calendar.d.ts +5 -0
- package/dist/vanilla/components/styles.d.ts +6 -0
- package/dist/vanilla/components/types.d.ts +182 -0
- package/dist/vanilla/components/ui/select.d.ts +10 -0
- package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +41 -0
- package/dist/vanilla/components/utils.d.ts +5 -0
- package/dist/vanilla/components/validation.d.ts +2 -0
- package/dist/vanilla/context/TemplateContext.d.ts +12 -0
- package/dist/vanilla/core/index.d.ts +8 -0
- package/dist/vanilla/index.d.ts +7 -0
- package/dist/vanilla/index.js +2 -0
- package/dist/vanilla/lib/templateUtils.d.ts +3 -0
- package/dist/vanilla/react/index.d.ts +2 -0
- package/dist/vanilla/services/AppointmentService.d.ts +85 -0
- package/dist/vanilla/services/AuthService.d.ts +6 -0
- package/dist/vanilla/services/PatientService.d.ts +14 -0
- package/dist/vanilla/templates/alternative.css +13 -0
- package/dist/vanilla/templates/default.css +13 -0
- package/dist/vanilla/templates/registry.d.ts +12 -0
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +41 -0
- package/dist/vanilla/vanilla/index.d.ts +2 -0
- package/dist/vanilla/vanilla/widget.d.ts +10 -0
- package/dist/vanilla/widget.css +217 -0
- package/dist/vanilla/widget.d.ts +10 -0
- package/dist/vanilla/widget.js +5084 -0
- package/package.json +40 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CreateAppointmentPayload, AppointmentListPayload, AppointmentListResponse, AvailableSlotsPayload, UpdateAppointmentPayload, AvailableSlot, RescheduleAppointmentPayload, CreateMeetingPayload, CreateMeetingResponse, EndMeetingPayload } from "./types";
|
|
2
|
+
export declare const createAppointment: (appointmentPayload: Partial<CreateAppointmentPayload>) => Promise<any>;
|
|
3
|
+
export declare const updateAppointment: (appointmentPayload: UpdateAppointmentPayload) => Promise<any>;
|
|
4
|
+
export declare const rescheduleAppointment: (appointmentPayload: RescheduleAppointmentPayload) => Promise<any>;
|
|
5
|
+
export declare const deleteAppointment: (payload: {
|
|
6
|
+
appointmentId: number;
|
|
7
|
+
workspaceId: number;
|
|
8
|
+
addressId: number;
|
|
9
|
+
}) => Promise<any>;
|
|
10
|
+
export declare const fetchAppointments: (payload: AppointmentListPayload) => Promise<AppointmentListResponse[]>;
|
|
11
|
+
export declare const fetchAvailableSlots: (payload: AvailableSlotsPayload) => Promise<AvailableSlot[]>;
|
|
12
|
+
export declare const createMeeting: (payload: CreateMeetingPayload) => Promise<CreateMeetingResponse>;
|
|
13
|
+
export declare const endMeeting: (payload: EndMeetingPayload) => Promise<any>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export declare enum PaymentMode {
|
|
2
|
+
CASH = "CASH",
|
|
3
|
+
CARD = "CARD",
|
|
4
|
+
UPI = "UPI"
|
|
5
|
+
}
|
|
6
|
+
export declare enum AppointmentType {
|
|
7
|
+
CONSULTATION = "CONSULTATION",
|
|
8
|
+
FOLLOW_UP = "FOLLOW_UP",
|
|
9
|
+
LAB_TEST = "LAB_TEST",
|
|
10
|
+
SURGERY = "SURGERY",
|
|
11
|
+
VIRTUAL = "VIRTUAL",
|
|
12
|
+
IN_PERSON = "IN_PERSON"
|
|
13
|
+
}
|
|
14
|
+
export declare enum AppointmentStatus {
|
|
15
|
+
SCHEDULED = "SCHEDULED",
|
|
16
|
+
CANCELLED = "CANCELLED",
|
|
17
|
+
COMPLETED = "COMPLETED",
|
|
18
|
+
NO_SHOW = "NO_SHOW"
|
|
19
|
+
}
|
|
20
|
+
export declare enum AppointmentMode {
|
|
21
|
+
ONLINE = "ONLINE",
|
|
22
|
+
OFFLINE = "OFFLINE"
|
|
23
|
+
}
|
|
24
|
+
export declare enum AppointmentAction {
|
|
25
|
+
EDIT = "EDIT",
|
|
26
|
+
RESCHEDULE = "RESCHEDULE",
|
|
27
|
+
CANCEL = "CANCEL"
|
|
28
|
+
}
|
|
29
|
+
export declare enum AppointmentSource {
|
|
30
|
+
MEDOS_WEBSITE = "MEDOS_WEBSITE",
|
|
31
|
+
WEBSITE = "WEBSITE",
|
|
32
|
+
ANDROID = "ANDROID",
|
|
33
|
+
IOS = "IOS",
|
|
34
|
+
MEDOS_APP_ANDROID = "MEDOS_APP_ANDROID",
|
|
35
|
+
MEDOS_APP_IOS = "MEDOS_APP_IOS"
|
|
36
|
+
}
|
|
37
|
+
export interface CreateAppointmentPayload {
|
|
38
|
+
workspaceId: number;
|
|
39
|
+
addressId: number;
|
|
40
|
+
doctorId: number;
|
|
41
|
+
patientId: number;
|
|
42
|
+
mode: AppointmentMode;
|
|
43
|
+
appointmentDate: string;
|
|
44
|
+
fromDateTimeTs: string;
|
|
45
|
+
toDateTimeTs: string;
|
|
46
|
+
consultationCharge: number;
|
|
47
|
+
appointmentNotes?: string;
|
|
48
|
+
paymentMode: PaymentMode;
|
|
49
|
+
type: AppointmentType;
|
|
50
|
+
patientCheckedIn?: boolean;
|
|
51
|
+
isNoShow?: boolean;
|
|
52
|
+
source: AppointmentSource;
|
|
53
|
+
attachments?: File[];
|
|
54
|
+
}
|
|
55
|
+
export interface UpdateAppointmentPayload {
|
|
56
|
+
id: number;
|
|
57
|
+
workspaceId: number;
|
|
58
|
+
addressId: number;
|
|
59
|
+
mode: AppointmentMode;
|
|
60
|
+
consultationCharge: number;
|
|
61
|
+
appointmentNotes?: string;
|
|
62
|
+
paymentMode: PaymentMode;
|
|
63
|
+
type: AppointmentType;
|
|
64
|
+
patientCheckedIn?: boolean;
|
|
65
|
+
isNoShow?: boolean;
|
|
66
|
+
source: AppointmentSource;
|
|
67
|
+
}
|
|
68
|
+
export interface RescheduleAppointmentPayload {
|
|
69
|
+
id: number;
|
|
70
|
+
workspaceId: number;
|
|
71
|
+
addressId: number;
|
|
72
|
+
doctorId: number;
|
|
73
|
+
appointmentDate: string;
|
|
74
|
+
fromDateTimeTs: string;
|
|
75
|
+
toDateTimeTs: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AppointmentListPayload {
|
|
78
|
+
workspaceId: number;
|
|
79
|
+
addressId: number;
|
|
80
|
+
doctorId?: number;
|
|
81
|
+
patientId?: number;
|
|
82
|
+
appointmentDate: string;
|
|
83
|
+
startDate: string;
|
|
84
|
+
endDate: string;
|
|
85
|
+
status: string;
|
|
86
|
+
}
|
|
87
|
+
export interface Appointment {
|
|
88
|
+
id: number;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
deleted: boolean;
|
|
91
|
+
createdAtEpoch: number;
|
|
92
|
+
workspaceId: number;
|
|
93
|
+
addressId: number;
|
|
94
|
+
doctorId: number;
|
|
95
|
+
patientId: number;
|
|
96
|
+
fromDateTimeTs: number;
|
|
97
|
+
toDateTimeTs: number;
|
|
98
|
+
appointmentDate: string;
|
|
99
|
+
status: AppointmentStatus;
|
|
100
|
+
appointmentNotes: string;
|
|
101
|
+
type: string;
|
|
102
|
+
durationInSeconds: number;
|
|
103
|
+
mode: AppointmentMode;
|
|
104
|
+
reminderSent: boolean;
|
|
105
|
+
paymentMode: string;
|
|
106
|
+
patientCheckedIn: boolean;
|
|
107
|
+
consultationCharge: number;
|
|
108
|
+
isNoShow: boolean;
|
|
109
|
+
source: AppointmentSource;
|
|
110
|
+
}
|
|
111
|
+
export interface AppointmentListResponse {
|
|
112
|
+
appointment: Appointment;
|
|
113
|
+
patient?: any;
|
|
114
|
+
}
|
|
115
|
+
export interface AvailableSlot {
|
|
116
|
+
appointmentDate: string;
|
|
117
|
+
fromDateTimeTs: string;
|
|
118
|
+
toDateTimeTs: string;
|
|
119
|
+
}
|
|
120
|
+
export interface AvailableSlotsPayload {
|
|
121
|
+
workspaceId: number;
|
|
122
|
+
addressId: number;
|
|
123
|
+
doctorId: number;
|
|
124
|
+
appointmentDate?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface CreateMeetingPayload {
|
|
127
|
+
hostId: number;
|
|
128
|
+
channelName: string;
|
|
129
|
+
appointmentId: number;
|
|
130
|
+
joinerId: number;
|
|
131
|
+
}
|
|
132
|
+
export interface CreateMeetingResponse {
|
|
133
|
+
meetingId: number;
|
|
134
|
+
hostToken: string;
|
|
135
|
+
appId: string;
|
|
136
|
+
channelName: string;
|
|
137
|
+
joinerTokens: {
|
|
138
|
+
userId: number;
|
|
139
|
+
token: string;
|
|
140
|
+
}[];
|
|
141
|
+
}
|
|
142
|
+
export interface EndMeetingPayload {
|
|
143
|
+
id: number;
|
|
144
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FetchWorkspaceAddressDoctorResponse, AppointmentConfig } from "./types";
|
|
2
|
+
export declare const createAppointmentConfig: (payload: AppointmentConfig) => Promise<AppointmentConfig>;
|
|
3
|
+
export declare const updateAppointmentConfig: ({ id, payload, }: {
|
|
4
|
+
id: string;
|
|
5
|
+
payload: Omit<AppointmentConfig, "userId" | "workspaceId" | "addressId">;
|
|
6
|
+
}) => Promise<AppointmentConfig>;
|
|
7
|
+
export declare const deleteAppointmentConfig: ({ id, }: {
|
|
8
|
+
id: number;
|
|
9
|
+
workspaceId?: number;
|
|
10
|
+
addressId?: number;
|
|
11
|
+
userId?: number;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
export declare const fetchWorkspaceAddressesDoctor: (workspaceId: string) => Promise<FetchWorkspaceAddressDoctorResponse>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export interface DoctorAddress {
|
|
2
|
+
id: number;
|
|
3
|
+
completeAddress: string;
|
|
4
|
+
phoneNumber: string;
|
|
5
|
+
doctorsCount: number;
|
|
6
|
+
totalConfiguredAppointments: number;
|
|
7
|
+
doctors: Doctor[];
|
|
8
|
+
}
|
|
9
|
+
export interface AppointmentFeeConfigurationDTO {
|
|
10
|
+
offlineConsultationFee: number;
|
|
11
|
+
onlineConsultationFee: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AppointmentTypeAndPermissionDTO {
|
|
15
|
+
allowOnline: boolean;
|
|
16
|
+
allowOffline: boolean;
|
|
17
|
+
allowCancellation: boolean;
|
|
18
|
+
allowRescheduling: boolean;
|
|
19
|
+
cancellationAllowedBeforeInHours: number;
|
|
20
|
+
}
|
|
21
|
+
export interface BasicAppointmentSettingDTO {
|
|
22
|
+
defaultDuration: number;
|
|
23
|
+
bufferTime: number;
|
|
24
|
+
bookingLimitPerDay: number;
|
|
25
|
+
maximumConsecutiveAppointment: number;
|
|
26
|
+
}
|
|
27
|
+
export interface AppointmentConsultationValidityAndFollowUpPolicyDTO {
|
|
28
|
+
enableConsultationValidity: boolean;
|
|
29
|
+
consultationValidityDays: number;
|
|
30
|
+
followUpConsultationFee: number;
|
|
31
|
+
maximumFollowUpVisits: number;
|
|
32
|
+
followUpFeeType: string;
|
|
33
|
+
followUpFeePercentage: number;
|
|
34
|
+
validityAppliesToSameComplaint: boolean;
|
|
35
|
+
validityResetOnNewComplaint: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface AppointmentWorkingHourSlot {
|
|
38
|
+
id?: number;
|
|
39
|
+
startTime: string;
|
|
40
|
+
endTime: string;
|
|
41
|
+
duration: number;
|
|
42
|
+
}
|
|
43
|
+
export interface AppointmentConfigWorkingHours {
|
|
44
|
+
id?: number;
|
|
45
|
+
dayOfWeek: string;
|
|
46
|
+
workingHours: AppointmentWorkingHourSlot[];
|
|
47
|
+
}
|
|
48
|
+
export interface SpecialDayConfig {
|
|
49
|
+
eventDayDate: string;
|
|
50
|
+
eventDayType: string;
|
|
51
|
+
eventDayName: string;
|
|
52
|
+
}
|
|
53
|
+
export interface AppointmentConfig {
|
|
54
|
+
id?: number;
|
|
55
|
+
workspaceId: number;
|
|
56
|
+
addressId: number;
|
|
57
|
+
userId: number;
|
|
58
|
+
status?: string;
|
|
59
|
+
appointmentConfigWorkingHours: AppointmentConfigWorkingHours[];
|
|
60
|
+
appointmentConsultationValidityAndFollowUpPolicyDTO: AppointmentConsultationValidityAndFollowUpPolicyDTO;
|
|
61
|
+
appointmentFeeConfigurationDTO: AppointmentFeeConfigurationDTO;
|
|
62
|
+
appointmentTypeAndPermissionDTO: AppointmentTypeAndPermissionDTO;
|
|
63
|
+
basicAppointmentSettingDTO: BasicAppointmentSettingDTO;
|
|
64
|
+
specialDayConfigs: SpecialDayConfig[];
|
|
65
|
+
}
|
|
66
|
+
export interface Doctor {
|
|
67
|
+
id: number;
|
|
68
|
+
email: string;
|
|
69
|
+
name: string;
|
|
70
|
+
specialization: string[];
|
|
71
|
+
phoneNumber: string;
|
|
72
|
+
profilePic: string | null;
|
|
73
|
+
appointmentConfig: AppointmentConfig | null;
|
|
74
|
+
}
|
|
75
|
+
export interface FetchWorkspaceAddressDoctorResponse {
|
|
76
|
+
totalAddresses: number;
|
|
77
|
+
totalConfiguredAppointments: number;
|
|
78
|
+
totalPartialConfiguredAppointments: number;
|
|
79
|
+
totalNotConfiguredAppointments: number;
|
|
80
|
+
addresses: DoctorAddress[];
|
|
81
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { AddressesResponse } from "../services/AppointmentService";
|
|
3
|
+
import { SendPhoneVerificationOtpPayload, VerifyPhoneVerificationOtpPayload } from "../services/PatientService";
|
|
4
|
+
interface MedosClientConfig {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
}
|
|
8
|
+
interface MedosClientSessionConfig {
|
|
9
|
+
sessionToken: string;
|
|
10
|
+
baseURL?: string;
|
|
11
|
+
}
|
|
12
|
+
declare class MedosClient {
|
|
13
|
+
private static instance;
|
|
14
|
+
private static token;
|
|
15
|
+
private static refreshHandler;
|
|
16
|
+
private static isRefreshing;
|
|
17
|
+
private static pendingRequests;
|
|
18
|
+
private static initPromise;
|
|
19
|
+
static init({ apiKey, baseURL, }: MedosClientConfig): Promise<void>;
|
|
20
|
+
static initWithSession({ sessionToken, baseURL, }: MedosClientSessionConfig): Promise<void>;
|
|
21
|
+
private static initializeAxiosInstance;
|
|
22
|
+
static fetchAllAddressesAndDoctors(): Promise<AddressesResponse>;
|
|
23
|
+
static fetchAppointments(workspaceId: number, addressId: number, doctorId: number, appointmentDate: string): Promise<any[]>;
|
|
24
|
+
static sendPhoneVerificationOtp(payload: SendPhoneVerificationOtpPayload): Promise<any>;
|
|
25
|
+
static verifyPhoneVerificationOtp(payload: VerifyPhoneVerificationOtpPayload): Promise<any>;
|
|
26
|
+
static get client(): AxiosInstance;
|
|
27
|
+
static ensureInitialized(): Promise<AxiosInstance>;
|
|
28
|
+
static isInitialized(): boolean;
|
|
29
|
+
private static setToken;
|
|
30
|
+
static setRefreshHandler(handler: () => Promise<string | null>): void;
|
|
31
|
+
}
|
|
32
|
+
export { MedosClient };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Slot } from "../services/AppointmentService";
|
|
3
|
+
export type AppointmentMode = "ONLINE" | "OFFLINE";
|
|
4
|
+
export type PaymentMode = "CASH" | "CARD" | "UPI";
|
|
5
|
+
type AppointmentModalProps = {
|
|
6
|
+
onlineFee?: number | null;
|
|
7
|
+
offlineFee?: number | null;
|
|
8
|
+
slots: Slot[];
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
onContinue: (mode: AppointmentMode, date: Date, slot: Slot, charge: string, paymentMode: PaymentMode) => void;
|
|
11
|
+
onDateChange?: (date: Date) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const AppointmentDateTimeModal: React.FC<AppointmentModalProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type ConfigurableCardProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
subtitle?: string;
|
|
5
|
+
content?: React.ReactNode;
|
|
6
|
+
ctaLabel?: string;
|
|
7
|
+
onCta?: () => void;
|
|
8
|
+
variant?: "filled" | "outline";
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const ConfigurableCard: React.FC<ConfigurableCardProps>;
|
|
12
|
+
export default ConfigurableCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ConfirmationCheck: React.FC;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ConsultationTypeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DateTimeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MapPinIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PaymentMethodIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UserIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const CONTAINER_STYLES: Record<string, React.CSSProperties>;
|
|
3
|
+
export declare const BUTTON_STYLES: Record<string, React.CSSProperties>;
|
|
4
|
+
export declare const PHONE_VERIFY_STYLES: Record<string, React.CSSProperties>;
|
|
5
|
+
export declare const PATIENT_DETAILS_STYLES: Record<string, React.CSSProperties>;
|
|
6
|
+
export declare const SUCCESS_STYLES: Record<string, React.CSSProperties>;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Doctor, Slot, AddressItem } from "../services/AppointmentService";
|
|
2
|
+
export type AppointmentCalenderProps = {
|
|
3
|
+
onError?: (err: Error) => void;
|
|
4
|
+
};
|
|
5
|
+
export type PhoneVerificationStepProps = {
|
|
6
|
+
state: AppointmentState;
|
|
7
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
8
|
+
onSendOtp: () => Promise<void>;
|
|
9
|
+
onVerifyOtp: () => Promise<void>;
|
|
10
|
+
onBack: () => void;
|
|
11
|
+
onContinue: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type PatientDetailsStepProps = {
|
|
14
|
+
state: AppointmentState;
|
|
15
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
16
|
+
onBack: () => void;
|
|
17
|
+
onSubmit: () => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export type SuccessStepProps = {
|
|
20
|
+
state: AppointmentState;
|
|
21
|
+
onReset: () => void;
|
|
22
|
+
};
|
|
23
|
+
export type PhoneInputSectionProps = {
|
|
24
|
+
countryCode: string;
|
|
25
|
+
patientPhone: string;
|
|
26
|
+
onCountryCodeChange: (code: string) => void;
|
|
27
|
+
onPhoneChange: (phone: string) => void;
|
|
28
|
+
};
|
|
29
|
+
export type OtpInputSectionProps = {
|
|
30
|
+
countryCode: string;
|
|
31
|
+
patientPhone: string;
|
|
32
|
+
otpCode: string;
|
|
33
|
+
otpVerified: boolean;
|
|
34
|
+
onOtpChange: (code: string) => void;
|
|
35
|
+
};
|
|
36
|
+
export type PatientInfoSectionProps = {
|
|
37
|
+
state: AppointmentState;
|
|
38
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
39
|
+
};
|
|
40
|
+
export type AddressInfoSectionProps = {
|
|
41
|
+
state: AppointmentState;
|
|
42
|
+
dispatch: React.Dispatch<AppointmentAction>;
|
|
43
|
+
};
|
|
44
|
+
export interface AppointmentState {
|
|
45
|
+
step: number;
|
|
46
|
+
loading: boolean;
|
|
47
|
+
error: string | null;
|
|
48
|
+
workspaceId: number | null;
|
|
49
|
+
addresses: AddressItem[];
|
|
50
|
+
addressDoctorsMap: Record<number, Doctor[]>;
|
|
51
|
+
selectedAddress: number | null;
|
|
52
|
+
selectedDoctor: number | null;
|
|
53
|
+
selectedDate: Date;
|
|
54
|
+
slots: Slot[];
|
|
55
|
+
selectedSlot: Slot | null;
|
|
56
|
+
consultationMode: "ONLINE" | "OFFLINE";
|
|
57
|
+
consultationCharge: string;
|
|
58
|
+
patientName: string;
|
|
59
|
+
patientAge: string;
|
|
60
|
+
patientEmail: string;
|
|
61
|
+
patientGender: string;
|
|
62
|
+
bloodGroup: string;
|
|
63
|
+
patientAddress: string;
|
|
64
|
+
patientCity: string;
|
|
65
|
+
patientState: string;
|
|
66
|
+
patientCountry: string;
|
|
67
|
+
patientZipcode: string;
|
|
68
|
+
patientLandmark: string;
|
|
69
|
+
countryCode: string;
|
|
70
|
+
patientPhone: string;
|
|
71
|
+
otpCode: string;
|
|
72
|
+
otpSent: boolean;
|
|
73
|
+
otpVerified: boolean;
|
|
74
|
+
otpSending: boolean;
|
|
75
|
+
otpVerifying: boolean;
|
|
76
|
+
}
|
|
77
|
+
export type AppointmentAction = {
|
|
78
|
+
type: "SET_STEP";
|
|
79
|
+
payload: number;
|
|
80
|
+
} | {
|
|
81
|
+
type: "SET_LOADING";
|
|
82
|
+
payload: boolean;
|
|
83
|
+
} | {
|
|
84
|
+
type: "SET_ERROR";
|
|
85
|
+
payload: string | null;
|
|
86
|
+
} | {
|
|
87
|
+
type: "SET_WORKSPACE";
|
|
88
|
+
payload: {
|
|
89
|
+
id: number;
|
|
90
|
+
addresses: AddressItem[];
|
|
91
|
+
};
|
|
92
|
+
} | {
|
|
93
|
+
type: "SET_SELECTED_ADDRESS";
|
|
94
|
+
payload: number | null;
|
|
95
|
+
} | {
|
|
96
|
+
type: "SET_SELECTED_DOCTOR";
|
|
97
|
+
payload: number | null;
|
|
98
|
+
} | {
|
|
99
|
+
type: "SET_SELECTED_DATE";
|
|
100
|
+
payload: Date;
|
|
101
|
+
} | {
|
|
102
|
+
type: "SET_SLOTS";
|
|
103
|
+
payload: Slot[];
|
|
104
|
+
} | {
|
|
105
|
+
type: "SET_SELECTED_SLOT";
|
|
106
|
+
payload: Slot | null;
|
|
107
|
+
} | {
|
|
108
|
+
type: "SET_CONSULTATION_MODE";
|
|
109
|
+
payload: "ONLINE" | "OFFLINE";
|
|
110
|
+
} | {
|
|
111
|
+
type: "SET_CONSULTATION_CHARGE";
|
|
112
|
+
payload: string;
|
|
113
|
+
} | {
|
|
114
|
+
type: "SET_PATIENT_NAME";
|
|
115
|
+
payload: string;
|
|
116
|
+
} | {
|
|
117
|
+
type: "SET_PATIENT_AGE";
|
|
118
|
+
payload: string;
|
|
119
|
+
} | {
|
|
120
|
+
type: "SET_PATIENT_EMAIL";
|
|
121
|
+
payload: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "SET_PATIENT_GENDER";
|
|
124
|
+
payload: string;
|
|
125
|
+
} | {
|
|
126
|
+
type: "SET_BLOOD_GROUP";
|
|
127
|
+
payload: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: "SET_PATIENT_ADDRESS";
|
|
130
|
+
payload: string;
|
|
131
|
+
} | {
|
|
132
|
+
type: "SET_PATIENT_CITY";
|
|
133
|
+
payload: string;
|
|
134
|
+
} | {
|
|
135
|
+
type: "SET_PATIENT_STATE";
|
|
136
|
+
payload: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "SET_PATIENT_COUNTRY";
|
|
139
|
+
payload: string;
|
|
140
|
+
} | {
|
|
141
|
+
type: "SET_PATIENT_ZIPCODE";
|
|
142
|
+
payload: string;
|
|
143
|
+
} | {
|
|
144
|
+
type: "SET_PATIENT_LANDMARK";
|
|
145
|
+
payload: string;
|
|
146
|
+
} | {
|
|
147
|
+
type: "SET_COUNTRY_CODE";
|
|
148
|
+
payload: string;
|
|
149
|
+
} | {
|
|
150
|
+
type: "SET_PATIENT_PHONE";
|
|
151
|
+
payload: string;
|
|
152
|
+
} | {
|
|
153
|
+
type: "SET_OTP_CODE";
|
|
154
|
+
payload: string;
|
|
155
|
+
} | {
|
|
156
|
+
type: "SET_OTP_SENT";
|
|
157
|
+
payload: boolean;
|
|
158
|
+
} | {
|
|
159
|
+
type: "SET_OTP_VERIFIED";
|
|
160
|
+
payload: boolean;
|
|
161
|
+
} | {
|
|
162
|
+
type: "SET_OTP_SENDING";
|
|
163
|
+
payload: boolean;
|
|
164
|
+
} | {
|
|
165
|
+
type: "SET_OTP_VERIFYING";
|
|
166
|
+
payload: boolean;
|
|
167
|
+
} | {
|
|
168
|
+
type: "RESET_FORM";
|
|
169
|
+
};
|
|
170
|
+
export declare const COUNTRY_CODES: {
|
|
171
|
+
code: string;
|
|
172
|
+
label: string;
|
|
173
|
+
}[];
|
|
174
|
+
export declare const GENDER_OPTIONS: {
|
|
175
|
+
value: string;
|
|
176
|
+
label: string;
|
|
177
|
+
}[];
|
|
178
|
+
export declare const BLOOD_GROUP_OPTIONS: {
|
|
179
|
+
value: string;
|
|
180
|
+
label: string;
|
|
181
|
+
}[];
|
|
182
|
+
export declare const INITIAL_STATE: AppointmentState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
6
|
+
export interface SelectOptionProps extends React.OptionHTMLAttributes<HTMLOptionElement> {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const SelectOption: React.ForwardRefExoticComponent<SelectOptionProps & React.RefAttributes<HTMLOptionElement>>;
|
|
10
|
+
export { Select, SelectOption };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface SelectProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
value?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SelectValueProps {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
}
|
|
17
|
+
interface SelectContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface SelectItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
value: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface BaseComponentProps {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const Select: React.FC<SelectProps>;
|
|
32
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
declare const SelectValue: React.FC<SelectValueProps>;
|
|
34
|
+
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
declare const SelectGroup: React.FC<BaseComponentProps>;
|
|
37
|
+
declare const SelectLabel: React.FC<BaseComponentProps>;
|
|
38
|
+
declare const SelectSeparator: React.FC<{
|
|
39
|
+
className?: string;
|
|
40
|
+
}>;
|
|
41
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import type { TemplateId } from "../core";
|
|
3
|
+
interface TemplateContextType {
|
|
4
|
+
templateId: TemplateId;
|
|
5
|
+
}
|
|
6
|
+
export interface TemplateProviderProps {
|
|
7
|
+
templateId: TemplateId;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const TemplateProvider: React.FC<TemplateProviderProps>;
|
|
11
|
+
export declare const useTemplate: () => TemplateContextType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { MedosClient } from "../client/MedosClient";
|
|
2
|
+
export * from "../appointments/provider";
|
|
3
|
+
export * from "../appointments/types";
|
|
4
|
+
export * from "../appointment-calendar/provider";
|
|
5
|
+
export * from "../appointment-calendar/types";
|
|
6
|
+
export { PatientService, SendPhoneVerificationOtpPayload, VerifyPhoneVerificationOtpPayload, } from "../services/PatientService";
|
|
7
|
+
export { AppointmentService, type BookAppointmentPayload, type PatientPayload, type PatientAddressPayload, type AddressesResponse, type AddressItem, } from "../services/AppointmentService";
|
|
8
|
+
export { AuthService } from "../services/AuthService";
|