@integraciones_doc24/sdk 1.15.11 → 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 -74
  8. package/lib/baseSdk/user.d.ts +91 -91
  9. package/lib/baseSdk/user.js +136 -136
  10. package/lib/index.d.ts +365 -365
  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 -1816
  19. package/lib/schemas.js +421 -420
  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,82 +1,82 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDiagnosticaMethods = 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 getDiagnosticaMethods = (makeRequest) => {
9
- const getDiagnosticaHistory = async (patient, from, to) => {
10
- const path = '/history-diagnostica';
11
- const response = await makeRequest('POST', path, {
12
- patient: {
13
- gender: patient.gender,
14
- id_type: patient.identificationType,
15
- id_value: patient.identificationValue,
16
- },
17
- dateFrom: from.toISOString(),
18
- dateTo: to.toISOString(),
19
- });
20
- const list = response.data.info;
21
- return list.map((i) => ({
22
- date: new Date(Date.parse(i.date)),
23
- location: i.location,
24
- exams: i.exams,
25
- deepLink: i.deeplink,
26
- }));
27
- };
28
- const getDiagnosticaDeepLink = async (kiosk, user, patient) => {
29
- const path = '/deeplink-diagnostica';
30
- const response = await makeRequest('POST', path, {
31
- kiosk,
32
- user: mapUserData(user),
33
- patient: mapPatientData(patient),
34
- });
35
- const data = response.data.info.data;
36
- if (data.forwarding_required)
37
- return { forwardingRequired: true, deepLink: data.deeplink };
38
- return { forwardingRequired: false };
39
- };
40
- const getDiagnosticaAccess = async (kiosk, user, patient) => {
41
- const path = '/access-diagnostica';
42
- await makeRequest('POST', path, {
43
- kiosk,
44
- user: mapUserData(user),
45
- patient: mapPatientData(patient),
46
- });
47
- return;
48
- };
49
- return {
50
- getDiagnosticaHistory: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.diagnosticaPatientFilter, zod_1.date(), zod_1.date()]), schemas_1.doc24Schemas.diagnosticaHistoryAppointment.array(), getDiagnosticaHistory),
51
- getDiagnosticaDeepLink: validation_1.validateFunction(zod_1.tuple([
52
- zod_1.string(),
53
- schemas_1.doc24Schemas.diagnosticaUser,
54
- schemas_1.doc24Schemas.diagnosticaPatient,
55
- ]), schemas_1.doc24Schemas.diagnosticaDeepLinkResponse, getDiagnosticaDeepLink),
56
- getDiagnosticaAccess: validation_1.validateFunction(zod_1.tuple([
57
- zod_1.string(),
58
- schemas_1.doc24Schemas.diagnosticaUser,
59
- schemas_1.doc24Schemas.diagnosticaPatient,
60
- ]), zod_1.void(), getDiagnosticaAccess),
61
- };
62
- };
63
- exports.getDiagnosticaMethods = getDiagnosticaMethods;
64
- const mapPatientData = (patient) => {
65
- var _a;
66
- return {
67
- name: patient.firstName,
68
- surname: patient.lastName,
69
- birthday: date_fns_1.format(patient.birthday, 'yyyy-MM-dd'),
70
- id_type: 'DNI',
71
- id_value: patient.identificationValue,
72
- gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase(),
73
- };
74
- };
75
- const mapUserData = (user) => {
76
- return {
77
- ...mapPatientData(user),
78
- phone: user.phone,
79
- email: user.email,
80
- language: user.language,
81
- };
82
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDiagnosticaMethods = 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 getDiagnosticaMethods = (makeRequest) => {
9
+ const getDiagnosticaHistory = async (patient, from, to) => {
10
+ const path = '/history-diagnostica';
11
+ const response = await makeRequest('POST', path, {
12
+ patient: {
13
+ gender: patient.gender,
14
+ id_type: patient.identificationType,
15
+ id_value: patient.identificationValue,
16
+ },
17
+ dateFrom: from.toISOString(),
18
+ dateTo: to.toISOString(),
19
+ });
20
+ const list = response.data.info;
21
+ return list.map((i) => ({
22
+ date: new Date(Date.parse(i.date)),
23
+ location: i.location,
24
+ exams: i.exams,
25
+ deepLink: i.deeplink,
26
+ }));
27
+ };
28
+ const getDiagnosticaDeepLink = async (kiosk, user, patient) => {
29
+ const path = '/deeplink-diagnostica';
30
+ const response = await makeRequest('POST', path, {
31
+ kiosk,
32
+ user: mapUserData(user),
33
+ patient: mapPatientData(patient),
34
+ });
35
+ const data = response.data.info.data;
36
+ if (data.forwarding_required)
37
+ return { forwardingRequired: true, deepLink: data.deeplink };
38
+ return { forwardingRequired: false };
39
+ };
40
+ const getDiagnosticaAccess = async (kiosk, user, patient) => {
41
+ const path = '/access-diagnostica';
42
+ await makeRequest('POST', path, {
43
+ kiosk,
44
+ user: mapUserData(user),
45
+ patient: mapPatientData(patient),
46
+ });
47
+ return;
48
+ };
49
+ return {
50
+ getDiagnosticaHistory: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.diagnosticaPatientFilter, zod_1.date(), zod_1.date()]), schemas_1.doc24Schemas.diagnosticaHistoryAppointment.array(), getDiagnosticaHistory),
51
+ getDiagnosticaDeepLink: validation_1.validateFunction(zod_1.tuple([
52
+ zod_1.string(),
53
+ schemas_1.doc24Schemas.diagnosticaUser,
54
+ schemas_1.doc24Schemas.diagnosticaPatient,
55
+ ]), schemas_1.doc24Schemas.diagnosticaDeepLinkResponse, getDiagnosticaDeepLink),
56
+ getDiagnosticaAccess: validation_1.validateFunction(zod_1.tuple([
57
+ zod_1.string(),
58
+ schemas_1.doc24Schemas.diagnosticaUser,
59
+ schemas_1.doc24Schemas.diagnosticaPatient,
60
+ ]), zod_1.void(), getDiagnosticaAccess),
61
+ };
62
+ };
63
+ exports.getDiagnosticaMethods = getDiagnosticaMethods;
64
+ const mapPatientData = (patient) => {
65
+ var _a;
66
+ return {
67
+ name: patient.firstName,
68
+ surname: patient.lastName,
69
+ birthday: date_fns_1.format(patient.birthday, 'yyyy-MM-dd'),
70
+ id_type: 'DNI',
71
+ id_value: patient.identificationValue,
72
+ gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase(),
73
+ };
74
+ };
75
+ const mapUserData = (user) => {
76
+ return {
77
+ ...mapPatientData(user),
78
+ phone: user.phone,
79
+ email: user.email,
80
+ language: user.language,
81
+ };
82
+ };
@@ -1,177 +1,177 @@
1
- import { RequestMaker } from '../request';
2
- export declare const getExternalMethods: (makeRequest: RequestMaker) => {
3
- externalLogin: (params: {
4
- user: string;
5
- password: string;
6
- }) => Promise<{
7
- gender?: "m" | "f" | "o" | undefined;
8
- firstName: string;
9
- lastName: string;
10
- countryId: string;
11
- phone: string;
12
- email: string;
13
- birthday: Date;
14
- identificationNumber: string;
15
- }>;
16
- preExternalEnrollment: (params: ({
17
- birthdate: Date;
18
- identificationNumber: string;
19
- } & {
20
- phone: string;
21
- email: string;
22
- }) | ({
23
- birthdate: Date;
24
- identificationNumber: string;
25
- } & {
26
- phone?: undefined;
27
- email: string;
28
- }) | ({
29
- birthdate: Date;
30
- identificationNumber: string;
31
- } & {
32
- email?: undefined;
33
- phone: string;
34
- })) => Promise<void>;
35
- externalEnrollment: (params: ({
36
- birthdate: Date;
37
- identificationNumber: string;
38
- } & {
39
- phone: string;
40
- email: string;
41
- } & {
42
- password: string;
43
- } & {
44
- emailCode: string;
45
- phoneCode: string;
46
- }) | ({
47
- birthdate: Date;
48
- identificationNumber: string;
49
- } & {
50
- phone: string;
51
- email: string;
52
- } & {
53
- password: string;
54
- } & {
55
- phoneCode?: undefined;
56
- emailCode: string;
57
- }) | ({
58
- birthdate: Date;
59
- identificationNumber: string;
60
- } & {
61
- phone: string;
62
- email: string;
63
- } & {
64
- password: string;
65
- } & {
66
- emailCode?: undefined;
67
- phoneCode: string;
68
- }) | ({
69
- birthdate: Date;
70
- identificationNumber: string;
71
- } & {
72
- phone?: undefined;
73
- email: string;
74
- } & {
75
- password: string;
76
- } & {
77
- emailCode: string;
78
- phoneCode: string;
79
- }) | ({
80
- birthdate: Date;
81
- identificationNumber: string;
82
- } & {
83
- phone?: undefined;
84
- email: string;
85
- } & {
86
- password: string;
87
- } & {
88
- phoneCode?: undefined;
89
- emailCode: string;
90
- }) | ({
91
- birthdate: Date;
92
- identificationNumber: string;
93
- } & {
94
- phone?: undefined;
95
- email: string;
96
- } & {
97
- password: string;
98
- } & {
99
- emailCode?: undefined;
100
- phoneCode: string;
101
- }) | ({
102
- birthdate: Date;
103
- identificationNumber: string;
104
- } & {
105
- email?: undefined;
106
- phone: string;
107
- } & {
108
- password: string;
109
- } & {
110
- emailCode: string;
111
- phoneCode: string;
112
- }) | ({
113
- birthdate: Date;
114
- identificationNumber: string;
115
- } & {
116
- email?: undefined;
117
- phone: string;
118
- } & {
119
- password: string;
120
- } & {
121
- phoneCode?: undefined;
122
- emailCode: string;
123
- }) | ({
124
- birthdate: Date;
125
- identificationNumber: string;
126
- } & {
127
- email?: undefined;
128
- phone: string;
129
- } & {
130
- password: string;
131
- } & {
132
- emailCode?: undefined;
133
- phoneCode: string;
134
- })) => Promise<{
135
- gender?: "m" | "f" | "o" | undefined;
136
- firstName: string;
137
- lastName: string;
138
- countryId: string;
139
- phone: string;
140
- email: string;
141
- birthday: Date;
142
- identificationNumber: string;
143
- }>;
144
- sendExternalVerificationCode: (params: {
145
- birthdate: Date;
146
- channel: "1" | "2";
147
- identificationNumber: string;
148
- }) => Promise<void>;
149
- verifyExternalVerificationCode: (params: {
150
- code: string;
151
- birthdate: Date;
152
- channel: "1" | "2";
153
- identificationNumber: string;
154
- }) => Promise<any>;
155
- externalResetPassword: (params: ({
156
- birthdate: Date;
157
- password: string;
158
- identificationNumber: string;
159
- } & {
160
- emailCode: string;
161
- phoneCode: string;
162
- }) | ({
163
- birthdate: Date;
164
- password: string;
165
- identificationNumber: string;
166
- } & {
167
- phoneCode?: undefined;
168
- emailCode: string;
169
- }) | ({
170
- birthdate: Date;
171
- password: string;
172
- identificationNumber: string;
173
- } & {
174
- emailCode?: undefined;
175
- phoneCode: string;
176
- })) => Promise<any>;
177
- };
1
+ import { RequestMaker } from '../request';
2
+ export declare const getExternalMethods: (makeRequest: RequestMaker) => {
3
+ externalLogin: (params: {
4
+ user: string;
5
+ password: string;
6
+ }) => Promise<{
7
+ gender?: "m" | "f" | "o" | undefined;
8
+ firstName: string;
9
+ lastName: string;
10
+ countryId: string;
11
+ phone: string;
12
+ email: string;
13
+ birthday: Date;
14
+ identificationNumber: string;
15
+ }>;
16
+ preExternalEnrollment: (params: ({
17
+ birthdate: Date;
18
+ identificationNumber: string;
19
+ } & {
20
+ phone: string;
21
+ email: string;
22
+ }) | ({
23
+ birthdate: Date;
24
+ identificationNumber: string;
25
+ } & {
26
+ phone?: undefined;
27
+ email: string;
28
+ }) | ({
29
+ birthdate: Date;
30
+ identificationNumber: string;
31
+ } & {
32
+ email?: undefined;
33
+ phone: string;
34
+ })) => Promise<void>;
35
+ externalEnrollment: (params: ({
36
+ birthdate: Date;
37
+ identificationNumber: string;
38
+ } & {
39
+ phone: string;
40
+ email: string;
41
+ } & {
42
+ password: string;
43
+ } & {
44
+ emailCode: string;
45
+ phoneCode: string;
46
+ }) | ({
47
+ birthdate: Date;
48
+ identificationNumber: string;
49
+ } & {
50
+ phone: string;
51
+ email: string;
52
+ } & {
53
+ password: string;
54
+ } & {
55
+ phoneCode?: undefined;
56
+ emailCode: string;
57
+ }) | ({
58
+ birthdate: Date;
59
+ identificationNumber: string;
60
+ } & {
61
+ phone: string;
62
+ email: string;
63
+ } & {
64
+ password: string;
65
+ } & {
66
+ emailCode?: undefined;
67
+ phoneCode: string;
68
+ }) | ({
69
+ birthdate: Date;
70
+ identificationNumber: string;
71
+ } & {
72
+ phone?: undefined;
73
+ email: string;
74
+ } & {
75
+ password: string;
76
+ } & {
77
+ emailCode: string;
78
+ phoneCode: string;
79
+ }) | ({
80
+ birthdate: Date;
81
+ identificationNumber: string;
82
+ } & {
83
+ phone?: undefined;
84
+ email: string;
85
+ } & {
86
+ password: string;
87
+ } & {
88
+ phoneCode?: undefined;
89
+ emailCode: string;
90
+ }) | ({
91
+ birthdate: Date;
92
+ identificationNumber: string;
93
+ } & {
94
+ phone?: undefined;
95
+ email: string;
96
+ } & {
97
+ password: string;
98
+ } & {
99
+ emailCode?: undefined;
100
+ phoneCode: string;
101
+ }) | ({
102
+ birthdate: Date;
103
+ identificationNumber: string;
104
+ } & {
105
+ email?: undefined;
106
+ phone: string;
107
+ } & {
108
+ password: string;
109
+ } & {
110
+ emailCode: string;
111
+ phoneCode: string;
112
+ }) | ({
113
+ birthdate: Date;
114
+ identificationNumber: string;
115
+ } & {
116
+ email?: undefined;
117
+ phone: string;
118
+ } & {
119
+ password: string;
120
+ } & {
121
+ phoneCode?: undefined;
122
+ emailCode: string;
123
+ }) | ({
124
+ birthdate: Date;
125
+ identificationNumber: string;
126
+ } & {
127
+ email?: undefined;
128
+ phone: string;
129
+ } & {
130
+ password: string;
131
+ } & {
132
+ emailCode?: undefined;
133
+ phoneCode: string;
134
+ })) => Promise<{
135
+ gender?: "m" | "f" | "o" | undefined;
136
+ firstName: string;
137
+ lastName: string;
138
+ countryId: string;
139
+ phone: string;
140
+ email: string;
141
+ birthday: Date;
142
+ identificationNumber: string;
143
+ }>;
144
+ sendExternalVerificationCode: (params: {
145
+ birthdate: Date;
146
+ channel: "1" | "2";
147
+ identificationNumber: string;
148
+ }) => Promise<void>;
149
+ verifyExternalVerificationCode: (params: {
150
+ code: string;
151
+ birthdate: Date;
152
+ channel: "1" | "2";
153
+ identificationNumber: string;
154
+ }) => Promise<any>;
155
+ externalResetPassword: (params: ({
156
+ birthdate: Date;
157
+ password: string;
158
+ identificationNumber: string;
159
+ } & {
160
+ emailCode: string;
161
+ phoneCode: string;
162
+ }) | ({
163
+ birthdate: Date;
164
+ password: string;
165
+ identificationNumber: string;
166
+ } & {
167
+ phoneCode?: undefined;
168
+ emailCode: string;
169
+ }) | ({
170
+ birthdate: Date;
171
+ password: string;
172
+ identificationNumber: string;
173
+ } & {
174
+ emailCode?: undefined;
175
+ phoneCode: string;
176
+ })) => Promise<any>;
177
+ };