@integraciones_doc24/sdk 1.16.40 → 1.16.42

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 (50) hide show
  1. package/README.md +21 -0
  2. package/lib/baseSdk/diagnostica.d.ts +54 -54
  3. package/lib/baseSdk/diagnostica.js +82 -82
  4. package/lib/baseSdk/external.d.ts +177 -177
  5. package/lib/baseSdk/external.js +96 -96
  6. package/lib/baseSdk/index.d.ts +2 -2
  7. package/lib/baseSdk/index.js +80 -80
  8. package/lib/baseSdk/integrationError.d.ts +16 -16
  9. package/lib/baseSdk/integrationError.js +33 -33
  10. package/lib/baseSdk/user.d.ts +115 -115
  11. package/lib/baseSdk/user.js +136 -136
  12. package/lib/index.d.ts +417 -416
  13. package/lib/index.js +24 -22
  14. package/lib/request/index.d.ts +4 -4
  15. package/lib/request/index.js +32 -32
  16. package/lib/request/token.d.ts +2 -2
  17. package/lib/request/token.js +34 -34
  18. package/lib/request/validation.d.ts +10 -10
  19. package/lib/request/validation.js +28 -28
  20. package/lib/schemas.d.ts +2930 -2813
  21. package/lib/schemas.js +640 -601
  22. package/lib/types.d.ts +183 -178
  23. package/lib/types.js +2 -2
  24. package/lib/userSdk/binah.d.ts +21 -21
  25. package/lib/userSdk/binah.js +20 -20
  26. package/lib/userSdk/chat.d.ts +57 -57
  27. package/lib/userSdk/chat.js +98 -98
  28. package/lib/userSdk/eligibility.d.ts +29 -0
  29. package/lib/userSdk/eligibility.js +81 -0
  30. package/lib/userSdk/external.d.ts +34 -34
  31. package/lib/userSdk/external.js +72 -72
  32. package/lib/userSdk/index.d.ts +2 -2
  33. package/lib/userSdk/index.js +36 -33
  34. package/lib/userSdk/patients.d.ts +62 -62
  35. package/lib/userSdk/patients.js +93 -93
  36. package/lib/userSdk/schedule.d.ts +59 -59
  37. package/lib/userSdk/schedule.js +90 -90
  38. package/lib/userSdk/specialties.d.ts +19 -19
  39. package/lib/userSdk/specialties.js +48 -48
  40. package/lib/userSdk/videoVisit.d.ts +229 -225
  41. package/lib/userSdk/videoVisit.js +288 -283
  42. package/lib/utils.d.ts +4 -4
  43. package/lib/utils.js +68 -68
  44. package/lib/webhook/index.d.ts +2 -2
  45. package/lib/webhook/index.js +67 -67
  46. package/lib/webhook/responses.d.ts +35 -35
  47. package/lib/webhook/responses.js +42 -42
  48. package/lib/webhook/token.d.ts +2 -2
  49. package/lib/webhook/token.js +23 -23
  50. package/package.json +37 -37
package/lib/types.d.ts CHANGED
@@ -1,178 +1,183 @@
1
- import { TypeOf } from 'zod';
2
- import { doc24Schemas } from './schemas';
3
- export declare namespace Doc24 {
4
- type SdkCredentials = TypeOf<typeof doc24Schemas.sdkCredentials>;
5
- type SdkParams = TypeOf<typeof doc24Schemas.sdkParams>;
6
- type User = TypeOf<typeof doc24Schemas.user>;
7
- type Patient = TypeOf<typeof doc24Schemas.patient>;
8
- type PatientSearch = TypeOf<typeof doc24Schemas.patientSearch>;
9
- type Specialty = TypeOf<typeof doc24Schemas.specialty>;
10
- type ScheduleAvailabilityFilter = TypeOf<typeof doc24Schemas.scheduleAvailabilityFilter>;
11
- type AvailableAppointment = TypeOf<typeof doc24Schemas.availableAppointment>;
12
- type AvailableScheduleClinics = TypeOf<typeof doc24Schemas.availableScheduleClinics>;
13
- type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
14
- type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
15
- type AttachedFile = TypeOf<typeof doc24Schemas.attachedFile>;
16
- type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
17
- type HistoricalVideoVisit = TypeOf<typeof doc24Schemas.historicalVideoVisit>;
18
- type VideoVisitDetails = TypeOf<typeof doc24Schemas.videoVisitDetails>;
19
- type CompleteVideoVisitDetails = TypeOf<typeof doc24Schemas.completeVideoVisitDetails>;
20
- type ActiveVideoVisitData = TypeOf<typeof doc24Schemas.activeVideoVisitData>;
21
- type SpecialtyMode = TypeOf<typeof doc24Schemas.specialtyMode>;
22
- type Professional = TypeOf<typeof doc24Schemas.professional>;
23
- type ProfessionalsListItem = TypeOf<typeof doc24Schemas.professionalsListItem>;
24
- type Appointment = TypeOf<typeof doc24Schemas.appointment>;
25
- type ChatroomAvailabilityFilter = TypeOf<typeof doc24Schemas.chatroomAvailabilityFilter>;
26
- type AvailableChatroom = TypeOf<typeof doc24Schemas.availableChatroom>;
27
- type ChatParameters = TypeOf<typeof doc24Schemas.chatParameters>;
28
- type ChatDetails = TypeOf<typeof doc24Schemas.chatDetails>;
29
- type ChatPost = TypeOf<typeof doc24Schemas.chatPost>;
30
- type EnrollmentParams = TypeOf<typeof doc24Schemas.enrollmentParams>;
31
- type CoverageInfo = TypeOf<typeof doc24Schemas.coverageInfo>;
32
- type DiagnosticaPatientFilter = TypeOf<typeof doc24Schemas.diagnosticaPatientFilter>;
33
- type DiagnosticaUser = TypeOf<typeof doc24Schemas.diagnosticaUser>;
34
- type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
35
- type DiagnosticaHistoryAppointment = TypeOf<typeof doc24Schemas.diagnosticaHistoryAppointment>;
36
- type DiagnosticaDeepLinkResponse = TypeOf<typeof doc24Schemas.diagnosticaDeepLinkResponse>;
37
- type SendVerificationCodeParams = TypeOf<typeof doc24Schemas.sendVerificationCodeParams>;
38
- type DeclareUserParams = TypeOf<typeof doc24Schemas.declareUserParams>;
39
- type DeclareUserResponse = TypeOf<typeof doc24Schemas.declareUserResponse>;
40
- type DeclarePatientParams = TypeOf<typeof doc24Schemas.declarePatientParams>;
41
- type DeclarePatientResponse = TypeOf<typeof doc24Schemas.declarePatientResponse>;
42
- type VerificationCodeParams = TypeOf<typeof doc24Schemas.verificationCodeParams>;
43
- type ExternalLoginParams = TypeOf<typeof doc24Schemas.externalLoginParams>;
44
- type ExternalLoginResponse = TypeOf<typeof doc24Schemas.externalLoginResponse>;
45
- type PreExternalEnrollmentParams = TypeOf<typeof doc24Schemas.preExternalEnrollmentParams>;
46
- type ExternalEnrollmentParams = TypeOf<typeof doc24Schemas.externalEnrollmentParams>;
47
- type SendExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.sendExternalVerificationCodeParams>;
48
- type VerifyExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.verifyExternalVerificationCodeParams>;
49
- type ExternalResetPasswordParams = TypeOf<typeof doc24Schemas.externalResetPasswordParams>;
50
- type ExternalPatient = TypeOf<typeof doc24Schemas.externalPatient>;
51
- type ExternalAppointment = TypeOf<typeof doc24Schemas.externalAppointment>;
52
- type BinahWellnessGetLinkParams = TypeOf<typeof doc24Schemas.binahWellnessGetLinkParams>;
53
- type BinahWellnessResponse = TypeOf<typeof doc24Schemas.binahWellnessResponse>;
54
- type ProfessionalsBySpecialtyFilter = TypeOf<typeof doc24Schemas.professionalsBySpecialtyFilter>;
55
- type ReportIntegrationErrorParams = TypeOf<typeof doc24Schemas.reportIntegrationErrorParams>;
56
- type ReportIntegrationErrorResponse = TypeOf<typeof doc24Schemas.reportIntegrationErrorResponse>;
57
- type UploadFileConsultationParams = TypeOf<typeof doc24Schemas.uploadFileConsultationParams>;
58
- type UploadFileConsultationResponse = TypeOf<typeof doc24Schemas.uploadFileConsultationResponse>;
59
- type DeleteFileConsultationParams = TypeOf<typeof doc24Schemas.deleteFileConsultationParams>;
60
- type HealthQuizParams = TypeOf<typeof doc24Schemas.healthQuizParams>;
61
- type BaseSdk = {
62
- declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
63
- getUserId: (user: User) => Promise<number>;
64
- getUserInstance: (user: User | number) => Promise<UserSdk>;
65
- getProfessional: (professionalId: number) => Promise<Professional>;
66
- getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
67
- enroll: (params: EnrollmentParams) => Promise<void>;
68
- getCoverageInfo: (identificationValue: string) => Promise<CoverageInfo>;
69
- sendVerificationCode: (params: SendVerificationCodeParams) => Promise<void>;
70
- getDiagnosticaHistory: (patient: DiagnosticaPatientFilter, from: Date, to: Date) => Promise<DiagnosticaHistoryAppointment[]>;
71
- getDiagnosticaDeepLink: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<DiagnosticaDeepLinkResponse>;
72
- getDiagnosticaAccess: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<void>;
73
- externalLogin: (params: ExternalLoginParams) => Promise<ExternalLoginResponse>;
74
- preExternalEnrollment: (params: PreExternalEnrollmentParams) => Promise<void>;
75
- externalEnrollment: (params: ExternalEnrollmentParams) => Promise<ExternalLoginResponse>;
76
- sendExternalVerificationCode: (params: SendExternalVerificationCodeParams) => Promise<void>;
77
- verifyExternalVerificationCode: (params: VerifyExternalVerificationCodeParams) => Promise<any>;
78
- externalResetPassword: (params: ExternalResetPasswordParams) => Promise<any>;
79
- reportIntegrationError: (params: ReportIntegrationErrorParams) => Promise<ReportIntegrationErrorResponse>;
80
- };
81
- type UserSdk = {
82
- declarePatient: (params: DeclarePatientParams) => Promise<DeclarePatientResponse>;
83
- getPatientId: (patient: PatientSearch) => Promise<number>;
84
- deletePatient: (patientId: number) => Promise<void>;
85
- getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
86
- getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<ProfessionalsListItem[]>;
87
- getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
88
- getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
89
- getAppointment: (appointmentId: number) => Promise<Appointment>;
90
- getAppointmentByVcToken: (vcToken: string) => Promise<Appointment>;
91
- scheduleVideoVisit: (params: ScheduleParameters) => Promise<string>;
92
- cancelVideoVisit: (vcToken: string) => Promise<void>;
93
- getVideoVisit: (vcToken: string, patientId: number) => Promise<VideoVisit>;
94
- getVideoVisitDetails: (vcId: number) => Promise<VideoVisitDetails>;
95
- getCompleteVideoVisitDetails: (vcToken: string) => Promise<CompleteVideoVisitDetails>;
96
- getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
97
- getPatientVideoVisitHistory: (patientId: number) => Promise<HistoricalVideoVisit[]>;
98
- getActiveVideoVisits: () => Promise<ActiveVideoVisitData[]>;
99
- getAvailableChatrooms: (patientId: number, specialtyId: number, filter: ChatroomAvailabilityFilter) => Promise<AvailableChatroom[]>;
100
- createNewChat: (chatParameters: ChatParameters) => Promise<number>;
101
- getPatientChats: (patientId: number) => Promise<ChatDetails[]>;
102
- getChatPosts: (chatId: number) => Promise<ChatPost[]>;
103
- cancelChat: (chatId: number) => Promise<void>;
104
- sendChatMessage: (chatId: number, message: string) => Promise<number>;
105
- getExternalStudiesHistoryLink: (patient: ExternalPatient) => Promise<string | null>;
106
- getExternalAppointmentsLink: (identificationValue: string, birthdate: Date) => Promise<string | null>;
107
- getExternalAppointments: () => Promise<ExternalAppointment[]>;
108
- cancelExternalAppointment: (appointmentId: ExternalAppointment) => Promise<void>;
109
- getPatientPHR: (patientId: number) => Promise<string>;
110
- submitHealthQuiz: (params: HealthQuizParams) => Promise<void>;
111
- userId: number;
112
- getBinahWellnessLink: (body: BinahWellnessGetLinkParams) => Promise<BinahWellnessResponse>;
113
- uploadFileConsultation: (params: UploadFileConsultationParams) => Promise<UploadFileConsultationResponse>;
114
- deleteFileConsultation: (params: DeleteFileConsultationParams) => Promise<void>;
115
- };
116
- namespace Webhook {
117
- type StatusChangeEventStatus = 'S' | 'C' | 'F' | 'A' | 'D' | 'L';
118
- type InvitationStatusChangeEvent = {
119
- status: StatusChangeEventStatus;
120
- changeDate: Date;
121
- vcToken: string;
122
- patientId: number;
123
- professionalId: number;
124
- appointmentId: number;
125
- docPatientId: number;
126
- idSharedVc: number;
127
- identificationType: string;
128
- identificationValue: string;
129
- specialtyId: number;
130
- date: any;
131
- appointmentTime: string;
132
- appointmentDate: string;
133
- userTimeZone: string;
134
- };
135
- type ConsultationStatusChangeEvent = {
136
- id: number;
137
- invitationId: number;
138
- status: StatusChangeEventStatus;
139
- changeDate: Date;
140
- vcToken?: string;
141
- patientId?: number;
142
- };
143
- type AppointmentStatusChangeEvent = {
144
- id: number;
145
- status: StatusChangeEventStatus;
146
- vcTokens: {
147
- vc_token: string;
148
- }[];
149
- changeDate: Date;
150
- };
151
- type ChatUpdateEvent = {
152
- id: number;
153
- status: 'active' | 'ended';
154
- patientId: number;
155
- professionalId: number;
156
- date: Date;
157
- };
158
- type Events = {
159
- onInvitationStatusChange?: (event: InvitationStatusChangeEvent) => void;
160
- onConsultationStatusChange?: (event: ConsultationStatusChangeEvent) => void;
161
- onAppointmentStatusChange?: (event: AppointmentStatusChangeEvent) => void;
162
- onChatUpdate?: (event: ChatUpdateEvent) => void;
163
- };
164
- type Request = {
165
- headers: Record<string, string>;
166
- body: unknown;
167
- query: unknown;
168
- };
169
- type Response = {
170
- status: {
171
- code: number;
172
- message?: string;
173
- };
174
- data: unknown;
175
- };
176
- type Handler = (request: Doc24.Webhook.Request) => Promise<Doc24.Webhook.Response>;
177
- }
178
- }
1
+ import { TypeOf } from 'zod';
2
+ import { doc24Schemas } from './schemas';
3
+ export declare namespace Doc24 {
4
+ type SdkCredentials = TypeOf<typeof doc24Schemas.sdkCredentials>;
5
+ type SdkParams = TypeOf<typeof doc24Schemas.sdkParams>;
6
+ type User = TypeOf<typeof doc24Schemas.user>;
7
+ type Patient = TypeOf<typeof doc24Schemas.patient>;
8
+ type PatientSearch = TypeOf<typeof doc24Schemas.patientSearch>;
9
+ type Specialty = TypeOf<typeof doc24Schemas.specialty>;
10
+ type ScheduleAvailabilityFilter = TypeOf<typeof doc24Schemas.scheduleAvailabilityFilter>;
11
+ type AvailableAppointment = TypeOf<typeof doc24Schemas.availableAppointment>;
12
+ type AvailableScheduleClinics = TypeOf<typeof doc24Schemas.availableScheduleClinics>;
13
+ type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
14
+ type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
15
+ type AttachedFile = TypeOf<typeof doc24Schemas.attachedFile>;
16
+ type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
17
+ type HistoricalVideoVisit = TypeOf<typeof doc24Schemas.historicalVideoVisit>;
18
+ type VideoVisitDetails = TypeOf<typeof doc24Schemas.videoVisitDetails>;
19
+ type CompleteVideoVisitDetails = TypeOf<typeof doc24Schemas.completeVideoVisitDetails>;
20
+ type ActiveVideoVisitData = TypeOf<typeof doc24Schemas.activeVideoVisitData>;
21
+ type SpecialtyMode = TypeOf<typeof doc24Schemas.specialtyMode>;
22
+ type Professional = TypeOf<typeof doc24Schemas.professional>;
23
+ type ProfessionalsListItem = TypeOf<typeof doc24Schemas.professionalsListItem>;
24
+ type Appointment = TypeOf<typeof doc24Schemas.appointment>;
25
+ type ChatroomAvailabilityFilter = TypeOf<typeof doc24Schemas.chatroomAvailabilityFilter>;
26
+ type AvailableChatroom = TypeOf<typeof doc24Schemas.availableChatroom>;
27
+ type ChatParameters = TypeOf<typeof doc24Schemas.chatParameters>;
28
+ type ChatDetails = TypeOf<typeof doc24Schemas.chatDetails>;
29
+ type ChatPost = TypeOf<typeof doc24Schemas.chatPost>;
30
+ type EnrollmentParams = TypeOf<typeof doc24Schemas.enrollmentParams>;
31
+ type CoverageInfo = TypeOf<typeof doc24Schemas.coverageInfo>;
32
+ type DiagnosticaPatientFilter = TypeOf<typeof doc24Schemas.diagnosticaPatientFilter>;
33
+ type DiagnosticaUser = TypeOf<typeof doc24Schemas.diagnosticaUser>;
34
+ type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
35
+ type DiagnosticaHistoryAppointment = TypeOf<typeof doc24Schemas.diagnosticaHistoryAppointment>;
36
+ type DiagnosticaDeepLinkResponse = TypeOf<typeof doc24Schemas.diagnosticaDeepLinkResponse>;
37
+ type SendVerificationCodeParams = TypeOf<typeof doc24Schemas.sendVerificationCodeParams>;
38
+ type DeclareUserParams = TypeOf<typeof doc24Schemas.declareUserParams>;
39
+ type DeclareUserResponse = TypeOf<typeof doc24Schemas.declareUserResponse>;
40
+ type DeclarePatientParams = TypeOf<typeof doc24Schemas.declarePatientParams>;
41
+ type DeclarePatientResponse = TypeOf<typeof doc24Schemas.declarePatientResponse>;
42
+ type VerificationCodeParams = TypeOf<typeof doc24Schemas.verificationCodeParams>;
43
+ type ExternalLoginParams = TypeOf<typeof doc24Schemas.externalLoginParams>;
44
+ type ExternalLoginResponse = TypeOf<typeof doc24Schemas.externalLoginResponse>;
45
+ type PreExternalEnrollmentParams = TypeOf<typeof doc24Schemas.preExternalEnrollmentParams>;
46
+ type ExternalEnrollmentParams = TypeOf<typeof doc24Schemas.externalEnrollmentParams>;
47
+ type SendExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.sendExternalVerificationCodeParams>;
48
+ type VerifyExternalVerificationCodeParams = TypeOf<typeof doc24Schemas.verifyExternalVerificationCodeParams>;
49
+ type ExternalResetPasswordParams = TypeOf<typeof doc24Schemas.externalResetPasswordParams>;
50
+ type ExternalPatient = TypeOf<typeof doc24Schemas.externalPatient>;
51
+ type ExternalAppointment = TypeOf<typeof doc24Schemas.externalAppointment>;
52
+ type BinahWellnessGetLinkParams = TypeOf<typeof doc24Schemas.binahWellnessGetLinkParams>;
53
+ type BinahWellnessResponse = TypeOf<typeof doc24Schemas.binahWellnessResponse>;
54
+ type EligibilityIdentificationType = TypeOf<typeof doc24Schemas.eligibilityIdentificationType>;
55
+ type EligibilityParams = TypeOf<typeof doc24Schemas.eligibilityParams>;
56
+ type EligibilityAffiliate = TypeOf<typeof doc24Schemas.eligibilityAffiliate>;
57
+ type EligibilityResponse = TypeOf<typeof doc24Schemas.eligibilityResponse>;
58
+ type ProfessionalsBySpecialtyFilter = TypeOf<typeof doc24Schemas.professionalsBySpecialtyFilter>;
59
+ type ReportIntegrationErrorParams = TypeOf<typeof doc24Schemas.reportIntegrationErrorParams>;
60
+ type ReportIntegrationErrorResponse = TypeOf<typeof doc24Schemas.reportIntegrationErrorResponse>;
61
+ type UploadFileConsultationParams = TypeOf<typeof doc24Schemas.uploadFileConsultationParams>;
62
+ type UploadFileConsultationResponse = TypeOf<typeof doc24Schemas.uploadFileConsultationResponse>;
63
+ type DeleteFileConsultationParams = TypeOf<typeof doc24Schemas.deleteFileConsultationParams>;
64
+ type HealthQuizParams = TypeOf<typeof doc24Schemas.healthQuizParams>;
65
+ type BaseSdk = {
66
+ declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
67
+ getUserId: (user: User) => Promise<number>;
68
+ getUserInstance: (user: User | number) => Promise<UserSdk>;
69
+ getProfessional: (professionalId: number) => Promise<Professional>;
70
+ getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
71
+ enroll: (params: EnrollmentParams) => Promise<void>;
72
+ getCoverageInfo: (identificationValue: string) => Promise<CoverageInfo>;
73
+ sendVerificationCode: (params: SendVerificationCodeParams) => Promise<void>;
74
+ getDiagnosticaHistory: (patient: DiagnosticaPatientFilter, from: Date, to: Date) => Promise<DiagnosticaHistoryAppointment[]>;
75
+ getDiagnosticaDeepLink: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<DiagnosticaDeepLinkResponse>;
76
+ getDiagnosticaAccess: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<void>;
77
+ externalLogin: (params: ExternalLoginParams) => Promise<ExternalLoginResponse>;
78
+ preExternalEnrollment: (params: PreExternalEnrollmentParams) => Promise<void>;
79
+ externalEnrollment: (params: ExternalEnrollmentParams) => Promise<ExternalLoginResponse>;
80
+ sendExternalVerificationCode: (params: SendExternalVerificationCodeParams) => Promise<void>;
81
+ verifyExternalVerificationCode: (params: VerifyExternalVerificationCodeParams) => Promise<any>;
82
+ externalResetPassword: (params: ExternalResetPasswordParams) => Promise<any>;
83
+ reportIntegrationError: (params: ReportIntegrationErrorParams) => Promise<ReportIntegrationErrorResponse>;
84
+ };
85
+ type UserSdk = {
86
+ declarePatient: (params: DeclarePatientParams) => Promise<DeclarePatientResponse>;
87
+ getPatientId: (patient: PatientSearch) => Promise<number>;
88
+ deletePatient: (patientId: number) => Promise<void>;
89
+ getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
90
+ getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<ProfessionalsListItem[]>;
91
+ getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
92
+ getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
93
+ getAppointment: (appointmentId: number) => Promise<Appointment>;
94
+ getAppointmentByVcToken: (vcToken: string) => Promise<Appointment>;
95
+ scheduleVideoVisit: (params: ScheduleParameters) => Promise<string>;
96
+ cancelVideoVisit: (vcToken: string) => Promise<void>;
97
+ getVideoVisit: (vcToken: string, patientId: number) => Promise<VideoVisit>;
98
+ getVideoVisitDetails: (vcId: number) => Promise<VideoVisitDetails>;
99
+ getCompleteVideoVisitDetails: (vcToken: string) => Promise<CompleteVideoVisitDetails>;
100
+ getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
101
+ getPatientVideoVisitHistory: (patientId: number) => Promise<HistoricalVideoVisit[]>;
102
+ getActiveVideoVisits: () => Promise<ActiveVideoVisitData[]>;
103
+ getAvailableChatrooms: (patientId: number, specialtyId: number, filter: ChatroomAvailabilityFilter) => Promise<AvailableChatroom[]>;
104
+ createNewChat: (chatParameters: ChatParameters) => Promise<number>;
105
+ getPatientChats: (patientId: number) => Promise<ChatDetails[]>;
106
+ getChatPosts: (chatId: number) => Promise<ChatPost[]>;
107
+ cancelChat: (chatId: number) => Promise<void>;
108
+ sendChatMessage: (chatId: number, message: string) => Promise<number>;
109
+ getExternalStudiesHistoryLink: (patient: ExternalPatient) => Promise<string | null>;
110
+ getExternalAppointmentsLink: (identificationValue: string, birthdate: Date) => Promise<string | null>;
111
+ getExternalAppointments: () => Promise<ExternalAppointment[]>;
112
+ cancelExternalAppointment: (appointmentId: ExternalAppointment) => Promise<void>;
113
+ getPatientPHR: (patientId: number) => Promise<string>;
114
+ submitHealthQuiz: (params: HealthQuizParams) => Promise<void>;
115
+ userId: number;
116
+ getBinahWellnessLink: (body: BinahWellnessGetLinkParams) => Promise<BinahWellnessResponse>;
117
+ uploadFileConsultation: (params: UploadFileConsultationParams) => Promise<UploadFileConsultationResponse>;
118
+ deleteFileConsultation: (params: DeleteFileConsultationParams) => Promise<void>;
119
+ checkEligibility: (params: EligibilityParams) => Promise<EligibilityResponse>;
120
+ };
121
+ namespace Webhook {
122
+ type StatusChangeEventStatus = 'S' | 'C' | 'F' | 'A' | 'D' | 'L';
123
+ type InvitationStatusChangeEvent = {
124
+ status: StatusChangeEventStatus;
125
+ changeDate: Date;
126
+ vcToken: string;
127
+ patientId: number;
128
+ professionalId: number;
129
+ appointmentId: number;
130
+ docPatientId: number;
131
+ idSharedVc: number;
132
+ identificationType: string;
133
+ identificationValue: string;
134
+ specialtyId: number;
135
+ date: any;
136
+ appointmentTime: string;
137
+ appointmentDate: string;
138
+ userTimeZone: string;
139
+ };
140
+ type ConsultationStatusChangeEvent = {
141
+ id: number;
142
+ invitationId: number;
143
+ status: StatusChangeEventStatus;
144
+ changeDate: Date;
145
+ vcToken?: string;
146
+ patientId?: number;
147
+ };
148
+ type AppointmentStatusChangeEvent = {
149
+ id: number;
150
+ status: StatusChangeEventStatus;
151
+ vcTokens: {
152
+ vc_token: string;
153
+ }[];
154
+ changeDate: Date;
155
+ };
156
+ type ChatUpdateEvent = {
157
+ id: number;
158
+ status: 'active' | 'ended';
159
+ patientId: number;
160
+ professionalId: number;
161
+ date: Date;
162
+ };
163
+ type Events = {
164
+ onInvitationStatusChange?: (event: InvitationStatusChangeEvent) => void;
165
+ onConsultationStatusChange?: (event: ConsultationStatusChangeEvent) => void;
166
+ onAppointmentStatusChange?: (event: AppointmentStatusChangeEvent) => void;
167
+ onChatUpdate?: (event: ChatUpdateEvent) => void;
168
+ };
169
+ type Request = {
170
+ headers: Record<string, string>;
171
+ body: unknown;
172
+ query: unknown;
173
+ };
174
+ type Response = {
175
+ status: {
176
+ code: number;
177
+ message?: string;
178
+ };
179
+ data: unknown;
180
+ };
181
+ type Handler = (request: Doc24.Webhook.Request) => Promise<Doc24.Webhook.Response>;
182
+ }
183
+ }
package/lib/types.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +1,21 @@
1
- import { RequestMaker } from '../request';
2
- export declare const getBinahWellnessMethods: (makeRequest: RequestMaker) => {
3
- getBinahWellnessLink: (body: {
4
- patientId: number;
5
- socket: {
6
- device: string;
7
- provider: string;
8
- socketUrl: string;
9
- callbackUrl: string;
10
- socketAuthToken: string;
11
- };
12
- }) => Promise<{
13
- data: {
14
- info: {
15
- link: string;
16
- };
17
- timestamp: string;
18
- };
19
- signature: string;
20
- }>;
21
- };
1
+ import { RequestMaker } from '../request';
2
+ export declare const getBinahWellnessMethods: (makeRequest: RequestMaker) => {
3
+ getBinahWellnessLink: (body: {
4
+ patientId: number;
5
+ socket: {
6
+ device: string;
7
+ provider: string;
8
+ socketUrl: string;
9
+ callbackUrl: string;
10
+ socketAuthToken: string;
11
+ };
12
+ }) => Promise<{
13
+ data: {
14
+ info: {
15
+ link: string;
16
+ };
17
+ timestamp: string;
18
+ };
19
+ signature: string;
20
+ }>;
21
+ };
@@ -1,20 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBinahWellnessMethods = void 0;
4
- const zod_1 = require("zod");
5
- const schemas_1 = require("../schemas");
6
- const validation_1 = require("../request/validation");
7
- const getBinahWellnessMethods = (makeRequest) => {
8
- const getBinahWellnessLink = async (body) => {
9
- const path = `/wellness-test`;
10
- const response = await makeRequest('POST', path, {
11
- patient_id: body.patientId,
12
- socket: body.socket,
13
- });
14
- return response;
15
- };
16
- return {
17
- getBinahWellnessLink: validation_1.validateFunction(zod_1.tuple([zod_1.any()]), schemas_1.doc24Schemas.binahWellnessResponse, getBinahWellnessLink),
18
- };
19
- };
20
- exports.getBinahWellnessMethods = getBinahWellnessMethods;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBinahWellnessMethods = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../schemas");
6
+ const validation_1 = require("../request/validation");
7
+ const getBinahWellnessMethods = (makeRequest) => {
8
+ const getBinahWellnessLink = async (body) => {
9
+ const path = `/wellness-test`;
10
+ const response = await makeRequest('POST', path, {
11
+ patient_id: body.patientId,
12
+ socket: body.socket,
13
+ });
14
+ return response;
15
+ };
16
+ return {
17
+ getBinahWellnessLink: validation_1.validateFunction(zod_1.tuple([zod_1.any()]), schemas_1.doc24Schemas.binahWellnessResponse, getBinahWellnessLink),
18
+ };
19
+ };
20
+ exports.getBinahWellnessMethods = getBinahWellnessMethods;
@@ -1,57 +1,57 @@
1
- import { RequestMaker } from '../request';
2
- export declare const getChatMethods: (makeRequest: RequestMaker) => {
3
- getAvailableChatrooms: (patientId: number, specialtyId: number, filter: {
4
- offset?: number | undefined;
5
- limit?: number | undefined;
6
- }) => Promise<{
7
- id: number;
8
- professional: {
9
- logoUrl?: string | null | undefined;
10
- id: number;
11
- fullName: string;
12
- };
13
- specialty: {
14
- id: number;
15
- description: string;
16
- };
17
- }[]>;
18
- createNewChat: (chatParameters: {
19
- patientId: number;
20
- specialtyId: number;
21
- language: string;
22
- chatroomId: number;
23
- }) => Promise<number>;
24
- getPatientChats: (patientId: number) => Promise<{
25
- id: number;
26
- patient: {
27
- firstName: string;
28
- lastName: string;
29
- id: number;
30
- };
31
- professional: {
32
- logoUrl?: string | null | undefined;
33
- id: number;
34
- fullName: string;
35
- };
36
- status: string;
37
- paymentStatus: string;
38
- specialty: {
39
- id: number;
40
- description: string;
41
- };
42
- chatRoomId: number;
43
- startDate: Date;
44
- lastEventDate: Date;
45
- closureDate: Date | null;
46
- patientLastPost: Date | null;
47
- professionalLastPost: Date | null;
48
- }[]>;
49
- getChatPosts: (chatId: number) => Promise<{
50
- date: Date;
51
- message: string;
52
- id: number;
53
- userType: "patient" | "professional";
54
- }[]>;
55
- cancelChat: (chatId: number) => Promise<void>;
56
- sendChatMessage: (chatId: number, message: string) => Promise<number>;
57
- };
1
+ import { RequestMaker } from '../request';
2
+ export declare const getChatMethods: (makeRequest: RequestMaker) => {
3
+ getAvailableChatrooms: (patientId: number, specialtyId: number, filter: {
4
+ offset?: number | undefined;
5
+ limit?: number | undefined;
6
+ }) => Promise<{
7
+ id: number;
8
+ professional: {
9
+ logoUrl?: string | null | undefined;
10
+ id: number;
11
+ fullName: string;
12
+ };
13
+ specialty: {
14
+ id: number;
15
+ description: string;
16
+ };
17
+ }[]>;
18
+ createNewChat: (chatParameters: {
19
+ patientId: number;
20
+ specialtyId: number;
21
+ language: string;
22
+ chatroomId: number;
23
+ }) => Promise<number>;
24
+ getPatientChats: (patientId: number) => Promise<{
25
+ id: number;
26
+ patient: {
27
+ firstName: string;
28
+ lastName: string;
29
+ id: number;
30
+ };
31
+ professional: {
32
+ logoUrl?: string | null | undefined;
33
+ id: number;
34
+ fullName: string;
35
+ };
36
+ status: string;
37
+ paymentStatus: string;
38
+ specialty: {
39
+ id: number;
40
+ description: string;
41
+ };
42
+ chatRoomId: number;
43
+ startDate: Date;
44
+ lastEventDate: Date;
45
+ closureDate: Date | null;
46
+ patientLastPost: Date | null;
47
+ professionalLastPost: Date | null;
48
+ }[]>;
49
+ getChatPosts: (chatId: number) => Promise<{
50
+ date: Date;
51
+ message: string;
52
+ id: number;
53
+ userType: "patient" | "professional";
54
+ }[]>;
55
+ cancelChat: (chatId: number) => Promise<void>;
56
+ sendChatMessage: (chatId: number, message: string) => Promise<number>;
57
+ };