@integraciones_doc24/sdk 1.10.0 → 1.12.0

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/schemas.d.ts CHANGED
@@ -389,6 +389,8 @@ export declare const doc24Schemas: {
389
389
  }>>;
390
390
  paymentStatus: import("zod").ZodOptional<import("zod").ZodString>;
391
391
  atentionId: import("zod").ZodOptional<import("zod").ZodNumber>;
392
+ specialty: import("zod").ZodString;
393
+ professional: import("zod").ZodString;
392
394
  }, "strip", import("zod").ZodTypeAny, {
393
395
  appointment?: {
394
396
  date: Date;
@@ -402,6 +404,8 @@ export declare const doc24Schemas: {
402
404
  atentionId?: number | undefined;
403
405
  id: number | null;
404
406
  patientId: number;
407
+ professional: string;
408
+ specialty: string;
405
409
  creationDate: Date;
406
410
  user: {
407
411
  phone: string | null;
@@ -422,6 +426,8 @@ export declare const doc24Schemas: {
422
426
  atentionId?: number | undefined;
423
427
  id: number | null;
424
428
  patientId: number;
429
+ professional: string;
430
+ specialty: string;
425
431
  creationDate: Date;
426
432
  user: {
427
433
  phone: string | null;
package/lib/schemas.js CHANGED
@@ -316,6 +316,8 @@ exports.doc24Schemas = {
316
316
  }).optional(),
317
317
  paymentStatus: zod_1.string().optional(),
318
318
  atentionId: zod_1.number().optional(),
319
+ specialty: zod_1.string(),
320
+ professional: zod_1.string(),
319
321
  }),
320
322
  videoVisitDetails: zod_1.object({
321
323
  id: zod_1.number(),
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,15 @@ 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
+ const response = await makeRequest('DELETE', path);
58
+ return response.data;
59
+ };
55
60
  return {
56
61
  declarePatient: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.declarePatientParams]), schemas_1.doc24Schemas.declarePatientResponse, declarePatient),
57
62
  getPatientId: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.patient]), zod_1.number(), getPatientId),
63
+ deletePatient: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.void(), deletePatient),
58
64
  };
59
65
  };
60
66
  exports.getPatientMethods = getPatientMethods;
@@ -30,6 +30,8 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
30
30
  atentionId?: number | undefined;
31
31
  id: number | null;
32
32
  patientId: number;
33
+ professional: string;
34
+ specialty: string;
33
35
  creationDate: Date;
34
36
  user: {
35
37
  phone: string | null;
@@ -51,6 +53,8 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
51
53
  atentionId?: number | undefined;
52
54
  id: number | null;
53
55
  patientId: number;
56
+ professional: string;
57
+ specialty: string;
54
58
  creationDate: Date;
55
59
  user: {
56
60
  phone: string | null;
@@ -143,5 +143,7 @@ const mapVideoVisit = (raw) => {
143
143
  : undefined,
144
144
  paymentStatus: (_a = raw.payment_status) !== null && _a !== void 0 ? _a : undefined,
145
145
  atentionId: (_b = raw.atentionId) !== null && _b !== void 0 ? _b : undefined,
146
+ professional: raw.professional,
147
+ specialty: raw.specialty,
146
148
  };
147
149
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },