@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.
Files changed (192) hide show
  1. package/lib/baseSdk/index.js +5 -1
  2. package/lib/lib/baseSdk/index.d.ts +57 -10
  3. package/lib/lib/baseSdk/user.d.ts +16 -5
  4. package/lib/lib/baseSdk/user.js +67 -25
  5. package/lib/lib/index.d.ts +44 -16
  6. package/lib/lib/lib/baseSdk/diagnostica.d.ts +6 -0
  7. package/lib/lib/lib/baseSdk/diagnostica.js +79 -0
  8. package/lib/lib/lib/baseSdk/index.d.ts +51 -0
  9. package/lib/lib/lib/baseSdk/index.js +66 -0
  10. package/lib/lib/lib/baseSdk/user.d.ts +9 -0
  11. package/lib/lib/lib/baseSdk/user.js +130 -0
  12. package/lib/lib/lib/index.d.ts +168 -0
  13. package/lib/lib/lib/index.js +22 -0
  14. package/lib/lib/lib/lib/baseSdk/diagnostica.d.ts +6 -0
  15. package/lib/lib/lib/lib/baseSdk/diagnostica.js +79 -0
  16. package/lib/lib/lib/lib/baseSdk/index.d.ts +14 -0
  17. package/lib/lib/lib/lib/baseSdk/index.js +66 -0
  18. package/lib/lib/lib/lib/baseSdk/user.d.ts +9 -0
  19. package/lib/lib/lib/lib/baseSdk/user.js +130 -0
  20. package/lib/lib/lib/lib/index.d.ts +58 -0
  21. package/lib/lib/lib/lib/index.js +22 -0
  22. package/lib/lib/lib/lib/request/index.d.ts +2 -0
  23. package/lib/lib/lib/lib/request/index.js +26 -0
  24. package/lib/lib/lib/lib/request/token.d.ts +2 -0
  25. package/lib/lib/lib/lib/request/token.js +34 -0
  26. package/lib/lib/lib/lib/request/validation.d.ts +10 -0
  27. package/lib/lib/lib/lib/request/validation.js +28 -0
  28. package/lib/lib/lib/lib/schemas.d.ts +1334 -0
  29. package/lib/lib/lib/lib/schemas.js +325 -0
  30. package/lib/lib/lib/lib/test.d.ts +1 -0
  31. package/lib/lib/lib/lib/test.js +55 -0
  32. package/lib/lib/lib/lib/types.d.ts +1 -0
  33. package/lib/lib/lib/lib/types.js +2 -0
  34. package/lib/lib/lib/lib/userSdk/chat.d.ts +9 -0
  35. package/lib/lib/lib/lib/userSdk/chat.js +98 -0
  36. package/lib/lib/lib/lib/userSdk/index.d.ts +24 -0
  37. package/lib/lib/lib/lib/userSdk/index.js +27 -0
  38. package/lib/lib/lib/lib/userSdk/patients.d.ts +5 -0
  39. package/lib/lib/lib/lib/userSdk/patients.js +55 -0
  40. package/lib/lib/lib/lib/userSdk/schedule.d.ts +7 -0
  41. package/lib/lib/lib/lib/userSdk/schedule.js +76 -0
  42. package/lib/lib/lib/lib/userSdk/specialties.d.ts +4 -0
  43. package/lib/lib/lib/lib/userSdk/specialties.js +19 -0
  44. package/lib/lib/lib/lib/userSdk/videoVisit.d.ts +10 -0
  45. package/lib/lib/lib/lib/userSdk/videoVisit.js +147 -0
  46. package/lib/lib/lib/lib/utils.d.ts +4 -0
  47. package/lib/lib/lib/lib/utils.js +19 -0
  48. package/lib/lib/lib/lib/webhook/index.d.ts +8 -0
  49. package/lib/lib/lib/lib/webhook/index.js +55 -0
  50. package/lib/lib/lib/lib/webhook/responses.d.ts +36 -0
  51. package/lib/lib/lib/lib/webhook/responses.js +42 -0
  52. package/lib/lib/lib/lib/webhook/token.d.ts +2 -0
  53. package/lib/lib/lib/lib/webhook/token.js +23 -0
  54. package/lib/lib/lib/request/index.d.ts +2 -0
  55. package/lib/lib/lib/request/index.js +26 -0
  56. package/lib/lib/lib/request/token.d.ts +2 -0
  57. package/lib/lib/lib/request/token.js +34 -0
  58. package/lib/lib/lib/request/validation.d.ts +10 -0
  59. package/lib/lib/lib/request/validation.js +28 -0
  60. package/lib/lib/lib/schemas.d.ts +1334 -0
  61. package/lib/lib/lib/schemas.js +325 -0
  62. package/lib/lib/lib/src/baseSdk/diagnostica.d.ts +6 -0
  63. package/lib/lib/lib/src/baseSdk/diagnostica.js +79 -0
  64. package/lib/lib/lib/src/baseSdk/index.d.ts +51 -0
  65. package/lib/lib/lib/src/baseSdk/index.js +66 -0
  66. package/lib/lib/lib/src/baseSdk/user.d.ts +9 -0
  67. package/lib/lib/lib/src/baseSdk/user.js +130 -0
  68. package/lib/lib/lib/src/index.d.ts +169 -0
  69. package/lib/lib/lib/src/index.js +22 -0
  70. package/lib/lib/lib/src/request/index.d.ts +2 -0
  71. package/lib/lib/lib/src/request/index.js +26 -0
  72. package/lib/lib/lib/src/request/token.d.ts +2 -0
  73. package/lib/lib/lib/src/request/token.js +34 -0
  74. package/lib/lib/lib/src/request/validation.d.ts +10 -0
  75. package/lib/lib/lib/src/request/validation.js +28 -0
  76. package/lib/lib/lib/src/schemas.d.ts +1340 -0
  77. package/lib/lib/lib/src/schemas.js +325 -0
  78. package/lib/lib/lib/src/types.d.ts +1 -0
  79. package/lib/lib/lib/src/types.js +2 -0
  80. package/lib/lib/lib/src/userSdk/chat.d.ts +9 -0
  81. package/lib/lib/lib/src/userSdk/chat.js +98 -0
  82. package/lib/lib/lib/src/userSdk/index.d.ts +102 -0
  83. package/lib/lib/lib/src/userSdk/index.js +27 -0
  84. package/lib/lib/lib/src/userSdk/patients.d.ts +5 -0
  85. package/lib/lib/lib/src/userSdk/patients.js +55 -0
  86. package/lib/lib/lib/src/userSdk/schedule.d.ts +7 -0
  87. package/lib/lib/lib/src/userSdk/schedule.js +76 -0
  88. package/lib/lib/lib/src/userSdk/specialties.d.ts +4 -0
  89. package/lib/lib/lib/src/userSdk/specialties.js +19 -0
  90. package/lib/lib/lib/src/userSdk/videoVisit.d.ts +10 -0
  91. package/lib/lib/lib/src/userSdk/videoVisit.js +147 -0
  92. package/lib/lib/lib/src/utils.d.ts +4 -0
  93. package/lib/lib/lib/src/utils.js +19 -0
  94. package/lib/lib/lib/src/webhook/index.d.ts +8 -0
  95. package/lib/lib/lib/src/webhook/index.js +55 -0
  96. package/lib/lib/lib/src/webhook/responses.d.ts +36 -0
  97. package/lib/lib/lib/src/webhook/responses.js +42 -0
  98. package/lib/lib/lib/src/webhook/token.d.ts +2 -0
  99. package/lib/lib/lib/src/webhook/token.js +23 -0
  100. package/lib/lib/lib/test.d.ts +1 -0
  101. package/lib/lib/lib/test.js +55 -0
  102. package/lib/lib/lib/types.d.ts +1 -0
  103. package/lib/lib/lib/types.js +2 -0
  104. package/lib/lib/lib/userSdk/chat.d.ts +9 -0
  105. package/lib/lib/lib/userSdk/chat.js +98 -0
  106. package/lib/lib/lib/userSdk/index.d.ts +102 -0
  107. package/lib/lib/lib/userSdk/index.js +27 -0
  108. package/lib/lib/lib/userSdk/patients.d.ts +5 -0
  109. package/lib/lib/lib/userSdk/patients.js +55 -0
  110. package/lib/lib/lib/userSdk/schedule.d.ts +7 -0
  111. package/lib/lib/lib/userSdk/schedule.js +76 -0
  112. package/lib/lib/lib/userSdk/specialties.d.ts +4 -0
  113. package/lib/lib/lib/userSdk/specialties.js +19 -0
  114. package/lib/lib/lib/userSdk/videoVisit.d.ts +10 -0
  115. package/lib/lib/lib/userSdk/videoVisit.js +147 -0
  116. package/lib/lib/lib/utils.d.ts +4 -0
  117. package/lib/lib/lib/utils.js +19 -0
  118. package/lib/lib/lib/webhook/index.d.ts +8 -0
  119. package/lib/lib/lib/webhook/index.js +55 -0
  120. package/lib/lib/lib/webhook/responses.d.ts +36 -0
  121. package/lib/lib/lib/webhook/responses.js +42 -0
  122. package/lib/lib/lib/webhook/token.d.ts +2 -0
  123. package/lib/lib/lib/webhook/token.js +23 -0
  124. package/lib/lib/schemas.d.ts +256 -60
  125. package/lib/lib/schemas.js +33 -2
  126. package/lib/lib/src/baseSdk/diagnostica.d.ts +11 -0
  127. package/lib/lib/src/baseSdk/diagnostica.js +79 -0
  128. package/lib/lib/src/baseSdk/index.d.ts +162 -0
  129. package/lib/lib/src/baseSdk/index.js +66 -0
  130. package/lib/lib/src/baseSdk/user.d.ts +41 -0
  131. package/lib/lib/src/baseSdk/user.js +130 -0
  132. package/lib/lib/src/index.d.ts +183 -0
  133. package/lib/lib/src/index.js +22 -0
  134. package/lib/lib/src/request/index.d.ts +2 -0
  135. package/lib/lib/src/request/index.js +26 -0
  136. package/lib/lib/src/request/token.d.ts +2 -0
  137. package/lib/lib/src/request/token.js +34 -0
  138. package/lib/lib/src/request/validation.d.ts +10 -0
  139. package/lib/lib/src/request/validation.js +28 -0
  140. package/lib/lib/src/schemas.d.ts +1340 -0
  141. package/lib/lib/src/schemas.js +325 -0
  142. package/lib/lib/src/types.d.ts +1 -0
  143. package/lib/lib/src/types.js +2 -0
  144. package/lib/lib/src/userSdk/chat.d.ts +9 -0
  145. package/lib/lib/src/userSdk/chat.js +98 -0
  146. package/lib/lib/src/userSdk/index.d.ts +241 -0
  147. package/lib/lib/src/userSdk/index.js +27 -0
  148. package/lib/lib/src/userSdk/patients.d.ts +13 -0
  149. package/lib/lib/src/userSdk/patients.js +55 -0
  150. package/lib/lib/src/userSdk/schedule.d.ts +15 -0
  151. package/lib/lib/src/userSdk/schedule.js +76 -0
  152. package/lib/lib/src/userSdk/specialties.d.ts +4 -0
  153. package/lib/lib/src/userSdk/specialties.js +19 -0
  154. package/lib/lib/src/userSdk/videoVisit.d.ts +72 -0
  155. package/lib/lib/src/userSdk/videoVisit.js +147 -0
  156. package/lib/lib/src/utils.d.ts +4 -0
  157. package/lib/lib/src/utils.js +19 -0
  158. package/lib/lib/src/webhook/index.d.ts +8 -0
  159. package/lib/lib/src/webhook/index.js +55 -0
  160. package/lib/lib/src/webhook/responses.d.ts +36 -0
  161. package/lib/lib/src/webhook/responses.js +42 -0
  162. package/lib/lib/src/webhook/token.d.ts +2 -0
  163. package/lib/lib/src/webhook/token.js +23 -0
  164. package/lib/lib/userSdk/index.d.ts +25 -5
  165. package/lib/lib/userSdk/patients.d.ts +10 -1
  166. package/lib/lib/userSdk/patients.js +34 -6
  167. package/lib/lib/userSdk/videoVisit.d.ts +1 -1
  168. package/lib/lib/utils.d.ts +1 -1
  169. package/lib/lib/utils.js +3 -3
  170. package/lib/src/baseSdk/diagnostica.d.ts +6 -6
  171. package/lib/src/baseSdk/user.d.ts +52 -4
  172. package/lib/src/baseSdk/user.js +67 -25
  173. package/lib/src/index.d.ts +45 -16
  174. package/lib/src/schemas.d.ts +226 -30
  175. package/lib/src/schemas.js +33 -2
  176. package/lib/src/types.d.ts +10 -2
  177. package/lib/src/userSdk/chat.d.ts +1 -1
  178. package/lib/src/userSdk/patients.d.ts +23 -2
  179. package/lib/src/userSdk/patients.js +34 -6
  180. package/lib/src/userSdk/videoVisit.d.ts +2 -2
  181. package/lib/src/utils.d.ts +1 -1
  182. package/lib/src/utils.js +3 -3
  183. package/lib/test.js +2 -36
  184. package/package.json +4 -1
  185. package/lib/baseSdk/external.d.ts +0 -28
  186. package/lib/baseSdk/external.js +0 -73
  187. package/lib/lib/baseSdk/external.d.ts +0 -15
  188. package/lib/lib/baseSdk/external.js +0 -73
  189. package/lib/lib/userSdk/sarasas.d.ts +0 -6
  190. package/lib/lib/userSdk/sarasas.js +0 -13
  191. package/lib/userSdk/sarasas.d.ts +0 -6
  192. package/lib/userSdk/sarasas.js +0 -13
@@ -27,39 +27,8 @@ export namespace doc24Schemas {
27
27
  key: string;
28
28
  };
29
29
  }>;
30
- export const user: zod_1.ZodObject<zod_1.extendShape<{
31
- firstName: zod_1.ZodString;
32
- lastName: zod_1.ZodString;
33
- identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
34
- identificationValue: zod_1.ZodString;
35
- countryId: zod_1.ZodString;
36
- birthdate: zod_1.ZodDate;
37
- gender: zod_1.ZodEnum<["m", "f"]>;
38
- }, {
39
- phone: zod_1.ZodString;
40
- email: zod_1.ZodString;
41
- }>, "strip", zod_1.ZodTypeAny, {
42
- firstName: string;
43
- lastName: string;
44
- identificationType: "ndi" | "passport" | "credential";
45
- identificationValue: string;
46
- gender: "m" | "f";
47
- phone: string;
48
- email: string;
49
- countryId: string;
50
- birthdate: Date;
51
- }, {
52
- firstName: string;
53
- lastName: string;
54
- identificationType: "ndi" | "passport" | "credential";
55
- identificationValue: string;
56
- gender: "m" | "f";
57
- phone: string;
58
- email: string;
59
- countryId: string;
60
- birthdate: Date;
61
- }>;
62
- export { basePersonData as patient };
30
+ export { user };
31
+ export { patient };
63
32
  export { specialtyMode };
64
33
  export { specialty };
65
34
  export { scheduleAvailabilityFilter };
@@ -147,13 +116,13 @@ export namespace doc24Schemas {
147
116
  email: zod_1.ZodNullable<zod_1.ZodString>;
148
117
  phone: zod_1.ZodNullable<zod_1.ZodString>;
149
118
  }, "strip", zod_1.ZodTypeAny, {
150
- id: number;
151
119
  phone: string | null;
152
120
  email: string | null;
153
- }, {
154
121
  id: number;
122
+ }, {
155
123
  phone: string | null;
156
124
  email: string | null;
125
+ id: number;
157
126
  }>;
158
127
  vcToken: zod_1.ZodString;
159
128
  appointment: zod_1.ZodOptional<zod_1.ZodObject<{
@@ -193,9 +162,9 @@ export namespace doc24Schemas {
193
162
  patientId: number;
194
163
  creationDate: Date;
195
164
  user: {
196
- id: number;
197
165
  phone: string | null;
198
166
  email: string | null;
167
+ id: number;
199
168
  };
200
169
  vcToken: string;
201
170
  }, {
@@ -213,9 +182,9 @@ export namespace doc24Schemas {
213
182
  patientId: number;
214
183
  creationDate: Date;
215
184
  user: {
216
- id: number;
217
185
  phone: string | null;
218
186
  email: string | null;
187
+ id: number;
219
188
  };
220
189
  vcToken: string;
221
190
  }>;
@@ -465,14 +434,14 @@ export namespace doc24Schemas {
465
434
  brief: string;
466
435
  }>;
467
436
  }, "strip", zod_1.ZodTypeAny, {
468
- id: number;
469
- logoUrl: string;
470
437
  firstName: string;
471
438
  lastName: string;
439
+ birthdate: Date;
472
440
  gender: "m" | "f";
473
441
  phone: string | null;
474
442
  email: string;
475
- birthdate: Date;
443
+ id: number;
444
+ logoUrl: string;
476
445
  specialties: {
477
446
  id: number;
478
447
  description: string;
@@ -488,14 +457,14 @@ export namespace doc24Schemas {
488
457
  brief: string;
489
458
  };
490
459
  }, {
491
- id: number;
492
- logoUrl: string;
493
460
  firstName: string;
494
461
  lastName: string;
462
+ birthdate: Date;
495
463
  gender: "m" | "f";
496
464
  phone: string | null;
497
465
  email: string;
498
- birthdate: Date;
466
+ id: number;
467
+ logoUrl: string;
499
468
  specialties: {
500
469
  id: number;
501
470
  description: string;
@@ -536,6 +505,11 @@ export namespace doc24Schemas {
536
505
  export { diagnosticaPatient };
537
506
  export { diagnosticaDeepLinkResponse };
538
507
  export { coverageInfo };
508
+ export { sendVerificationCodeParams };
509
+ export { declareUserParams };
510
+ export { declareUserResponse };
511
+ export { declarePatientParams };
512
+ export { declarePatientResponse };
539
513
  }
540
514
  declare const identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
541
515
  declare const sdkCredentials: zod_1.ZodObject<{
@@ -549,7 +523,7 @@ declare const sdkCredentials: zod_1.ZodObject<{
549
523
  key: string;
550
524
  }>;
551
525
  import zod_1 = require("zod");
552
- declare const basePersonData: zod_1.ZodObject<{
526
+ declare const user: zod_1.ZodObject<zod_1.extendShape<{
553
527
  firstName: zod_1.ZodString;
554
528
  lastName: zod_1.ZodString;
555
529
  identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
@@ -557,22 +531,54 @@ declare const basePersonData: zod_1.ZodObject<{
557
531
  countryId: zod_1.ZodString;
558
532
  birthdate: zod_1.ZodDate;
559
533
  gender: zod_1.ZodEnum<["m", "f"]>;
560
- }, "strip", zod_1.ZodTypeAny, {
534
+ }, {
535
+ phone: zod_1.ZodString;
536
+ email: zod_1.ZodString;
537
+ }>, "strip", zod_1.ZodTypeAny, {
561
538
  firstName: string;
562
539
  lastName: string;
563
540
  identificationType: "ndi" | "passport" | "credential";
564
541
  identificationValue: string;
565
- gender: "m" | "f";
566
542
  countryId: string;
567
543
  birthdate: Date;
544
+ gender: "m" | "f";
545
+ phone: string;
546
+ email: string;
568
547
  }, {
569
548
  firstName: string;
570
549
  lastName: string;
571
550
  identificationType: "ndi" | "passport" | "credential";
572
551
  identificationValue: string;
552
+ countryId: string;
553
+ birthdate: Date;
554
+ gender: "m" | "f";
555
+ phone: string;
556
+ email: string;
557
+ }>;
558
+ declare const patient: zod_1.ZodObject<{
559
+ firstName: zod_1.ZodString;
560
+ lastName: zod_1.ZodString;
561
+ identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
562
+ identificationValue: zod_1.ZodString;
563
+ countryId: zod_1.ZodString;
564
+ birthdate: zod_1.ZodDate;
565
+ gender: zod_1.ZodEnum<["m", "f"]>;
566
+ }, "strip", zod_1.ZodTypeAny, {
567
+ firstName: string;
568
+ lastName: string;
569
+ identificationType: "ndi" | "passport" | "credential";
570
+ identificationValue: string;
571
+ countryId: string;
572
+ birthdate: Date;
573
573
  gender: "m" | "f";
574
+ }, {
575
+ firstName: string;
576
+ lastName: string;
577
+ identificationType: "ndi" | "passport" | "credential";
578
+ identificationValue: string;
574
579
  countryId: string;
575
580
  birthdate: Date;
581
+ gender: "m" | "f";
576
582
  }>;
577
583
  declare const specialtyMode: zod_1.ZodEnum<["appointment", "chat", "instant"]>;
578
584
  declare const specialty: zod_1.ZodObject<{
@@ -851,13 +857,13 @@ declare const chatDetails: zod_1.ZodObject<{
851
857
  firstName: zod_1.ZodString;
852
858
  lastName: zod_1.ZodString;
853
859
  }, "strip", zod_1.ZodTypeAny, {
854
- id: number;
855
860
  firstName: string;
856
861
  lastName: string;
857
- }, {
858
862
  id: number;
863
+ }, {
859
864
  firstName: string;
860
865
  lastName: string;
866
+ id: number;
861
867
  }>;
862
868
  patientLastPost: zod_1.ZodNullable<zod_1.ZodDate>;
863
869
  professional: zod_1.ZodObject<{
@@ -889,9 +895,9 @@ declare const chatDetails: zod_1.ZodObject<{
889
895
  }, "strip", zod_1.ZodTypeAny, {
890
896
  id: number;
891
897
  patient: {
892
- id: number;
893
898
  firstName: string;
894
899
  lastName: string;
900
+ id: number;
895
901
  };
896
902
  professional: {
897
903
  id: number;
@@ -913,9 +919,9 @@ declare const chatDetails: zod_1.ZodObject<{
913
919
  }, {
914
920
  id: number;
915
921
  patient: {
916
- id: number;
917
922
  firstName: string;
918
923
  lastName: string;
924
+ id: number;
919
925
  };
920
926
  professional: {
921
927
  id: number;
@@ -963,18 +969,18 @@ declare const enrollmentParams: zod_1.ZodObject<{
963
969
  }, "strip", zod_1.ZodTypeAny, {
964
970
  firstName: string;
965
971
  lastName: string;
972
+ birthdate: Date;
966
973
  gender: "m" | "f";
967
974
  email: string;
968
- birthdate: Date;
969
975
  startDate: Date;
970
976
  identificationNumber: string;
971
977
  plan: string;
972
978
  }, {
973
979
  firstName: string;
974
980
  lastName: string;
981
+ birthdate: Date;
975
982
  gender: "m" | "f";
976
983
  email: string;
977
- birthdate: Date;
978
984
  startDate: Date;
979
985
  identificationNumber: string;
980
986
  plan: string;
@@ -1007,25 +1013,25 @@ declare const diagnosticaUser: zod_1.ZodObject<zod_1.extendShape<{
1007
1013
  email: zod_1.ZodString;
1008
1014
  language: zod_1.ZodString;
1009
1015
  }>, "strip", zod_1.ZodTypeAny, {
1010
- language: string;
1011
1016
  firstName: string;
1012
1017
  lastName: string;
1013
- birthday: Date;
1014
1018
  identificationType: "dni";
1015
1019
  identificationValue: string;
1016
1020
  gender: "m" | "f";
1017
1021
  phone: string;
1018
1022
  email: string;
1019
- }, {
1020
1023
  language: string;
1024
+ birthday: Date;
1025
+ }, {
1021
1026
  firstName: string;
1022
1027
  lastName: string;
1023
- birthday: Date;
1024
1028
  identificationType: "dni";
1025
1029
  identificationValue: string;
1026
1030
  gender: "m" | "f";
1027
1031
  phone: string;
1028
1032
  email: string;
1033
+ language: string;
1034
+ birthday: Date;
1029
1035
  }>;
1030
1036
  declare const diagnosticaPatient: zod_1.ZodObject<{
1031
1037
  firstName: zod_1.ZodString;
@@ -1037,17 +1043,17 @@ declare const diagnosticaPatient: zod_1.ZodObject<{
1037
1043
  }, "strip", zod_1.ZodTypeAny, {
1038
1044
  firstName: string;
1039
1045
  lastName: string;
1040
- birthday: Date;
1041
1046
  identificationType: "dni";
1042
1047
  identificationValue: string;
1043
1048
  gender: "m" | "f";
1049
+ birthday: Date;
1044
1050
  }, {
1045
1051
  firstName: string;
1046
1052
  lastName: string;
1047
- birthday: Date;
1048
1053
  identificationType: "dni";
1049
1054
  identificationValue: string;
1050
1055
  gender: "m" | "f";
1056
+ birthday: Date;
1051
1057
  }>;
1052
1058
  declare const diagnosticaDeepLinkResponse: zod_1.ZodUnion<[zod_1.ZodObject<{
1053
1059
  forwardingRequired: zod_1.ZodLiteral<true>;
@@ -1091,9 +1097,9 @@ declare const coverageInfo: zod_1.ZodNullable<zod_1.ZodObject<{
1091
1097
  }, "strip", zod_1.ZodTypeAny, {
1092
1098
  firstName: string | null;
1093
1099
  lastName: string | null;
1100
+ birthdate: Date;
1094
1101
  gender: "m" | "f";
1095
1102
  email: string | null;
1096
- birthdate: Date;
1097
1103
  identificationNumber: string;
1098
1104
  plan: string | null;
1099
1105
  financerId: number | null;
@@ -1114,9 +1120,9 @@ declare const coverageInfo: zod_1.ZodNullable<zod_1.ZodObject<{
1114
1120
  }, {
1115
1121
  firstName: string | null;
1116
1122
  lastName: string | null;
1123
+ birthdate: Date;
1117
1124
  gender: "m" | "f";
1118
1125
  email: string | null;
1119
- birthdate: Date;
1120
1126
  identificationNumber: string;
1121
1127
  plan: string | null;
1122
1128
  financerId: number | null;
@@ -1135,4 +1141,194 @@ declare const coverageInfo: zod_1.ZodNullable<zod_1.ZodObject<{
1135
1141
  authorizationCode: string | null;
1136
1142
  authorizationCodeExpiration: Date | null;
1137
1143
  }>>;
1144
+ declare const sendVerificationCodeParams: zod_1.ZodObject<{
1145
+ identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
1146
+ identificationValue: zod_1.ZodString;
1147
+ channel: zod_1.ZodEnum<["1", "2"]>;
1148
+ }, "strip", zod_1.ZodTypeAny, {
1149
+ identificationType: "ndi" | "passport" | "credential";
1150
+ identificationValue: string;
1151
+ channel: "1" | "2";
1152
+ }, {
1153
+ identificationType: "ndi" | "passport" | "credential";
1154
+ identificationValue: string;
1155
+ channel: "1" | "2";
1156
+ }>;
1157
+ declare const declareUserParams: zod_1.ZodObject<{
1158
+ user: zod_1.ZodObject<zod_1.extendShape<{
1159
+ firstName: zod_1.ZodString;
1160
+ lastName: zod_1.ZodString;
1161
+ identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
1162
+ identificationValue: zod_1.ZodString;
1163
+ countryId: zod_1.ZodString;
1164
+ birthdate: zod_1.ZodDate;
1165
+ gender: zod_1.ZodEnum<["m", "f"]>;
1166
+ }, {
1167
+ phone: zod_1.ZodString;
1168
+ email: zod_1.ZodString;
1169
+ }>, "strip", zod_1.ZodTypeAny, {
1170
+ firstName: string;
1171
+ lastName: string;
1172
+ identificationType: "ndi" | "passport" | "credential";
1173
+ identificationValue: string;
1174
+ countryId: string;
1175
+ birthdate: Date;
1176
+ gender: "m" | "f";
1177
+ phone: string;
1178
+ email: string;
1179
+ }, {
1180
+ firstName: string;
1181
+ lastName: string;
1182
+ identificationType: "ndi" | "passport" | "credential";
1183
+ identificationValue: string;
1184
+ countryId: string;
1185
+ birthdate: Date;
1186
+ gender: "m" | "f";
1187
+ phone: string;
1188
+ email: string;
1189
+ }>;
1190
+ channel: zod_1.ZodOptional<zod_1.ZodEnum<["1", "2"]>>;
1191
+ code: zod_1.ZodOptional<zod_1.ZodString>;
1192
+ }, "strip", zod_1.ZodTypeAny, {
1193
+ code?: string | undefined;
1194
+ channel?: "1" | "2" | undefined;
1195
+ user: {
1196
+ firstName: string;
1197
+ lastName: string;
1198
+ identificationType: "ndi" | "passport" | "credential";
1199
+ identificationValue: string;
1200
+ countryId: string;
1201
+ birthdate: Date;
1202
+ gender: "m" | "f";
1203
+ phone: string;
1204
+ email: string;
1205
+ };
1206
+ }, {
1207
+ code?: string | undefined;
1208
+ channel?: "1" | "2" | undefined;
1209
+ user: {
1210
+ firstName: string;
1211
+ lastName: string;
1212
+ identificationType: "ndi" | "passport" | "credential";
1213
+ identificationValue: string;
1214
+ countryId: string;
1215
+ birthdate: Date;
1216
+ gender: "m" | "f";
1217
+ phone: string;
1218
+ email: string;
1219
+ };
1220
+ }>;
1221
+ declare const declareUserResponse: zod_1.ZodObject<zod_1.extendShape<{
1222
+ patientId: zod_1.ZodNullable<zod_1.ZodNumber>;
1223
+ userInfo: zod_1.ZodObject<{
1224
+ email: zod_1.ZodString;
1225
+ phone: zod_1.ZodString;
1226
+ }, "strip", zod_1.ZodTypeAny, {
1227
+ phone: string;
1228
+ email: string;
1229
+ }, {
1230
+ phone: string;
1231
+ email: string;
1232
+ }>;
1233
+ askCode: zod_1.ZodBoolean;
1234
+ }, {
1235
+ userId: zod_1.ZodNumber;
1236
+ }>, "strip", zod_1.ZodTypeAny, {
1237
+ patientId: number | null;
1238
+ userInfo: {
1239
+ phone: string;
1240
+ email: string;
1241
+ };
1242
+ askCode: boolean;
1243
+ userId: number;
1244
+ }, {
1245
+ patientId: number | null;
1246
+ userInfo: {
1247
+ phone: string;
1248
+ email: string;
1249
+ };
1250
+ askCode: boolean;
1251
+ userId: number;
1252
+ }>;
1253
+ declare const declarePatientParams: zod_1.ZodObject<{
1254
+ patient: zod_1.ZodObject<{
1255
+ firstName: zod_1.ZodString;
1256
+ lastName: zod_1.ZodString;
1257
+ identificationType: zod_1.ZodEnum<["ndi", "passport", "credential"]>;
1258
+ identificationValue: zod_1.ZodString;
1259
+ countryId: zod_1.ZodString;
1260
+ birthdate: zod_1.ZodDate;
1261
+ gender: zod_1.ZodEnum<["m", "f"]>;
1262
+ }, "strip", zod_1.ZodTypeAny, {
1263
+ firstName: string;
1264
+ lastName: string;
1265
+ identificationType: "ndi" | "passport" | "credential";
1266
+ identificationValue: string;
1267
+ countryId: string;
1268
+ birthdate: Date;
1269
+ gender: "m" | "f";
1270
+ }, {
1271
+ firstName: string;
1272
+ lastName: string;
1273
+ identificationType: "ndi" | "passport" | "credential";
1274
+ identificationValue: string;
1275
+ countryId: string;
1276
+ birthdate: Date;
1277
+ gender: "m" | "f";
1278
+ }>;
1279
+ channel: zod_1.ZodOptional<zod_1.ZodEnum<["1", "2"]>>;
1280
+ code: zod_1.ZodOptional<zod_1.ZodString>;
1281
+ }, "strip", zod_1.ZodTypeAny, {
1282
+ code?: string | undefined;
1283
+ channel?: "1" | "2" | undefined;
1284
+ patient: {
1285
+ firstName: string;
1286
+ lastName: string;
1287
+ identificationType: "ndi" | "passport" | "credential";
1288
+ identificationValue: string;
1289
+ countryId: string;
1290
+ birthdate: Date;
1291
+ gender: "m" | "f";
1292
+ };
1293
+ }, {
1294
+ code?: string | undefined;
1295
+ channel?: "1" | "2" | undefined;
1296
+ patient: {
1297
+ firstName: string;
1298
+ lastName: string;
1299
+ identificationType: "ndi" | "passport" | "credential";
1300
+ identificationValue: string;
1301
+ countryId: string;
1302
+ birthdate: Date;
1303
+ gender: "m" | "f";
1304
+ };
1305
+ }>;
1306
+ declare const declarePatientResponse: zod_1.ZodObject<{
1307
+ patientId: zod_1.ZodNullable<zod_1.ZodNumber>;
1308
+ userInfo: zod_1.ZodObject<{
1309
+ email: zod_1.ZodString;
1310
+ phone: zod_1.ZodString;
1311
+ }, "strip", zod_1.ZodTypeAny, {
1312
+ phone: string;
1313
+ email: string;
1314
+ }, {
1315
+ phone: string;
1316
+ email: string;
1317
+ }>;
1318
+ askCode: zod_1.ZodBoolean;
1319
+ }, "strip", zod_1.ZodTypeAny, {
1320
+ patientId: number | null;
1321
+ userInfo: {
1322
+ phone: string;
1323
+ email: string;
1324
+ };
1325
+ askCode: boolean;
1326
+ }, {
1327
+ patientId: number | null;
1328
+ userInfo: {
1329
+ phone: string;
1330
+ email: string;
1331
+ };
1332
+ askCode: boolean;
1333
+ }>;
1138
1334
  export {};
@@ -14,6 +14,8 @@ const basePersonData = zod_1.object({
14
14
  birthdate: zod_1.date(),
15
15
  gender,
16
16
  });
17
+ const patient = basePersonData;
18
+ const user = basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() });
17
19
  const specialtyMode = zod_1.enum(['appointment', 'chat', 'instant']);
18
20
  const specialty = zod_1.object({
19
21
  id: zod_1.number(),
@@ -172,12 +174,36 @@ const coverageInfo = zod_1.object({
172
174
  authorizationCode: zod_1.string().nullable(),
173
175
  authorizationCodeExpiration: zod_1.date().nullable(),
174
176
  }).nullable();
177
+ const sendVerificationCodeParams = zod_1.object({
178
+ identificationType,
179
+ identificationValue: zod_1.string(),
180
+ channel: zod_1.enum(['1', '2']),
181
+ });
182
+ const declareUserParams = zod_1.object({
183
+ user,
184
+ channel: zod_1.enum(['1', '2']).optional(),
185
+ code: zod_1.string().optional(),
186
+ });
187
+ const declarePatientParams = zod_1.object({
188
+ patient,
189
+ channel: zod_1.enum(['1', '2']).optional(),
190
+ code: zod_1.string().optional(),
191
+ });
192
+ const declarePatientResponse = zod_1.object({
193
+ patientId: zod_1.number().nullable(),
194
+ userInfo: zod_1.object({
195
+ email: zod_1.string(),
196
+ phone: zod_1.string(),
197
+ }),
198
+ askCode: zod_1.boolean(),
199
+ });
200
+ const declareUserResponse = declarePatientResponse.extend({ userId: zod_1.number() });
175
201
  exports.doc24Schemas = {
176
202
  identificationType,
177
203
  sdkCredentials,
178
204
  sdkParams: zod_1.object({ url: zod_1.string(), credentials: sdkCredentials }),
179
- user: basePersonData.extend({ phone: zod_1.string(), email: zod_1.string() }),
180
- patient: basePersonData,
205
+ user,
206
+ patient,
181
207
  specialtyMode,
182
208
  specialty,
183
209
  scheduleAvailabilityFilter,
@@ -291,4 +317,9 @@ exports.doc24Schemas = {
291
317
  diagnosticaPatient,
292
318
  diagnosticaDeepLinkResponse,
293
319
  coverageInfo,
320
+ sendVerificationCodeParams,
321
+ declareUserParams,
322
+ declareUserResponse,
323
+ declarePatientParams,
324
+ declarePatientResponse,
294
325
  };
@@ -0,0 +1,11 @@
1
+ export var __esModule: boolean;
2
+ export function getDiagnosticaMethods(makeRequest: any): {
3
+ getDiagnosticaHistory: (...params: any) => Promise<any>;
4
+ getDiagnosticaDeepLink: (...params: any) => Promise<{
5
+ forwardingRequired: true;
6
+ deepLink: string;
7
+ } | {
8
+ forwardingRequired: false;
9
+ }>;
10
+ getDiagnosticaAccess: (...params: any) => Promise<void>;
11
+ };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDiagnosticaMethods = 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 getDiagnosticaMethods = (makeRequest) => {
9
+ const getDiagnosticaHistory = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.diagnosticaPatientFilter, zod_1.date(), zod_1.date()]), schemas_1.doc24Schemas.diagnosticaHistoryAppointment.array(), async (patient, from, to) => {
10
+ const path = '/history-diagnostica';
11
+ const response = await makeRequest('POST', path, {
12
+ patient: {
13
+ gender: patient.gender,
14
+ id_type: patient.identificationType === 'ndi'
15
+ ? 'DNI'
16
+ : patient.identificationType,
17
+ id_value: patient.identificationValue,
18
+ },
19
+ dateFrom: from.toISOString(),
20
+ dateTo: to.toISOString(),
21
+ });
22
+ const list = response.data.info;
23
+ return list.map((i) => ({
24
+ date: new Date(Date.parse(i.date)),
25
+ location: i.location,
26
+ exams: i.exams,
27
+ deepLink: i.deeplink,
28
+ }));
29
+ });
30
+ const getDiagnosticaDeepLink = validation_1.validateFunction(zod_1.tuple([
31
+ zod_1.string(),
32
+ schemas_1.doc24Schemas.diagnosticaUser,
33
+ schemas_1.doc24Schemas.diagnosticaPatient,
34
+ ]), schemas_1.doc24Schemas.diagnosticaDeepLinkResponse, async (kiosk, user, patient) => {
35
+ const path = '/deeplink-diagnostica';
36
+ const response = await makeRequest('POST', path, {
37
+ kiosk,
38
+ user: mapUserData(user),
39
+ patient: mapPatientData(patient),
40
+ });
41
+ const data = response.data.info.data;
42
+ if (data.forwarding_required)
43
+ return { forwardingRequired: true, deepLink: data.deeplink };
44
+ return { forwardingRequired: false };
45
+ });
46
+ const getDiagnosticaAccess = validation_1.validateFunction(zod_1.tuple([
47
+ zod_1.string(),
48
+ schemas_1.doc24Schemas.diagnosticaUser,
49
+ schemas_1.doc24Schemas.diagnosticaPatient,
50
+ ]), zod_1.void(), async (kiosk, user, patient) => {
51
+ const path = '/access-diagnostica';
52
+ await makeRequest('POST', path, {
53
+ kiosk,
54
+ user: mapUserData(user),
55
+ patient: mapPatientData(patient),
56
+ });
57
+ return;
58
+ });
59
+ return { getDiagnosticaHistory, getDiagnosticaDeepLink, getDiagnosticaAccess };
60
+ };
61
+ exports.getDiagnosticaMethods = getDiagnosticaMethods;
62
+ const mapPatientData = (patient) => {
63
+ return {
64
+ name: patient.firstName,
65
+ surname: patient.lastName,
66
+ birthday: date_fns_1.format(patient.birthday, 'yyyy-MM-dd'),
67
+ id_type: 'DNI',
68
+ id_value: patient.identificationValue,
69
+ gender: patient.gender.toLocaleUpperCase(),
70
+ };
71
+ };
72
+ const mapUserData = (user) => {
73
+ return {
74
+ ...mapPatientData(user),
75
+ phone: user.phone,
76
+ email: user.email,
77
+ language: user.language,
78
+ };
79
+ };