@integraciones_doc24/sdk 1.16.35 → 1.16.37

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/schemas.d.ts CHANGED
@@ -518,6 +518,25 @@ export declare const doc24Schemas: {
518
518
  language: string;
519
519
  details: string;
520
520
  }>]>;
521
+ attachedFile: import("zod").ZodObject<{
522
+ fileId: import("zod").ZodNumber;
523
+ fileName: import("zod").ZodNullable<import("zod").ZodString>;
524
+ fileUrl: import("zod").ZodString;
525
+ fileType: import("zod").ZodEnum<["IMG", "FILE"]>;
526
+ uploadDate: import("zod").ZodDate;
527
+ }, "strip", import("zod").ZodTypeAny, {
528
+ fileId: number;
529
+ fileName: string | null;
530
+ fileUrl: string;
531
+ fileType: "IMG" | "FILE";
532
+ uploadDate: Date;
533
+ }, {
534
+ fileId: number;
535
+ fileName: string | null;
536
+ fileUrl: string;
537
+ fileType: "IMG" | "FILE";
538
+ uploadDate: Date;
539
+ }>;
521
540
  videoVisit: import("zod").ZodObject<{
522
541
  id: import("zod").ZodNullable<import("zod").ZodNumber>;
523
542
  creationDate: import("zod").ZodDate;
@@ -563,6 +582,25 @@ export declare const doc24Schemas: {
563
582
  city: import("zod").ZodOptional<import("zod").ZodString>;
564
583
  province: import("zod").ZodOptional<import("zod").ZodString>;
565
584
  modality: import("zod").ZodOptional<import("zod").ZodEnum<["P", "V"]>>;
585
+ attachedFiles: import("zod").ZodArray<import("zod").ZodObject<{
586
+ fileId: import("zod").ZodNumber;
587
+ fileName: import("zod").ZodNullable<import("zod").ZodString>;
588
+ fileUrl: import("zod").ZodString;
589
+ fileType: import("zod").ZodEnum<["IMG", "FILE"]>;
590
+ uploadDate: import("zod").ZodDate;
591
+ }, "strip", import("zod").ZodTypeAny, {
592
+ fileId: number;
593
+ fileName: string | null;
594
+ fileUrl: string;
595
+ fileType: "IMG" | "FILE";
596
+ uploadDate: Date;
597
+ }, {
598
+ fileId: number;
599
+ fileName: string | null;
600
+ fileUrl: string;
601
+ fileType: "IMG" | "FILE";
602
+ uploadDate: Date;
603
+ }>, "many">;
566
604
  }, "strip", import("zod").ZodTypeAny, {
567
605
  appointment?: {
568
606
  date: Date;
@@ -588,6 +626,13 @@ export declare const doc24Schemas: {
588
626
  id: number;
589
627
  };
590
628
  vcToken: string;
629
+ attachedFiles: {
630
+ fileId: number;
631
+ fileName: string | null;
632
+ fileUrl: string;
633
+ fileType: "IMG" | "FILE";
634
+ uploadDate: Date;
635
+ }[];
591
636
  }, {
592
637
  appointment?: {
593
638
  date: Date;
@@ -613,6 +658,13 @@ export declare const doc24Schemas: {
613
658
  id: number;
614
659
  };
615
660
  vcToken: string;
661
+ attachedFiles: {
662
+ fileId: number;
663
+ fileName: string | null;
664
+ fileUrl: string;
665
+ fileType: "IMG" | "FILE";
666
+ uploadDate: Date;
667
+ }[];
616
668
  }>;
617
669
  historicalVideoVisit: import("zod").ZodObject<import("zod").extendShape<{
618
670
  id: import("zod").ZodNullable<import("zod").ZodNumber>;
@@ -659,9 +711,30 @@ export declare const doc24Schemas: {
659
711
  city: import("zod").ZodOptional<import("zod").ZodString>;
660
712
  province: import("zod").ZodOptional<import("zod").ZodString>;
661
713
  modality: import("zod").ZodOptional<import("zod").ZodEnum<["P", "V"]>>;
714
+ attachedFiles: import("zod").ZodArray<import("zod").ZodObject<{
715
+ fileId: import("zod").ZodNumber;
716
+ fileName: import("zod").ZodNullable<import("zod").ZodString>;
717
+ fileUrl: import("zod").ZodString;
718
+ fileType: import("zod").ZodEnum<["IMG", "FILE"]>;
719
+ uploadDate: import("zod").ZodDate;
720
+ }, "strip", import("zod").ZodTypeAny, {
721
+ fileId: number;
722
+ fileName: string | null;
723
+ fileUrl: string;
724
+ fileType: "IMG" | "FILE";
725
+ uploadDate: Date;
726
+ }, {
727
+ fileId: number;
728
+ fileName: string | null;
729
+ fileUrl: string;
730
+ fileType: "IMG" | "FILE";
731
+ uploadDate: Date;
732
+ }>, "many">;
662
733
  }, {
663
734
  specialty: import("zod").ZodString;
664
735
  professional: import("zod").ZodString;
736
+ medications: import("zod").ZodOptional<import("zod").ZodBoolean>;
737
+ practices: import("zod").ZodOptional<import("zod").ZodBoolean>;
665
738
  }>, "strip", import("zod").ZodTypeAny, {
666
739
  appointment?: {
667
740
  date: Date;
@@ -678,6 +751,8 @@ export declare const doc24Schemas: {
678
751
  address?: string | undefined;
679
752
  city?: string | undefined;
680
753
  province?: string | undefined;
754
+ medications?: boolean | undefined;
755
+ practices?: boolean | undefined;
681
756
  id: number | null;
682
757
  patientId: number;
683
758
  professional: string;
@@ -688,6 +763,13 @@ export declare const doc24Schemas: {
688
763
  id: number;
689
764
  };
690
765
  vcToken: string;
766
+ attachedFiles: {
767
+ fileId: number;
768
+ fileName: string | null;
769
+ fileUrl: string;
770
+ fileType: "IMG" | "FILE";
771
+ uploadDate: Date;
772
+ }[];
691
773
  specialty: string;
692
774
  }, {
693
775
  appointment?: {
@@ -705,6 +787,8 @@ export declare const doc24Schemas: {
705
787
  address?: string | undefined;
706
788
  city?: string | undefined;
707
789
  province?: string | undefined;
790
+ medications?: boolean | undefined;
791
+ practices?: boolean | undefined;
708
792
  id: number | null;
709
793
  patientId: number;
710
794
  professional: string;
@@ -715,10 +799,18 @@ export declare const doc24Schemas: {
715
799
  id: number;
716
800
  };
717
801
  vcToken: string;
802
+ attachedFiles: {
803
+ fileId: number;
804
+ fileName: string | null;
805
+ fileUrl: string;
806
+ fileType: "IMG" | "FILE";
807
+ uploadDate: Date;
808
+ }[];
718
809
  specialty: string;
719
810
  }>;
720
811
  videoVisitDetails: import("zod").ZodObject<{
721
812
  id: import("zod").ZodNumber;
813
+ vcToken: import("zod").ZodOptional<import("zod").ZodString>;
722
814
  status: import("zod").ZodString;
723
815
  paymentStatus: import("zod").ZodString;
724
816
  professional: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -823,11 +915,31 @@ export declare const doc24Schemas: {
823
915
  name: string;
824
916
  url: string;
825
917
  }>, "many">;
918
+ attachedFiles: import("zod").ZodArray<import("zod").ZodObject<{
919
+ fileId: import("zod").ZodNumber;
920
+ fileName: import("zod").ZodNullable<import("zod").ZodString>;
921
+ fileUrl: import("zod").ZodString;
922
+ fileType: import("zod").ZodEnum<["IMG", "FILE"]>;
923
+ uploadDate: import("zod").ZodDate;
924
+ }, "strip", import("zod").ZodTypeAny, {
925
+ fileId: number;
926
+ fileName: string | null;
927
+ fileUrl: string;
928
+ fileType: "IMG" | "FILE";
929
+ uploadDate: Date;
930
+ }, {
931
+ fileId: number;
932
+ fileName: string | null;
933
+ fileUrl: string;
934
+ fileType: "IMG" | "FILE";
935
+ uploadDate: Date;
936
+ }>, "many">;
826
937
  }, "strip", import("zod").ZodTypeAny, {
827
938
  professional?: {
828
939
  id: number;
829
940
  fullName: string;
830
941
  } | undefined;
942
+ vcToken?: string | undefined;
831
943
  appointment: {
832
944
  date: Date;
833
945
  id: number;
@@ -841,6 +953,13 @@ export declare const doc24Schemas: {
841
953
  };
842
954
  status: string;
843
955
  paymentStatus: string;
956
+ attachedFiles: {
957
+ fileId: number;
958
+ fileName: string | null;
959
+ fileUrl: string;
960
+ fileType: "IMG" | "FILE";
961
+ uploadDate: Date;
962
+ }[];
844
963
  finishDate: Date | null;
845
964
  retries: number;
846
965
  report: {
@@ -870,6 +989,7 @@ export declare const doc24Schemas: {
870
989
  id: number;
871
990
  fullName: string;
872
991
  } | undefined;
992
+ vcToken?: string | undefined;
873
993
  appointment: {
874
994
  date: Date;
875
995
  id: number;
@@ -883,6 +1003,13 @@ export declare const doc24Schemas: {
883
1003
  };
884
1004
  status: string;
885
1005
  paymentStatus: string;
1006
+ attachedFiles: {
1007
+ fileId: number;
1008
+ fileName: string | null;
1009
+ fileUrl: string;
1010
+ fileType: "IMG" | "FILE";
1011
+ uploadDate: Date;
1012
+ }[];
886
1013
  finishDate: Date | null;
887
1014
  retries: number;
888
1015
  report: {
@@ -1084,6 +1211,25 @@ export declare const doc24Schemas: {
1084
1211
  name: string;
1085
1212
  url: string;
1086
1213
  }>, "many">;
1214
+ attachedFiles: import("zod").ZodArray<import("zod").ZodObject<{
1215
+ fileId: import("zod").ZodNumber;
1216
+ fileName: import("zod").ZodNullable<import("zod").ZodString>;
1217
+ fileUrl: import("zod").ZodString;
1218
+ fileType: import("zod").ZodEnum<["IMG", "FILE"]>;
1219
+ uploadDate: import("zod").ZodDate;
1220
+ }, "strip", import("zod").ZodTypeAny, {
1221
+ fileId: number;
1222
+ fileName: string | null;
1223
+ fileUrl: string;
1224
+ fileType: "IMG" | "FILE";
1225
+ uploadDate: Date;
1226
+ }, {
1227
+ fileId: number;
1228
+ fileName: string | null;
1229
+ fileUrl: string;
1230
+ fileType: "IMG" | "FILE";
1231
+ uploadDate: Date;
1232
+ }>, "many">;
1087
1233
  }, "strip", import("zod").ZodTypeAny, {
1088
1234
  modality?: "P" | "V" | undefined;
1089
1235
  professional?: {
@@ -1101,6 +1247,13 @@ export declare const doc24Schemas: {
1101
1247
  language: string;
1102
1248
  status: string;
1103
1249
  paymentStatus: string;
1250
+ attachedFiles: {
1251
+ fileId: number;
1252
+ fileName: string | null;
1253
+ fileUrl: string;
1254
+ fileType: "IMG" | "FILE";
1255
+ uploadDate: Date;
1256
+ }[];
1104
1257
  finishDate: Date | null;
1105
1258
  report: {
1106
1259
  indications?: string | null | undefined;
@@ -1159,6 +1312,13 @@ export declare const doc24Schemas: {
1159
1312
  language: string;
1160
1313
  status: string;
1161
1314
  paymentStatus: string;
1315
+ attachedFiles: {
1316
+ fileId: number;
1317
+ fileName: string | null;
1318
+ fileUrl: string;
1319
+ fileType: "IMG" | "FILE";
1320
+ uploadDate: Date;
1321
+ }[];
1162
1322
  finishDate: Date | null;
1163
1323
  report: {
1164
1324
  indications?: string | null | undefined;
@@ -2521,11 +2681,11 @@ export declare const doc24Schemas: {
2521
2681
  vcToken: import("zod").ZodString;
2522
2682
  fileId: import("zod").ZodNumber;
2523
2683
  }, "strip", import("zod").ZodTypeAny, {
2524
- vcToken: string;
2525
2684
  fileId: number;
2526
- }, {
2527
2685
  vcToken: string;
2686
+ }, {
2528
2687
  fileId: number;
2688
+ vcToken: string;
2529
2689
  }>;
2530
2690
  healthQuizParams: import("zod").ZodObject<{
2531
2691
  patientId: import("zod").ZodNumber;
package/lib/schemas.js CHANGED
@@ -173,6 +173,15 @@ const diagnosticaDeepLinkResponse = zod_1.object({
173
173
  forwardingRequired: zod_1.literal(true),
174
174
  deepLink: zod_1.string().url(),
175
175
  }).or(zod_1.object({ forwardingRequired: zod_1.literal(false) }));
176
+ // Files the patient attached from the waiting room (upload-file-consultation).
177
+ // Separate from `files`, which are the attention's own documents.
178
+ const attachedFile = zod_1.object({
179
+ fileId: zod_1.number(),
180
+ fileName: zod_1.string().nullable(),
181
+ fileUrl: zod_1.string().url(),
182
+ fileType: zod_1.enum(['IMG', 'FILE']),
183
+ uploadDate: zod_1.date(),
184
+ });
176
185
  const videoVisit = zod_1.object({
177
186
  id: zod_1.number().nullable(),
178
187
  creationDate: zod_1.date(),
@@ -198,10 +207,13 @@ const videoVisit = zod_1.object({
198
207
  city: zod_1.string().optional(),
199
208
  province: zod_1.string().optional(),
200
209
  modality: zod_1.enum(['P', 'V']).optional(),
210
+ attachedFiles: zod_1.array(attachedFile),
201
211
  });
202
212
  const historicalVideoVisit = videoVisit.extend({
203
213
  specialty: zod_1.string(),
204
214
  professional: zod_1.string(),
215
+ medications: zod_1.boolean().optional(),
216
+ practices: zod_1.boolean().optional(),
205
217
  });
206
218
  const coverageInfo = zod_1.object({
207
219
  financerId: zod_1.number().nullable(),
@@ -377,10 +389,12 @@ exports.doc24Schemas = {
377
389
  appointmentScheduleParameters,
378
390
  instantScheduleParameters,
379
391
  ]),
392
+ attachedFile,
380
393
  videoVisit,
381
394
  historicalVideoVisit,
382
395
  videoVisitDetails: zod_1.object({
383
396
  id: zod_1.number(),
397
+ vcToken: zod_1.string().optional(),
384
398
  status: zod_1.string(),
385
399
  paymentStatus: zod_1.string(),
386
400
  professional: zod_1.object({
@@ -412,6 +426,7 @@ exports.doc24Schemas = {
412
426
  medication: zod_1.array(zod_1.any()),
413
427
  }),
414
428
  files: zod_1.array(zod_1.object({ name: zod_1.string(), url: zod_1.string().url() })),
429
+ attachedFiles: zod_1.array(attachedFile),
415
430
  }),
416
431
  completeVideoVisitDetails: zod_1.object({
417
432
  id: zod_1.number(),
@@ -465,6 +480,7 @@ exports.doc24Schemas = {
465
480
  certificate: zod_1.array(zod_1.any()).or(zod_1.string()).nullish(),
466
481
  }),
467
482
  files: zod_1.array(zod_1.object({ name: zod_1.string(), url: zod_1.string().url() })),
483
+ attachedFiles: zod_1.array(attachedFile),
468
484
  }),
469
485
  activeVideoVisitData: zod_1.object({
470
486
  consultationId: zod_1.number(),
package/lib/types.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare namespace Doc24 {
11
11
  type AvailableScheduleClinics = TypeOf<typeof doc24Schemas.availableScheduleClinics>;
12
12
  type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
13
13
  type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
14
+ type AttachedFile = TypeOf<typeof doc24Schemas.attachedFile>;
14
15
  type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
15
16
  type HistoricalVideoVisit = TypeOf<typeof doc24Schemas.historicalVideoVisit>;
16
17
  type VideoVisitDetails = TypeOf<typeof doc24Schemas.videoVisitDetails>;
@@ -43,6 +43,13 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
43
43
  id: number;
44
44
  };
45
45
  vcToken: string;
46
+ attachedFiles: {
47
+ fileId: number;
48
+ fileName: string | null;
49
+ fileUrl: string;
50
+ fileType: "IMG" | "FILE";
51
+ uploadDate: Date;
52
+ }[];
46
53
  }>;
47
54
  getPatientVideoVisitHistory: (patientId: number) => Promise<{
48
55
  appointment?: {
@@ -60,6 +67,8 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
60
67
  address?: string | undefined;
61
68
  city?: string | undefined;
62
69
  province?: string | undefined;
70
+ medications?: boolean | undefined;
71
+ practices?: boolean | undefined;
63
72
  id: number | null;
64
73
  patientId: number;
65
74
  professional: string;
@@ -70,6 +79,13 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
70
79
  id: number;
71
80
  };
72
81
  vcToken: string;
82
+ attachedFiles: {
83
+ fileId: number;
84
+ fileName: string | null;
85
+ fileUrl: string;
86
+ fileType: "IMG" | "FILE";
87
+ uploadDate: Date;
88
+ }[];
73
89
  specialty: string;
74
90
  }[]>;
75
91
  getVideoVisitDetails: (vcId: number) => Promise<{
@@ -77,6 +93,7 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
77
93
  id: number;
78
94
  fullName: string;
79
95
  } | undefined;
96
+ vcToken?: string | undefined;
80
97
  appointment: {
81
98
  date: Date;
82
99
  id: number;
@@ -90,6 +107,13 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
90
107
  };
91
108
  status: string;
92
109
  paymentStatus: string;
110
+ attachedFiles: {
111
+ fileId: number;
112
+ fileName: string | null;
113
+ fileUrl: string;
114
+ fileType: "IMG" | "FILE";
115
+ uploadDate: Date;
116
+ }[];
93
117
  finishDate: Date | null;
94
118
  retries: number;
95
119
  report: {
@@ -138,6 +162,13 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
138
162
  language: string;
139
163
  status: string;
140
164
  paymentStatus: string;
165
+ attachedFiles: {
166
+ fileId: number;
167
+ fileName: string | null;
168
+ fileUrl: string;
169
+ fileType: "IMG" | "FILE";
170
+ uploadDate: Date;
171
+ }[];
141
172
  finishDate: Date | null;
142
173
  report: {
143
174
  indications?: string | null | undefined;
@@ -188,7 +219,7 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
188
219
  fileId?: number | undefined;
189
220
  }>;
190
221
  deleteFileConsultation: (params: {
191
- vcToken: string;
192
222
  fileId: number;
223
+ vcToken: string;
193
224
  }) => Promise<void>;
194
225
  };
@@ -45,10 +45,12 @@ const getVideoVisitMethods = (makeRequest) => {
45
45
  return response.data.map((raw) => mapHistoricalVideoVisit(raw));
46
46
  });
47
47
  const getVideoVisitDetails = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.videoVisitDetails, async (vcId) => {
48
+ var _a;
48
49
  const path = `/video-visit-records/${vcId}`;
49
50
  const response = await makeRequest('GET', path);
50
51
  return {
51
52
  id: response.data.consultation_id,
53
+ vcToken: (_a = response.data.vc_token) !== null && _a !== void 0 ? _a : undefined,
52
54
  status: response.data.status,
53
55
  paymentStatus: response.data.payment_status,
54
56
  professional: response.data.professional_id
@@ -102,6 +104,7 @@ const getVideoVisitMethods = (makeRequest) => {
102
104
  name: f.nombre_file,
103
105
  url: f.file,
104
106
  })),
107
+ attachedFiles: mapAttachedFiles(response.data.attached_files),
105
108
  };
106
109
  });
107
110
  const getActiveVideoVisits = validation_1.validateFunction(zod_1.tuple([]), zod_1.array(schemas_1.doc24Schemas.activeVideoVisitData), async () => {
@@ -194,6 +197,7 @@ const getVideoVisitMethods = (makeRequest) => {
194
197
  name: f.nombre_file,
195
198
  url: f.file,
196
199
  })),
200
+ attachedFiles: mapAttachedFiles(response.data.attached_files),
197
201
  };
198
202
  });
199
203
  const uploadFileConsultation = validation_1.validateFunction(zod_1.tuple([schemas_1.doc24Schemas.uploadFileConsultationParams]), schemas_1.doc24Schemas.uploadFileConsultationResponse, async (params) => {
@@ -253,12 +257,27 @@ const mapVideoVisit = (raw) => {
253
257
  city: (_e = raw.localidad) !== null && _e !== void 0 ? _e : undefined,
254
258
  province: (_f = raw.provincia) !== null && _f !== void 0 ? _f : undefined,
255
259
  modality: (_g = raw.modalidad) !== null && _g !== void 0 ? _g : undefined,
260
+ attachedFiles: mapAttachedFiles(raw.attached_files),
256
261
  };
257
262
  };
263
+ // `upload_date` is Argentina time without offset: parse with the default -03,
264
+ // never with the brand's `time_zone` (that one is a correction, not the zone).
265
+ const mapAttachedFiles = (raw) => (raw !== null && raw !== void 0 ? raw : []).map((f) => {
266
+ var _a;
267
+ return ({
268
+ fileId: Number(f.file_id),
269
+ fileName: (_a = f.file_name) !== null && _a !== void 0 ? _a : null,
270
+ fileUrl: f.file_url,
271
+ fileType: f.file_type,
272
+ uploadDate: utils_1.parseDateTime(f.upload_date),
273
+ });
274
+ });
258
275
  const mapHistoricalVideoVisit = (raw) => {
259
276
  return {
260
277
  ...mapVideoVisit(raw),
261
278
  professional: raw.professional,
262
279
  specialty: raw.specialty,
280
+ medications: raw.medications != null ? Boolean(raw.medications) : undefined,
281
+ practices: raw.practices != null ? Boolean(raw.practices) : undefined,
263
282
  };
264
283
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.16.35",
3
+ "version": "1.16.37",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },