@integraciones_doc24/sdk 1.4.2 → 1.5.1

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.
@@ -1,7 +1,7 @@
1
1
  import { RequestMaker } from '../request';
2
2
  export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
3
3
  getDiagnosticaHistory: (patient: {
4
- identificationType: "ndi" | "passport" | "credential";
4
+ identificationType: "DNI";
5
5
  identificationValue: string;
6
6
  gender: "m" | "f";
7
7
  }, from: Date, to: Date) => Promise<{
@@ -13,7 +13,7 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
13
13
  getDiagnosticaDeepLink: (kiosk: string, user: {
14
14
  firstName: string;
15
15
  lastName: string;
16
- identificationType: "dni";
16
+ identificationType: "DNI";
17
17
  identificationValue: string;
18
18
  gender: "m" | "f";
19
19
  phone: string;
@@ -23,7 +23,7 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
23
23
  }, patient: {
24
24
  firstName: string;
25
25
  lastName: string;
26
- identificationType: "dni";
26
+ identificationType: "DNI";
27
27
  identificationValue: string;
28
28
  gender: "m" | "f";
29
29
  birthday: Date;
@@ -36,7 +36,7 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
36
36
  getDiagnosticaAccess: (kiosk: string, user: {
37
37
  firstName: string;
38
38
  lastName: string;
39
- identificationType: "dni";
39
+ identificationType: "DNI";
40
40
  identificationValue: string;
41
41
  gender: "m" | "f";
42
42
  phone: string;
@@ -46,7 +46,7 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
46
46
  }, patient: {
47
47
  firstName: string;
48
48
  lastName: string;
49
- identificationType: "dni";
49
+ identificationType: "DNI";
50
50
  identificationValue: string;
51
51
  gender: "m" | "f";
52
52
  birthday: Date;
@@ -5,7 +5,7 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
5
5
  user: {
6
6
  firstName: string;
7
7
  lastName: string;
8
- identificationType: "ndi" | "passport" | "credential";
8
+ identificationType: number;
9
9
  identificationValue: string;
10
10
  countryId: string;
11
11
  birthdate: Date;
@@ -30,7 +30,7 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
30
30
  getUserId: (user: {
31
31
  firstName: string;
32
32
  lastName: string;
33
- identificationType: "ndi" | "passport" | "credential";
33
+ identificationType: number;
34
34
  identificationValue: string;
35
35
  countryId: string;
36
36
  birthdate: Date;
@@ -39,14 +39,14 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
39
39
  email: string;
40
40
  }) => Promise<number>;
41
41
  getVerificationCode: (params: {
42
- identificationType: "ndi" | "passport" | "credential";
42
+ identificationType: number;
43
43
  identificationValue: string;
44
44
  channel: "1" | "2";
45
45
  }) => Promise<void>;
46
46
  getUserInstance: (user: number | {
47
47
  firstName: string;
48
48
  lastName: string;
49
- identificationType: "ndi" | "passport" | "credential";
49
+ identificationType: number;
50
50
  identificationValue: string;
51
51
  countryId: string;
52
52
  birthdate: Date;
@@ -13,7 +13,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
13
13
  const mappedUser = {
14
14
  lastname: user.lastName,
15
15
  firstname: user.firstName,
16
- identification_type: utils_1.getIdetificationTypeId(user.identificationType),
16
+ identification_type: user.identificationType,
17
17
  identification_value: user.identificationValue,
18
18
  birthdate: date_fns_1.format(user.birthdate, 'yyyy-MM-dd'),
19
19
  gender: user.gender.toUpperCase(),
@@ -41,7 +41,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
41
41
  const mappedUser = {
42
42
  lastname: user.lastName,
43
43
  firstname: user.firstName,
44
- identification_type: utils_1.getIdetificationTypeId(user.identificationType),
44
+ identification_type: user.identificationType,
45
45
  identification_value: user.identificationValue,
46
46
  birthdate: date_fns_1.format(user.birthdate, 'yyyy-MM-dd'),
47
47
  gender: user.gender.toUpperCase(),
@@ -57,7 +57,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
57
57
  const getVerificationCode = async (params) => {
58
58
  const path = '/send-verification-code';
59
59
  const mappedParams = {
60
- identification_type: utils_1.getIdetificationTypeId(params.identificationType),
60
+ identification_type: params.identificationType,
61
61
  identification_value: params.identificationValue,
62
62
  channel: parseInt(params.channel),
63
63
  };
package/lib/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
9
9
  user: {
10
10
  firstName: string;
11
11
  lastName: string;
12
- identificationType: "ndi" | "passport" | "credential";
12
+ identificationType: number;
13
13
  identificationValue: string;
14
14
  countryId: string;
15
15
  birthdate: Date;
@@ -34,7 +34,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
34
34
  getUserId: (user: {
35
35
  firstName: string;
36
36
  lastName: string;
37
- identificationType: "ndi" | "passport" | "credential";
37
+ identificationType: number;
38
38
  identificationValue: string;
39
39
  countryId: string;
40
40
  birthdate: Date;
@@ -45,7 +45,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
45
45
  getUserInstance: (user: number | {
46
46
  firstName: string;
47
47
  lastName: string;
48
- identificationType: "ndi" | "passport" | "credential";
48
+ identificationType: number;
49
49
  identificationValue: string;
50
50
  countryId: string;
51
51
  birthdate: Date;
@@ -131,12 +131,12 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
131
131
  authorizationCodeExpiration: Date | null;
132
132
  } | null>;
133
133
  getVerificationCode: (params: {
134
- identificationType: "ndi" | "passport" | "credential";
134
+ identificationType: number;
135
135
  identificationValue: string;
136
136
  channel: "1" | "2";
137
137
  }) => Promise<void>;
138
138
  getDiagnosticaHistory: (patient: {
139
- identificationType: "ndi" | "passport" | "credential";
139
+ identificationType: "DNI";
140
140
  identificationValue: string;
141
141
  gender: "m" | "f";
142
142
  }, from: Date, to: Date) => Promise<{
@@ -148,7 +148,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
148
148
  getDiagnosticaDeepLink: (kiosk: string, user: {
149
149
  firstName: string;
150
150
  lastName: string;
151
- identificationType: "dni";
151
+ identificationType: "DNI";
152
152
  identificationValue: string;
153
153
  gender: "m" | "f";
154
154
  phone: string;
@@ -158,7 +158,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
158
158
  }, patient: {
159
159
  firstName: string;
160
160
  lastName: string;
161
- identificationType: "dni";
161
+ identificationType: "DNI";
162
162
  identificationValue: string;
163
163
  gender: "m" | "f";
164
164
  birthday: Date;
@@ -171,7 +171,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
171
171
  getDiagnosticaAccess: (kiosk: string, user: {
172
172
  firstName: string;
173
173
  lastName: string;
174
- identificationType: "dni";
174
+ identificationType: "DNI";
175
175
  identificationValue: string;
176
176
  gender: "m" | "f";
177
177
  phone: string;
@@ -181,7 +181,7 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
181
181
  }, patient: {
182
182
  firstName: string;
183
183
  lastName: string;
184
- identificationType: "dni";
184
+ identificationType: "DNI";
185
185
  identificationValue: string;
186
186
  gender: "m" | "f";
187
187
  birthday: Date;
package/lib/schemas.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export declare const doc24Schemas: {
2
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
3
2
  sdkCredentials: import("zod").ZodObject<{
4
3
  iss: import("zod").ZodString;
5
4
  key: import("zod").ZodString;
@@ -38,7 +37,7 @@ export declare const doc24Schemas: {
38
37
  user: import("zod").ZodObject<import("zod").extendShape<{
39
38
  firstName: import("zod").ZodString;
40
39
  lastName: import("zod").ZodString;
41
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
40
+ identificationType: import("zod").ZodNumber;
42
41
  identificationValue: import("zod").ZodString;
43
42
  countryId: import("zod").ZodString;
44
43
  birthdate: import("zod").ZodDate;
@@ -49,7 +48,7 @@ export declare const doc24Schemas: {
49
48
  }>, "strip", import("zod").ZodTypeAny, {
50
49
  firstName: string;
51
50
  lastName: string;
52
- identificationType: "ndi" | "passport" | "credential";
51
+ identificationType: number;
53
52
  identificationValue: string;
54
53
  countryId: string;
55
54
  birthdate: Date;
@@ -59,7 +58,7 @@ export declare const doc24Schemas: {
59
58
  }, {
60
59
  firstName: string;
61
60
  lastName: string;
62
- identificationType: "ndi" | "passport" | "credential";
61
+ identificationType: number;
63
62
  identificationValue: string;
64
63
  countryId: string;
65
64
  birthdate: Date;
@@ -70,7 +69,7 @@ export declare const doc24Schemas: {
70
69
  patient: import("zod").ZodObject<{
71
70
  firstName: import("zod").ZodString;
72
71
  lastName: import("zod").ZodString;
73
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
72
+ identificationType: import("zod").ZodNumber;
74
73
  identificationValue: import("zod").ZodString;
75
74
  countryId: import("zod").ZodString;
76
75
  birthdate: import("zod").ZodDate;
@@ -78,7 +77,7 @@ export declare const doc24Schemas: {
78
77
  }, "strip", import("zod").ZodTypeAny, {
79
78
  firstName: string;
80
79
  lastName: string;
81
- identificationType: "ndi" | "passport" | "credential";
80
+ identificationType: number;
82
81
  identificationValue: string;
83
82
  countryId: string;
84
83
  birthdate: Date;
@@ -86,7 +85,7 @@ export declare const doc24Schemas: {
86
85
  }, {
87
86
  firstName: string;
88
87
  lastName: string;
89
- identificationType: "ndi" | "passport" | "credential";
88
+ identificationType: number;
90
89
  identificationValue: string;
91
90
  countryId: string;
92
91
  birthdate: Date;
@@ -945,14 +944,14 @@ export declare const doc24Schemas: {
945
944
  }>;
946
945
  diagnosticaPatientFilter: import("zod").ZodObject<{
947
946
  gender: import("zod").ZodEnum<["m", "f"]>;
948
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
947
+ identificationType: import("zod").ZodLiteral<"DNI">;
949
948
  identificationValue: import("zod").ZodString;
950
949
  }, "strip", import("zod").ZodTypeAny, {
951
- identificationType: "ndi" | "passport" | "credential";
950
+ identificationType: "DNI";
952
951
  identificationValue: string;
953
952
  gender: "m" | "f";
954
953
  }, {
955
- identificationType: "ndi" | "passport" | "credential";
954
+ identificationType: "DNI";
956
955
  identificationValue: string;
957
956
  gender: "m" | "f";
958
957
  }>;
@@ -976,7 +975,7 @@ export declare const doc24Schemas: {
976
975
  firstName: import("zod").ZodString;
977
976
  lastName: import("zod").ZodString;
978
977
  birthday: import("zod").ZodDate;
979
- identificationType: import("zod").ZodLiteral<"dni">;
978
+ identificationType: import("zod").ZodLiteral<"DNI">;
980
979
  identificationValue: import("zod").ZodString;
981
980
  gender: import("zod").ZodEnum<["m", "f"]>;
982
981
  }, {
@@ -986,7 +985,7 @@ export declare const doc24Schemas: {
986
985
  }>, "strip", import("zod").ZodTypeAny, {
987
986
  firstName: string;
988
987
  lastName: string;
989
- identificationType: "dni";
988
+ identificationType: "DNI";
990
989
  identificationValue: string;
991
990
  gender: "m" | "f";
992
991
  phone: string;
@@ -996,7 +995,7 @@ export declare const doc24Schemas: {
996
995
  }, {
997
996
  firstName: string;
998
997
  lastName: string;
999
- identificationType: "dni";
998
+ identificationType: "DNI";
1000
999
  identificationValue: string;
1001
1000
  gender: "m" | "f";
1002
1001
  phone: string;
@@ -1008,20 +1007,20 @@ export declare const doc24Schemas: {
1008
1007
  firstName: import("zod").ZodString;
1009
1008
  lastName: import("zod").ZodString;
1010
1009
  birthday: import("zod").ZodDate;
1011
- identificationType: import("zod").ZodLiteral<"dni">;
1010
+ identificationType: import("zod").ZodLiteral<"DNI">;
1012
1011
  identificationValue: import("zod").ZodString;
1013
1012
  gender: import("zod").ZodEnum<["m", "f"]>;
1014
1013
  }, "strip", import("zod").ZodTypeAny, {
1015
1014
  firstName: string;
1016
1015
  lastName: string;
1017
- identificationType: "dni";
1016
+ identificationType: "DNI";
1018
1017
  identificationValue: string;
1019
1018
  gender: "m" | "f";
1020
1019
  birthday: Date;
1021
1020
  }, {
1022
1021
  firstName: string;
1023
1022
  lastName: string;
1024
- identificationType: "dni";
1023
+ identificationType: "DNI";
1025
1024
  identificationValue: string;
1026
1025
  gender: "m" | "f";
1027
1026
  birthday: Date;
@@ -1113,15 +1112,15 @@ export declare const doc24Schemas: {
1113
1112
  authorizationCodeExpiration: Date | null;
1114
1113
  }>>;
1115
1114
  getVerificationCodeParams: import("zod").ZodObject<{
1116
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
1115
+ identificationType: import("zod").ZodNumber;
1117
1116
  identificationValue: import("zod").ZodString;
1118
1117
  channel: import("zod").ZodEnum<["1", "2"]>;
1119
1118
  }, "strip", import("zod").ZodTypeAny, {
1120
- identificationType: "ndi" | "passport" | "credential";
1119
+ identificationType: number;
1121
1120
  identificationValue: string;
1122
1121
  channel: "1" | "2";
1123
1122
  }, {
1124
- identificationType: "ndi" | "passport" | "credential";
1123
+ identificationType: number;
1125
1124
  identificationValue: string;
1126
1125
  channel: "1" | "2";
1127
1126
  }>;
@@ -1129,7 +1128,7 @@ export declare const doc24Schemas: {
1129
1128
  user: import("zod").ZodObject<import("zod").extendShape<{
1130
1129
  firstName: import("zod").ZodString;
1131
1130
  lastName: import("zod").ZodString;
1132
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
1131
+ identificationType: import("zod").ZodNumber;
1133
1132
  identificationValue: import("zod").ZodString;
1134
1133
  countryId: import("zod").ZodString;
1135
1134
  birthdate: import("zod").ZodDate;
@@ -1140,7 +1139,7 @@ export declare const doc24Schemas: {
1140
1139
  }>, "strip", import("zod").ZodTypeAny, {
1141
1140
  firstName: string;
1142
1141
  lastName: string;
1143
- identificationType: "ndi" | "passport" | "credential";
1142
+ identificationType: number;
1144
1143
  identificationValue: string;
1145
1144
  countryId: string;
1146
1145
  birthdate: Date;
@@ -1150,7 +1149,7 @@ export declare const doc24Schemas: {
1150
1149
  }, {
1151
1150
  firstName: string;
1152
1151
  lastName: string;
1153
- identificationType: "ndi" | "passport" | "credential";
1152
+ identificationType: number;
1154
1153
  identificationValue: string;
1155
1154
  countryId: string;
1156
1155
  birthdate: Date;
@@ -1162,7 +1161,7 @@ export declare const doc24Schemas: {
1162
1161
  user: {
1163
1162
  firstName: string;
1164
1163
  lastName: string;
1165
- identificationType: "ndi" | "passport" | "credential";
1164
+ identificationType: number;
1166
1165
  identificationValue: string;
1167
1166
  countryId: string;
1168
1167
  birthdate: Date;
@@ -1174,7 +1173,7 @@ export declare const doc24Schemas: {
1174
1173
  user: {
1175
1174
  firstName: string;
1176
1175
  lastName: string;
1177
- identificationType: "ndi" | "passport" | "credential";
1176
+ identificationType: number;
1178
1177
  identificationValue: string;
1179
1178
  countryId: string;
1180
1179
  birthdate: Date;
@@ -1233,7 +1232,7 @@ export declare const doc24Schemas: {
1233
1232
  patient: import("zod").ZodObject<{
1234
1233
  firstName: import("zod").ZodString;
1235
1234
  lastName: import("zod").ZodString;
1236
- identificationType: import("zod").ZodEnum<["ndi", "passport", "credential"]>;
1235
+ identificationType: import("zod").ZodNumber;
1237
1236
  identificationValue: import("zod").ZodString;
1238
1237
  countryId: import("zod").ZodString;
1239
1238
  birthdate: import("zod").ZodDate;
@@ -1241,7 +1240,7 @@ export declare const doc24Schemas: {
1241
1240
  }, "strip", import("zod").ZodTypeAny, {
1242
1241
  firstName: string;
1243
1242
  lastName: string;
1244
- identificationType: "ndi" | "passport" | "credential";
1243
+ identificationType: number;
1245
1244
  identificationValue: string;
1246
1245
  countryId: string;
1247
1246
  birthdate: Date;
@@ -1249,7 +1248,7 @@ export declare const doc24Schemas: {
1249
1248
  }, {
1250
1249
  firstName: string;
1251
1250
  lastName: string;
1252
- identificationType: "ndi" | "passport" | "credential";
1251
+ identificationType: number;
1253
1252
  identificationValue: string;
1254
1253
  countryId: string;
1255
1254
  birthdate: Date;
@@ -1259,7 +1258,7 @@ export declare const doc24Schemas: {
1259
1258
  patient: {
1260
1259
  firstName: string;
1261
1260
  lastName: string;
1262
- identificationType: "ndi" | "passport" | "credential";
1261
+ identificationType: number;
1263
1262
  identificationValue: string;
1264
1263
  countryId: string;
1265
1264
  birthdate: Date;
@@ -1269,7 +1268,7 @@ export declare const doc24Schemas: {
1269
1268
  patient: {
1270
1269
  firstName: string;
1271
1270
  lastName: string;
1272
- identificationType: "ndi" | "passport" | "credential";
1271
+ identificationType: number;
1273
1272
  identificationValue: string;
1274
1273
  countryId: string;
1275
1274
  birthdate: Date;
@@ -1287,12 +1286,18 @@ export declare const doc24Schemas: {
1287
1286
  }>>;
1288
1287
  declarePatientResponse: import("zod").ZodUnion<[import("zod").ZodObject<{
1289
1288
  userInfo: import("zod").ZodObject<{
1289
+ firstName: import("zod").ZodString;
1290
+ lastName: import("zod").ZodString;
1290
1291
  email: import("zod").ZodString;
1291
1292
  phone: import("zod").ZodString;
1292
1293
  }, "strip", import("zod").ZodTypeAny, {
1294
+ firstName: string;
1295
+ lastName: string;
1293
1296
  phone: string;
1294
1297
  email: string;
1295
1298
  }, {
1299
+ firstName: string;
1300
+ lastName: string;
1296
1301
  phone: string;
1297
1302
  email: string;
1298
1303
  }>;
@@ -1300,12 +1305,16 @@ export declare const doc24Schemas: {
1300
1305
  }, "strip", import("zod").ZodTypeAny, {
1301
1306
  askCode: true;
1302
1307
  userInfo: {
1308
+ firstName: string;
1309
+ lastName: string;
1303
1310
  phone: string;
1304
1311
  email: string;
1305
1312
  };
1306
1313
  }, {
1307
1314
  askCode: true;
1308
1315
  userInfo: {
1316
+ firstName: string;
1317
+ lastName: string;
1309
1318
  phone: string;
1310
1319
  email: string;
1311
1320
  };
package/lib/schemas.js CHANGED
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doc24Schemas = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const gender = zod_1.enum(['m', 'f']);
6
- const identificationType = zod_1.enum(['ndi', 'passport', 'credential']);
6
+ // const identificationType = zEnum(['ndi', 'passport', 'credential']);
7
7
  const sdkCredentials = zod_1.object({ iss: zod_1.string(), key: zod_1.string() });
8
8
  const basePersonData = zod_1.object({
9
9
  firstName: zod_1.string(),
10
10
  lastName: zod_1.string(),
11
- identificationType,
11
+ identificationType: zod_1.number(),
12
12
  identificationValue: zod_1.string(),
13
13
  countryId: zod_1.string(),
14
14
  birthdate: zod_1.date(),
@@ -137,7 +137,7 @@ const diagnosticaPatient = zod_1.object({
137
137
  firstName: zod_1.string(),
138
138
  lastName: zod_1.string(),
139
139
  birthday: zod_1.date(),
140
- identificationType: zod_1.literal('dni'),
140
+ identificationType: zod_1.literal('DNI'),
141
141
  identificationValue: zod_1.string(),
142
142
  gender: gender,
143
143
  });
@@ -175,7 +175,7 @@ const coverageInfo = zod_1.object({
175
175
  authorizationCodeExpiration: zod_1.date().nullable(),
176
176
  }).nullable();
177
177
  const getVerificationCodeParams = zod_1.object({
178
- identificationType,
178
+ identificationType: zod_1.number(),
179
179
  identificationValue: zod_1.string(),
180
180
  channel: zod_1.enum(['1', '2']),
181
181
  });
@@ -191,6 +191,8 @@ const declarePatientParams = zod_1.object({
191
191
  }).and(verificationParams);
192
192
  const declarePatientResponse = zod_1.object({
193
193
  userInfo: zod_1.object({
194
+ firstName: zod_1.string(),
195
+ lastName: zod_1.string(),
194
196
  email: zod_1.string(),
195
197
  phone: zod_1.string(),
196
198
  }),
@@ -211,7 +213,6 @@ const declareUserResponse = zod_1.object({
211
213
  userId: zod_1.number(),
212
214
  }));
213
215
  exports.doc24Schemas = {
214
- identificationType,
215
216
  sdkCredentials,
216
217
  sdkParams: zod_1.object({ url: zod_1.string(), credentials: sdkCredentials }),
217
218
  user,
@@ -321,7 +322,7 @@ exports.doc24Schemas = {
321
322
  enrollmentParams,
322
323
  diagnosticaPatientFilter: zod_1.object({
323
324
  gender,
324
- identificationType,
325
+ identificationType: zod_1.literal('DNI'),
325
326
  identificationValue: zod_1.string(),
326
327
  }),
327
328
  diagnosticaHistoryAppointment,
package/lib/types.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { TypeOf } from 'zod';
2
2
  import { doc24Schemas } from './schemas';
3
3
  export declare namespace Doc24 {
4
- type IdentificationType = TypeOf<typeof doc24Schemas.identificationType>;
5
4
  type SdkCredentials = TypeOf<typeof doc24Schemas.sdkCredentials>;
6
5
  type SdkParams = TypeOf<typeof doc24Schemas.sdkParams>;
7
6
  type User = TypeOf<typeof doc24Schemas.user>;
@@ -4,7 +4,7 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
4
4
  patient: {
5
5
  firstName: string;
6
6
  lastName: string;
7
- identificationType: "ndi" | "passport" | "credential";
7
+ identificationType: number;
8
8
  identificationValue: string;
9
9
  countryId: string;
10
10
  birthdate: Date;
@@ -16,6 +16,8 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
16
16
  }) => Promise<{
17
17
  askCode: true;
18
18
  userInfo: {
19
+ firstName: string;
20
+ lastName: string;
19
21
  phone: string;
20
22
  email: string;
21
23
  };
@@ -26,7 +28,7 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
26
28
  getPatientId: (patient: {
27
29
  firstName: string;
28
30
  lastName: string;
29
- identificationType: "ndi" | "passport" | "credential";
31
+ identificationType: number;
30
32
  identificationValue: string;
31
33
  countryId: string;
32
34
  birthdate: Date;
@@ -5,14 +5,13 @@ const date_fns_1 = require("date-fns");
5
5
  const zod_1 = require("zod");
6
6
  const validation_1 = require("../request/validation");
7
7
  const schemas_1 = require("../schemas");
8
- const utils_1 = require("../utils");
9
8
  const getPatientMethods = (makeRequest) => {
10
9
  const declarePatient = async ({ patient, channel, code, }) => {
11
10
  const path = '/patient';
12
11
  const mappedPatient = {
13
12
  lastname: patient.lastName,
14
13
  firstname: patient.firstName,
15
- identification_type: utils_1.getIdetificationTypeId(patient.identificationType),
14
+ identification_type: patient.identificationType,
16
15
  identification_value: patient.identificationValue,
17
16
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
18
17
  gender: patient.gender.toUpperCase(),
@@ -27,7 +26,12 @@ const getPatientMethods = (makeRequest) => {
27
26
  const data = response.data;
28
27
  if (data.ask_code)
29
28
  return {
30
- userInfo: data.user_info,
29
+ userInfo: {
30
+ firstName: data.user_info.firstname,
31
+ lastName: data.user_info.lastname,
32
+ phone: data.user_info.phone,
33
+ email: data.user_info.email,
34
+ },
31
35
  askCode: true,
32
36
  };
33
37
  return { askCode: false, patientId: data.patient_id };
@@ -37,7 +41,7 @@ const getPatientMethods = (makeRequest) => {
37
41
  const mappedPatient = {
38
42
  lastname: patient.lastName,
39
43
  firstname: patient.firstName,
40
- identification_type: utils_1.getIdetificationTypeId(patient.identificationType),
44
+ identification_type: patient.identificationType,
41
45
  identification_value: patient.identificationValue,
42
46
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
43
47
  gender: patient.gender.toUpperCase(),
package/lib/utils.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- import { Doc24 } from '.';
2
1
  export declare const parseDate: (str: string) => Date;
3
2
  export declare const parseDateTime: (str: string) => Date;
4
- export declare const getIdetificationTypeId: (type: Doc24.IdentificationType) => 6 | 5 | 999;
package/lib/utils.js CHANGED
@@ -1,19 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getIdetificationTypeId = exports.parseDateTime = exports.parseDate = void 0;
3
+ exports.parseDateTime = exports.parseDate = void 0;
4
4
  const date_fns_1 = require("date-fns");
5
+ // import {Doc24} from '.';
5
6
  const timeZone = '-03';
6
7
  const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
7
8
  exports.parseDate = parseDate;
8
9
  const parseDateTime = (str) => date_fns_1.parse(`${str} ${timeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
9
10
  exports.parseDateTime = parseDateTime;
10
- const getIdetificationTypeId = (type) => {
11
- if (type === 'ndi')
12
- return 6;
13
- if (type === 'passport')
14
- return 5;
15
- if (type === 'credential')
16
- return 999;
17
- throw new Error('Invalid identificationType');
18
- };
19
- exports.getIdetificationTypeId = getIdetificationTypeId;
11
+ // export const getIdetificationTypeId = (type: Doc24.IdentificationType) => {
12
+ // if (type === 'ndi') return 6;
13
+ // if (type === 'passport') return 5;
14
+ // if (type === 'credential') return 999;
15
+ // throw new Error('Invalid identificationType');
16
+ // };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.4.2",
3
+ "version": "1.5.1",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },