medos-sdk 1.1.10 → 1.1.11

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 (97) hide show
  1. package/dist/client/MedosClient.d.ts +1 -0
  2. package/dist/client/MedosClient.js +7 -0
  3. package/dist/components/AppointmentCalender.js +19 -22
  4. package/dist/components/AppointmentConfirmationStep.d.ts +1 -0
  5. package/dist/components/AppointmentConfirmationStep.js +34 -42
  6. package/dist/components/AppointmentDateTimeModal.d.ts +1 -0
  7. package/dist/components/AppointmentDateTimeModal.js +201 -168
  8. package/dist/components/AppointmentSummaryStep.d.ts +12 -0
  9. package/dist/components/AppointmentSummaryStep.js +168 -0
  10. package/dist/components/BookingOptionStep.d.ts +14 -0
  11. package/dist/components/BookingOptionStep.js +346 -0
  12. package/dist/components/ContactInformationStep.js +10 -4
  13. package/dist/components/ContactPreferenceStep.js +10 -1
  14. package/dist/components/DoctorSelectModal.js +105 -59
  15. package/dist/components/EnquiryForm.js +81 -69
  16. package/dist/components/Icons/CloseIcon.d.ts +9 -0
  17. package/dist/components/Icons/CloseIcon.js +5 -0
  18. package/dist/components/InquiryDetailsStep.js +5 -1
  19. package/dist/components/PatientDetailsStep.js +17 -12
  20. package/dist/components/PatientSelectionStep.d.ts +12 -0
  21. package/dist/components/PatientSelectionStep.js +254 -0
  22. package/dist/components/PhoneVerificationStep.js +1 -1
  23. package/dist/components/SuccessStep.js +1 -1
  24. package/dist/components/appointment-booking/AppointmentCalender.js +200 -60
  25. package/dist/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
  26. package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +110 -25
  27. package/dist/components/appointment-booking/hooks/useAppointmentState.js +32 -0
  28. package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +0 -1
  29. package/dist/components/appointment-booking/types.d.ts +163 -0
  30. package/dist/components/appointment-booking/types.js +16 -0
  31. package/dist/components/appointment-modal-styles.d.ts +259 -0
  32. package/dist/components/appointment-modal-styles.js +395 -0
  33. package/dist/components/constant.d.ts +2 -0
  34. package/dist/components/constant.js +15 -0
  35. package/dist/components/custom-calendar.js +20 -11
  36. package/dist/components/styles.js +93 -52
  37. package/dist/components/theme-styles.d.ts +5 -4
  38. package/dist/components/theme-styles.js +221 -125
  39. package/dist/components/types.d.ts +3 -1
  40. package/dist/components/types.js +15 -0
  41. package/dist/components/utils.d.ts +3 -0
  42. package/dist/components/utils.js +59 -0
  43. package/dist/components/validation.d.ts +2 -0
  44. package/dist/components/validation.js +41 -0
  45. package/dist/core/theme/index.d.ts +1 -0
  46. package/dist/core/theme/index.js +1 -0
  47. package/dist/core/theme/responsive.d.ts +15 -0
  48. package/dist/core/theme/responsive.js +113 -0
  49. package/dist/core/theme/themes.js +16 -4
  50. package/dist/core/theme/types.d.ts +8 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +1 -0
  53. package/dist/react/ThemeProvider.d.ts +2 -1
  54. package/dist/react/ThemeProvider.js +49 -10
  55. package/dist/services/AppointmentService.d.ts +80 -2
  56. package/dist/services/AppointmentService.js +114 -5
  57. package/dist/services/WorkspaceService.d.ts +58 -3
  58. package/dist/services/WorkspaceService.js +10 -1
  59. package/dist/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  60. package/dist/vanilla/AppointmentCalendarWidget.js +820 -377
  61. package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
  62. package/dist/vanilla/EnquiryFormWidget.js +25 -43
  63. package/dist/vanilla/client/MedosClient.d.ts +1 -0
  64. package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +1 -0
  65. package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +1 -0
  66. package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
  67. package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
  68. package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
  69. package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
  70. package/dist/vanilla/components/VanillaCalendar.js +33 -18
  71. package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
  72. package/dist/vanilla/components/VanillaIcons.js +92 -0
  73. package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
  74. package/dist/vanilla/components/VanillaSelect.js +93 -5
  75. package/dist/vanilla/components/appointment-booking/hooks/useAppointmentFlow.d.ts +0 -1
  76. package/dist/vanilla/components/appointment-booking/types.d.ts +163 -0
  77. package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
  78. package/dist/vanilla/components/constant.d.ts +2 -0
  79. package/dist/vanilla/components/theme-styles.d.ts +5 -4
  80. package/dist/vanilla/components/types.d.ts +3 -1
  81. package/dist/vanilla/components/utils.d.ts +3 -0
  82. package/dist/vanilla/components/validation.d.ts +2 -0
  83. package/dist/vanilla/core/theme/index.d.ts +1 -0
  84. package/dist/vanilla/core/theme/responsive.d.ts +15 -0
  85. package/dist/vanilla/core/theme/types.d.ts +8 -0
  86. package/dist/vanilla/enquiry-widget.js +373 -52
  87. package/dist/vanilla/index.d.ts +2 -0
  88. package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
  89. package/dist/vanilla/services/AppointmentService.d.ts +80 -2
  90. package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
  91. package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +9 -7
  92. package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
  93. package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
  94. package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
  95. package/dist/vanilla/widget.css +833 -207
  96. package/dist/vanilla/widget.js +6444 -5676
  97. package/package.json +1 -1
@@ -11,6 +11,7 @@ export type Slot = {
11
11
  [key: string]: any;
12
12
  };
13
13
  type PatientPayload = {
14
+ id?: number;
14
15
  firstName: string;
15
16
  lastName: string;
16
17
  email?: string;
@@ -18,6 +19,8 @@ type PatientPayload = {
18
19
  phoneNumber: string;
19
20
  age?: number;
20
21
  gender?: "MALE" | "FEMALE" | "OTHER";
22
+ dob?: string;
23
+ bloodGroup?: string;
21
24
  };
22
25
  type PatientAddressPayload = {
23
26
  addressLine1: string;
@@ -26,6 +29,11 @@ type PatientAddressPayload = {
26
29
  country: string;
27
30
  zipcode: string;
28
31
  landmark?: string;
32
+ addressLine2?: string;
33
+ completeAddress?: string;
34
+ countryCode?: string;
35
+ phoneNumber?: string;
36
+ patientId?: number;
29
37
  };
30
38
  type BookAppointmentPayload = {
31
39
  workspaceId?: string | number;
@@ -35,13 +43,79 @@ type BookAppointmentPayload = {
35
43
  appointmentDate: string;
36
44
  fromDateTimeTs: string;
37
45
  toDateTimeTs: string;
38
- consultationCharge?: string;
46
+ consultationCharge?: string | number;
39
47
  type?: "CONSULTATION" | string;
40
48
  source?: string;
49
+ bookingType?: "PACKAGE_PURCHASE" | "ONE_TIME_APPOINTMENT" | "USE_ACTIVE_PACKAGE";
50
+ paymentMode?: "CASH" | "CARD" | string;
51
+ packageConfigId?: number;
52
+ patientPackageId?: number;
53
+ packageAmount?: number;
41
54
  patientPayload: PatientPayload;
42
55
  patientAddress: PatientAddressPayload;
43
56
  attachments?: File[];
44
57
  };
58
+ export type UnifiedBookAppointmentPayload = {
59
+ workspaceId: number;
60
+ workspaceAddressId: number;
61
+ doctorId: number;
62
+ mode: "ONLINE" | "OFFLINE";
63
+ appointmentDate: string;
64
+ fromDateTimeTs: string;
65
+ toDateTimeTs: string;
66
+ bookingType: "PACKAGE_PURCHASE" | "ONE_TIME_APPOINTMENT" | "USE_ACTIVE_PACKAGE";
67
+ consultationCharge: number;
68
+ packageConfigId?: number;
69
+ patientPackageId?: number;
70
+ packageAmount?: number;
71
+ paymentMode: "CASH" | "CARD" | string;
72
+ type: "CONSULTATION" | string;
73
+ source: string;
74
+ patientPayload: {
75
+ id?: number;
76
+ firstName: string;
77
+ lastName: string;
78
+ email: string;
79
+ countryCode: string;
80
+ phoneNumber: string;
81
+ dob: string;
82
+ age: number;
83
+ gender: "MALE" | "FEMALE" | "OTHER";
84
+ bloodGroup: string;
85
+ };
86
+ patientAddress: {
87
+ completeAddress: string;
88
+ addressLine1: string;
89
+ addressLine2?: string;
90
+ city: string;
91
+ state: string;
92
+ country: string;
93
+ zipcode: string;
94
+ landmark?: string;
95
+ countryCode: string;
96
+ phoneNumber: string;
97
+ patientId: number;
98
+ };
99
+ };
100
+ export type AppointmentResponse = {
101
+ id: number;
102
+ patientName: string;
103
+ patientEmail: string;
104
+ patientPhone: string;
105
+ doctorId: number;
106
+ addressId: number;
107
+ appointmentDate: string;
108
+ startTime: string;
109
+ endTime: string;
110
+ status: string;
111
+ consultationCharge: number;
112
+ paymentMode: string;
113
+ type: string;
114
+ mode: string;
115
+ notes?: string;
116
+ createdAt: string;
117
+ [key: string]: any;
118
+ };
45
119
  type AppointmentPayload = {
46
120
  workspaceId?: string | number;
47
121
  workspaceAddressId: string | number;
@@ -78,8 +152,12 @@ type AddressesResponse = {
78
152
  addresses: AddressItem[];
79
153
  };
80
154
  declare const AppointmentService: {
155
+ arePackagesConfigured(): Promise<boolean>;
81
156
  getAddresses(): Promise<AddressesResponse>;
82
157
  fetchSlots(workspaceId: number, addressId: number, doctorId: number, appointmentDate: string): Promise<Slot[]>;
83
- createAppointment(payload: BookAppointmentPayload): Promise<any>;
158
+ transformToUnifiedPayload(payload: BookAppointmentPayload): UnifiedBookAppointmentPayload;
159
+ createLegacyAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
160
+ createAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
161
+ createUnifiedAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
84
162
  };
85
163
  export { AppointmentService, AppointmentPayload, BookAppointmentPayload, PatientPayload, PatientAddressPayload, AddressesResponse, AddressItem, };
@@ -1,9 +1,64 @@
1
- interface WorkspaceResponse {
1
+ import { ThemeName } from "../core/theme/themes";
2
+ interface Address {
3
+ id: number;
4
+ createdAt: string;
5
+ deleted: boolean;
6
+ createdAtEpoch: number;
7
+ completeAddress: string;
8
+ addressLine1: string;
9
+ addressLine2: string;
10
+ city: string;
11
+ state: string;
12
+ country: string;
13
+ zipcode: string;
14
+ landmark: string;
15
+ phoneNumber: string;
16
+ latitude: number;
17
+ longitude: number;
18
+ userId: number;
19
+ }
20
+ interface ConsultationType {
21
+ fee: number;
22
+ currency: string;
23
+ type: string;
24
+ }
25
+ interface User {
2
26
  id: number;
3
- name?: string;
27
+ createdAt: string;
28
+ lastUpdatedAt: string;
29
+ deleted: boolean;
30
+ createdAtEpoch: number;
31
+ lastUpdatedAtEpoch: number;
32
+ firstName: string;
33
+ lastName: string;
34
+ email: string;
35
+ gender: string;
36
+ countryCode: string;
37
+ phoneNumber: string;
38
+ platform: string;
39
+ isKycCompleted: boolean;
40
+ }
41
+ interface Doctor {
42
+ consultationTypes: ConsultationType[];
43
+ user: User;
44
+ }
45
+ interface AddressDoctor {
46
+ address: Address;
47
+ doctors: Doctor[];
48
+ doctorCount: number;
49
+ }
50
+ interface WorkspaceResponse {
51
+ totalDoctors: number;
52
+ totalAddresses: number;
53
+ addressDoctors: AddressDoctor[];
54
+ workspaceId: number;
55
+ theme?: ThemeName;
56
+ arePackagesConfigured?: boolean;
4
57
  [key: string]: any;
5
58
  }
6
59
  declare const WorkspaceService: {
7
60
  fetchWorkspace(): Promise<WorkspaceResponse>;
61
+ fetchTheme(): Promise<ThemeName | undefined>;
8
62
  };
9
- export { WorkspaceService, WorkspaceResponse };
63
+ export { WorkspaceService };
64
+ export type { WorkspaceResponse, Address, ConsultationType, User, Doctor, AddressDoctor, };
@@ -35,17 +35,19 @@ declare class AppointmentCalendarWidget {
35
35
  private render;
36
36
  private initializeCustomComponents;
37
37
  private renderStep;
38
- private renderStep0;
39
- private renderStep1;
40
- private renderStep2;
41
- private renderStep3;
42
- private renderStep4;
43
- private renderSuccessIcon;
38
+ private renderPhoneVerificationStep;
39
+ private renderBookingOptionStep;
40
+ private renderPackageExplorerStep;
41
+ private renderLocationDoctorStep;
42
+ private renderNewAppointmentStep;
43
+ private renderPatientSelectionStep;
44
+ private renderAppointmentSummaryStep;
45
+ private renderSuccessStep;
44
46
  private formatDate;
45
47
  private formatTime;
46
48
  private calculateDuration;
47
- private renderStep5;
48
49
  private attachEventListeners;
50
+ private getPlaceholderPatients;
49
51
  private escapeHtml;
50
52
  destroy(): void;
51
53
  }
@@ -13,6 +13,7 @@ declare class EnquiryFormWidget {
13
13
  private mounted;
14
14
  private state;
15
15
  private countryCodeSelect;
16
+ private contactMethodSelect;
16
17
  constructor(container: HTMLElement | string, options: EnquiryFormWidgetOptions);
17
18
  private init;
18
19
  private validateContactStep;
@@ -12,6 +12,11 @@ export declare const VanillaIcons: {
12
12
  phone: (size?: number) => string;
13
13
  mail: (size?: number) => string;
14
14
  clock: (size?: number) => string;
15
+ calendar: (size?: number) => string;
16
+ giftBox: (size?: number) => string;
17
+ arrowLeft: (size?: number) => string;
18
+ users: (size?: number) => string;
19
+ plus: (size?: number) => string;
15
20
  medosLogo: (width?: number, height?: number) => string;
16
21
  };
17
22
  export default VanillaIcons;
@@ -33,6 +33,8 @@ export declare class VanillaSelect {
33
33
  private attachPortalEvents;
34
34
  private detachPortalEvents;
35
35
  private focusNextItem;
36
+ private focusFirstItem;
37
+ private focusLastItem;
36
38
  private selectValue;
37
39
  setValue(value: string): void;
38
40
  getValue(): string;
@@ -42,5 +44,6 @@ export declare class VanillaSelect {
42
44
  destroy(): void;
43
45
  private escapeHtml;
44
46
  }
47
+ export declare function createContactMethodSelect(container: HTMLElement | string, currentValue?: "PHONE" | "EMAIL" | "BOTH", onValueChange?: (value: "PHONE" | "EMAIL" | "BOTH") => void): VanillaSelect;
45
48
  export declare function upgradeNativeSelect(selectElement: HTMLSelectElement, config?: VanillaSelectOptions): VanillaSelect;
46
49
  export default VanillaSelect;