@integraciones_doc24/sdk 1.15.17 → 1.15.19
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/lib/baseSdk/index.js +0 -37
- package/lib/index.d.ts +0 -7
- package/lib/schemas.d.ts +3 -3
- package/lib/schemas.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/userSdk/specialties.d.ts +9 -0
- package/lib/userSdk/specialties.js +27 -1
- package/package.json +1 -1
package/lib/baseSdk/index.js
CHANGED
|
@@ -9,7 +9,6 @@ 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");
|
|
13
12
|
const getBaseSdk = async (url, credentials) => {
|
|
14
13
|
const makeRequest = await request_1.getRequestFactory(url, credentials);
|
|
15
14
|
const diagnosticaMethods = diagnostica_1.getDiagnosticaMethods(makeRequest);
|
|
@@ -71,42 +70,6 @@ const getBaseSdk = async (url, credentials) => {
|
|
|
71
70
|
};
|
|
72
71
|
return mapped;
|
|
73
72
|
}),
|
|
74
|
-
getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter]), zod_1.any(), async (body = {}) => {
|
|
75
|
-
var _a;
|
|
76
|
-
const mappedBody = {
|
|
77
|
-
specialty_id: body.specialtyId,
|
|
78
|
-
professional_id: body.professionalId,
|
|
79
|
-
offset: body.offset,
|
|
80
|
-
limit: body.limit,
|
|
81
|
-
language: (_a = body.language) !== null && _a !== void 0 ? _a : 'ES',
|
|
82
|
-
};
|
|
83
|
-
const path = `/professionals-by-specialty`;
|
|
84
|
-
const response = await makeRequest('POST', path, mappedBody);
|
|
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));
|
|
102
|
-
return {
|
|
103
|
-
response,
|
|
104
|
-
mappedBody,
|
|
105
|
-
token,
|
|
106
|
-
token2,
|
|
107
|
-
professionals,
|
|
108
|
-
};
|
|
109
|
-
}),
|
|
110
73
|
};
|
|
111
74
|
return baseSdk;
|
|
112
75
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -80,13 +80,6 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
|
|
|
80
80
|
brief: string;
|
|
81
81
|
};
|
|
82
82
|
}>;
|
|
83
|
-
getProfessionalsBySpecialty: (body: {
|
|
84
|
-
specialtyId?: number | null | undefined;
|
|
85
|
-
language?: string | null | undefined;
|
|
86
|
-
professionalId?: number | null | undefined;
|
|
87
|
-
offset?: number | null | undefined;
|
|
88
|
-
limit?: number | null | undefined;
|
|
89
|
-
}) => Promise<any>;
|
|
90
83
|
getAvailableScheduleClinics: () => Promise<{
|
|
91
84
|
specialties: {
|
|
92
85
|
id: number;
|
package/lib/schemas.d.ts
CHANGED
|
@@ -856,7 +856,7 @@ export declare const doc24Schemas: {
|
|
|
856
856
|
professionalsListItem: import("zod").ZodObject<{
|
|
857
857
|
id: import("zod").ZodNumber;
|
|
858
858
|
fullName: import("zod").ZodString;
|
|
859
|
-
consultation_value: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString
|
|
859
|
+
consultation_value: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodNumber, import("zod").ZodString]>>>>;
|
|
860
860
|
logoUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
861
861
|
primer_turno: import("zod").ZodOptional<import("zod").ZodString>;
|
|
862
862
|
degree: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -864,7 +864,7 @@ export declare const doc24Schemas: {
|
|
|
864
864
|
}, "strip", import("zod").ZodTypeAny, {
|
|
865
865
|
logoUrl?: string | undefined;
|
|
866
866
|
brief?: string | undefined;
|
|
867
|
-
consultation_value?: string | null | undefined;
|
|
867
|
+
consultation_value?: string | number | null | undefined;
|
|
868
868
|
degree?: string | undefined;
|
|
869
869
|
primer_turno?: string | undefined;
|
|
870
870
|
id: number;
|
|
@@ -872,7 +872,7 @@ export declare const doc24Schemas: {
|
|
|
872
872
|
}, {
|
|
873
873
|
logoUrl?: string | undefined;
|
|
874
874
|
brief?: string | undefined;
|
|
875
|
-
consultation_value?: string | null | undefined;
|
|
875
|
+
consultation_value?: string | number | null | undefined;
|
|
876
876
|
degree?: string | undefined;
|
|
877
877
|
primer_turno?: string | undefined;
|
|
878
878
|
id: number;
|
package/lib/schemas.js
CHANGED
|
@@ -401,7 +401,7 @@ exports.doc24Schemas = {
|
|
|
401
401
|
professionalsListItem: zod_1.object({
|
|
402
402
|
id: zod_1.number(),
|
|
403
403
|
fullName: zod_1.string(),
|
|
404
|
-
consultation_value: zod_1.string().optional().nullish(),
|
|
404
|
+
consultation_value: zod_1.number().or(zod_1.string()).optional().nullish(),
|
|
405
405
|
logoUrl: zod_1.string().optional(),
|
|
406
406
|
primer_turno: zod_1.string().optional(),
|
|
407
407
|
degree: zod_1.string().optional(),
|
package/lib/types.d.ts
CHANGED
|
@@ -52,7 +52,6 @@ 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<any>;
|
|
56
55
|
getAvailableScheduleClinics: () => Promise<AvailableScheduleClinics>;
|
|
57
56
|
enroll: (params: EnrollmentParams) => Promise<void>;
|
|
58
57
|
getCoverageInfo: (identificationValue: string) => Promise<CoverageInfo>;
|
|
@@ -72,6 +71,7 @@ export declare namespace Doc24 {
|
|
|
72
71
|
getPatientId: (patient: Patient) => Promise<number>;
|
|
73
72
|
deletePatient: (patientId: number) => Promise<void>;
|
|
74
73
|
getSpecialties: (mode: SpecialtyMode, language: string) => Promise<Specialty[]>;
|
|
74
|
+
getProfessionalsBySpecialty: (body: ProfessionalsBySpecialtyFilter) => Promise<ProfessionalsListItem[]>;
|
|
75
75
|
getScheduleDates: (patientId: number, filter?: ScheduleAvailabilityFilter) => Promise<Date[]>;
|
|
76
76
|
getSchedule: (patientId: number, specialtyId: number, filter?: ScheduleFilter) => Promise<AvailableAppointment[]>;
|
|
77
77
|
getAppointment: (appointmentId: number) => Promise<Appointment>;
|
|
@@ -4,4 +4,13 @@ export declare const getSpecialtiesMethods: (makeRequest: RequestMaker) => {
|
|
|
4
4
|
id: number;
|
|
5
5
|
description: string;
|
|
6
6
|
}[]>;
|
|
7
|
+
getProfessionalsBySpecialty: (...params: any) => Promise<{
|
|
8
|
+
logoUrl?: string | undefined;
|
|
9
|
+
brief?: string | undefined;
|
|
10
|
+
consultation_value?: string | number | null | undefined;
|
|
11
|
+
degree?: string | undefined;
|
|
12
|
+
primer_turno?: string | undefined;
|
|
13
|
+
id: number;
|
|
14
|
+
fullName: string;
|
|
15
|
+
}[]>;
|
|
7
16
|
};
|
|
@@ -14,6 +14,32 @@ const getSpecialtiesMethods = (makeRequest) => {
|
|
|
14
14
|
description: s.specialty,
|
|
15
15
|
}));
|
|
16
16
|
});
|
|
17
|
-
return {
|
|
17
|
+
return {
|
|
18
|
+
getSpecialties,
|
|
19
|
+
getProfessionalsBySpecialty: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.professionalsBySpecialtyFilter]), zod_1.array(schemas_1.doc24Schemas.professionalsListItem), async (body = {}) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const mappedBody = {
|
|
22
|
+
specialty_id: body.specialtyId,
|
|
23
|
+
professional_id: body.professionalId,
|
|
24
|
+
offset: body.offset,
|
|
25
|
+
limit: body.limit,
|
|
26
|
+
language: (_a = body.language) !== null && _a !== void 0 ? _a : 'ES',
|
|
27
|
+
};
|
|
28
|
+
const path = `/professionals-by-specialty`;
|
|
29
|
+
const response = await makeRequest('POST', path, mappedBody);
|
|
30
|
+
const mapProfessionalResponse = (rawItem) => {
|
|
31
|
+
return {
|
|
32
|
+
id: rawItem.id_profesional,
|
|
33
|
+
fullName: rawItem.denominacion,
|
|
34
|
+
consultation_value: rawItem.consultation_value,
|
|
35
|
+
logoUrl: rawItem.logo,
|
|
36
|
+
primer_turno: rawItem.primer_turno,
|
|
37
|
+
brief: rawItem.mini_cv,
|
|
38
|
+
degree: rawItem.degree,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
return response.data.profesionales.map((o) => mapProfessionalResponse(o));
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
18
44
|
};
|
|
19
45
|
exports.getSpecialtiesMethods = getSpecialtiesMethods;
|