@tryvital/vital-node 0.3.7 → 0.3.8

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.
@@ -5,14 +5,9 @@ import {
5
5
  OrderRequestResponse,
6
6
  OrderResponse,
7
7
  PatientAdress,
8
- Testkit,
8
+ PatientDetails,
9
9
  TestkitResponse,
10
10
  } from './models/testkit_models';
11
- import {
12
- ClientWebhookResponse,
13
- WebhookEventTypes,
14
- ClientFacingWebhook,
15
- } from './models/webhook_models';
16
11
 
17
12
  export class TestkitsApi {
18
13
  baseURL: string;
@@ -43,7 +38,8 @@ export class TestkitsApi {
43
38
  public async order(
44
39
  userKey: string,
45
40
  testkitId: string,
46
- patientAddress: PatientAdress
41
+ patientAddress: PatientAdress,
42
+ patientDetails: PatientDetails
47
43
  ): Promise<OrderRequestResponse> {
48
44
  const resp = await this.client.post(
49
45
  this.baseURL.concat('/testkit/orders'),
package/client/User.ts CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  UserKeyResponse,
4
4
  SuccessResponse,
5
5
  ClientFacingUser,
6
- SourceClientFacing,
7
6
  Providers,
7
+ ProvidersResponse,
8
8
  } from './models/user_models';
9
9
 
10
10
  export class UserApi {
@@ -46,7 +46,7 @@ export class UserApi {
46
46
  return resp.data;
47
47
  }
48
48
 
49
- public async providers(userKey: string): Promise<Array<SourceClientFacing>> {
49
+ public async providers(userKey: string): Promise<ProvidersResponse> {
50
50
  const resp = await this.client.get(
51
51
  this.baseURL.concat(`/user/providers/${userKey}`)
52
52
  );
@@ -18,13 +18,13 @@ export interface ClientFacingActivity {
18
18
  * @type {number}
19
19
  * @memberof ClientFacingActivity
20
20
  */
21
- caloriesTotal: number;
21
+ calories_total: number;
22
22
  /**
23
23
  * Energy consumption caused by the physical activity of the day in kilocalories.::kilocalories
24
24
  * @type {number}
25
25
  * @memberof ClientFacingActivity
26
26
  */
27
- caloriesActive: number;
27
+ calories_active: number;
28
28
  /**
29
29
  * Total number of steps registered during the day.::steps
30
30
  * @type {number}
@@ -36,7 +36,7 @@ export interface ClientFacingActivity {
36
36
  * @type {number}
37
37
  * @memberof ClientFacingActivity
38
38
  */
39
- dailyMovement?: number;
39
+ daily_movement?: number;
40
40
  /**
41
41
  * Number of minutes during the day with low intensity activity (e.g. household work).::minutes
42
42
  * @type {number}
@@ -9,6 +9,11 @@ export interface PatientAdress {
9
9
  phone_number: string;
10
10
  }
11
11
 
12
+ export interface PatientDetails {
13
+ dob: string;
14
+ gender: string;
15
+ }
16
+
12
17
  export interface Testkit {
13
18
  id: string;
14
19
  name: string;
@@ -13,6 +13,10 @@ export interface SourceClientFacing {
13
13
  logo: string;
14
14
  }
15
15
 
16
+ export interface ProvidersResponse {
17
+ providers: SourceClientFacing[];
18
+ }
19
+
16
20
  export interface SourceWithLinkInfo {
17
21
  name: string;
18
22
  slug: string;
@@ -1,11 +1,11 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { Order, OrderRequestResponse, OrderResponse, PatientAdress, TestkitResponse } from './models/testkit_models';
2
+ import { Order, OrderRequestResponse, OrderResponse, PatientAdress, PatientDetails, TestkitResponse } from './models/testkit_models';
3
3
  export declare class TestkitsApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
6
6
  constructor(baseURL: string, axios: AxiosInstance);
7
7
  get(): Promise<TestkitResponse>;
8
8
  get_orders(startDate: Date, endDate: Date): Promise<OrderResponse>;
9
- order(userKey: string, testkitId: string, patientAddress: PatientAdress): Promise<OrderRequestResponse>;
9
+ order(userKey: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
10
10
  get_order(orderId: string): Promise<Order>;
11
11
  }
@@ -70,7 +70,7 @@ var TestkitsApi = /** @class */ (function () {
70
70
  });
71
71
  });
72
72
  };
73
- TestkitsApi.prototype.order = function (userKey, testkitId, patientAddress) {
73
+ TestkitsApi.prototype.order = function (userKey, testkitId, patientAddress, patientDetails) {
74
74
  return __awaiter(this, void 0, void 0, function () {
75
75
  var resp;
76
76
  return __generator(this, function (_a) {
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { UserKeyResponse, SuccessResponse, ClientFacingUser, SourceClientFacing, Providers } from './models/user_models';
2
+ import { UserKeyResponse, SuccessResponse, ClientFacingUser, Providers, ProvidersResponse } from './models/user_models';
3
3
  export declare class UserApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
@@ -9,6 +9,6 @@ export declare class UserApi {
9
9
  getAll(): Promise<Array<ClientFacingUser>>;
10
10
  get(userKey: string): Promise<ClientFacingUser>;
11
11
  resolve(clientUserId: string): Promise<ClientFacingUser>;
12
- providers(userKey: string): Promise<Array<SourceClientFacing>>;
12
+ providers(userKey: string): Promise<ProvidersResponse>;
13
13
  deregisterProvider(userKey: string, provider: Providers): Promise<SuccessResponse>;
14
14
  }
@@ -17,13 +17,13 @@ export interface ClientFacingActivity {
17
17
  * @type {number}
18
18
  * @memberof ClientFacingActivity
19
19
  */
20
- caloriesTotal: number;
20
+ calories_total: number;
21
21
  /**
22
22
  * Energy consumption caused by the physical activity of the day in kilocalories.::kilocalories
23
23
  * @type {number}
24
24
  * @memberof ClientFacingActivity
25
25
  */
26
- caloriesActive: number;
26
+ calories_active: number;
27
27
  /**
28
28
  * Total number of steps registered during the day.::steps
29
29
  * @type {number}
@@ -35,7 +35,7 @@ export interface ClientFacingActivity {
35
35
  * @type {number}
36
36
  * @memberof ClientFacingActivity
37
37
  */
38
- dailyMovement?: number;
38
+ daily_movement?: number;
39
39
  /**
40
40
  * Number of minutes during the day with low intensity activity (e.g. household work).::minutes
41
41
  * @type {number}
@@ -8,6 +8,10 @@ export interface PatientAdress {
8
8
  country: string;
9
9
  phone_number: string;
10
10
  }
11
+ export interface PatientDetails {
12
+ dob: string;
13
+ gender: string;
14
+ }
11
15
  export interface Testkit {
12
16
  id: string;
13
17
  name: string;
@@ -10,6 +10,9 @@ export interface SourceClientFacing {
10
10
  slug: string;
11
11
  logo: string;
12
12
  }
13
+ export interface ProvidersResponse {
14
+ providers: SourceClientFacing[];
15
+ }
13
16
  export interface SourceWithLinkInfo {
14
17
  name: string;
15
18
  slug: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [