@integraciones_doc24/sdk 1.15.15 → 1.15.17

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.
@@ -9,6 +9,7 @@ const utils_1 = require("../utils");
9
9
  const diagnostica_1 = require("./diagnostica");
10
10
  const user_1 = require("./user");
11
11
  const external_1 = require("./external");
12
+ const token_1 = require("../request/token");
12
13
  const getBaseSdk = async (url, credentials) => {
13
14
  const makeRequest = await request_1.getRequestFactory(url, credentials);
14
15
  const diagnosticaMethods = diagnostica_1.getDiagnosticaMethods(makeRequest);
@@ -70,7 +71,7 @@ const getBaseSdk = async (url, credentials) => {
70
71
  };
71
72
  return mapped;
72
73
  }),
73
- getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter.optional()]), schemas_1.doc24Schemas.professionalsListItem, async (body = {}) => {
74
+ getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter]), zod_1.any(), async (body = {}) => {
74
75
  var _a;
75
76
  const mappedBody = {
76
77
  specialty_id: body.specialtyId,
@@ -81,19 +82,29 @@ const getBaseSdk = async (url, credentials) => {
81
82
  };
82
83
  const path = `/professionals-by-specialty`;
83
84
  const response = await makeRequest('POST', path, mappedBody);
84
- const raw = response.data;
85
+ const mapProfessionalResponse = (rawItem) => {
86
+ return {
87
+ id: rawItem.id_profesional,
88
+ fullName: rawItem.denominacion,
89
+ consultation_value: rawItem.consultation_value,
90
+ logoUrl: rawItem.logo,
91
+ primer_turno: rawItem.primer_turno,
92
+ brief: rawItem.mini_cv,
93
+ degree: rawItem.degree,
94
+ };
95
+ };
96
+ const token = await token_1.getToken(credentials, JSON.stringify(mappedBody));
97
+ const token2 = await token_1.getToken(credentials, undefined);
98
+ /*return (response.data.profesionales as any[]).map((o) =>
99
+ mapProfessionalResponse(o),
100
+ );*/
101
+ const professionals = response.data.profesionales.map((o) => mapProfessionalResponse(o));
85
102
  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,
103
+ response,
104
+ mappedBody,
105
+ token,
106
+ token2,
107
+ professionals,
97
108
  };
98
109
  }),
99
110
  };
package/lib/index.d.ts CHANGED
@@ -82,23 +82,11 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
82
82
  }>;
83
83
  getProfessionalsBySpecialty: (body: {
84
84
  specialtyId?: number | null | undefined;
85
- language?: string | undefined;
85
+ language?: string | null | undefined;
86
86
  professionalId?: number | null | undefined;
87
- offset?: number | undefined;
88
- limit?: number | undefined;
89
- }) => Promise<{
90
- logoUrl?: string | undefined;
91
- brief?: string | undefined;
92
- consultation_value?: string | null | undefined;
93
- degree?: string | undefined;
94
- resume?: {
95
- link: string;
96
- brief: string;
97
- } | undefined;
98
- primer_turno?: string | undefined;
99
- id: number;
100
- fullName: string;
101
- }>;
87
+ offset?: number | null | undefined;
88
+ limit?: number | null | undefined;
89
+ }) => Promise<any>;
102
90
  getAvailableScheduleClinics: () => Promise<{
103
91
  specialties: {
104
92
  id: number;
package/lib/schemas.d.ts CHANGED
@@ -313,21 +313,21 @@ export declare const doc24Schemas: {
313
313
  professionalsBySpecialtyFilter: import("zod").ZodObject<{
314
314
  professionalId: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
315
315
  specialtyId: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
316
- offset: import("zod").ZodOptional<import("zod").ZodNumber>;
317
- limit: import("zod").ZodOptional<import("zod").ZodNumber>;
318
- language: import("zod").ZodOptional<import("zod").ZodString>;
316
+ offset: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
317
+ limit: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
318
+ language: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
319
319
  }, "strip", import("zod").ZodTypeAny, {
320
320
  specialtyId?: number | null | undefined;
321
- language?: string | undefined;
321
+ language?: string | null | undefined;
322
322
  professionalId?: number | null | undefined;
323
- offset?: number | undefined;
324
- limit?: number | undefined;
323
+ offset?: number | null | undefined;
324
+ limit?: number | null | undefined;
325
325
  }, {
326
326
  specialtyId?: number | null | undefined;
327
- language?: string | undefined;
327
+ language?: string | null | undefined;
328
328
  professionalId?: number | null | undefined;
329
- offset?: number | undefined;
330
- limit?: number | undefined;
329
+ offset?: number | null | undefined;
330
+ limit?: number | null | undefined;
331
331
  }>;
332
332
  scheduleParameters: import("zod").ZodUnion<[import("zod").ZodObject<import("zod").extendShape<{
333
333
  patientId: import("zod").ZodNumber;
@@ -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
@@ -328,9 +328,9 @@ exports.doc24Schemas = {
328
328
  professionalsBySpecialtyFilter: zod_1.object({
329
329
  professionalId: zod_1.number().optional().nullable(),
330
330
  specialtyId: zod_1.number().optional().nullable(),
331
- offset: zod_1.number().optional(),
332
- limit: zod_1.number().optional(),
333
- language: zod_1.string().optional(),
331
+ offset: zod_1.number().optional().nullable(),
332
+ limit: zod_1.number().optional().nullable(),
333
+ language: zod_1.string().optional().nullable(),
334
334
  }),
335
335
  scheduleParameters: zod_1.union([
336
336
  appointmentScheduleParameters,
@@ -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
@@ -52,7 +52,7 @@ export declare namespace Doc24 {
52
52
  getUserId: (user: User) => Promise<number>;
53
53
  getUserInstance: (user: User | number) => Promise<UserSdk>;
54
54
  getProfessional: (professionalId: number) => Promise<Professional>;
55
- getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<ProfessionalsListItem>;
55
+ getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<any>;
56
56
  getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
57
57
  enroll: (params: EnrollmentParams) => Promise<void>;
58
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.15",
3
+ "version": "1.15.17",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },