@integraciones_doc24/sdk 0.34.1 → 0.34.3

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.
@@ -15,27 +15,27 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
15
15
  getUserInstance: (...params: any) => Promise<any>;
16
16
  enroll: (...params: any) => Promise<void>;
17
17
  getConverageInfo: (identificationValue: string) => Promise<{
18
+ firstName: string | null;
19
+ lastName: string | null;
20
+ gender: "m" | "f";
18
21
  email: string | null;
22
+ birthdate: Date;
23
+ identificationNumber: string;
19
24
  plan: string | null;
20
- id_afiliacion_default: number | null;
21
- id_financiador: number | null;
22
- nro_documento: string;
23
- nro_credencial: string | null;
24
- apellido: string | null;
25
- nombre: string | null;
26
- fecha_nacimiento: string;
27
- id_financiador_plan: number | null;
28
- sexo: "M" | "F" | null;
25
+ financerId: number | null;
26
+ defaultAffiliationId: number | null;
27
+ credentialNumber: string | null;
28
+ financerPlanId: number | null;
29
29
  brand: number | null;
30
- nro_documento_titular: string | null;
31
- valor_copago: number | null;
32
- telefono_movil: string | null;
33
- empresa: string | null;
34
- fecha_alta: string | null;
35
- fecha_baja: string | null;
30
+ holderIdentificationNumber: string | null;
31
+ copaymentValue: number | null;
32
+ mobilePhone: string | null;
33
+ company: string | null;
34
+ dischargeDate: Date | null;
35
+ leavingDate: Date | null;
36
36
  identificacion_tributaria: string | null;
37
- fecha_baja_padron: string | null;
38
- codigo_autorizacion: string | null;
39
- codigo_autorizacion_vencimiento: string | null;
37
+ deregistrationDate: Date | null;
38
+ authorizationCode: string | null;
39
+ authorizationCodeExpiration: Date | null;
40
40
  } | null>;
41
41
  };
@@ -28,7 +28,36 @@ const getUserMethods = (makeRequest, url, credentials) => {
28
28
  const getConverageInfo = validation_1.validateFunction(zod_1.tuple([zod_1.string()]), schemas_1.doc24Schemas.coverageInfo, async (identificationValue) => {
29
29
  const path = `/info-coverage/${identificationValue}`;
30
30
  const response = await makeRequest('GET', path);
31
- return response.data.info;
31
+ const raw = response.data.info;
32
+ const mappedCoverageInfo = {
33
+ financerId: raw.id_financiador,
34
+ defaultAffiliationId: raw.id_afiliacion_default,
35
+ plan: raw.plan,
36
+ identificationNumber: raw.nro_documento,
37
+ credentialNumber: raw.nro_credencial,
38
+ lastName: raw.apellido,
39
+ firstName: raw.nombre,
40
+ birthdate: utils_1.parseDate(raw.fecha_nacimiento),
41
+ financerPlanId: raw.id_financiador_plan,
42
+ gender: raw.sexo.toLowerCase(),
43
+ brand: raw.brand,
44
+ holderIdentificationNumber: raw.nro_documento_titular,
45
+ copaymentValue: raw.valor_copago,
46
+ mobilePhone: raw.telefono_movil,
47
+ company: raw.empresa,
48
+ email: raw.email,
49
+ dischargeDate: raw.fecha_alta ? utils_1.parseDateTime(raw.fecha_alta) : null,
50
+ leavingDate: raw.fecha_baja ? utils_1.parseDateTime(raw.fecha_baja) : null,
51
+ identificacion_tributaria: raw.identificacion_tributaria,
52
+ deregistrationDate: raw.fecha_baja_padron
53
+ ? utils_1.parseDateTime(raw.fecha_baja_padron)
54
+ : null,
55
+ authorizationCode: raw.codigo_autorizacion,
56
+ authorizationCodeExpiration: raw.codigo_autorizacion_vencimiento
57
+ ? utils_1.parseDateTime(raw.codigo_autorizacion_vencimiento)
58
+ : null,
59
+ };
60
+ return mappedCoverageInfo;
32
61
  });
33
62
  return {
34
63
  declareUser: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.user]), zod_1.number(), getUserId),
package/lib/index.d.ts CHANGED
@@ -77,28 +77,28 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
77
77
  plan: string;
78
78
  }) => Promise<void>;
79
79
  getConverageInfo: (identificationValue: string) => Promise<{
80
+ firstName: string | null;
81
+ lastName: string | null;
82
+ gender: "m" | "f";
80
83
  email: string | null;
84
+ birthdate: Date;
85
+ identificationNumber: string;
81
86
  plan: string | null;
82
- id_afiliacion_default: number | null;
83
- id_financiador: number | null;
84
- nro_documento: string;
85
- nro_credencial: string | null;
86
- apellido: string | null;
87
- nombre: string | null;
88
- fecha_nacimiento: string;
89
- id_financiador_plan: number | null;
90
- sexo: "M" | "F" | null;
87
+ financerId: number | null;
88
+ defaultAffiliationId: number | null;
89
+ credentialNumber: string | null;
90
+ financerPlanId: number | null;
91
91
  brand: number | null;
92
- nro_documento_titular: string | null;
93
- valor_copago: number | null;
94
- telefono_movil: string | null;
95
- empresa: string | null;
96
- fecha_alta: string | null;
97
- fecha_baja: string | null;
92
+ holderIdentificationNumber: string | null;
93
+ copaymentValue: number | null;
94
+ mobilePhone: string | null;
95
+ company: string | null;
96
+ dischargeDate: Date | null;
97
+ leavingDate: Date | null;
98
98
  identificacion_tributaria: string | null;
99
- fecha_baja_padron: string | null;
100
- codigo_autorizacion: string | null;
101
- codigo_autorizacion_vencimiento: string | null;
99
+ deregistrationDate: Date | null;
100
+ authorizationCode: string | null;
101
+ authorizationCodeExpiration: Date | null;
102
102
  } | null>;
103
103
  getDiagnosticaHistory: (patient: {
104
104
  identificationType: "ndi" | "passport" | "credential";
package/lib/schemas.d.ts CHANGED
@@ -1025,73 +1025,73 @@ export declare const doc24Schemas: {
1025
1025
  forwardingRequired: false;
1026
1026
  }>]>;
1027
1027
  coverageInfo: import("zod").ZodNullable<import("zod").ZodObject<{
1028
- id_afiliacion_default: import("zod").ZodNullable<import("zod").ZodNumber>;
1029
- id_financiador: import("zod").ZodNullable<import("zod").ZodNumber>;
1028
+ financerId: import("zod").ZodNullable<import("zod").ZodNumber>;
1029
+ defaultAffiliationId: import("zod").ZodNullable<import("zod").ZodNumber>;
1030
1030
  plan: import("zod").ZodNullable<import("zod").ZodString>;
1031
- nro_documento: import("zod").ZodString;
1032
- nro_credencial: import("zod").ZodNullable<import("zod").ZodString>;
1033
- apellido: import("zod").ZodNullable<import("zod").ZodString>;
1034
- nombre: import("zod").ZodNullable<import("zod").ZodString>;
1035
- fecha_nacimiento: import("zod").ZodString;
1036
- id_financiador_plan: import("zod").ZodNullable<import("zod").ZodNumber>;
1037
- sexo: import("zod").ZodNullable<import("zod").ZodEnum<["M", "F"]>>;
1031
+ identificationNumber: import("zod").ZodString;
1032
+ credentialNumber: import("zod").ZodNullable<import("zod").ZodString>;
1033
+ lastName: import("zod").ZodNullable<import("zod").ZodString>;
1034
+ firstName: import("zod").ZodNullable<import("zod").ZodString>;
1035
+ birthdate: import("zod").ZodDate;
1036
+ financerPlanId: import("zod").ZodNullable<import("zod").ZodNumber>;
1037
+ gender: import("zod").ZodEnum<["m", "f"]>;
1038
1038
  brand: import("zod").ZodNullable<import("zod").ZodNumber>;
1039
- nro_documento_titular: import("zod").ZodNullable<import("zod").ZodString>;
1040
- valor_copago: import("zod").ZodNullable<import("zod").ZodNumber>;
1041
- telefono_movil: import("zod").ZodNullable<import("zod").ZodString>;
1042
- empresa: import("zod").ZodNullable<import("zod").ZodString>;
1039
+ holderIdentificationNumber: import("zod").ZodNullable<import("zod").ZodString>;
1040
+ copaymentValue: import("zod").ZodNullable<import("zod").ZodNumber>;
1041
+ mobilePhone: import("zod").ZodNullable<import("zod").ZodString>;
1042
+ company: import("zod").ZodNullable<import("zod").ZodString>;
1043
1043
  email: import("zod").ZodNullable<import("zod").ZodString>;
1044
- fecha_alta: import("zod").ZodNullable<import("zod").ZodString>;
1045
- fecha_baja: import("zod").ZodNullable<import("zod").ZodString>;
1044
+ dischargeDate: import("zod").ZodNullable<import("zod").ZodDate>;
1045
+ leavingDate: import("zod").ZodNullable<import("zod").ZodDate>;
1046
1046
  identificacion_tributaria: import("zod").ZodNullable<import("zod").ZodString>;
1047
- fecha_baja_padron: import("zod").ZodNullable<import("zod").ZodString>;
1048
- codigo_autorizacion: import("zod").ZodNullable<import("zod").ZodString>;
1049
- codigo_autorizacion_vencimiento: import("zod").ZodNullable<import("zod").ZodString>;
1047
+ deregistrationDate: import("zod").ZodNullable<import("zod").ZodDate>;
1048
+ authorizationCode: import("zod").ZodNullable<import("zod").ZodString>;
1049
+ authorizationCodeExpiration: import("zod").ZodNullable<import("zod").ZodDate>;
1050
1050
  }, "strip", import("zod").ZodTypeAny, {
1051
+ firstName: string | null;
1052
+ lastName: string | null;
1053
+ gender: "m" | "f";
1051
1054
  email: string | null;
1055
+ birthdate: Date;
1056
+ identificationNumber: string;
1052
1057
  plan: string | null;
1053
- id_afiliacion_default: number | null;
1054
- id_financiador: number | null;
1055
- nro_documento: string;
1056
- nro_credencial: string | null;
1057
- apellido: string | null;
1058
- nombre: string | null;
1059
- fecha_nacimiento: string;
1060
- id_financiador_plan: number | null;
1061
- sexo: "M" | "F" | null;
1058
+ financerId: number | null;
1059
+ defaultAffiliationId: number | null;
1060
+ credentialNumber: string | null;
1061
+ financerPlanId: number | null;
1062
1062
  brand: number | null;
1063
- nro_documento_titular: string | null;
1064
- valor_copago: number | null;
1065
- telefono_movil: string | null;
1066
- empresa: string | null;
1067
- fecha_alta: string | null;
1068
- fecha_baja: string | null;
1063
+ holderIdentificationNumber: string | null;
1064
+ copaymentValue: number | null;
1065
+ mobilePhone: string | null;
1066
+ company: string | null;
1067
+ dischargeDate: Date | null;
1068
+ leavingDate: Date | null;
1069
1069
  identificacion_tributaria: string | null;
1070
- fecha_baja_padron: string | null;
1071
- codigo_autorizacion: string | null;
1072
- codigo_autorizacion_vencimiento: string | null;
1070
+ deregistrationDate: Date | null;
1071
+ authorizationCode: string | null;
1072
+ authorizationCodeExpiration: Date | null;
1073
1073
  }, {
1074
+ firstName: string | null;
1075
+ lastName: string | null;
1076
+ gender: "m" | "f";
1074
1077
  email: string | null;
1078
+ birthdate: Date;
1079
+ identificationNumber: string;
1075
1080
  plan: string | null;
1076
- id_afiliacion_default: number | null;
1077
- id_financiador: number | null;
1078
- nro_documento: string;
1079
- nro_credencial: string | null;
1080
- apellido: string | null;
1081
- nombre: string | null;
1082
- fecha_nacimiento: string;
1083
- id_financiador_plan: number | null;
1084
- sexo: "M" | "F" | null;
1081
+ financerId: number | null;
1082
+ defaultAffiliationId: number | null;
1083
+ credentialNumber: string | null;
1084
+ financerPlanId: number | null;
1085
1085
  brand: number | null;
1086
- nro_documento_titular: string | null;
1087
- valor_copago: number | null;
1088
- telefono_movil: string | null;
1089
- empresa: string | null;
1090
- fecha_alta: string | null;
1091
- fecha_baja: string | null;
1086
+ holderIdentificationNumber: string | null;
1087
+ copaymentValue: number | null;
1088
+ mobilePhone: string | null;
1089
+ company: string | null;
1090
+ dischargeDate: Date | null;
1091
+ leavingDate: Date | null;
1092
1092
  identificacion_tributaria: string | null;
1093
- fecha_baja_padron: string | null;
1094
- codigo_autorizacion: string | null;
1095
- codigo_autorizacion_vencimiento: string | null;
1093
+ deregistrationDate: Date | null;
1094
+ authorizationCode: string | null;
1095
+ authorizationCodeExpiration: Date | null;
1096
1096
  }>>;
1097
1097
  };
package/lib/schemas.js CHANGED
@@ -148,28 +148,28 @@ const diagnosticaDeepLinkResponse = zod_1.object({
148
148
  deepLink: zod_1.string().url(),
149
149
  }).or(zod_1.object({ forwardingRequired: zod_1.literal(false) }));
150
150
  const coverageInfo = zod_1.object({
151
- id_afiliacion_default: zod_1.number().nullable(),
152
- id_financiador: zod_1.number().nullable(),
151
+ financerId: zod_1.number().nullable(),
152
+ defaultAffiliationId: zod_1.number().nullable(),
153
153
  plan: zod_1.string().nullable(),
154
- nro_documento: zod_1.string(),
155
- nro_credencial: zod_1.string().nullable(),
156
- apellido: zod_1.string().nullable(),
157
- nombre: zod_1.string().nullable(),
158
- fecha_nacimiento: zod_1.string(),
159
- id_financiador_plan: zod_1.number().nullable(),
160
- sexo: zod_1.enum(['M', 'F']).nullable(),
154
+ identificationNumber: zod_1.string(),
155
+ credentialNumber: zod_1.string().nullable(),
156
+ lastName: zod_1.string().nullable(),
157
+ firstName: zod_1.string().nullable(),
158
+ birthdate: zod_1.date(),
159
+ financerPlanId: zod_1.number().nullable(),
160
+ gender,
161
161
  brand: zod_1.number().nullable(),
162
- nro_documento_titular: zod_1.string().nullable(),
163
- valor_copago: zod_1.number().nullable(),
164
- telefono_movil: zod_1.string().nullable(),
165
- empresa: zod_1.string().nullable(),
162
+ holderIdentificationNumber: zod_1.string().nullable(),
163
+ copaymentValue: zod_1.number().nullable(),
164
+ mobilePhone: zod_1.string().nullable(),
165
+ company: zod_1.string().nullable(),
166
166
  email: zod_1.string().email().nullable(),
167
- fecha_alta: zod_1.string().nullable(),
168
- fecha_baja: zod_1.string().nullable(),
167
+ dischargeDate: zod_1.date().nullable(),
168
+ leavingDate: zod_1.date().nullable(),
169
169
  identificacion_tributaria: zod_1.string().nullable(),
170
- fecha_baja_padron: zod_1.string().nullable(),
171
- codigo_autorizacion: zod_1.string().nullable(),
172
- codigo_autorizacion_vencimiento: zod_1.string().nullable(),
170
+ deregistrationDate: zod_1.date().nullable(),
171
+ authorizationCode: zod_1.string().nullable(),
172
+ authorizationCodeExpiration: zod_1.date().nullable(),
173
173
  }).nullable();
174
174
  exports.doc24Schemas = {
175
175
  identificationType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "0.34.1",
3
+ "version": "0.34.3",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {