@integraciones_doc24/sdk 0.26.3 → 0.27.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
@@ -68,6 +68,7 @@ type SdkParams = {
68
68
  type BaseSdk = {
69
69
  getUserInstance: (user: User) => Promise<UserSdk>;
70
70
  getProfessional: (professionalId: number) => Promise<Professional>;
71
+ getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>
71
72
  }
72
73
 
73
74
  type RequestHandlerParams = {
package/lib/baseSdk.js CHANGED
@@ -61,6 +61,24 @@ const getBaseSdk = async (url, credentials) => {
61
61
  },
62
62
  };
63
63
  }),
64
+ getAvailableScheduleClinics: validation_1.validateFunction(zod_1.tuple([]), schemas_1.doc24Schemas.availableScheduleClinics, async () => {
65
+ const path = `/schedule/clinics`;
66
+ const response = await makeRequest('GET', path);
67
+ const mapSpeciality = (s) => ({
68
+ id: s.id_especialidad,
69
+ description: s.especialidad,
70
+ });
71
+ const mapped = {
72
+ specialties: response.data.specialties.map(mapSpeciality),
73
+ professionals: response.data.professionals.map((p) => ({
74
+ id: p.id_profesional,
75
+ fullName: p.denominacion,
76
+ clinicId: p.id_consultorio,
77
+ specialties: p.especialidades.map(mapSpeciality),
78
+ })),
79
+ };
80
+ return mapped;
81
+ }),
64
82
  };
65
83
  return baseSdk;
66
84
  };
package/lib/index.d.ts CHANGED
@@ -36,14 +36,14 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
36
36
  gender: "m" | "f";
37
37
  phone: string;
38
38
  email: string;
39
- matriculation: {
40
- number: string;
41
- type: string;
42
- }[];
43
39
  specialties: {
44
40
  id: number;
45
41
  description: string;
46
42
  }[];
43
+ matriculation: {
44
+ number: string;
45
+ type: string;
46
+ }[];
47
47
  degree: string;
48
48
  languages: string[];
49
49
  resume: {
@@ -51,5 +51,20 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
51
51
  brief: string;
52
52
  };
53
53
  }>;
54
+ getAvailableScheduleClinics: () => Promise<{
55
+ specialties: {
56
+ id: number;
57
+ description: string;
58
+ }[];
59
+ professionals: {
60
+ id: number;
61
+ fullName: string;
62
+ clinicId: number;
63
+ specialties: {
64
+ id: number;
65
+ description: string;
66
+ }[];
67
+ }[];
68
+ }>;
54
69
  }>;
55
70
  export type { Doc24 } from './types';
package/lib/schemas.d.ts CHANGED
@@ -179,6 +179,77 @@ export declare const doc24Schemas: {
179
179
  };
180
180
  atentions: number;
181
181
  }>;
182
+ availableScheduleClinics: import("zod").ZodObject<{
183
+ specialties: import("zod").ZodArray<import("zod").ZodObject<{
184
+ id: import("zod").ZodNumber;
185
+ description: import("zod").ZodString;
186
+ }, "strip", import("zod").ZodTypeAny, {
187
+ id: number;
188
+ description: string;
189
+ }, {
190
+ id: number;
191
+ description: string;
192
+ }>, "many">;
193
+ professionals: import("zod").ZodArray<import("zod").ZodObject<{
194
+ id: import("zod").ZodNumber;
195
+ fullName: import("zod").ZodString;
196
+ clinicId: import("zod").ZodNumber;
197
+ specialties: import("zod").ZodArray<import("zod").ZodObject<{
198
+ id: import("zod").ZodNumber;
199
+ description: import("zod").ZodString;
200
+ }, "strip", import("zod").ZodTypeAny, {
201
+ id: number;
202
+ description: string;
203
+ }, {
204
+ id: number;
205
+ description: string;
206
+ }>, "many">;
207
+ }, "strip", import("zod").ZodTypeAny, {
208
+ id: number;
209
+ fullName: string;
210
+ clinicId: number;
211
+ specialties: {
212
+ id: number;
213
+ description: string;
214
+ }[];
215
+ }, {
216
+ id: number;
217
+ fullName: string;
218
+ clinicId: number;
219
+ specialties: {
220
+ id: number;
221
+ description: string;
222
+ }[];
223
+ }>, "many">;
224
+ }, "strip", import("zod").ZodTypeAny, {
225
+ specialties: {
226
+ id: number;
227
+ description: string;
228
+ }[];
229
+ professionals: {
230
+ id: number;
231
+ fullName: string;
232
+ clinicId: number;
233
+ specialties: {
234
+ id: number;
235
+ description: string;
236
+ }[];
237
+ }[];
238
+ }, {
239
+ specialties: {
240
+ id: number;
241
+ description: string;
242
+ }[];
243
+ professionals: {
244
+ id: number;
245
+ fullName: string;
246
+ clinicId: number;
247
+ specialties: {
248
+ id: number;
249
+ description: string;
250
+ }[];
251
+ }[];
252
+ }>;
182
253
  scheduleFilter: import("zod").ZodObject<{
183
254
  professionalId: import("zod").ZodOptional<import("zod").ZodNumber>;
184
255
  offset: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -587,14 +658,14 @@ export declare const doc24Schemas: {
587
658
  gender: "m" | "f";
588
659
  phone: string;
589
660
  email: string;
590
- matriculation: {
591
- number: string;
592
- type: string;
593
- }[];
594
661
  specialties: {
595
662
  id: number;
596
663
  description: string;
597
664
  }[];
665
+ matriculation: {
666
+ number: string;
667
+ type: string;
668
+ }[];
598
669
  degree: string;
599
670
  languages: string[];
600
671
  resume: {
@@ -610,14 +681,14 @@ export declare const doc24Schemas: {
610
681
  gender: "m" | "f";
611
682
  phone: string;
612
683
  email: string;
613
- matriculation: {
614
- number: string;
615
- type: string;
616
- }[];
617
684
  specialties: {
618
685
  id: number;
619
686
  description: string;
620
687
  }[];
688
+ matriculation: {
689
+ number: string;
690
+ type: string;
691
+ }[];
621
692
  degree: string;
622
693
  languages: string[];
623
694
  resume: {
package/lib/schemas.js CHANGED
@@ -43,18 +43,27 @@ const appointment = zod_1.object({
43
43
  professionalId: zod_1.number(),
44
44
  date: zod_1.date(),
45
45
  });
46
- const baseScheduleParamters = zod_1.object({
46
+ const availableScheduleClinics = zod_1.object({
47
+ specialties: specialty.array(),
48
+ professionals: zod_1.object({
49
+ id: zod_1.number(),
50
+ fullName: zod_1.string(),
51
+ clinicId: zod_1.number(),
52
+ specialties: specialty.array(),
53
+ }).array(),
54
+ });
55
+ const baseScheduleParameters = zod_1.object({
47
56
  patientId: zod_1.number(),
48
57
  specialtyId: zod_1.number(),
49
58
  language: zod_1.string(),
50
59
  details: zod_1.string(),
51
60
  extraInfo: zod_1.any(),
52
61
  });
53
- const appointmentScheduleParameters = baseScheduleParamters.extend({
62
+ const appointmentScheduleParameters = baseScheduleParameters.extend({
54
63
  type: zod_1.literal('appointment'),
55
64
  appointmentId: zod_1.number().or(zod_1.string()),
56
65
  });
57
- const instantScheduleParameters = baseScheduleParamters.extend({
66
+ const instantScheduleParameters = baseScheduleParameters.extend({
58
67
  type: zod_1.literal('instant'),
59
68
  });
60
69
  const chatroomAvailabilityFilter = zod_1.object({
@@ -114,6 +123,7 @@ exports.doc24Schemas = {
114
123
  specialty,
115
124
  scheduleAvailabilityFilter,
116
125
  availableAppointment,
126
+ availableScheduleClinics,
117
127
  scheduleFilter: zod_1.object({
118
128
  professionalId: zod_1.number().optional(),
119
129
  offset: zod_1.number().optional(),
package/lib/types.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare namespace Doc24 {
9
9
  type Specialty = TypeOf<typeof doc24Schemas.specialty>;
10
10
  type ScheduleAvailabilityFilter = TypeOf<typeof doc24Schemas.scheduleAvailabilityFilter>;
11
11
  type AvailableAppointment = TypeOf<typeof doc24Schemas.availableAppointment>;
12
+ type AvailableScheduleClinics = TypeOf<typeof doc24Schemas.availableScheduleClinics>;
12
13
  type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
13
14
  type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
14
15
  type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
@@ -26,6 +27,7 @@ export declare namespace Doc24 {
26
27
  declareUser: (user: User) => Promise<number>;
27
28
  getUserInstance: (user: User | number) => Promise<UserSdk>;
28
29
  getProfessional: (professionalId: number) => Promise<Professional>;
30
+ getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
29
31
  };
30
32
  type UserSdk = {
31
33
  declarePatient: (patient: Patient) => Promise<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "0.26.3",
3
+ "version": "0.27.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {