@integraciones_doc24/sdk 1.12.1 → 1.12.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.
@@ -1,8 +1,8 @@
1
1
  import { RequestMaker } from '../request';
2
2
  export declare const getExternalMethods: (makeRequest: RequestMaker) => {
3
3
  externalLogin: (params: {
4
- password: string;
5
4
  user: string;
5
+ password: string;
6
6
  }) => Promise<{
7
7
  firstName: string;
8
8
  lastName: string;
package/lib/index.d.ts CHANGED
@@ -187,8 +187,8 @@ export declare const doc24Sdk: (params: Doc24.SdkParams) => Promise<{
187
187
  birthday: Date;
188
188
  }) => Promise<void>;
189
189
  externalLogin: (params: {
190
- password: string;
191
190
  user: string;
191
+ password: string;
192
192
  }) => Promise<{
193
193
  firstName: string;
194
194
  lastName: string;
package/lib/schemas.d.ts CHANGED
@@ -158,12 +158,12 @@ export declare const doc24Schemas: {
158
158
  fullName: string;
159
159
  logoUrl: string;
160
160
  };
161
- clinicId: number;
162
- cost: string;
163
161
  specialty: {
164
162
  id: number;
165
163
  description: string;
166
164
  };
165
+ clinicId: number;
166
+ cost: string;
167
167
  atentions: number;
168
168
  }, {
169
169
  length?: number | null | undefined;
@@ -176,12 +176,12 @@ export declare const doc24Schemas: {
176
176
  fullName: string;
177
177
  logoUrl: string;
178
178
  };
179
- clinicId: number;
180
- cost: string;
181
179
  specialty: {
182
180
  id: number;
183
181
  description: string;
184
182
  };
183
+ clinicId: number;
184
+ cost: string;
185
185
  atentions: number;
186
186
  }>;
187
187
  availableScheduleClinics: import("zod").ZodObject<{
@@ -389,9 +389,91 @@ export declare const doc24Schemas: {
389
389
  }>>;
390
390
  paymentStatus: import("zod").ZodOptional<import("zod").ZodString>;
391
391
  atentionId: import("zod").ZodOptional<import("zod").ZodNumber>;
392
+ }, "strip", import("zod").ZodTypeAny, {
393
+ appointment?: {
394
+ date: Date;
395
+ id: number;
396
+ } | undefined;
397
+ videoVisit?: {
398
+ id: number;
399
+ status: string;
400
+ } | undefined;
401
+ paymentStatus?: string | undefined;
402
+ atentionId?: number | undefined;
403
+ id: number | null;
404
+ patientId: number;
405
+ creationDate: Date;
406
+ user: {
407
+ phone: string | null;
408
+ email: string | null;
409
+ id: number;
410
+ };
411
+ vcToken: string;
412
+ }, {
413
+ appointment?: {
414
+ date: Date;
415
+ id: number;
416
+ } | undefined;
417
+ videoVisit?: {
418
+ id: number;
419
+ status: string;
420
+ } | undefined;
421
+ paymentStatus?: string | undefined;
422
+ atentionId?: number | undefined;
423
+ id: number | null;
424
+ patientId: number;
425
+ creationDate: Date;
426
+ user: {
427
+ phone: string | null;
428
+ email: string | null;
429
+ id: number;
430
+ };
431
+ vcToken: string;
432
+ }>;
433
+ historicalVideoVisit: import("zod").ZodObject<import("zod").extendShape<{
434
+ id: import("zod").ZodNullable<import("zod").ZodNumber>;
435
+ creationDate: import("zod").ZodDate;
436
+ patientId: import("zod").ZodNumber;
437
+ user: import("zod").ZodObject<{
438
+ id: import("zod").ZodNumber;
439
+ email: import("zod").ZodNullable<import("zod").ZodString>;
440
+ phone: import("zod").ZodNullable<import("zod").ZodString>;
441
+ }, "strip", import("zod").ZodTypeAny, {
442
+ phone: string | null;
443
+ email: string | null;
444
+ id: number;
445
+ }, {
446
+ phone: string | null;
447
+ email: string | null;
448
+ id: number;
449
+ }>;
450
+ vcToken: import("zod").ZodString;
451
+ appointment: import("zod").ZodOptional<import("zod").ZodObject<{
452
+ id: import("zod").ZodNumber;
453
+ date: import("zod").ZodDate;
454
+ }, "strip", import("zod").ZodTypeAny, {
455
+ date: Date;
456
+ id: number;
457
+ }, {
458
+ date: Date;
459
+ id: number;
460
+ }>>;
461
+ videoVisit: import("zod").ZodOptional<import("zod").ZodObject<{
462
+ id: import("zod").ZodNumber;
463
+ status: import("zod").ZodString;
464
+ }, "strip", import("zod").ZodTypeAny, {
465
+ id: number;
466
+ status: string;
467
+ }, {
468
+ id: number;
469
+ status: string;
470
+ }>>;
471
+ paymentStatus: import("zod").ZodOptional<import("zod").ZodString>;
472
+ atentionId: import("zod").ZodOptional<import("zod").ZodNumber>;
473
+ }, {
392
474
  specialty: import("zod").ZodString;
393
475
  professional: import("zod").ZodString;
394
- }, "strip", import("zod").ZodTypeAny, {
476
+ }>, "strip", import("zod").ZodTypeAny, {
395
477
  appointment?: {
396
478
  date: Date;
397
479
  id: number;
@@ -405,7 +487,6 @@ export declare const doc24Schemas: {
405
487
  id: number | null;
406
488
  patientId: number;
407
489
  professional: string;
408
- specialty: string;
409
490
  creationDate: Date;
410
491
  user: {
411
492
  phone: string | null;
@@ -413,6 +494,7 @@ export declare const doc24Schemas: {
413
494
  id: number;
414
495
  };
415
496
  vcToken: string;
497
+ specialty: string;
416
498
  }, {
417
499
  appointment?: {
418
500
  date: Date;
@@ -427,7 +509,6 @@ export declare const doc24Schemas: {
427
509
  id: number | null;
428
510
  patientId: number;
429
511
  professional: string;
430
- specialty: string;
431
512
  creationDate: Date;
432
513
  user: {
433
514
  phone: string | null;
@@ -435,6 +516,7 @@ export declare const doc24Schemas: {
435
516
  id: number;
436
517
  };
437
518
  vcToken: string;
519
+ specialty: string;
438
520
  }>;
439
521
  videoVisitDetails: import("zod").ZodObject<{
440
522
  id: import("zod").ZodNumber;
@@ -874,11 +956,11 @@ export declare const doc24Schemas: {
874
956
  logoUrl: string;
875
957
  };
876
958
  status: string;
959
+ paymentStatus: string;
877
960
  specialty: {
878
961
  id: number;
879
962
  description: string;
880
963
  };
881
- paymentStatus: string;
882
964
  chatRoomId: number;
883
965
  startDate: Date;
884
966
  lastEventDate: Date;
@@ -898,11 +980,11 @@ export declare const doc24Schemas: {
898
980
  logoUrl: string;
899
981
  };
900
982
  status: string;
983
+ paymentStatus: string;
901
984
  specialty: {
902
985
  id: number;
903
986
  description: string;
904
987
  };
905
- paymentStatus: string;
906
988
  chatRoomId: number;
907
989
  startDate: Date;
908
990
  lastEventDate: Date;
@@ -1354,11 +1436,11 @@ export declare const doc24Schemas: {
1354
1436
  user: import("zod").ZodString;
1355
1437
  password: import("zod").ZodString;
1356
1438
  }, "strip", import("zod").ZodTypeAny, {
1357
- password: string;
1358
1439
  user: string;
1359
- }, {
1360
1440
  password: string;
1441
+ }, {
1361
1442
  user: string;
1443
+ password: string;
1362
1444
  }>;
1363
1445
  externalLoginResponse: import("zod").ZodObject<{
1364
1446
  firstName: import("zod").ZodString;
package/lib/schemas.js CHANGED
@@ -151,6 +151,31 @@ const diagnosticaDeepLinkResponse = zod_1.object({
151
151
  forwardingRequired: zod_1.literal(true),
152
152
  deepLink: zod_1.string().url(),
153
153
  }).or(zod_1.object({ forwardingRequired: zod_1.literal(false) }));
154
+ const videoVisit = zod_1.object({
155
+ id: zod_1.number().nullable(),
156
+ creationDate: zod_1.date(),
157
+ patientId: zod_1.number(),
158
+ user: zod_1.object({
159
+ id: zod_1.number(),
160
+ email: zod_1.string().nullable(),
161
+ phone: zod_1.string().nullable(),
162
+ }),
163
+ vcToken: zod_1.string(),
164
+ appointment: zod_1.object({
165
+ id: zod_1.number(),
166
+ date: zod_1.date(),
167
+ }).optional(),
168
+ videoVisit: zod_1.object({
169
+ id: zod_1.number(),
170
+ status: zod_1.string(),
171
+ }).optional(),
172
+ paymentStatus: zod_1.string().optional(),
173
+ atentionId: zod_1.number().optional(),
174
+ });
175
+ const historicalVideoVisit = videoVisit.extend({
176
+ specialty: zod_1.string(),
177
+ professional: zod_1.string(),
178
+ });
154
179
  const coverageInfo = zod_1.object({
155
180
  financerId: zod_1.number().nullable(),
156
181
  defaultAffiliationId: zod_1.number().nullable(),
@@ -296,29 +321,8 @@ exports.doc24Schemas = {
296
321
  appointmentScheduleParameters,
297
322
  instantScheduleParameters,
298
323
  ]),
299
- videoVisit: zod_1.object({
300
- id: zod_1.number().nullable(),
301
- creationDate: zod_1.date(),
302
- patientId: zod_1.number(),
303
- user: zod_1.object({
304
- id: zod_1.number(),
305
- email: zod_1.string().nullable(),
306
- phone: zod_1.string().nullable(),
307
- }),
308
- vcToken: zod_1.string(),
309
- appointment: zod_1.object({
310
- id: zod_1.number(),
311
- date: zod_1.date(),
312
- }).optional(),
313
- videoVisit: zod_1.object({
314
- id: zod_1.number(),
315
- status: zod_1.string(),
316
- }).optional(),
317
- paymentStatus: zod_1.string().optional(),
318
- atentionId: zod_1.number().optional(),
319
- specialty: zod_1.string(),
320
- professional: zod_1.string(),
321
- }),
324
+ videoVisit,
325
+ historicalVideoVisit,
322
326
  videoVisitDetails: zod_1.object({
323
327
  id: zod_1.number(),
324
328
  status: zod_1.string(),
package/lib/types.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare namespace Doc24 {
12
12
  type ScheduleFilter = TypeOf<typeof doc24Schemas.scheduleFilter>;
13
13
  type ScheduleParameters = TypeOf<typeof doc24Schemas.scheduleParameters>;
14
14
  type VideoVisit = TypeOf<typeof doc24Schemas.videoVisit>;
15
+ type HistoricalVideoVisit = TypeOf<typeof doc24Schemas.historicalVideoVisit>;
15
16
  type VideoVisitDetails = TypeOf<typeof doc24Schemas.videoVisitDetails>;
16
17
  type ActiveVideoVisitData = TypeOf<typeof doc24Schemas.activeVideoVisitData>;
17
18
  type SpecialtyMode = TypeOf<typeof doc24Schemas.specialtyMode>;
@@ -81,7 +82,7 @@ export declare namespace Doc24 {
81
82
  getVideoVisit: (vcToken: string, patientId: number) => Promise<VideoVisit>;
82
83
  getVideoVisitDetails: (vcId: number) => Promise<VideoVisitDetails>;
83
84
  getVideoVisitLink: (vcToken: string, patientId: number) => Promise<string | null>;
84
- getPatientVideoVisitHistory: (patientId: number) => Promise<VideoVisit[]>;
85
+ getPatientVideoVisitHistory: (patientId: number) => Promise<HistoricalVideoVisit[]>;
85
86
  getActiveVideoVisits: () => Promise<ActiveVideoVisitData[]>;
86
87
  getAvailableChatrooms: (patientId: number, specialtyId: number, filter: ChatroomAvailabilityFilter) => Promise<AvailableChatroom[]>;
87
88
  createNewChat: (chatParameters: ChatParameters) => Promise<number>;
@@ -34,11 +34,11 @@ export declare const getChatMethods: (makeRequest: RequestMaker) => {
34
34
  logoUrl: string;
35
35
  };
36
36
  status: string;
37
+ paymentStatus: string;
37
38
  specialty: {
38
39
  id: number;
39
40
  description: string;
40
41
  };
41
- paymentStatus: string;
42
42
  chatRoomId: number;
43
43
  startDate: Date;
44
44
  lastEventDate: Date;
@@ -20,12 +20,12 @@ export declare const getScheduleMethods: (makeRequest: RequestMaker) => {
20
20
  fullName: string;
21
21
  logoUrl: string;
22
22
  };
23
- clinicId: number;
24
- cost: string;
25
23
  specialty: {
26
24
  id: number;
27
25
  description: string;
28
26
  };
27
+ clinicId: number;
28
+ cost: string;
29
29
  atentions: number;
30
30
  }[]>;
31
31
  getScheduleDates: (patientId: number, filter?: {
@@ -30,8 +30,6 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
30
30
  atentionId?: number | undefined;
31
31
  id: number | null;
32
32
  patientId: number;
33
- professional: string;
34
- specialty: string;
35
33
  creationDate: Date;
36
34
  user: {
37
35
  phone: string | null;
@@ -54,7 +52,6 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
54
52
  id: number | null;
55
53
  patientId: number;
56
54
  professional: string;
57
- specialty: string;
58
55
  creationDate: Date;
59
56
  user: {
60
57
  phone: string | null;
@@ -62,6 +59,7 @@ export declare const getVideoVisitMethods: (makeRequest: RequestMaker) => {
62
59
  id: number;
63
60
  };
64
61
  vcToken: string;
62
+ specialty: string;
65
63
  }[]>;
66
64
  getVideoVisitDetails: (vcId: number) => Promise<{
67
65
  professional?: {
@@ -33,10 +33,10 @@ const getVideoVisitMethods = (makeRequest) => {
33
33
  const response = await makeRequest('GET', path);
34
34
  return mapVideoVisit(response.data);
35
35
  });
36
- const getPatientVideoVisitHistory = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.array(schemas_1.doc24Schemas.videoVisit), async (patientId) => {
36
+ const getPatientVideoVisitHistory = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), zod_1.array(schemas_1.doc24Schemas.historicalVideoVisit), async (patientId) => {
37
37
  const path = `/video-visit-history/${patientId}`;
38
38
  const response = await makeRequest('GET', path);
39
- return response.data.map((raw) => mapVideoVisit(raw));
39
+ return response.data.map((raw) => mapHistoricalVideoVisit(raw));
40
40
  });
41
41
  const getVideoVisitDetails = validation_1.validateFunction(zod_1.tuple([zod_1.number()]), schemas_1.doc24Schemas.videoVisitDetails, async (vcId) => {
42
42
  const path = `/video-visit-records/${vcId}`;
@@ -143,6 +143,11 @@ const mapVideoVisit = (raw) => {
143
143
  : undefined,
144
144
  paymentStatus: (_a = raw.payment_status) !== null && _a !== void 0 ? _a : undefined,
145
145
  atentionId: (_b = raw.atentionId) !== null && _b !== void 0 ? _b : undefined,
146
+ };
147
+ };
148
+ const mapHistoricalVideoVisit = (raw) => {
149
+ return {
150
+ ...mapVideoVisit(raw),
146
151
  professional: raw.professional,
147
152
  specialty: raw.specialty,
148
153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },