@integraciones_doc24/sdk 1.15.14 → 1.15.16

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.
@@ -70,7 +70,7 @@ const getBaseSdk = async (url, credentials) => {
70
70
  };
71
71
  return mapped;
72
72
  }),
73
- getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter.optional()]), schemas_1.doc24Schemas.professionalsListItem, async (body = {}) => {
73
+ getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter]), zod_1.array(schemas_1.doc24Schemas.professionalsListItem), async (body = {}) => {
74
74
  var _a;
75
75
  const mappedBody = {
76
76
  specialty_id: body.specialtyId,
@@ -81,20 +81,18 @@ const getBaseSdk = async (url, credentials) => {
81
81
  };
82
82
  const path = `/professionals-by-specialty`;
83
83
  const response = await makeRequest('POST', path, mappedBody);
84
- const raw = response.data;
85
- return {
86
- id: raw.professional_id,
87
- fullName: raw.denominacion,
88
- consultation_value: raw.consultation_value,
89
- logoUrl: raw.logo,
90
- primer_turno: raw.primer_turno,
91
- resume: {
92
- link: raw.resume_link,
93
- brief: raw.resume_brief,
94
- },
95
- brief: raw.mini_cv,
96
- degree: raw.degree,
84
+ const mapProfessionalResponse = (rawItem) => {
85
+ return {
86
+ id: rawItem.id_profesional,
87
+ fullName: rawItem.denominacion,
88
+ consultation_value: rawItem.consultation_value,
89
+ logoUrl: rawItem.logo,
90
+ primer_turno: rawItem.primer_turno,
91
+ brief: rawItem.mini_cv,
92
+ degree: rawItem.degree,
93
+ };
97
94
  };
95
+ return response.data.profesionales.map((o) => mapProfessionalResponse(o));
98
96
  }),
99
97
  };
100
98
  return baseSdk;
package/lib/index.d.ts CHANGED
@@ -80,19 +80,21 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
80
80
  brief: string;
81
81
  };
82
82
  }>;
83
- getProfessionalsBySpecialty: () => Promise<{
83
+ getProfessionalsBySpecialty: (body: {
84
+ specialtyId?: number | null | undefined;
85
+ language?: string | undefined;
86
+ professionalId?: number | null | undefined;
87
+ offset?: number | undefined;
88
+ limit?: number | undefined;
89
+ }) => Promise<{
84
90
  logoUrl?: string | undefined;
85
91
  brief?: string | undefined;
86
92
  consultation_value?: string | null | undefined;
87
93
  degree?: string | undefined;
88
- resume?: {
89
- link: string;
90
- brief: string;
91
- } | undefined;
92
94
  primer_turno?: string | undefined;
93
95
  id: number;
94
96
  fullName: string;
95
- }>;
97
+ }[]>;
96
98
  getAvailableScheduleClinics: () => Promise<{
97
99
  specialties: {
98
100
  id: number;
package/lib/schemas.d.ts CHANGED
@@ -859,16 +859,6 @@ export declare const doc24Schemas: {
859
859
  consultation_value: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>>;
860
860
  logoUrl: import("zod").ZodOptional<import("zod").ZodString>;
861
861
  primer_turno: import("zod").ZodOptional<import("zod").ZodString>;
862
- resume: import("zod").ZodOptional<import("zod").ZodObject<{
863
- link: import("zod").ZodString;
864
- brief: import("zod").ZodString;
865
- }, "strip", import("zod").ZodTypeAny, {
866
- link: string;
867
- brief: string;
868
- }, {
869
- link: string;
870
- brief: string;
871
- }>>;
872
862
  degree: import("zod").ZodOptional<import("zod").ZodString>;
873
863
  brief: import("zod").ZodOptional<import("zod").ZodString>;
874
864
  }, "strip", import("zod").ZodTypeAny, {
@@ -876,10 +866,6 @@ export declare const doc24Schemas: {
876
866
  brief?: string | undefined;
877
867
  consultation_value?: string | null | undefined;
878
868
  degree?: string | undefined;
879
- resume?: {
880
- link: string;
881
- brief: string;
882
- } | undefined;
883
869
  primer_turno?: string | undefined;
884
870
  id: number;
885
871
  fullName: string;
@@ -888,10 +874,6 @@ export declare const doc24Schemas: {
888
874
  brief?: string | undefined;
889
875
  consultation_value?: string | null | undefined;
890
876
  degree?: string | undefined;
891
- resume?: {
892
- link: string;
893
- brief: string;
894
- } | undefined;
895
877
  primer_turno?: string | undefined;
896
878
  id: number;
897
879
  fullName: string;
package/lib/schemas.js CHANGED
@@ -404,10 +404,6 @@ exports.doc24Schemas = {
404
404
  consultation_value: zod_1.string().optional().nullish(),
405
405
  logoUrl: zod_1.string().optional(),
406
406
  primer_turno: zod_1.string().optional(),
407
- resume: zod_1.object({
408
- link: zod_1.string(),
409
- brief: zod_1.string(),
410
- }).optional(),
411
407
  degree: zod_1.string().optional(),
412
408
  brief: zod_1.string().optional(),
413
409
  }),
package/lib/types.d.ts CHANGED
@@ -46,12 +46,13 @@ export declare namespace Doc24 {
46
46
  type ExternalResetPasswordParams = TypeOf<typeof doc24Schemas.externalResetPasswordParams>;
47
47
  type ExternalPatient = TypeOf<typeof doc24Schemas.externalPatient>;
48
48
  type ExternalAppointment = TypeOf<typeof doc24Schemas.externalAppointment>;
49
+ type ProfessionalsBySpecialtyFilter = TypeOf<typeof doc24Schemas.professionalsBySpecialtyFilter>;
49
50
  type BaseSdk = {
50
51
  declareUser: (params: DeclareUserParams) => Promise<DeclareUserResponse>;
51
52
  getUserId: (user: User) => Promise<number>;
52
53
  getUserInstance: (user: User | number) => Promise<UserSdk>;
53
54
  getProfessional: (professionalId: number) => Promise<Professional>;
54
- getProfessionalsBySpecialty: () => Promise<ProfessionalsListItem>;
55
+ getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<ProfessionalsListItem[]>;
55
56
  getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
56
57
  enroll: (params: EnrollmentParams) => Promise<void>;
57
58
  getCoverageInfo: (identificationValue: string) => Promise<CoverageInfo>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.15.14",
3
+ "version": "1.15.16",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },