@integraciones_doc24/sdk 1.11.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -72,7 +72,7 @@ type SdkParams = {
72
72
  url: string;
73
73
  credentials: SdkCredentials;
74
74
  };
75
- type BaseSdk = {
75
+ export type BaseSdk = {
76
76
  declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
77
77
  getUserId: (user: User) => Promise<number>;
78
78
  getUserInstance: (user: User | number) => Promise<UserSdk>;
@@ -110,6 +110,15 @@ type BaseSdk = {
110
110
  params: VerifyExternalVerificationCodeParams,
111
111
  ) => Promise<any>;
112
112
  externalResetPassword: (params: ExternalResetPasswordParams) => Promise<any>;
113
+ getExternalStudiesHistoryLink: (patient: ExternalPatient) => Promise<string>;
114
+ getExternalAppointmentsLink: (
115
+ identificationValue: string,
116
+ birthdate: Date,
117
+ ) => Promise<string>;
118
+ getExternalAppointments: () => Promise<ExternalAppointment[]>;
119
+ cancelExternalAppointment: (
120
+ appointmentId: ExternalAppointment,
121
+ ) => Promise<void>;
113
122
  };
114
123
 
115
124
  type RequestHandlerParams = {
@@ -143,11 +152,12 @@ app.all('/doc24', async (req, res) => {
143
152
  Most of the methods need a user specified, so `getUserInstance` returns an instance of `UserSdk` with them.
144
153
 
145
154
  ```ts
146
- type UserSdk = {
155
+ export type UserSdk = {
147
156
  declarePatient: (
148
157
  params: DeclarePatientParams,
149
158
  ) => Promise<DeclarePatientResponse>;
150
159
  getPatientId: (patient: Patient) => Promise<number>;
160
+ deletePatient: (patientId: number) => Promise<void>;
151
161
  getSpecialties: (
152
162
  mode: SpecialtyMode,
153
163
  language: string,
package/lib/types.d.ts CHANGED
@@ -70,6 +70,7 @@ export declare namespace Doc24 {
70
70
  type UserSdk = {
71
71
  declarePatient: (params: DeclarePatientParams) => Promise<DeclarePatientResponse>;
72
72
  getPatientId: (patient: Patient) => Promise<number>;
73
+ deletePatient: (patientId: number) => Promise<void>;
73
74
  getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
74
75
  getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
75
76
  getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
@@ -34,4 +34,5 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
34
34
  birthdate: Date;
35
35
  gender: "m" | "f";
36
36
  }) => Promise<number>;
37
+ deletePatient: (patientId: number) => Promise<void>;
37
38
  };
@@ -52,9 +52,14 @@ const getPatientMethods = (makeRequest) => {
52
52
  });
53
53
  return response.data.patient_id;
54
54
  };
55
+ const deletePatient = async (patientId) => {
56
+ const path = `/patient/${patientId}`;
57
+ await makeRequest('DELETE', path);
58
+ };
55
59
  return {
56
60
  declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.declarePatientParams]), schemas_1.doc24Schemas.declarePatientResponse, declarePatient),
57
61
  getPatientId: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), getPatientId),
62
+ deletePatient: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.void(), deletePatient),
58
63
  };
59
64
  };
60
65
  exports.getPatientMethods = getPatientMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },