@integraciones_doc24/sdk 0.35.0 → 0.35.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.
- package/lib/baseSdk/index.js +5 -1
- package/lib/lib/baseSdk/index.d.ts +57 -10
- package/lib/lib/baseSdk/user.d.ts +16 -5
- package/lib/lib/baseSdk/user.js +67 -25
- package/lib/lib/index.d.ts +44 -16
- package/lib/lib/lib/baseSdk/diagnostica.d.ts +6 -0
- package/lib/lib/lib/baseSdk/diagnostica.js +79 -0
- package/lib/lib/lib/baseSdk/index.d.ts +51 -0
- package/lib/lib/lib/baseSdk/index.js +66 -0
- package/lib/lib/lib/baseSdk/user.d.ts +9 -0
- package/lib/lib/lib/baseSdk/user.js +130 -0
- package/lib/lib/lib/index.d.ts +168 -0
- package/lib/lib/lib/index.js +22 -0
- package/lib/lib/lib/lib/baseSdk/diagnostica.d.ts +6 -0
- package/lib/lib/lib/lib/baseSdk/diagnostica.js +79 -0
- package/lib/lib/lib/lib/baseSdk/index.d.ts +14 -0
- package/lib/lib/lib/lib/baseSdk/index.js +66 -0
- package/lib/lib/lib/lib/baseSdk/user.d.ts +9 -0
- package/lib/lib/lib/lib/baseSdk/user.js +130 -0
- package/lib/lib/lib/lib/index.d.ts +58 -0
- package/lib/lib/lib/lib/index.js +22 -0
- package/lib/lib/lib/lib/request/index.d.ts +2 -0
- package/lib/lib/lib/lib/request/index.js +26 -0
- package/lib/lib/lib/lib/request/token.d.ts +2 -0
- package/lib/lib/lib/lib/request/token.js +34 -0
- package/lib/lib/lib/lib/request/validation.d.ts +10 -0
- package/lib/lib/lib/lib/request/validation.js +28 -0
- package/lib/lib/lib/lib/schemas.d.ts +1334 -0
- package/lib/lib/lib/lib/schemas.js +325 -0
- package/lib/lib/lib/lib/test.d.ts +1 -0
- package/lib/lib/lib/lib/test.js +55 -0
- package/lib/lib/lib/lib/types.d.ts +1 -0
- package/lib/lib/lib/lib/types.js +2 -0
- package/lib/lib/lib/lib/userSdk/chat.d.ts +9 -0
- package/lib/lib/lib/lib/userSdk/chat.js +98 -0
- package/lib/lib/lib/lib/userSdk/index.d.ts +24 -0
- package/lib/lib/lib/lib/userSdk/index.js +27 -0
- package/lib/lib/lib/lib/userSdk/patients.d.ts +5 -0
- package/lib/lib/lib/lib/userSdk/patients.js +55 -0
- package/lib/lib/lib/lib/userSdk/schedule.d.ts +7 -0
- package/lib/lib/lib/lib/userSdk/schedule.js +76 -0
- package/lib/lib/lib/lib/userSdk/specialties.d.ts +4 -0
- package/lib/lib/lib/lib/userSdk/specialties.js +19 -0
- package/lib/lib/lib/lib/userSdk/videoVisit.d.ts +10 -0
- package/lib/lib/lib/lib/userSdk/videoVisit.js +147 -0
- package/lib/lib/lib/lib/utils.d.ts +4 -0
- package/lib/lib/lib/lib/utils.js +19 -0
- package/lib/lib/lib/lib/webhook/index.d.ts +8 -0
- package/lib/lib/lib/lib/webhook/index.js +55 -0
- package/lib/lib/lib/lib/webhook/responses.d.ts +36 -0
- package/lib/lib/lib/lib/webhook/responses.js +42 -0
- package/lib/lib/lib/lib/webhook/token.d.ts +2 -0
- package/lib/lib/lib/lib/webhook/token.js +23 -0
- package/lib/lib/lib/request/index.d.ts +2 -0
- package/lib/lib/lib/request/index.js +26 -0
- package/lib/lib/lib/request/token.d.ts +2 -0
- package/lib/lib/lib/request/token.js +34 -0
- package/lib/lib/lib/request/validation.d.ts +10 -0
- package/lib/lib/lib/request/validation.js +28 -0
- package/lib/lib/lib/schemas.d.ts +1334 -0
- package/lib/lib/lib/schemas.js +325 -0
- package/lib/lib/lib/src/baseSdk/diagnostica.d.ts +6 -0
- package/lib/lib/lib/src/baseSdk/diagnostica.js +79 -0
- package/lib/lib/lib/src/baseSdk/index.d.ts +51 -0
- package/lib/lib/lib/src/baseSdk/index.js +66 -0
- package/lib/lib/lib/src/baseSdk/user.d.ts +9 -0
- package/lib/lib/lib/src/baseSdk/user.js +130 -0
- package/lib/lib/lib/src/index.d.ts +169 -0
- package/lib/lib/lib/src/index.js +22 -0
- package/lib/lib/lib/src/request/index.d.ts +2 -0
- package/lib/lib/lib/src/request/index.js +26 -0
- package/lib/lib/lib/src/request/token.d.ts +2 -0
- package/lib/lib/lib/src/request/token.js +34 -0
- package/lib/lib/lib/src/request/validation.d.ts +10 -0
- package/lib/lib/lib/src/request/validation.js +28 -0
- package/lib/lib/lib/src/schemas.d.ts +1340 -0
- package/lib/lib/lib/src/schemas.js +325 -0
- package/lib/lib/lib/src/types.d.ts +1 -0
- package/lib/lib/lib/src/types.js +2 -0
- package/lib/lib/lib/src/userSdk/chat.d.ts +9 -0
- package/lib/lib/lib/src/userSdk/chat.js +98 -0
- package/lib/lib/lib/src/userSdk/index.d.ts +102 -0
- package/lib/lib/lib/src/userSdk/index.js +27 -0
- package/lib/lib/lib/src/userSdk/patients.d.ts +5 -0
- package/lib/lib/lib/src/userSdk/patients.js +55 -0
- package/lib/lib/lib/src/userSdk/schedule.d.ts +7 -0
- package/lib/lib/lib/src/userSdk/schedule.js +76 -0
- package/lib/lib/lib/src/userSdk/specialties.d.ts +4 -0
- package/lib/lib/lib/src/userSdk/specialties.js +19 -0
- package/lib/lib/lib/src/userSdk/videoVisit.d.ts +10 -0
- package/lib/lib/lib/src/userSdk/videoVisit.js +147 -0
- package/lib/lib/lib/src/utils.d.ts +4 -0
- package/lib/lib/lib/src/utils.js +19 -0
- package/lib/lib/lib/src/webhook/index.d.ts +8 -0
- package/lib/lib/lib/src/webhook/index.js +55 -0
- package/lib/lib/lib/src/webhook/responses.d.ts +36 -0
- package/lib/lib/lib/src/webhook/responses.js +42 -0
- package/lib/lib/lib/src/webhook/token.d.ts +2 -0
- package/lib/lib/lib/src/webhook/token.js +23 -0
- package/lib/lib/lib/test.d.ts +1 -0
- package/lib/lib/lib/test.js +55 -0
- package/lib/lib/lib/types.d.ts +1 -0
- package/lib/lib/lib/types.js +2 -0
- package/lib/lib/lib/userSdk/chat.d.ts +9 -0
- package/lib/lib/lib/userSdk/chat.js +98 -0
- package/lib/lib/lib/userSdk/index.d.ts +102 -0
- package/lib/lib/lib/userSdk/index.js +27 -0
- package/lib/lib/lib/userSdk/patients.d.ts +5 -0
- package/lib/lib/lib/userSdk/patients.js +55 -0
- package/lib/lib/lib/userSdk/schedule.d.ts +7 -0
- package/lib/lib/lib/userSdk/schedule.js +76 -0
- package/lib/lib/lib/userSdk/specialties.d.ts +4 -0
- package/lib/lib/lib/userSdk/specialties.js +19 -0
- package/lib/lib/lib/userSdk/videoVisit.d.ts +10 -0
- package/lib/lib/lib/userSdk/videoVisit.js +147 -0
- package/lib/lib/lib/utils.d.ts +4 -0
- package/lib/lib/lib/utils.js +19 -0
- package/lib/lib/lib/webhook/index.d.ts +8 -0
- package/lib/lib/lib/webhook/index.js +55 -0
- package/lib/lib/lib/webhook/responses.d.ts +36 -0
- package/lib/lib/lib/webhook/responses.js +42 -0
- package/lib/lib/lib/webhook/token.d.ts +2 -0
- package/lib/lib/lib/webhook/token.js +23 -0
- package/lib/lib/schemas.d.ts +256 -60
- package/lib/lib/schemas.js +33 -2
- package/lib/lib/src/baseSdk/diagnostica.d.ts +11 -0
- package/lib/lib/src/baseSdk/diagnostica.js +79 -0
- package/lib/lib/src/baseSdk/index.d.ts +162 -0
- package/lib/lib/src/baseSdk/index.js +66 -0
- package/lib/lib/src/baseSdk/user.d.ts +41 -0
- package/lib/lib/src/baseSdk/user.js +130 -0
- package/lib/lib/src/index.d.ts +183 -0
- package/lib/lib/src/index.js +22 -0
- package/lib/lib/src/request/index.d.ts +2 -0
- package/lib/lib/src/request/index.js +26 -0
- package/lib/lib/src/request/token.d.ts +2 -0
- package/lib/lib/src/request/token.js +34 -0
- package/lib/lib/src/request/validation.d.ts +10 -0
- package/lib/lib/src/request/validation.js +28 -0
- package/lib/lib/src/schemas.d.ts +1340 -0
- package/lib/lib/src/schemas.js +325 -0
- package/lib/lib/src/types.d.ts +1 -0
- package/lib/lib/src/types.js +2 -0
- package/lib/lib/src/userSdk/chat.d.ts +9 -0
- package/lib/lib/src/userSdk/chat.js +98 -0
- package/lib/lib/src/userSdk/index.d.ts +241 -0
- package/lib/lib/src/userSdk/index.js +27 -0
- package/lib/lib/src/userSdk/patients.d.ts +13 -0
- package/lib/lib/src/userSdk/patients.js +55 -0
- package/lib/lib/src/userSdk/schedule.d.ts +15 -0
- package/lib/lib/src/userSdk/schedule.js +76 -0
- package/lib/lib/src/userSdk/specialties.d.ts +4 -0
- package/lib/lib/src/userSdk/specialties.js +19 -0
- package/lib/lib/src/userSdk/videoVisit.d.ts +72 -0
- package/lib/lib/src/userSdk/videoVisit.js +147 -0
- package/lib/lib/src/utils.d.ts +4 -0
- package/lib/lib/src/utils.js +19 -0
- package/lib/lib/src/webhook/index.d.ts +8 -0
- package/lib/lib/src/webhook/index.js +55 -0
- package/lib/lib/src/webhook/responses.d.ts +36 -0
- package/lib/lib/src/webhook/responses.js +42 -0
- package/lib/lib/src/webhook/token.d.ts +2 -0
- package/lib/lib/src/webhook/token.js +23 -0
- package/lib/lib/userSdk/index.d.ts +25 -5
- package/lib/lib/userSdk/patients.d.ts +10 -1
- package/lib/lib/userSdk/patients.js +34 -6
- package/lib/lib/userSdk/videoVisit.d.ts +1 -1
- package/lib/lib/utils.d.ts +1 -1
- package/lib/lib/utils.js +3 -3
- package/lib/src/baseSdk/diagnostica.d.ts +6 -6
- package/lib/src/baseSdk/user.d.ts +52 -4
- package/lib/src/baseSdk/user.js +67 -25
- package/lib/src/index.d.ts +45 -16
- package/lib/src/schemas.d.ts +226 -30
- package/lib/src/schemas.js +33 -2
- package/lib/src/types.d.ts +10 -2
- package/lib/src/userSdk/chat.d.ts +1 -1
- package/lib/src/userSdk/patients.d.ts +23 -2
- package/lib/src/userSdk/patients.js +34 -6
- package/lib/src/userSdk/videoVisit.d.ts +2 -2
- package/lib/src/utils.d.ts +1 -1
- package/lib/src/utils.js +3 -3
- package/lib/test.js +2 -36
- package/package.json +4 -1
- package/lib/baseSdk/external.d.ts +0 -28
- package/lib/baseSdk/external.js +0 -73
- package/lib/lib/baseSdk/external.d.ts +0 -15
- package/lib/lib/baseSdk/external.js +0 -73
- package/lib/lib/userSdk/sarasas.d.ts +0 -6
- package/lib/lib/userSdk/sarasas.js +0 -13
- package/lib/userSdk/sarasas.d.ts +0 -6
- package/lib/userSdk/sarasas.js +0 -13
package/lib/src/utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getIdetificationTypeId = exports.parseDateTime = exports.parseDate = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
5
|
const timeZone = '-03';
|
|
6
6
|
const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
|
|
7
7
|
exports.parseDate = parseDate;
|
|
8
8
|
const parseDateTime = (str) => date_fns_1.parse(`${str} ${timeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
|
|
9
9
|
exports.parseDateTime = parseDateTime;
|
|
10
|
-
const
|
|
10
|
+
const getIdetificationTypeId = (type) => {
|
|
11
11
|
if (type === 'ndi')
|
|
12
12
|
return 6;
|
|
13
13
|
if (type === 'passport')
|
|
@@ -16,4 +16,4 @@ const getIndetificationTypeId = (type) => {
|
|
|
16
16
|
return 999;
|
|
17
17
|
throw new Error('Invalid identificationType');
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
19
|
+
exports.getIdetificationTypeId = getIdetificationTypeId;
|
package/lib/test.js
CHANGED
|
@@ -10,46 +10,12 @@ const test = async () => {
|
|
|
10
10
|
key: '33Ypv5jQ1VTr1KcOImdBhPnoRDqmPlYR3JWbrlUim9U=',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
-
const
|
|
14
|
-
let res = await userSdk.declarePatient({
|
|
15
|
-
patient: {
|
|
16
|
-
firstName: 'Rafael Elias',
|
|
17
|
-
lastName: 'Mian',
|
|
18
|
-
identificationType: 'ndi',
|
|
19
|
-
identificationValue: '37970350',
|
|
20
|
-
countryId: 'AR',
|
|
21
|
-
birthdate: new Date('1996-07-03'),
|
|
22
|
-
gender: 'm',
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
// let res = await baseSdk.declareUser({
|
|
26
|
-
// user: {
|
|
27
|
-
// firstName: 'Rafael Elias',
|
|
28
|
-
// lastName: 'Mian',
|
|
29
|
-
// identificationType: 'ndi',
|
|
30
|
-
// identificationValue: '37970350',
|
|
31
|
-
// countryId: 'AR',
|
|
32
|
-
// birthdate: new Date('1996-07-03'),
|
|
33
|
-
// gender: 'm',
|
|
34
|
-
// email: 'rafaelmian35@gmail.com',
|
|
35
|
-
// phone: '+5493764203061',
|
|
36
|
-
// },
|
|
37
|
-
// // channel: '1',
|
|
38
|
-
// // code: '370356',
|
|
39
|
-
// });
|
|
13
|
+
const res = await baseSdk.getAvailableScheduleClinics();
|
|
40
14
|
console.log(res);
|
|
41
|
-
// await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
42
|
-
// if (!res.ask_code) return res.userId;
|
|
43
|
-
// await baseSdk.sendVerificationCode({
|
|
44
|
-
// identificationType: 'ndi',
|
|
45
|
-
// identificationValue: '37970350',
|
|
46
|
-
// channel: '1',
|
|
47
|
-
// });
|
|
48
|
-
// console.log(res);
|
|
49
|
-
return;
|
|
50
15
|
}
|
|
51
16
|
catch (e) {
|
|
52
17
|
console.log(e);
|
|
53
18
|
}
|
|
54
19
|
};
|
|
55
20
|
test();
|
|
21
|
+
//
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { RequestMaker } from '../request';
|
|
2
|
-
export declare const getExternalMethods: (makeRequest: RequestMaker) => {
|
|
3
|
-
externalLogin: (user: string, password: string) => Promise<{
|
|
4
|
-
firstName: string;
|
|
5
|
-
lastName: string;
|
|
6
|
-
phone: string;
|
|
7
|
-
identificationNumber: string;
|
|
8
|
-
email: string;
|
|
9
|
-
birthday: Date;
|
|
10
|
-
gender: "m" | "f";
|
|
11
|
-
countryId: string;
|
|
12
|
-
}>;
|
|
13
|
-
preExternalEnroll: (params: {
|
|
14
|
-
phone: string;
|
|
15
|
-
identificationNumber: string;
|
|
16
|
-
birthdate: Date;
|
|
17
|
-
email: string;
|
|
18
|
-
}) => Promise<void>;
|
|
19
|
-
externalEnroll: (params: {
|
|
20
|
-
phone: string;
|
|
21
|
-
identificationNumber: string;
|
|
22
|
-
birthdate: Date;
|
|
23
|
-
email: string;
|
|
24
|
-
password: string;
|
|
25
|
-
emailCode: string;
|
|
26
|
-
phoneCode: string;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
};
|
package/lib/baseSdk/external.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExternalMethods = 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 getExternalMethods = (makeRequest) => {
|
|
9
|
-
const externalLogin = validation_1.validateFunction(zod_1.tuple([zod_1.string(), zod_1.string()]), schemas_1.doc24Schemas.externalLoginResponse, async (user, password) => {
|
|
10
|
-
const path = '/external-login';
|
|
11
|
-
const response = await makeRequest('POST', path, { user, password });
|
|
12
|
-
/* {
|
|
13
|
-
data: {
|
|
14
|
-
login_info: {
|
|
15
|
-
firstname: 'Nieves Iris',
|
|
16
|
-
lastname: 'Veiga',
|
|
17
|
-
birthdate: '1964-03-18T00:00:00',
|
|
18
|
-
identification_number: '16766094',
|
|
19
|
-
identification_type: 1,
|
|
20
|
-
country_id: 'AR',
|
|
21
|
-
gender: 'F',
|
|
22
|
-
address: 'Av. Pte Illia 13267',
|
|
23
|
-
city: 'Buenos Aires',
|
|
24
|
-
province: 'José C. Paz',
|
|
25
|
-
email: 'carlosiosella@gmail.com',
|
|
26
|
-
email_validated: true,
|
|
27
|
-
telephone: '3426310240',
|
|
28
|
-
cellphoneValidated: true,
|
|
29
|
-
external_id: null,
|
|
30
|
-
external_uid: 'srfoTzzYcE9',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
}; */
|
|
34
|
-
console.log(response);
|
|
35
|
-
const info = response.data.login_info;
|
|
36
|
-
return {
|
|
37
|
-
firstName: info.firstname,
|
|
38
|
-
lastName: info.lastname,
|
|
39
|
-
countryId: info.country_id,
|
|
40
|
-
birthday: new Date(Date.parse(info.birthdate)),
|
|
41
|
-
identificationNumber: info.identification_number,
|
|
42
|
-
gender: info.gender === 'F' ? 'f' : 'm',
|
|
43
|
-
email: info.email,
|
|
44
|
-
phone: info.telephone,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
const preExternalEnroll = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.preExternalEnrollmentParams]), zod_1.void(), async (params) => {
|
|
48
|
-
const path = '/pre-external-enrollment';
|
|
49
|
-
await makeRequest('POST', path, {
|
|
50
|
-
identification_number: params.identificationNumber,
|
|
51
|
-
birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
|
|
52
|
-
email: params.email,
|
|
53
|
-
telephone: params.phone,
|
|
54
|
-
});
|
|
55
|
-
return;
|
|
56
|
-
});
|
|
57
|
-
const externalEnroll = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalEnrollmentParams]), zod_1.void(), async (params) => {
|
|
58
|
-
const path = '/external-enrollment';
|
|
59
|
-
const response = await makeRequest('POST', path, {
|
|
60
|
-
identification_number: params.identificationNumber,
|
|
61
|
-
birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
|
|
62
|
-
email: params.email,
|
|
63
|
-
telephone: params.phone,
|
|
64
|
-
email_code: params.emailCode,
|
|
65
|
-
telephone_code: params.phoneCode,
|
|
66
|
-
password: params.password,
|
|
67
|
-
});
|
|
68
|
-
console.log(response);
|
|
69
|
-
return;
|
|
70
|
-
});
|
|
71
|
-
return { externalLogin, preExternalEnroll, externalEnroll };
|
|
72
|
-
};
|
|
73
|
-
exports.getExternalMethods = getExternalMethods;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export var __esModule: boolean;
|
|
2
|
-
export function getExternalMethods(makeRequest: any): {
|
|
3
|
-
externalLogin: (...params: any) => Promise<{
|
|
4
|
-
firstName: any;
|
|
5
|
-
lastName: any;
|
|
6
|
-
countryId: any;
|
|
7
|
-
birthday: Date;
|
|
8
|
-
identificationNumber: any;
|
|
9
|
-
gender: string;
|
|
10
|
-
email: any;
|
|
11
|
-
phone: any;
|
|
12
|
-
}>;
|
|
13
|
-
preExternalEnroll: (...params: any) => Promise<void>;
|
|
14
|
-
externalEnroll: (...params: any) => Promise<void>;
|
|
15
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExternalMethods = 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 getExternalMethods = (makeRequest) => {
|
|
9
|
-
const externalLogin = validation_1.validateFunction(zod_1.tuple([zod_1.string(), zod_1.string()]), schemas_1.doc24Schemas.externalLoginResponse, async (user, password) => {
|
|
10
|
-
const path = '/external-login';
|
|
11
|
-
const response = await makeRequest('POST', path, { user, password });
|
|
12
|
-
/* {
|
|
13
|
-
data: {
|
|
14
|
-
login_info: {
|
|
15
|
-
firstname: 'Nieves Iris',
|
|
16
|
-
lastname: 'Veiga',
|
|
17
|
-
birthdate: '1964-03-18T00:00:00',
|
|
18
|
-
identification_number: '16766094',
|
|
19
|
-
identification_type: 1,
|
|
20
|
-
country_id: 'AR',
|
|
21
|
-
gender: 'F',
|
|
22
|
-
address: 'Av. Pte Illia 13267',
|
|
23
|
-
city: 'Buenos Aires',
|
|
24
|
-
province: 'José C. Paz',
|
|
25
|
-
email: 'carlosiosella@gmail.com',
|
|
26
|
-
email_validated: true,
|
|
27
|
-
telephone: '3426310240',
|
|
28
|
-
cellphoneValidated: true,
|
|
29
|
-
external_id: null,
|
|
30
|
-
external_uid: 'srfoTzzYcE9',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
}; */
|
|
34
|
-
console.log(response);
|
|
35
|
-
const info = response.data.login_info;
|
|
36
|
-
return {
|
|
37
|
-
firstName: info.firstname,
|
|
38
|
-
lastName: info.lastname,
|
|
39
|
-
countryId: info.country_id,
|
|
40
|
-
birthday: new Date(Date.parse(info.birthdate)),
|
|
41
|
-
identificationNumber: info.identification_number,
|
|
42
|
-
gender: info.gender === 'F' ? 'f' : 'm',
|
|
43
|
-
email: info.email,
|
|
44
|
-
phone: info.telephone,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
const preExternalEnroll = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.preExternalEnrollmentParams]), zod_1.void(), async (params) => {
|
|
48
|
-
const path = '/pre-external-enrollment';
|
|
49
|
-
await makeRequest('POST', path, {
|
|
50
|
-
identification_number: params.identificationNumber,
|
|
51
|
-
birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
|
|
52
|
-
email: params.email,
|
|
53
|
-
telephone: params.phone,
|
|
54
|
-
});
|
|
55
|
-
return;
|
|
56
|
-
});
|
|
57
|
-
const externalEnroll = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.externalEnrollmentParams]), zod_1.void(), async (params) => {
|
|
58
|
-
const path = '/external-enrollment';
|
|
59
|
-
const response = await makeRequest('POST', path, {
|
|
60
|
-
identification_number: params.identificationNumber,
|
|
61
|
-
birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
|
|
62
|
-
email: params.email,
|
|
63
|
-
telephone: params.phone,
|
|
64
|
-
email_code: params.emailCode,
|
|
65
|
-
telephone_code: params.phoneCode,
|
|
66
|
-
password: params.password,
|
|
67
|
-
});
|
|
68
|
-
console.log(response);
|
|
69
|
-
return;
|
|
70
|
-
});
|
|
71
|
-
return { externalLogin, preExternalEnroll, externalEnroll };
|
|
72
|
-
};
|
|
73
|
-
exports.getExternalMethods = getExternalMethods;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSarasaMethods = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const validation_1 = require("../request/validation");
|
|
6
|
-
const schemas_1 = require("../schemas");
|
|
7
|
-
const getSarasaMethods = (_makeRequest) => {
|
|
8
|
-
const getSarasa = validation_1.validateFunction(zod_1.tuple([zod_1.string()]), schemas_1.doc24Schemas.sarasa, async (userId) => {
|
|
9
|
-
return { id: userId };
|
|
10
|
-
});
|
|
11
|
-
return { getSarasa };
|
|
12
|
-
};
|
|
13
|
-
exports.getSarasaMethods = getSarasaMethods;
|
package/lib/userSdk/sarasas.d.ts
DELETED
package/lib/userSdk/sarasas.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSarasaMethods = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const validation_1 = require("../request/validation");
|
|
6
|
-
const schemas_1 = require("../schemas");
|
|
7
|
-
const getSarasaMethods = (_makeRequest) => {
|
|
8
|
-
const getSarasa = validation_1.validateFunction(zod_1.tuple([zod_1.string()]), schemas_1.doc24Schemas.sarasa, async (userId) => {
|
|
9
|
-
return { id: userId };
|
|
10
|
-
});
|
|
11
|
-
return { getSarasa };
|
|
12
|
-
};
|
|
13
|
-
exports.getSarasaMethods = getSarasaMethods;
|