@integraciones_doc24/sdk 0.33.1 → 0.33.2

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.
@@ -14,12 +14,12 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
14
14
  language: string;
15
15
  firstName: string;
16
16
  lastName: string;
17
- phone: string;
18
- email: string;
19
17
  birthday: Date;
20
18
  identificationType: "dni";
21
19
  identificationValue: string;
22
20
  gender: "m" | "f";
21
+ phone: string;
22
+ email: string;
23
23
  }, patient: {
24
24
  firstName: string;
25
25
  lastName: string;
@@ -37,12 +37,12 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
37
37
  language: string;
38
38
  firstName: string;
39
39
  lastName: string;
40
- phone: string;
41
- email: string;
42
40
  birthday: Date;
43
41
  identificationType: "dni";
44
42
  identificationValue: string;
45
43
  gender: "m" | "f";
44
+ phone: string;
45
+ email: string;
46
46
  }, patient: {
47
47
  firstName: string;
48
48
  lastName: string;
@@ -38,7 +38,7 @@ const getDiagnosticaMethods = (makeRequest) => {
38
38
  user: mapUserData(user),
39
39
  patient: mapPatientData(patient),
40
40
  });
41
- const data = response.data.data.info.data;
41
+ const data = response.data.info.data;
42
42
  if (data.forwarding_required)
43
43
  return { forwardingRequired: true, deepLink: data.deeplink };
44
44
  return { forwardingRequired: false };
@@ -9,7 +9,6 @@ const schemas_1 = require("../schemas");
9
9
  const userSdk_1 = require("../userSdk");
10
10
  const utils_1 = require("../utils");
11
11
  const diagnostica_1 = require("./diagnostica");
12
- const external_1 = require("./external");
13
12
  const getBaseSdk = async (url, credentials) => {
14
13
  const makeRequest = await request_1.getRequestFactory(url, credentials);
15
14
  const getUserId = async (user) => {
@@ -30,10 +29,8 @@ const getBaseSdk = async (url, credentials) => {
30
29
  return response.data.user_id;
31
30
  };
32
31
  const diagnosticaMethods = diagnostica_1.getDiagnosticaMethods(makeRequest);
33
- const externalMethods = external_1.getExternalMethods(makeRequest);
34
32
  const baseSdk = {
35
33
  ...diagnosticaMethods,
36
- ...externalMethods,
37
34
  declareUser: validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.user]), zod_1.number(), getUserId),
