@integraciones_doc24/sdk 1.15.10 → 1.15.12

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.
Files changed (44) hide show
  1. package/README.md +202 -202
  2. package/lib/baseSdk/diagnostica.d.ts +54 -54
  3. package/lib/baseSdk/diagnostica.js +82 -82
  4. package/lib/baseSdk/external.d.ts +177 -177
  5. package/lib/baseSdk/external.js +96 -96
  6. package/lib/baseSdk/index.d.ts +2 -2
  7. package/lib/baseSdk/index.js +74 -73
  8. package/lib/baseSdk/user.d.ts +91 -91
  9. package/lib/baseSdk/user.js +136 -136
  10. package/lib/index.d.ts +365 -364
  11. package/lib/index.js +22 -22
  12. package/lib/request/index.d.ts +3 -3
  13. package/lib/request/index.js +26 -26
  14. package/lib/request/token.d.ts +2 -2
  15. package/lib/request/token.js +34 -34
  16. package/lib/request/validation.d.ts +10 -10
  17. package/lib/request/validation.js +28 -28
  18. package/lib/schemas.d.ts +1822 -1813
  19. package/lib/schemas.js +421 -419
  20. package/lib/types.d.ts +146 -146
  21. package/lib/types.js +2 -2
  22. package/lib/userSdk/chat.d.ts +57 -57
  23. package/lib/userSdk/chat.js +98 -98
  24. package/lib/userSdk/external.d.ts +34 -34
  25. package/lib/userSdk/external.js +72 -72
  26. package/lib/userSdk/index.d.ts +2 -2
  27. package/lib/userSdk/index.js +30 -30
  28. package/lib/userSdk/patients.d.ts +38 -38
  29. package/lib/userSdk/patients.js +67 -67
  30. package/lib/userSdk/schedule.d.ts +47 -47
  31. package/lib/userSdk/schedule.js +81 -81
  32. package/lib/userSdk/specialties.d.ts +7 -7
  33. package/lib/userSdk/specialties.js +19 -19
  34. package/lib/userSdk/videoVisit.d.ts +115 -113
  35. package/lib/userSdk/videoVisit.js +155 -154
  36. package/lib/utils.d.ts +2 -2
  37. package/lib/utils.js +16 -16
  38. package/lib/webhook/index.d.ts +2 -2
  39. package/lib/webhook/index.js +56 -56
  40. package/lib/webhook/responses.d.ts +35 -35
  41. package/lib/webhook/responses.js +42 -42
  42. package/lib/webhook/token.d.ts +2 -2
  43. package/lib/webhook/token.js +23 -23
  44. package/package.json +36 -36
@@ -1,81 +1,81 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScheduleMethods = void 0;
4
- const date_fns_1 = require("date-fns");
5
- const zod_1 = require("zod");
6
- const validation_1 = require("../request/validation");
7
- const schemas_1 = require("../schemas");
8
- const utils_1 = require("../utils");
9
- const getScheduleMethods = (makeRequest) => {
10
- const getScheduleDates = async (patientId, filter = {}) => {
11
- var _a;
12
- const mappedFilter = {
13
- specialty_id: filter.specialtyId,
14
- professional_id: filter.professionalId,
15
- language: (_a = filter.language) !== null && _a !== void 0 ? _a : 'ES',
16
- };
17
- const path = `/schedule/dates/${patientId}/${JSON.stringify(mappedFilter)}`;
18
- const response = await makeRequest('GET', path);
19
- return response.data.available_dates.map((o) => utils_1.parseDate(o.date, o.time_zone));
20
- };
21
- const getSchedule = async (patientId, specialtyId, filter = {}) => {
22
- var _a;
23
- const mappedFilter = {
24
- id_professional: filter.professionalId,
25
- offset: filter.offset,
26
- limit: filter.limit,
27
- week_day: filter.weekDay,
28
- date: filter.date && date_fns_1.format(filter.date, 'yyyy-MM-dd'),
29
- start_hour: filter.startHour,
30
- finish_hour: filter.finishHour,
31
- language: (_a = filter.language) !== null && _a !== void 0 ? _a : 'ES',
32
- };
33
- const path = `/schedule/availability/${patientId}/${specialtyId}/${JSON.stringify(mappedFilter)}`;
34
- const response = await makeRequest('GET', path);
35
- return response.data.available_appointments.map((a) => ({
36
- id: a.id,
37
- date: utils_1.parseDateTime(`${a.date} ${a.hour}`, a.time_zone),
38
- clinicId: a.clinic,
39
- professional: {
40
- id: a.professional_id,
41
- fullName: a.professional,
42
- logoUrl: a.logo,
43
- },
44
- cost: a.cost,
45
- specialty: {
46
- id: a.specialty_id,
47
- description: a.specialty,
48
- },
49
- type: a.type === 'P' ? 'appointment' : a.type === 'T' ? 'chat' : 'instant',
50
- atentions: a.atentions,
51
- ranking: a.ranking,
52
- length: a.length,
53
- consultation_value: a.consultation_value,
54
- }));
55
- };
56
- const getAppointment = async (appointmentId) => {
57
- const path = `/appointment/${appointmentId}`;
58
- const response = await makeRequest('GET', path);
59
- return {
60
- id: response.data.id,
61
- professionalId: response.data.professional_id,
62
- date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`, response.data.time_zone),
63
- };
64
- };
65
- const getAppointmentByVcToken = async (vcToken) => {
66
- const path = `/appointmentByToken/${vcToken}`;
67
- const response = await makeRequest('GET', path);
68
- return {
69
- id: response.data.id,
70
- professionalId: response.data.professional_id,
71
- date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`, response.data.time_zone),
72
- };
73
- };
74
- return {
75
- getSchedule: validation_1.validateFunction(zod_1.tuple([zod_1.number(), zod_1.number(), schemas_1.doc24Schemas.scheduleFilter.optional()]), zod_1.array(schemas_1.doc24Schemas.availableAppointment), getSchedule),
76
- getScheduleDates: validation_1.validateFunction(zod_1.tuple([zod_1.number(), schemas_1.doc24Schemas.scheduleAvailabilityFilter]), zod_1.array(zod_1.date()), getScheduleDates),
77
- getAppointment: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.appointment, getAppointment),
78
- getAppointmentByVcToken: validation_1.validateFunction(zod_1.tuple([zod_1.string()]), schemas_1.doc24Schemas.appointment, getAppointmentByVcToken),
79
- };
80
- };
81
- exports.getScheduleMethods = getScheduleMethods;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getScheduleMethods = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const zod_1 = require("zod");
6
+ const validation_1 = require("../request/validation");
7
+ const schemas_1 = require("../schemas");
8
+ const utils_1 = require("../utils");
9
+ const getScheduleMethods = (makeRequest) => {
10
+ const getScheduleDates = async (patientId, filter = {}) => {
11
+ var _a;
12
+ const mappedFilter = {
13
+ specialty_id: filter.specialtyId,
14
+ professional_id: filter.professionalId,
15
+ language: (_a = filter.language) !== null && _a !== void 0 ? _a : 'ES',
16
+ };
17
+ const path = `/schedule/dates/${patientId}/${JSON.stringify(mappedFilter)}`;
18
+ const response = await makeRequest('GET', path);
19
+ return response.data.available_dates.map((o) => utils_1.parseDate(o.date, o.time_zone));
20
+ };
21
+ const getSchedule = async (patientId, specialtyId, filter = {}) => {
22
+ var _a;
23
+ const mappedFilter = {
24
+ id_professional: filter.professionalId,
25
+ offset: filter.offset,
26
+ limit: filter.limit,
27
+ week_day: filter.weekDay,
28
+ date: filter.date && date_fns_1.format(filter.date, 'yyyy-MM-dd'),
29
+ start_hour: filter.startHour,
30
+ finish_hour: filter.finishHour,
31
+ language: (_a = filter.language) !== null && _a !== void 0 ? _a : 'ES',
32
+ };
33
+ const path = `/schedule/availability/${patientId}/${specialtyId}/${JSON.stringify(mappedFilter)}`;
34
+ const response = await makeRequest('GET', path);
35
+ return response.data.available_appointments.map((a) => ({
36
+ id: a.id,
37
+ date: utils_1.parseDateTime(`${a.date} ${a.hour}`, a.time_zone),
38
+ clinicId: a.clinic,
39
+ professional: {
40
+ id: a.professional_id,
41
+ fullName: a.professional,
42
+ logoUrl: a.logo,
43
+ },
44
+ cost: a.cost,
45
+ specialty: {
46
+ id: a.specialty_id,
47
+ description: a.specialty,
48
+ },
49
+ type: a.type === 'P' ? 'appointment' : a.type === 'T' ? 'chat' : 'instant',
50
+ atentions: a.atentions,
51
+ ranking: a.ranking,
52
+ length: a.length,
53
+ consultation_value: a.consultation_value,
54
+ }));
55
+ };
56
+ const getAppointment = async (appointmentId) => {
57
+ const path = `/appointment/${appointmentId}`;
58
+ const response = await makeRequest('GET', path);
59
+ return {
60
+ id: response.data.id,
61
+ professionalId: response.data.professional_id,
62
+ date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`, response.data.time_zone),
63
+ };
64
+ };
65
+ const getAppointmentByVcToken = async (vcToken) => {
66
+ const path = `/appointmentByToken/${vcToken}`;
67
+ const response = await makeRequest('GET', path);
68
+ return {
69
+ id: response.data.id,
70
+ professionalId: response.data.professional_id,
71
+ date: utils_1.parseDateTime(`${response.data.date} ${response.data.hour}`, response.data.time_zone),
72
+ };
73
+ };
74
+ return {
75
+ getSchedule: validation_1.validateFunction(zod_1.tuple([zod_1.number(), zod_1.number(), schemas_1.doc24Schemas.scheduleFilter.optional()]), zod_1.array(schemas_1.doc24Schemas.availableAppointment), getSchedule),
76
+ getScheduleDates: validation_1.validateFunction(zod_1.tuple([zod_1.number(), schemas_1.doc24Schemas.scheduleAvailabilityFilter]), zod_1.array(zod_1.date()), getScheduleDates),
77
+ getAppointment: validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.appointment, getAppointment),
78
+ getAppointmentByVcToken: validation_1.validateFunction(zod_1.tuple([zod_1.string()]), schemas_1.doc24Schemas.appointment, getAppointmentByVcToken),
79
+ };
80
+ };
81
+ exports.getScheduleMethods = getScheduleMethods;
@@ -1,7 +1,7 @@
1
- import { RequestMaker } from '../request';
2
- export declare const getSpecialtiesMethods: (makeRequest: RequestMaker) => {
3
- getSpecialties: (mode: "appointment" | "chat" | "instant", language: string) => Promise<{
4
- id: number;
5
- description: string;
6
- }[]>;
7
- };
1
+ import { RequestMaker } from '../request';
2
+ export declare const getSpecialtiesMethods: (makeRequest: RequestMaker) => {
3
+ getSpecialties: (mode: "appointment" | "chat" | "instant", language: string) => Promise<{
4
+ id: number;
5
+ description: string;
6
+ }[]>;
7
+ };
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSpecialtiesMethods = void 0;
4
- const zod_1 = require("zod");
5
- const validation_1 = require("../request/validation");
6
- const schemas_1 = require("../schemas");
7
- const getSpecialtiesMethods = (makeRequest) => {
8
- const getSpecialties = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.specialtyMode, zod_1.string()]), zod_1.array(schemas_1.doc24Schemas.specialty), async (mode, language) => {
9
- const type = mode === 'appointment' ? 'P' : mode === 'chat' ? 'T' : 'E';
10
- const path = `/specialties/${type}/${language.toUpperCase()}`;
11
- const response = await makeRequest('GET', path);
12
- return response.data.specialties.map((s) => ({
13
- id: s.specialty_id,
14
- description: s.specialty,
15
- }));
16
- });
17
- return { getSpecialties };
18
- };
19
- exports.getSpecialtiesMethods = getSpecialtiesMethods;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSpecialtiesMethods = void 0;
4
+ const zod_1 = require("zod");
5
+ const validation_1 = require("../request/validation");
6
+ const schemas_1 = require("../schemas");
7
+ const getSpecialtiesMethods = (makeRequest) => {
8
+ const getSpecialties = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.specialtyMode, zod_1.string()]), zod_1.array(schemas_1.doc24Schemas.specialty), async (mode, language) => {
9
+ const type = mode === 'appointment' ? 'P' : mode === 'chat' ? 'T' : 'E';
10
+ const path = `/specialties/${type}/${language.toUpperCase()}`;
11
+ const response = await makeRequest('GET', path);
12
+ return response.data.specialties.map((s) => ({
13
+ id: s.specialty_id,
14
+ description: s.specialty,
15
+ }));
16
+ });
17
+ return { getSpecialties };
18
+ };
19
+ exports.getSpecialtiesMethods = getSpecialtiesMethods;
@@ -1,113 +1,115 @@
1
- import { RequestMaker } from '../request';
2
- export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
3
- scheduleVideoVisit: (params: {
4
- extraInfo?: any;
5
- type: "appointment";
6
- patientId: number;
7
- specialtyId: number;
8
- language: string;
9
- details: string;
10
- appointmentId: string | number;
11
- } | {
12
- extraInfo?: any;
13
- type: "instant";
14
- patientId: number;
15
- specialtyId: number;
16
- language: string;
17
- details: string;
18
- }) => Promise<string>;
19
- cancelVideoVisit: (vcToken: string) => Promise<void>;
20
- getVideoVisit: (vcToken: string, patientId: number) => Promise<{
21
- appointment?: {
22
- date: Date;
23
- id: number;
24
- } | undefined;
25
- videoVisit?: {
26
- id: number;
27
- status: string;
28
- } | undefined;
29
- paymentStatus?: string | undefined;
30
- atentionId?: number | undefined;
31
- id: number | null;
32
- patientId: number;
33
- creationDate: Date;
34
- user: {
35
- phone: string | null;
36
- email: string | null;
37
- id: number;
38
- };
39
- vcToken: string;
40
- }>;
41
- getPatientVideoVisitHistory: (patientId: number) => Promise<{
42
- appointment?: {
43
- date: Date;
44
- id: number;
45
- } | undefined;
46
- videoVisit?: {
47
- id: number;
48
- status: string;
49
- } | undefined;
50
- paymentStatus?: string | undefined;
51
- atentionId?: number | undefined;
52
- id: number | null;
53
- patientId: number;
54
- professional: string;
55
- creationDate: Date;
56
- user: {
57
- phone: string | null;
58
- email: string | null;
59
- id: number;
60
- };
61
- vcToken: string;
62
- specialty: string;
63
- }[]>;
64
- getVideoVisitDetails: (vcId: number) => Promise<{
65
- professional?: {
66
- id: number;
67
- fullName: string;
68
- } | undefined;
69
- appointment: {
70
- date: Date;
71
- id: number;
72
- } | null;
73
- id: number;
74
- language: string;
75
- patient: {
76
- fullName: string;
77
- firstAccessDate: Date;
78
- lastAccessDate: Date;
79
- };
80
- status: string;
81
- paymentStatus: string;
82
- finishDate: Date | null;
83
- retries: number;
84
- report: {
85
- motive: string | null;
86
- actualDesease: string | null;
87
- indications: string | null;
88
- alertSigns: string | null;
89
- extendedMotive: string | null;
90
- diagnose: {
91
- code: string;
92
- description: string;
93
- }[];
94
- };
95
- pdf: {
96
- atention?: string | undefined;
97
- labs?: string | undefined;
98
- otherExams?: string | undefined;
99
- images?: string | undefined;
100
- medication: any[];
101
- };
102
- files: {
103
- name: string;
104
- url: string;
105
- }[];
106
- }>;
107
- getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
108
- getActiveVideoVisits: () => Promise<{
109
- patientId: number;
110
- vcToken: string;
111
- consultationId: number;
112
- }[]>;
113
- };
1
+ import { RequestMaker } from '../request';
2
+ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
3
+ scheduleVideoVisit: (params: {
4
+ extraInfo?: any;
5
+ type: "appointment";
6
+ patientId: number;
7
+ specialtyId: number;
8
+ language: string;
9
+ details: string;
10
+ appointmentId: string | number;
11
+ } | {
12
+ extraInfo?: any;
13
+ type: "instant";
14
+ patientId: number;
15
+ specialtyId: number;
16
+ language: string;
17
+ details: string;
18
+ }) => Promise<string>;
19
+ cancelVideoVisit: (vcToken: string) => Promise<void>;
20
+ getVideoVisit: (vcToken: string, patientId: number) => Promise<{
21
+ appointment?: {
22
+ date: Date;
23
+ id: number;
24
+ } | undefined;
25
+ videoVisit?: {
26
+ id: number;
27
+ status: string;
28
+ } | undefined;
29
+ paymentStatus?: string | undefined;
30
+ atentionId?: number | undefined;
31
+ waitingTime?: string | undefined;
32
+ id: number | null;
33
+ patientId: number;
34
+ creationDate: Date;
35
+ user: {
36
+ phone: string | null;
37
+ email: string | null;
38
+ id: number;
39
+ };
40
+ vcToken: string;
41
+ }>;
42
+ getPatientVideoVisitHistory: (patientId: number) => Promise<{
43
+ appointment?: {
44
+ date: Date;
45
+ id: number;
46
+ } | undefined;
47
+ videoVisit?: {
48
+ id: number;
49
+ status: string;
50
+ } | undefined;
51
+ paymentStatus?: string | undefined;
52
+ atentionId?: number | undefined;
53
+ waitingTime?: string | undefined;
54
+ id: number | null;
55
+ patientId: number;
56
+ professional: string;
57
+ creationDate: Date;
58
+ user: {
59
+ phone: string | null;
60
+ email: string | null;
61
+ id: number;
62
+ };
63
+ vcToken: string;
64
+ specialty: string;
65
+ }[]>;
66
+ getVideoVisitDetails: (vcId: number) => Promise<{
67
+ professional?: {
68
+ id: number;
69
+ fullName: string;
70
+ } | undefined;
71
+ appointment: {
72
+ date: Date;
73
+ id: number;
74
+ } | null;
75
+ id: number;
76
+ language: string;
77
+ patient: {
78
+ fullName: string;
79
+ firstAccessDate: Date;
80
+ lastAccessDate: Date;
81
+ };
82
+ status: string;
83
+ paymentStatus: string;
84
+ finishDate: Date | null;
85
+ retries: number;
86
+ report: {
87
+ motive: string | null;
88
+ actualDesease: string | null;
89
+ indications: string | null;
90
+ alertSigns: string | null;
91
+ extendedMotive: string | null;
92
+ diagnose: {
93
+ code: string;
94
+ description: string;
95
+ }[];
96
+ };
97
+ pdf: {
98
+ atention?: string | undefined;
99
+ labs?: string | undefined;
100
+ otherExams?: string | undefined;
101
+ images?: string | undefined;
102
+ medication: any[];
103
+ };
104
+ files: {
105
+ name: string;
106
+ url: string;
107
+ }[];
108
+ }>;
109
+ getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
110
+ getActiveVideoVisits: () => Promise<{
111
+ patientId: number;
112
+ vcToken: string;
113
+ consultationId: number;
114
+ }[]>;
115
+ };