@integraciones_doc24/sdk 1.8.1 → 1.8.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.
@@ -31,7 +31,7 @@ export declare const getExternalMethods: (makeRequest: RequestMaker) => {
31
31
  } & {
32
32
  email?: undefined;
33
33
  phone: string;
34
- })) => Promise<any>;
34
+ })) => Promise<void>;
35
35
  externalEnrollment: (params: ({
36
36
  birthdate: Date;
37
37
  identificationNumber: string;
@@ -131,7 +131,16 @@ export declare const getExternalMethods: (makeRequest: RequestMaker) => {
131
131
  } & {
132
132
  emailCode?: undefined;
133
133
  phoneCode: string;
134
- })) => Promise<any>;
134
+ })) => Promise<{
135
+ firstName: string;
136
+ lastName: string;
137
+ countryId: string;
138
+ gender: "m" | "f";
139
+ phone: string;
140
+ email: string;
141
+ birthday: Date;
142
+ identificationNumber: string;
143
+ }>;
135
144
  getExternalVerificationCode: (params: {
136
145
  birthdate: Date;
137
146
  channel: "1" | "2";
@@ -16,7 +16,7 @@ const getExternalMethods = (makeRequest) => {
16
16
  countryId: info.country_id,
17
17
  birthday: new Date(Date.parse(info.birthdate)),
18
18
  identificationNumber: info.identification_number,
19
- gender: info.gender === 'F' ? 'f' : 'm',
19
+ gender: info.gender.toLowerCase(),
20
20
  email: info.email,
21
21
  phone: info.telephone,
22
22
  };
@@ -42,7 +42,17 @@ const getExternalMethods = (makeRequest) => {
42
42
  email_code: params.emailCode,
43
43
  telephone_code: params.phoneCode,
44
44
  });
45
- return response.data;
45
+ const info = response.data.info;
46
+ return {
47
+ firstName: info.firstname,
48
+ lastName: info.lastname,
49
+ countryId: info.country_id,
50
+ birthday: new Date(Date.parse(info.birthdate)),
51
+ identificationNumber: info.identification_number,
52
+ gender: info.gender.toLowerCase(),
53
+ email: info.email,
54
+ phone: info.telephone,
55
+ };
46
56
  };
47
57
  const getExternalVerificationCode = async (params) => {
48
58
  const path = '/send-external-verification-code';
@@ -66,8 +76,8 @@ const getExternalMethods = (makeRequest) => {
66
76
  };
67
77
  return {
68
78
  externalLogin: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalLoginParams]), schemas_1.doc24Schemas.externalLoginResponse, externalLogin),
69
- preExternalEnrollment: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.preExternalEnrollmentParams]), zod_1.any(), preExternalEnrollment),
70
- externalEnrollment: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalEnrollmentParams]), zod_1.any(), externalEnrollment),
79
+ preExternalEnrollment: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.preExternalEnrollmentParams]), zod_1.void(), preExternalEnrollment),
80
+ externalEnrollment: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalEnrollmentParams]), schemas_1.doc24Schemas.externalLoginResponse, externalEnrollment),
71
81
  getExternalVerificationCode: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalVerificationCodeParams]), zod_1.any(), getExternalVerificationCode),
72
82
  externalResetPassword: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalResetPasswordParams]), zod_1.any(), externalResetPassword),
73
83
  };
package/lib/index.d.ts CHANGED
@@ -317,7 +317,16 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
317
317
  } & {
318
318
  emailCode?: undefined;
319
319
  phoneCode: string;
320
- })) => Promise<any>;
320
+ })) => Promise<{
321
+ firstName: string;
322
+ lastName: string;
323
+ countryId: string;
324
+ gender: "m" | "f";
325
+ phone: string;
326
+ email: string;
327
+ birthday: Date;
328
+ identificationNumber: string;
329
+ }>;
321
330
  getExternalVerificationCode: (params: {
322
331
  birthdate: Date;
323
332
  channel: "1" | "2";
package/lib/types.d.ts CHANGED
@@ -55,7 +55,7 @@ export declare namespace Doc24 {
55
55
  getDiagnosticaAccess: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<void>;
56
56
  externalLogin: (params: ExternalLoginParams) => Promise<ExternalLoginResponse>;
57
57
  preExternalEnrollment: (params: PreExternalEnrollmentParams) => Promise<void>;
58
- externalEnrollment: (params: ExternalEnrollmentParams) => Promise<any>;
58
+ externalEnrollment: (params: ExternalEnrollmentParams) => Promise<ExternalLoginResponse>;
59
59
  getExternalVerificationCode: (params: ExternalVerificationCodeParams) => Promise<void>;
60
60
  externalResetPassword: (params: ExternalResetPasswordParams) => Promise<any>;
61
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },