@integraciones_doc24/sdk 1.14.1 → 1.14.3

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/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const test: () => Promise<void>;
package/lib/test.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.test = void 0;
4
+ const _1 = require(".");
5
+ const test = async () => {
6
+ const baseSdk = await _1.doc24Sdk({
7
+ url: 'https://tapi.doc24.com.ar/ws/sdk',
8
+ credentials: {
9
+ iss: 'Diagnostica',
10
+ key: 'gS2J78V0Zw8XiZJPGC9RS8TlECgqM2TmVtOzNAZbqputgmtc',
11
+ },
12
+ });
13
+ const userId = await baseSdk.getUserInstance({
14
+ firstName: '-',
15
+ lastName: '-',
16
+ identificationType: 'nn',
17
+ identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
18
+ // identificationValue: '6511a9d659bbdfce7385dfda',
19
+ countryId: 'AR',
20
+ birthdate: new Date('2023-09-25'),
21
+ gender: 'm',
22
+ phone: '',
23
+ email: 'nomail@diagnostica.com.ar',
24
+ });
25
+ console.log(userId.userId);
26
+ // const userSdk = await baseSdk.getUserInstance(20892);
27
+ // const res = await userSdk.updatePatient(
28
+ // {
29
+ // identificationType: 'nn',
30
+ // identificationValue: 'jhYuPe9wu8WmSUroB4tLq8',
31
+ // },
32
+ // {
33
+ // firstName: 'Test',
34
+ // lastName: 'Emergency',
35
+ // identificationType: 'dni',
36
+ // identificationValue: '37972512',
37
+ // countryId: 'AR',
38
+ // birthdate: new Date(),
39
+ // gender: 'm',
40
+ // },
41
+ // );
42
+ // console.log(res);
43
+ };
44
+ exports.test = test;
45
+ exports.test();
@@ -16,7 +16,7 @@ const getScheduleMethods = (makeRequest) => {
16
16
  };
17
17
  const path = `/schedule/dates/${patientId}/${JSON.stringify(mappedFilter)}`;
18
18
  const response = await makeRequest('GET', path);
19
- return response.data.available_dates.map((o) => utils_1.parseDate(o.date));
19
+ return response.data.available_dates.map((o) => utils_1.parseDate(o.date, o.time_zone));
20
20
  };
21
21
  const getSchedule = async (patientId, specialtyId, filter = {}) => {
22
22
  var _a;
package/lib/utils.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const parseDate: (str: string) => Date;
1
+ export declare const parseDate: (str: string, timeZone?: string | null | undefined) => Date;
2
2
  export declare const parseDateTime: (str: string, timeZone?: string | null | undefined) => Date;
package/lib/utils.js CHANGED
@@ -4,7 +4,7 @@ exports.parseDateTime = exports.parseDate = void 0;
4
4
  const date_fns_1 = require("date-fns");
5
5
  // import {Doc24} from '.';
6
6
  const defaultTimeZone = '-03';
7
- const parseDate = (str) => exports.parseDateTime(`${str} 00:00:00`);
7
+ const parseDate = (str, timeZone) => exports.parseDateTime(`${str} 00:00:00`, timeZone);
8
8
  exports.parseDate = parseDate;
9
9
  const parseDateTime = (str, timeZone) => date_fns_1.parse(`${str} ${timeZone !== null && timeZone !== void 0 ? timeZone : defaultTimeZone}`, 'yyyy-MM-dd HH:mm:ss X', new Date());
10
10
  exports.parseDateTime = parseDateTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraciones_doc24/sdk",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "publishConfig": {
5
5
  "tag": "latest"
6
6
  },