38
35
  getUserInstance: validation_1.validateFunction(zod_1.tuple([zod_1.union([schemas_1.doc24Schemas.user, zod_1.number()])]),
39
36
  // TODO: validate?
package/lib/index.d.ts CHANGED
@@ -8,34 +8,34 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
8
8
  declareUser: (user: {
9
9
  firstName: string;
10
10
  lastName: string;
11
- phone: string;
12
- birthdate: Date;
13
- email: string;
14
11
  identificationType: "ndi" | "passport" | "credential";
15
12
  identificationValue: string;
16
13
  gender: "m" | "f";
14
+ phone: string;
15
+ email: string;
17
16
  countryId: string;
17
+ birthdate: Date;
18
18
  }) => Promise<number>;
19
19
  getUserInstance: (user: number | {
20
20
  firstName: string;
21
21
  lastName: string;
22
- phone: string;
23
- birthdate: Date;
24
- email: string;
25
22
  identificationType: "ndi" | "passport" | "credential";
26
23
  identificationValue: string;
27
24
  gender: "m" | "f";
25
+ phone: string;
26
+ email: string;
28
27
  countryId: string;
28
+ birthdate: Date;
29
29
  }) => Promise<Doc24.UserSdk>;
30
30
  getProfessional: (professionalId: number) => Promise<{
31
31
  id: number;
32
32
  logoUrl: string;
33
33
  firstName: string;
34
34
  lastName: string;
35
+ gender: "m" | "f";
35
36
  phone: string | null;
36
- birthdate: Date;
37
37
  email: string;
38
- gender: "m" | "f";
38
+ birthdate: Date;
39
39
  specialties: {
40
40
  id: number;
41
41
  description: string;
@@ -69,11 +69,11 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
69
69
  enroll: (params: {
70
70
  firstName: string;
71
71
  lastName: string;
72
- identificationNumber: string;
73
- birthdate: Date;
74
- email: string;
75
72
  gender: "m" | "f";
73
+ email: string;
74
+ birthdate: Date;
76
75
  startDate: Date;
76
+ identificationNumber: string;
77
77
  plan: string;
78
78
  }) => Promise<void>;
79
79
  getDiagnosticaHistory: (patient: {
@@ -90,12 +90,12 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
90
90
  language: string;
91
91
  firstName: string;
92
92
  lastName: string;
93
- phone: string;
94
- email: string;
95
93
  birthday: Date;
96
94
  identificationType: "dni";
97
95
  identificationValue: string;
98
96
  gender: "m" | "f";
97
+ phone: string;
98
+ email: string;
99
99
  }, patient: {
100
100
  firstName: string;
101
101
  lastName: string;
@@ -113,12 +113,12 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
113
113
  language: string;
114
114
  firstName: string;
115
115
  lastName: string;
116
- phone: string;
117
- email: string;
118
116
  birthday: Date;
119
117
  identificationType: "dni";
120
118
  identificationValue: string;
121
119
  gender: "m" | "f";
120
+ phone: string;
121
+ email: string;
122
122
  }, patient: {
123
123
  firstName: string;
124
124
  lastName: string;
@@ -127,30 +127,5 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
127
127
  identificationValue: string;
128
128
  gender: "m" | "f";
129
129
  }) => Promise<void>;
130
- externalLogin: (user: string, password: string) => Promise<{
131
- firstName: string;
132
- lastName: string;
133
- phone: string;
134
- identificationNumber: string;
135
- email: string;
136
- birthday: Date;
137
- gender: "m" | "f";
138
- countryId: string;
139
- }>;
140
- preExternalEnroll: (params: {
141
- phone: string;
142
- identificationNumber: string;
143
- birthdate: Date;
144
- email: string;
145
- }) => Promise<void>;
146
- externalEnroll: (params: {
147
- phone: string;
148
- identificationNumber: string;
149
- birthdate: Date;
150
- email: string;
151
- password: string;
152
- emailCode: string;
153
- phoneCode: string;
154
- }) => Promise<void>;
155
130
  }>;
156
131
  export type { Doc24 } from './types';
package/lib/schemas.d.ts CHANGED
@@ -49,23 +49,23 @@ export declare const doc24Schemas: {
49
49
  }>, "strip", import("zod").ZodTypeAny, {
50
50
  firstName: string;
51
51
  lastName: string;
52
- phone: string;
53
- birthdate: Date;
54
- email: string;
55
52
  identificationType: "ndi" | "passport" | "credential";
56
53
  identificationValue: string;
57
54
  gender: "m" | "f";
55
+ phone: string;
56
+ email: string;
58
57
  countryId: string;
58
+ birthdate: Date;
59
59
  }, {
60
60
  firstName: string;
61
61
  lastName: string;
62
- phone: string;
63
- birthdate: Date;
64
- email: string;
65
62
  identificationType: "ndi" | "passport" | "credential";
66
63
  identificationValue: string;
67
64
  gender: "m" | "f";
65
+ phone: string;
66
+ email: string;
68
67
  countryId: string;
68
+ birthdate: Date;
69
69
  }>;
70
70
  patient: import("zod").ZodObject<{
71
71
  firstName: import("zod").ZodString;
@@ -78,19 +78,19 @@ export declare const doc24Schemas: {
78
78
  }, "strip", import("zod").ZodTypeAny, {
79
79
  firstName: string;
80
80
  lastName: string;
81
- birthdate: Date;
82
81
  identificationType: "ndi" | "passport" | "credential";
83
82
  identificationValue: string;
84
83
  gender: "m" | "f";
85
84
  countryId: string;
85
+ birthdate: Date;
86
86
  }, {
87
87
  firstName: string;
88
88
  lastName: string;
89
- birthdate: Date;
90
89
  identificationType: "ndi" | "passport" | "credential";
91
90
  identificationValue: string;
92
91
  gender: "m" | "f";
93
92
  countryId: string;
93
+ birthdate: Date;
94
94
  }>;
95
95
  specialtyMode: import("zod").ZodEnum<["appointment", "chat", "instant"]>;
96
96
  specialty: import("zod").ZodObject<{
@@ -657,10 +657,10 @@ export declare const doc24Schemas: {
657
657
  logoUrl: string;
658
658
  firstName: string;
659
659
  lastName: string;
660
+ gender: "m" | "f";
660
661
  phone: string | null;
661
- birthdate: Date;
662
662
  email: string;
663
- gender: "m" | "f";
663
+ birthdate: Date;
664
664
  specialties: {
665
665
  id: number;
666
666
  description: string;
@@ -680,10 +680,10 @@ export declare const doc24Schemas: {
680
680
  logoUrl: string;
681
681
  firstName: string;
682
682
  lastName: string;
683
+ gender: "m" | "f";
683
684
  phone: string | null;
684
- birthdate: Date;
685
685
  email: string;
686
- gender: "m" | "f";
686
+ birthdate: Date;
687
687
  specialties: {
688
688
  id: number;
689
689
  description: string;
@@ -909,91 +909,21 @@ export declare const doc24Schemas: {
909
909
  }, "strip", import("zod").ZodTypeAny, {
910
910
  firstName: string;
911
911
  lastName: string;
912
- identificationNumber: string;
913
- birthdate: Date;
914
- email: string;
915
912
  gender: "m" | "f";
916
- startDate: Date;
917
- plan: string;
918
- }, {
919
- firstName: string;
920
- lastName: string;
921
- identificationNumber: string;
922
- birthdate: Date;
923
913
  email: string;
924
- gender: "m" | "f";
914
+ birthdate: Date;
925
915
  startDate: Date;
926
- plan: string;
927
- }>;
928
- externalLoginResponse: import("zod").ZodObject<{
929
- firstName: import("zod").ZodString;
930
- lastName: import("zod").ZodString;
931
- countryId: import("zod").ZodString;
932
- birthday: import("zod").ZodDate;
933
- identificationNumber: import("zod").ZodString;
934
- gender: import("zod").ZodEnum<["m", "f"]>;
935
- email: import("zod").ZodString;
936
- phone: import("zod").ZodString;
937
- }, "strip", import("zod").ZodTypeAny, {
938
- firstName: string;
939
- lastName: string;
940
- phone: string;
941
916
  identificationNumber: string;
942
- email: string;
943
- birthday: Date;
944
- gender: "m" | "f";
945
- countryId: string;
917
+ plan: string;
946
918
  }, {
947
919
  firstName: string;
948
920
  lastName: string;
949
- phone: string;
950
- identificationNumber: string;
951
- email: string;
952
- birthday: Date;
953
921
  gender: "m" | "f";
954
- countryId: string;
955
- }>;
956
- preExternalEnrollmentParams: import("zod").ZodObject<{
957
- phone: import("zod").ZodString;
958
- identificationNumber: import("zod").ZodString;
959
- birthdate: import("zod").ZodDate;
960
- email: import("zod").ZodString;
961
- }, "strip", import("zod").ZodTypeAny, {
962
- phone: string;
963
- identificationNumber: string;
964
- birthdate: Date;
965
922
  email: string;
966
- }, {
967
- phone: string;
968
- identificationNumber: string;
969
923
  birthdate: Date;
970
- email: string;
971
- }>;
972
- externalEnrollmentParams: import("zod").ZodObject<import("zod").extendShape<{
973
- phone: import("zod").ZodString;
974
- identificationNumber: import("zod").ZodString;
975
- birthdate: import("zod").ZodDate;
976
- email: import("zod").ZodString;
977
- }, {
978
- password: import("zod").ZodString;
979
- emailCode: import("zod").ZodString;
980
- phoneCode: import("zod").ZodString;
981
- }>, "strip", import("zod").ZodTypeAny, {
982
- phone: string;
983
- identificationNumber: string;
984
- birthdate: Date;
985
- email: string;
986
- password: string;
987
- emailCode: string;
988
- phoneCode: string;
989
- }, {
990
- phone: string;
924
+ startDate: Date;
991
925
  identificationNumber: string;
992
- birthdate: Date;
993
- email: string;
994
- password: string;
995
- emailCode: string;
996
- phoneCode: string;
926
+ plan: string;
997
927
  }>;
998
928
  diagnosticaPatientFilter: import("zod").ZodObject<{
999
929
  gender: import("zod").ZodEnum<["m", "f"]>;
@@ -1039,22 +969,22 @@ export declare const doc24Schemas: {
1039
969
  language: string;
1040
970
  firstName: string;
1041
971
  lastName: string;
1042
- phone: string;
1043
- email: string;
1044
972
  birthday: Date;
1045
973
  identificationType: "dni";
1046
974
  identificationValue: string;
1047
975
  gender: "m" | "f";
976
+ phone: string;
977
+ email: string;
1048
978
  }, {
1049
979
  language: string;
1050
980
  firstName: string;
1051
981
  lastName: string;
1052
- phone: string;
1053
- email: string;
1054
982
  birthday: Date;
1055
983
  identificationType: "dni";
1056
984
  identificationValue: string;
1057
985
  gender: "m" | "f";
986
+ phone: string;
987
+ email: string;
1058
988
  }>;
1059
989
  diagnosticaPatient: import("zod").ZodObject<{
1060
990
  firstName: import("zod").ZodString;
package/lib/schemas.js CHANGED
@@ -124,27 +124,6 @@ const enrollmentParams = zod_1.object({
124
124
  plan: zod_1.string(),
125
125
  startDate: zod_1.date(),
126
126
  });
127
- const externalLoginResponse = zod_1.object({
128
- firstName: zod_1.string(),
129
- lastName: zod_1.string(),
130
- countryId: zod_1.string(),
131
- birthday: zod_1.date(),
132
- identificationNumber: zod_1.string(),
133
- gender,
134
- email: zod_1.string().email(),
135
- phone: zod_1.string(),
136
- });
137
- const preExternalEnrollmentParams = zod_1.object({
138
- phone: zod_1.string(),
139
- identificationNumber: zod_1.string(),
140
- birthdate: zod_1.date(),
141
- email: zod_1.string().email(),
142
- });
143
- const externalEnrollmentParams = preExternalEnrollmentParams.merge(zod_1.object({
144
- password: zod_1.string(),
145
- emailCode: zod_1.string(),
146
- phoneCode: zod_1.string(),
147
- }));
148
127
  const diagnosticaHistoryAppointment = zod_1.object({
149
128
  date: zod_1.date(),
150
129
  location: zod_1.string(),
@@ -277,9 +256,6 @@ exports.doc24Schemas = {
277
256
  chatDetails,
278
257
  chatPost,
279
258
  enrollmentParams,
280
- externalLoginResponse,
281
- preExternalEnrollmentParams,
282
- externalEnrollmentParams,
283
259
  diagnosticaPatientFilter: zod_1.object({
284
260
  gender,
285
261
  identificationType,
package/lib/types.d.ts CHANGED
@@ -24,9 +24,6 @@ export declare namespace Doc24 {
24
24
  type ChatDetails = TypeOf<typeof doc24Schemas.chatDetails>;
25
25
  type ChatPost = TypeOf<typeof doc24Schemas.chatPost>;
26
26
  type EnrollmentParams = TypeOf<typeof doc24Schemas.enrollmentParams>;
27
- type ExternalLoginResponse = TypeOf<typeof doc24Schemas.externalLoginResponse>;
28
- type PreExternalEnrollmentParams = TypeOf<typeof doc24Schemas.preExternalEnrollmentParams>;
29
- type ExternalEnrollmentParams = TypeOf<typeof doc24Schemas.externalEnrollmentParams>;
30
27
  type DiagnosticaPatientFilter = TypeOf<typeof doc24Schemas.diagnosticaPatientFilter>;
31
28
  type DiagnosticaUser = TypeOf<typeof doc24Schemas.diagnosticaUser>;
32
29
  type DiagnosticaPatient = TypeOf<typeof doc24Schemas.diagnosticaPatient>;
@@ -41,9 +38,6 @@ export declare namespace Doc24 {
41
38
  getDiagnosticaHistory: (patient: DiagnosticaPatientFilter, from: Date, to: Date) => Promise<DiagnosticaHistoryAppointment[]>;
42
39
  getDiagnosticaDeepLink: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<DiagnosticaDeepLinkResponse>;
43
40
  getDiagnosticaAccess: (kiosk: string, user: DiagnosticaUser, patient: DiagnosticaPatient) => Promise<void>;
44
- externalLogin: (user: string, password: string) => Promise<ExternalLoginResponse>;
45
- preExternalEnroll: (params: PreExternalEnrollmentParams) => Promise<void>;
46
- externalEnroll: (params: ExternalEnrollmentParams) => Promise<void>;
47
41
  };
48
42
  type UserSdk = {
49
43
  declarePatient: (patient: Patient) => Promise<number>;
@@ -3,10 +3,10 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
3
3
  declarePatient: (patient: {
4
4
  firstName: string;
5
5
  lastName: string;
6
- birthdate: Date;
7
6
  identificationType: "ndi" | "passport" | "credential";
8
7
  identificationValue: string;
9
8
  gender: "m" | "f";
10
9
  countryId: string;
10
+ birthdate: Date;
11
11
  }) => Promise<number>;
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "0.33.1",
3
+ "version": "0.33.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {