@integraciones_doc24/sdk 1.15.5 → 1.15.7

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,9 +1,9 @@
1
1
  import { RequestMaker } from '../request';
2
2
  export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
3
3
  getDiagnosticaHistory: (patient: {
4
+ gender?: "m" | "f" | "o" | undefined;
4
5
  identificationType: "DNI";
5
6
  identificationValue: string;
6
- gender: "m" | "f" | "o";
7
7
  }, from: Date, to: Date) => Promise<{
8
8
  date: Date;
9
9
  location: string;
@@ -11,21 +11,21 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
11
11
  deepLink: string;
12
12
  }[]>;
13
13
  getDiagnosticaDeepLink: (kiosk: string, user: {
14
+ gender?: "m" | "f" | "o" | undefined;
14
15
  firstName: string;
15
16
  lastName: string;
16
17
  identificationType: "DNI";
17
18
  identificationValue: string;
18
- gender: "m" | "f" | "o";
19
19
  phone: string;
20
20
  email: string;
21
21
  language: string;
22
22
  birthday: Date;
23
23
  }, patient: {
24
+ gender?: "m" | "f" | "o" | undefined;
24
25
  firstName: string;
25
26
  lastName: string;
26
27
  identificationType: "DNI";
27
28
  identificationValue: string;
28
- gender: "m" | "f" | "o";
29
29
  birthday: Date;
30
30
  }) => Promise<{
31
31
  forwardingRequired: true;
@@ -34,21 +34,21 @@ export declare const getDiagnosticaMethods: (makeRequest: RequestMaker) => {
34
34
  forwardingRequired: false;
35
35
  }>;
36
36
  getDiagnosticaAccess: (kiosk: string, user: {
37
+ gender?: "m" | "f" | "o" | undefined;
37
38
  firstName: string;
38
39
  lastName: string;
39
40
  identificationType: "DNI";
40
41
  identificationValue: string;
41
- gender: "m" | "f" | "o";
42
42
  phone: string;
43
43
  email: string;
44
44
  language: string;
45
45
  birthday: Date;
46
46
  }, patient: {
47
+ gender?: "m" | "f" | "o" | undefined;
47
48
  firstName: string;
48
49
  lastName: string;
49
50
  identificationType: "DNI";
50
51
  identificationValue: string;
51
- gender: "m" | "f" | "o";
52
52
  birthday: Date;
53
53
  }) => Promise<void>;
54
54
  };
@@ -62,13 +62,14 @@ const getDiagnosticaMethods = (makeRequest) => {
62
62
  };
63
63
  exports.getDiagnosticaMethods = getDiagnosticaMethods;
64
64
  const mapPatientData = (patient) => {
65
+ var _a;
65
66
  return {
66
67
  name: patient.firstName,
67
68
  surname: patient.lastName,
68
69
  birthday: date_fns_1.format(patient.birthday, 'yyyy-MM-dd'),
69
70
  id_type: 'DNI',
70
71
  id_value: patient.identificationValue,
71
- gender: patient.gender.toLocaleUpperCase(),
72
+ gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase(),
72
73
  };
73
74
  };
74
75
  const mapUserData = (user) => {
@@ -4,10 +4,10 @@ export declare const getExternalMethods: (makeRequest: RequestMaker) => {
4
4
  user: string;
5
5
  password: string;
6
6
  }) => Promise<{
7
+ gender?: "m" | "f" | "o" | undefined;
7
8
  firstName: string;
8
9
  lastName: string;
9
10
  countryId: string;
10
- gender: "m" | "f" | "o";
11
11
  phone: string;
12
12
  email: string;
13
13
  birthday: Date;
@@ -132,10 +132,10 @@ export declare const getExternalMethods: (makeRequest: RequestMaker) => {
132
132
  emailCode?: undefined;
133
133
  phoneCode: string;
134
134
  })) => Promise<{
135
+ gender?: "m" | "f" | "o" | undefined;
135
136
  firstName: string;
136
137
  lastName: string;
137
138
  countryId: string;
138
- gender: "m" | "f" | "o";
139
139
  phone: string;
140
140
  email: string;
141
141
  birthday: Date;
@@ -3,14 +3,14 @@ import { Doc24 } from '../types';
3
3
  export declare const getUserMethods: (makeRequest: RequestMaker, url: string, credentials: Doc24.SdkCredentials) => {
4
4
  declareUser: (params: {
5
5
  user: {
6
+ identificationType?: number | undefined;
7
+ identificationValue?: string | undefined;
8
+ gender?: "m" | "f" | "o" | undefined;
9
+ phone?: string | undefined;
6
10
  firstName: string;
7
11
  lastName: string;
8
- identificationType: number;
9
- identificationValue: string;
10
12
  countryId: string;
11
13
  birthdate: Date;
12
- gender: "m" | "f" | "o";
13
- phone: string;
14
14
  email: string;
15
15
  };
16
16
  } & {
@@ -28,14 +28,14 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
28
28
  userId: number;
29
29
  }>;
30
30
  getUserId: (user: {
31
+ identificationType?: number | undefined;
32
+ identificationValue?: string | undefined;
33
+ gender?: "m" | "f" | "o" | undefined;
34
+ phone?: string | undefined;
31
35
  firstName: string;
32
36
  lastName: string;
33
- identificationType: number;
34
- identificationValue: string;
35
37
  countryId: string;
36
38
  birthdate: Date;
37
- gender: "m" | "f" | "o";
38
- phone: string;
39
39
  email: string;
40
40
  }) => Promise<number>;
41
41
  sendVerificationCode: (params: {
@@ -44,31 +44,31 @@ export declare const getUserMethods: (makeRequest: RequestMaker, url: string, cr
44
44
  channel: "1" | "2";
45
45
  }) => Promise<void>;
46
46
  getUserInstance: (user: number | {
47
+ identificationType?: number | undefined;
48
+ identificationValue?: string | undefined;
49
+ gender?: "m" | "f" | "o" | undefined;
50
+ phone?: string | undefined;
47
51
  firstName: string;
48
52
  lastName: string;
49
- identificationType: number;
50
- identificationValue: string;
51
53
  countryId: string;
52
54
  birthdate: Date;
53
- gender: "m" | "f" | "o";
54
- phone: string;
55
55
  email: string;
56
56
  }) => Promise<any>;
57
57
  enroll: (params: {
58
+ gender?: "m" | "f" | "o" | undefined;
58
59
  firstName: string;
59
60
  lastName: string;
60
61
  birthdate: Date;
61
- gender: "m" | "f" | "o";
62
62
  email: string;
63
63
  identificationNumber: string;
64
64
  startDate: Date;
65
65
  plan: string;
66
66
  }) => Promise<void>;
67
67
  getCoverageInfo: (identificationValue: string) => Promise<{
68
+ gender?: "m" | "f" | "o" | undefined;
68
69
  firstName: string | null;
69
70
  lastName: string | null;
70
71
  birthdate: Date;
71
- gender: "m" | "f" | "o";
72
72
  email: string | null;
73
73
  identificationNumber: string;
74
74
  plan: string | null;
@@ -9,6 +9,7 @@ const userSdk_1 = require("../userSdk");
9
9
  const utils_1 = require("../utils");
10
10
  const getUserMethods = (makeRequest, url, credentials) => {
11
11
  const declareUser = async ({ user, channel, code, }) => {
12
+ var _a;
12
13
  const path = '/user';
13
14
  const mappedUser = {
14
15
  lastname: user.lastName,
@@ -16,7 +17,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
16
17
  identification_type: user.identificationType,
17
18
  identification_value: user.identificationValue,
18
19
  birthdate: date_fns_1.format(user.birthdate, 'yyyy-MM-dd'),
19
- gender: user.gender.toUpperCase(),
20
+ gender: (_a = user.gender) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
20
21
  phone: user.phone,
21
22
  email: user.email,
22
23
  country_id: user.countryId,
@@ -37,6 +38,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
37
38
  };
38
39
  };
39
40
  const getUserId = async (user) => {
41
+ var _a;
40
42
  const path = '/search-user';
41
43
  const mappedUser = {
42
44
  lastname: user.lastName,
@@ -44,7 +46,7 @@ const getUserMethods = (makeRequest, url, credentials) => {
44
46
  identification_type: user.identificationType,
45
47
  identification_value: user.identificationValue,
46
48
  birthdate: date_fns_1.format(user.birthdate, 'yyyy-MM-dd'),
47
- gender: user.gender.toUpperCase(),
49
+ gender: (_a = user.gender) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
48
50
  phone: user.phone,
49
51
  email: user.email,
50
52
  country_id: user.countryId,
@@ -68,11 +70,12 @@ const getUserMethods = (makeRequest, url, credentials) => {
68
70
  return userSdk_1.userSdk(url, credentials, userId);
69
71
  };
70
72
  const enroll = async (params) => {
73
+ var _a;
71
74
  const path = `/enrollment`;
72
75
  const mappedUser = {
73
76
  firstname: params.firstName,
74
77
  lastname: params.lastName,
75
- gender: params.gender.toUpperCase(),
78
+ gender: (_a = params.gender) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
76
79
  identification_number: params.identificationNumber,
77
80
  birthdate: date_fns_1.format(params.birthdate, 'yyyy-MM-dd'),
78
81
  email: params.email,
package/lib/index.d.ts CHANGED
@@ -7,14 +7,14 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
7
7
  }) => Promise<Doc24.Webhook.Handler>;
8
8
  declareUser: (params: {
9
9
  user: {
10
+ identificationType?: number | undefined;
11
+ identificationValue?: string | undefined;
12
+ gender?: "m" | "f" | "o" | undefined;
13
+ phone?: string | undefined;
10
14
  firstName: string;
11
15
  lastName: string;
12
- identificationType: number;
13
- identificationValue: string;
14
16
  countryId: string;
15
17
  birthdate: Date;
16
- gender: "m" | "f" | "o";
17
- phone: string;
18
18
  email: string;
19
19
  };
20
20
  } & {
@@ -32,32 +32,32 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
32
32
  userId: number;
33
33
  }>;
34
34
  getUserId: (user: {
35
+ identificationType?: number | undefined;
36
+ identificationValue?: string | undefined;
37
+ gender?: "m" | "f" | "o" | undefined;
38
+ phone?: string | undefined;
35
39
  firstName: string;
36
40
  lastName: string;
37
- identificationType: number;
38
- identificationValue: string;
39
41
  countryId: string;
40
42
  birthdate: Date;
41
- gender: "m" | "f" | "o";
42
- phone: string;
43
43
  email: string;
44
44
  }) => Promise<number>;
45
45
  getUserInstance: (user: number | {
46
+ identificationType?: number | undefined;
47
+ identificationValue?: string | undefined;
48
+ gender?: "m" | "f" | "o" | undefined;
49
+ phone?: string | undefined;
46
50
  firstName: string;
47
51
  lastName: string;
48
- identificationType: number;
49
- identificationValue: string;
50
52
  countryId: string;
51
53
  birthdate: Date;
52
- gender: "m" | "f" | "o";
53
- phone: string;
54
54
  email: string;
55
55
  }) => Promise<Doc24.UserSdk>;
56
56
  getProfessional: (professionalId: number) => Promise<{
57
+ gender?: "m" | "f" | "o" | undefined;
57
58
  firstName: string;
58
59
  lastName: string;
59
60
  birthdate: Date;
60
- gender: "m" | "f" | "o";
61
61
  phone: string | null;
62
62
  email: string;
63
63
  id: number;
@@ -97,20 +97,20 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
97
97
  }[];
98
98
  }>;
99
99
  enroll: (params: {
100
+ gender?: "m" | "f" | "o" | undefined;
100
101
  firstName: string;
101
102
  lastName: string;
102
103
  birthdate: Date;
103
- gender: "m" | "f" | "o";
104
104
  email: string;
105
105
  identificationNumber: string;
106
106
  startDate: Date;
107
107
  plan: string;
108
108
  }) => Promise<void>;
109
109
  getCoverageInfo: (identificationValue: string) => Promise<{
110
+ gender?: "m" | "f" | "o" | undefined;
110
111
  firstName: string | null;
111
112
  lastName: string | null;
112
113
  birthdate: Date;
113
- gender: "m" | "f" | "o";
114
114
  email: string | null;
115
115
  identificationNumber: string;
116
116
  plan: string | null;
@@ -136,9 +136,9 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
136
136
  channel: "1" | "2";
137
137
  }) => Promise<void>;
138
138
  getDiagnosticaHistory: (patient: {
139
+ gender?: "m" | "f" | "o" | undefined;
139
140
  identificationType: "DNI";
140
141
  identificationValue: string;
141
- gender: "m" | "f" | "o";
142
142
  }, from: Date, to: Date) => Promise<{
143
143
  date: Date;
144
144
  location: string;
@@ -146,21 +146,21 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
146
146
  deepLink: string;
147
147
  }[]>;
148
148
  getDiagnosticaDeepLink: (kiosk: string, user: {
149
+ gender?: "m" | "f" | "o" | undefined;
149
150
  firstName: string;
150
151
  lastName: string;
151
152
  identificationType: "DNI";
152
153
  identificationValue: string;
153
- gender: "m" | "f" | "o";
154
154
  phone: string;
155
155
  email: string;
156
156
  language: string;
157
157
  birthday: Date;
158
158
  }, patient: {
159
+ gender?: "m" | "f" | "o" | undefined;
159
160
  firstName: string;
160
161
  lastName: string;
161
162
  identificationType: "DNI";
162
163
  identificationValue: string;
163
- gender: "m" | "f" | "o";
164
164
  birthday: Date;
165
165
  }) => Promise<{
166
166
  forwardingRequired: true;
@@ -169,31 +169,31 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
169
169
  forwardingRequired: false;
170
170
  }>;
171
171
  getDiagnosticaAccess: (kiosk: string, user: {
172
+ gender?: "m" | "f" | "o" | undefined;
172
173
  firstName: string;
173
174
  lastName: string;
174
175
  identificationType: "DNI";
175
176
  identificationValue: string;
176
- gender: "m" | "f" | "o";
177
177
  phone: string;
178
178
  email: string;
179
179
  language: string;
180
180
  birthday: Date;
181
181
  }, patient: {
182
+ gender?: "m" | "f" | "o" | undefined;
182
183
  firstName: string;
183
184
  lastName: string;
184
185
  identificationType: "DNI";
185
186
  identificationValue: string;
186
- gender: "m" | "f" | "o";
187
187
  birthday: Date;
188
188
  }) => Promise<void>;
189
189
  externalLogin: (params: {
190
190
  user: string;
191
191
  password: string;
192
192
  }) => Promise<{
193
+ gender?: "m" | "f" | "o" | undefined;
193
194
  firstName: string;
194
195
  lastName: string;
195
196
  countryId: string;
196
- gender: "m" | "f" | "o";
197
197
  phone: string;
198
198
  email: string;
199
199
  birthday: Date;
@@ -318,10 +318,10 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
318
318
  emailCode?: undefined;
319
319
  phoneCode: string;
320
320
  })) => Promise<{
321
+ gender?: "m" | "f" | "o" | undefined;
321
322
  firstName: string;
322
323
  lastName: string;
323
324
  countryId: string;
324
- gender: "m" | "f" | "o";
325
325
  phone: string;
326
326
  email: string;
327
327
  birthday: Date;
package/lib/schemas.d.ts CHANGED
@@ -37,59 +37,59 @@ export declare const doc24Schemas: {
37
37
  user: import("zod").ZodObject<import("zod").extendShape<{
38
38
  firstName: import("zod").ZodString;
39
39
  lastName: import("zod").ZodString;
40
- identificationType: import("zod").ZodNumber;
41
- identificationValue: import("zod").ZodString;
40
+ identificationType: import("zod").ZodOptional<import("zod").ZodNumber>;
41
+ identificationValue: import("zod").ZodOptional<import("zod").ZodString>;
42
42
  countryId: import("zod").ZodString;
43
43
  birthdate: import("zod").ZodDate;
44
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
44
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
45
45
  }, {
46
- phone: import("zod").ZodString;
46
+ phone: import("zod").ZodOptional<import("zod").ZodString>;
47
47
  email: import("zod").ZodString;
48
48
  }>, "strip", import("zod").ZodTypeAny, {
49
+ identificationType?: number | undefined;
50
+ identificationValue?: string | undefined;
51
+ gender?: "m" | "f" | "o" | undefined;
52
+ phone?: string | undefined;
49
53
  firstName: string;
50
54
  lastName: string;
51
- identificationType: number;
52
- identificationValue: string;
53
55
  countryId: string;
54
56
  birthdate: Date;
55
- gender: "m" | "f" | "o";
56
- phone: string;
57
57
  email: string;
58
58
  }, {
59
+ identificationType?: number | undefined;
60
+ identificationValue?: string | undefined;
61
+ gender?: "m" | "f" | "o" | undefined;
62
+ phone?: string | undefined;
59
63
  firstName: string;
60
64
  lastName: string;
61
- identificationType: number;
62
- identificationValue: string;
63
65
  countryId: string;
64
66
  birthdate: Date;
65
- gender: "m" | "f" | "o";
66
- phone: string;
67
67
  email: string;
68
68
  }>;
69
69
  patient: import("zod").ZodObject<{
70
70
  firstName: import("zod").ZodString;
71
71
  lastName: import("zod").ZodString;
72
- identificationType: import("zod").ZodNumber;
73
- identificationValue: import("zod").ZodString;
72
+ identificationType: import("zod").ZodOptional<import("zod").ZodNumber>;
73
+ identificationValue: import("zod").ZodOptional<import("zod").ZodString>;
74
74
  countryId: import("zod").ZodString;
75
75
  birthdate: import("zod").ZodDate;
76
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
76
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
77
77
  }, "strip", import("zod").ZodTypeAny, {
78
+ identificationType?: number | undefined;
79
+ identificationValue?: string | undefined;
80
+ gender?: "m" | "f" | "o" | undefined;
78
81
  firstName: string;
79
82
  lastName: string;
80
- identificationType: number;
81
- identificationValue: string;
82
83
  countryId: string;
83
84
  birthdate: Date;
84
- gender: "m" | "f" | "o";
85
85
  }, {
86
+ identificationType?: number | undefined;
87
+ identificationValue?: string | undefined;
88
+ gender?: "m" | "f" | "o" | undefined;
86
89
  firstName: string;
87
90
  lastName: string;
88
- identificationType: number;
89
- identificationValue: string;
90
91
  countryId: string;
91
92
  birthdate: Date;
92
- gender: "m" | "f" | "o";
93
93
  }>;
94
94
  specialtyMode: import("zod").ZodEnum<["appointment", "chat", "instant"]>;
95
95
  specialty: import("zod").ZodObject<{
@@ -727,7 +727,7 @@ export declare const doc24Schemas: {
727
727
  firstName: import("zod").ZodString;
728
728
  lastName: import("zod").ZodString;
729
729
  birthdate: import("zod").ZodDate;
730
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
730
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
731
731
  email: import("zod").ZodString;
732
732
  phone: import("zod").ZodNullable<import("zod").ZodString>;
733
733
  logoUrl: import("zod").ZodString;
@@ -764,10 +764,10 @@ export declare const doc24Schemas: {
764
764
  brief: string;
765
765
  }>;
766
766
  }, "strip", import("zod").ZodTypeAny, {
767
+ gender?: "m" | "f" | "o" | undefined;
767
768
  firstName: string;
768
769
  lastName: string;
769
770
  birthdate: Date;
770
- gender: "m" | "f" | "o";
771
771
  phone: string | null;
772
772
  email: string;
773
773
  id: number;
@@ -787,10 +787,10 @@ export declare const doc24Schemas: {
787
787
  brief: string;
788
788
  };
789
789
  }, {
790
+ gender?: "m" | "f" | "o" | undefined;
790
791
  firstName: string;
791
792
  lastName: string;
792
793
  birthdate: Date;
793
- gender: "m" | "f" | "o";
794
794
  phone: string | null;
795
795
  email: string;
796
796
  id: number;
@@ -1011,43 +1011,43 @@ export declare const doc24Schemas: {
1011
1011
  enrollmentParams: import("zod").ZodObject<{
1012
1012
  firstName: import("zod").ZodString;
1013
1013
  lastName: import("zod").ZodString;
1014
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1014
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1015
1015
  identificationNumber: import("zod").ZodString;
1016
1016
  birthdate: import("zod").ZodDate;
1017
1017
  email: import("zod").ZodString;
1018
1018
  plan: import("zod").ZodString;
1019
1019
  startDate: import("zod").ZodDate;
1020
1020
  }, "strip", import("zod").ZodTypeAny, {
1021
+ gender?: "m" | "f" | "o" | undefined;
1021
1022
  firstName: string;
1022
1023
  lastName: string;
1023
1024
  birthdate: Date;
1024
- gender: "m" | "f" | "o";
1025
1025
  email: string;
1026
1026
  identificationNumber: string;
1027
1027
  startDate: Date;
1028
1028
  plan: string;
1029
1029
  }, {
1030
+ gender?: "m" | "f" | "o" | undefined;
1030
1031
  firstName: string;
1031
1032
  lastName: string;
1032
1033
  birthdate: Date;
1033
- gender: "m" | "f" | "o";
1034
1034
  email: string;
1035
1035
  identificationNumber: string;
1036
1036
  startDate: Date;
1037
1037
  plan: string;
1038
1038
  }>;
1039
1039
  diagnosticaPatientFilter: import("zod").ZodObject<{
1040
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1040
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1041
1041
  identificationType: import("zod").ZodLiteral<"DNI">;
1042
1042
  identificationValue: import("zod").ZodString;
1043
1043
  }, "strip", import("zod").ZodTypeAny, {
1044
+ gender?: "m" | "f" | "o" | undefined;
1044
1045
  identificationType: "DNI";
1045
1046
  identificationValue: string;
1046
- gender: "m" | "f" | "o";
1047
1047
  }, {
1048
+ gender?: "m" | "f" | "o" | undefined;
1048
1049
  identificationType: "DNI";
1049
1050
  identificationValue: string;
1050
- gender: "m" | "f" | "o";
1051
1051
  }>;
1052
1052
  diagnosticaHistoryAppointment: import("zod").ZodObject<{
1053
1053
  date: import("zod").ZodDate;
@@ -1071,27 +1071,27 @@ export declare const doc24Schemas: {
1071
1071
  birthday: import("zod").ZodDate;
1072
1072
  identificationType: import("zod").ZodLiteral<"DNI">;
1073
1073
  identificationValue: import("zod").ZodString;
1074
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1074
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1075
1075
  }, {
1076
1076
  phone: import("zod").ZodString;
1077
1077
  email: import("zod").ZodString;
1078
1078
  language: import("zod").ZodString;
1079
1079
  }>, "strip", import("zod").ZodTypeAny, {
1080
+ gender?: "m" | "f" | "o" | undefined;
1080
1081
  firstName: string;
1081
1082
  lastName: string;
1082
1083
  identificationType: "DNI";
1083
1084
  identificationValue: string;
1084
- gender: "m" | "f" | "o";
1085
1085
  phone: string;
1086
1086
  email: string;
1087
1087
  language: string;
1088
1088
  birthday: Date;
1089
1089
  }, {
1090
+ gender?: "m" | "f" | "o" | undefined;
1090
1091
  firstName: string;
1091
1092
  lastName: string;
1092
1093
  identificationType: "DNI";
1093
1094
  identificationValue: string;
1094
- gender: "m" | "f" | "o";
1095
1095
  phone: string;
1096
1096
  email: string;
1097
1097
  language: string;
@@ -1103,20 +1103,20 @@ export declare const doc24Schemas: {
1103
1103
  birthday: import("zod").ZodDate;
1104
1104
  identificationType: import("zod").ZodLiteral<"DNI">;
1105
1105
  identificationValue: import("zod").ZodString;
1106
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1106
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1107
1107
  }, "strip", import("zod").ZodTypeAny, {
1108
+ gender?: "m" | "f" | "o" | undefined;
1108
1109
  firstName: string;
1109
1110
  lastName: string;
1110
1111
  identificationType: "DNI";
1111
1112
  identificationValue: string;
1112
- gender: "m" | "f" | "o";
1113
1113
  birthday: Date;
1114
1114
  }, {
1115
+ gender?: "m" | "f" | "o" | undefined;
1115
1116
  firstName: string;
1116
1117
  lastName: string;
1117
1118
  identificationType: "DNI";
1118
1119
  identificationValue: string;
1119
- gender: "m" | "f" | "o";
1120
1120
  birthday: Date;
1121
1121
  }>;
1122
1122
  diagnosticaDeepLinkResponse: import("zod").ZodUnion<[import("zod").ZodObject<{
@@ -1145,7 +1145,7 @@ export declare const doc24Schemas: {
1145
1145
  firstName: import("zod").ZodNullable<import("zod").ZodString>;
1146
1146
  birthdate: import("zod").ZodDate;
1147
1147
  financerPlanId: import("zod").ZodNullable<import("zod").ZodNumber>;
1148
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1148
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1149
1149
  brand: import("zod").ZodNullable<import("zod").ZodNumber>;
1150
1150
  holderIdentificationNumber: import("zod").ZodNullable<import("zod").ZodString>;
1151
1151
  copaymentValue: import("zod").ZodNullable<import("zod").ZodNumber>;
@@ -1159,10 +1159,10 @@ export declare const doc24Schemas: {
1159
1159
  authorizationCode: import("zod").ZodNullable<import("zod").ZodString>;
1160
1160
  authorizationCodeExpiration: import("zod").ZodNullable<import("zod").ZodDate>;
1161
1161
  }, "strip", import("zod").ZodTypeAny, {
1162
+ gender?: "m" | "f" | "o" | undefined;
1162
1163
  firstName: string | null;
1163
1164
  lastName: string | null;
1164
1165
  birthdate: Date;
1165
- gender: "m" | "f" | "o";
1166
1166
  email: string | null;
1167
1167
  identificationNumber: string;
1168
1168
  plan: string | null;
@@ -1182,10 +1182,10 @@ export declare const doc24Schemas: {
1182
1182
  authorizationCode: string | null;
1183
1183
  authorizationCodeExpiration: Date | null;
1184
1184
  }, {
1185
+ gender?: "m" | "f" | "o" | undefined;
1185
1186
  firstName: string | null;
1186
1187
  lastName: string | null;
1187
1188
  birthdate: Date;
1188
- gender: "m" | "f" | "o";
1189
1189
  email: string | null;
1190
1190
  identificationNumber: string;
1191
1191
  plan: string | null;
@@ -1222,57 +1222,57 @@ export declare const doc24Schemas: {
1222
1222
  user: import("zod").ZodObject<import("zod").extendShape<{
1223
1223
  firstName: import("zod").ZodString;
1224
1224
  lastName: import("zod").ZodString;
1225
- identificationType: import("zod").ZodNumber;
1226
- identificationValue: import("zod").ZodString;
1225
+ identificationType: import("zod").ZodOptional<import("zod").ZodNumber>;
1226
+ identificationValue: import("zod").ZodOptional<import("zod").ZodString>;
1227
1227
  countryId: import("zod").ZodString;
1228
1228
  birthdate: import("zod").ZodDate;
1229
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1229
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1230
1230
  }, {
1231
- phone: import("zod").ZodString;
1231
+ phone: import("zod").ZodOptional<import("zod").ZodString>;
1232
1232
  email: import("zod").ZodString;
1233
1233
  }>, "strip", import("zod").ZodTypeAny, {
1234
+ identificationType?: number | undefined;
1235
+ identificationValue?: string | undefined;
1236
+ gender?: "m" | "f" | "o" | undefined;
1237
+ phone?: string | undefined;
1234
1238
  firstName: string;
1235
1239
  lastName: string;
1236
- identificationType: number;
1237
- identificationValue: string;
1238
1240
  countryId: string;
1239
1241
  birthdate: Date;
1240
- gender: "m" | "f" | "o";
1241
- phone: string;
1242
1242
  email: string;
1243
1243
  }, {
1244
+ identificationType?: number | undefined;
1245
+ identificationValue?: string | undefined;
1246
+ gender?: "m" | "f" | "o" | undefined;
1247
+ phone?: string | undefined;
1244
1248
  firstName: string;
1245
1249
  lastName: string;
1246
- identificationType: number;
1247
- identificationValue: string;
1248
1250
  countryId: string;
1249
1251
  birthdate: Date;
1250
- gender: "m" | "f" | "o";
1251
- phone: string;
1252
1252
  email: string;
1253
1253
  }>;
1254
1254
  }, "strip", import("zod").ZodTypeAny, {
1255
1255
  user: {
1256
+ identificationType?: number | undefined;
1257
+ identificationValue?: string | undefined;
1258
+ gender?: "m" | "f" | "o" | undefined;
1259
+ phone?: string | undefined;
1256
1260
  firstName: string;
1257
1261
  lastName: string;
1258
- identificationType: number;
1259
- identificationValue: string;
1260
1262
  countryId: string;
1261
1263
  birthdate: Date;
1262
- gender: "m" | "f" | "o";
1263
- phone: string;
1264
1264
  email: string;
1265
1265
  };
1266
1266
  }, {
1267
1267
  user: {
1268
+ identificationType?: number | undefined;
1269
+ identificationValue?: string | undefined;
1270
+ gender?: "m" | "f" | "o" | undefined;
1271
+ phone?: string | undefined;
1268
1272
  firstName: string;
1269
1273
  lastName: string;
1270
- identificationType: number;
1271
- identificationValue: string;
1272
1274
  countryId: string;
1273
1275
  birthdate: Date;
1274
- gender: "m" | "f" | "o";
1275
- phone: string;
1276
1276
  email: string;
1277
1277
  };
1278
1278
  }>, import("zod").ZodObject<{
@@ -1326,47 +1326,47 @@ export declare const doc24Schemas: {
1326
1326
  patient: import("zod").ZodObject<{
1327
1327
  firstName: import("zod").ZodString;
1328
1328
  lastName: import("zod").ZodString;
1329
- identificationType: import("zod").ZodNumber;
1330
- identificationValue: import("zod").ZodString;
1329
+ identificationType: import("zod").ZodOptional<import("zod").ZodNumber>;
1330
+ identificationValue: import("zod").ZodOptional<import("zod").ZodString>;
1331
1331
  countryId: import("zod").ZodString;
1332
1332
  birthdate: import("zod").ZodDate;
1333
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1333
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1334
1334
  }, "strip", import("zod").ZodTypeAny, {
1335
+ identificationType?: number | undefined;
1336
+ identificationValue?: string | undefined;
1337
+ gender?: "m" | "f" | "o" | undefined;
1335
1338
  firstName: string;
1336
1339
  lastName: string;
1337
- identificationType: number;
1338
- identificationValue: string;
1339
1340
  countryId: string;
1340
1341
  birthdate: Date;
1341
- gender: "m" | "f" | "o";
1342
1342
  }, {
1343
+ identificationType?: number | undefined;
1344
+ identificationValue?: string | undefined;
1345
+ gender?: "m" | "f" | "o" | undefined;
1343
1346
  firstName: string;
1344
1347
  lastName: string;
1345
- identificationType: number;
1346
- identificationValue: string;
1347
1348
  countryId: string;
1348
1349
  birthdate: Date;
1349
- gender: "m" | "f" | "o";
1350
1350
  }>;
1351
1351
  }, "strip", import("zod").ZodTypeAny, {
1352
1352
  patient: {
1353
+ identificationType?: number | undefined;
1354
+ identificationValue?: string | undefined;
1355
+ gender?: "m" | "f" | "o" | undefined;
1353
1356
  firstName: string;
1354
1357
  lastName: string;
1355
- identificationType: number;
1356
- identificationValue: string;
1357
1358
  countryId: string;
1358
1359
  birthdate: Date;
1359
- gender: "m" | "f" | "o";
1360
1360
  };
1361
1361
  }, {
1362
1362
  patient: {
1363
+ identificationType?: number | undefined;
1364
+ identificationValue?: string | undefined;
1365
+ gender?: "m" | "f" | "o" | undefined;
1363
1366
  firstName: string;
1364
1367
  lastName: string;
1365
- identificationType: number;
1366
- identificationValue: string;
1367
1368
  countryId: string;
1368
1369
  birthdate: Date;
1369
- gender: "m" | "f" | "o";
1370
1370
  };
1371
1371
  }>, import("zod").ZodObject<{
1372
1372
  channel: import("zod").ZodOptional<import("zod").ZodEnum<["1", "2"]>>;
@@ -1448,23 +1448,23 @@ export declare const doc24Schemas: {
1448
1448
  countryId: import("zod").ZodString;
1449
1449
  birthday: import("zod").ZodDate;
1450
1450
  identificationNumber: import("zod").ZodString;
1451
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1451
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1452
1452
  email: import("zod").ZodString;
1453
1453
  phone: import("zod").ZodString;
1454
1454
  }, "strip", import("zod").ZodTypeAny, {
1455
+ gender?: "m" | "f" | "o" | undefined;
1455
1456
  firstName: string;
1456
1457
  lastName: string;
1457
1458
  countryId: string;
1458
- gender: "m" | "f" | "o";
1459
1459
  phone: string;
1460
1460
  email: string;
1461
1461
  birthday: Date;
1462
1462
  identificationNumber: string;
1463
1463
  }, {
1464
+ gender?: "m" | "f" | "o" | undefined;
1464
1465
  firstName: string;
1465
1466
  lastName: string;
1466
1467
  countryId: string;
1467
- gender: "m" | "f" | "o";
1468
1468
  phone: string;
1469
1469
  email: string;
1470
1470
  birthday: Date;
@@ -1687,17 +1687,17 @@ export declare const doc24Schemas: {
1687
1687
  birthdate: import("zod").ZodDate;
1688
1688
  identificationType: import("zod").ZodLiteral<"DNI">;
1689
1689
  identificationValue: import("zod").ZodString;
1690
- gender: import("zod").ZodEnum<["m", "f", "o"]>;
1690
+ gender: import("zod").ZodOptional<import("zod").ZodEnum<["m", "f", "o"]>>;
1691
1691
  }, "strip", import("zod").ZodTypeAny, {
1692
+ gender?: "m" | "f" | "o" | undefined;
1692
1693
  identificationType: "DNI";
1693
1694
  identificationValue: string;
1694
1695
  birthdate: Date;
1695
- gender: "m" | "f" | "o";
1696
1696
  }, {
1697
+ gender?: "m" | "f" | "o" | undefined;
1697
1698
  identificationType: "DNI";
1698
1699
  identificationValue: string;
1699
1700
  birthdate: Date;
1700
- gender: "m" | "f" | "o";
1701
1701
  }>;
1702
1702
  externalAppointment: import("zod").ZodObject<{
1703
1703
  id: import("zod").ZodNumber;
package/lib/schemas.js CHANGED
@@ -2,20 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doc24Schemas = void 0;
4
4
  const zod_1 = require("zod");
5
- const gender = zod_1.enum(['m', 'f', 'o']);
5
+ const gender = zod_1.enum(['m', 'f', 'o']).optional();
6
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: zod_1.number(),
12
- identificationValue: zod_1.string(),
11
+ identificationType: zod_1.number().optional(),
12
+ identificationValue: zod_1.string().optional(),
13
13
  countryId: zod_1.string(),
14
14
  birthdate: zod_1.date(),
15
15
  gender,
16
16
  });
17
17
  const patient = basePersonData;
18
- const user = basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() });
18
+ const user = basePersonData.extend({ phone: zod_1.string().optional(), email: zod_1.string() });
19
19
  const specialtyMode = zod_1.enum(['appointment', 'chat', 'instant']);
20
20
  const specialty = zod_1.object({
21
21
  id: zod_1.number(),
@@ -1,10 +1,10 @@
1
1
  import { RequestMaker } from '../request';
2
2
  export declare const getExternalMethods: (makeRequest: RequestMaker) => {
3
3
  getExternalStudiesHistoryLink: (patient: {
4
+ gender?: "m" | "f" | "o" | undefined;
4
5
  identificationType: "DNI";
5
6
  identificationValue: string;
6
7
  birthdate: Date;
7
- gender: "m" | "f" | "o";
8
8
  }) => Promise<string | null>;
9
9
  getExternalAppointmentsLink: (identificationValue: string, birthdate: Date) => Promise<string | null>;
10
10
  getExternalAppointments: () => Promise<{
@@ -62,10 +62,11 @@ const getExternalMethods = (makeRequest) => {
62
62
  };
63
63
  exports.getExternalMethods = getExternalMethods;
64
64
  const mapPatientData = (patient) => {
65
+ var _a;
65
66
  return {
66
67
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
67
68
  id_type: 'dni',
68
69
  id_value: patient.identificationValue,
69
- gender: patient.gender.toLocaleUpperCase(),
70
+ gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase(),
70
71
  };
71
72
  };
@@ -2,13 +2,13 @@ import { RequestMaker } from '../request';
2
2
  export declare const getPatientMethods: (makeRequest: RequestMaker) => {
3
3
  declarePatient: (params: {
4
4
  patient: {
5
+ identificationType?: number | undefined;
6
+ identificationValue?: string | undefined;
7
+ gender?: "m" | "f" | "o" | undefined;
5
8
  firstName: string;
6
9
  lastName: string;
7
- identificationType: number;
8
- identificationValue: string;
9
10
  countryId: string;
10
11
  birthdate: Date;
11
- gender: "m" | "f" | "o";
12
12
  };
13
13
  } & {
14
14
  code?: string | undefined;
@@ -26,13 +26,13 @@ export declare const getPatientMethods: (makeRequest: RequestMaker) => {
26
26
  askCode: false;
27
27
  }>;
28
28
  getPatientId: (patient: {
29
+ identificationType?: number | undefined;
30
+ identificationValue?: string | undefined;
31
+ gender?: "m" | "f" | "o" | undefined;
29
32
  firstName: string;
30
33
  lastName: string;
31
- identificationType: number;
32
- identificationValue: string;
33
34
  countryId: string;
34
35
  birthdate: Date;
35
- gender: "m" | "f" | "o";
36
36
  }) => Promise<number>;
37
37
  deletePatient: (patientId: number) => Promise<void>;
38
38
  };
@@ -7,6 +7,7 @@ const validation_1 = require("../request/validation");
7
7
  const schemas_1 = require("../schemas");
8
8
  const getPatientMethods = (makeRequest) => {
9
9
  const declarePatient = async ({ patient, channel, code, }) => {
10
+ var _a;
10
11
  const path = '/patient';
11
12
  const mappedPatient = {
12
13
  lastname: patient.lastName,
@@ -14,7 +15,7 @@ const getPatientMethods = (makeRequest) => {
14
15
  identification_type: patient.identificationType,
15
16
  identification_value: patient.identificationValue,
16
17
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
17
- gender: patient.gender.toUpperCase(),
18
+ gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
18
19
  country_id: patient.countryId,
19
20
  };
20
21
  const parsedChannel = channel ? parseInt(channel) : channel;
@@ -37,6 +38,7 @@ const getPatientMethods = (makeRequest) => {
37
38
  return { askCode: false, patientId: data.patient_id };
38
39
  };
39
40
  const getPatientId = async (patient) => {
41
+ var _a;
40
42
  const path = '/search-patient';
41
43
  const mappedPatient = {
42
44
  lastname: patient.lastName,
@@ -44,7 +46,7 @@ const getPatientMethods = (makeRequest) => {
44
46
  identification_type: patient.identificationType,
45
47
  identification_value: patient.identificationValue,
46
48
  birthdate: date_fns_1.format(patient.birthdate, 'yyyy-MM-dd'),
47
- gender: patient.gender.toUpperCase(),
49
+ gender: (_a = patient.gender) === null || _a === void 0 ? void 0 : _a.toUpperCase(),
48
50
  country_id: patient.countryId,
49
51
  };
50
52
  const response = await makeRequest('POST', path, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.15.5",
3
+ "version": "1.15.7",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },