@tryvital/vital-node 1.4.6 → 1.4.9

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.
@@ -28,7 +28,9 @@ export class TestkitsApi {
28
28
  endDate: Date,
29
29
  status?: string[],
30
30
  userId?: string,
31
- patientName?: string
31
+ patientName?: string,
32
+ page?: number,
33
+ size?: number
32
34
  ): Promise<OrderResponse> {
33
35
  const resp = await this.client.get(
34
36
  this.baseURL.concat('/testkit/orders/'),
@@ -39,6 +41,8 @@ export class TestkitsApi {
39
41
  status: status ? status : null,
40
42
  user_id: userId ? userId : null,
41
43
  patient_name: patientName ? patientName : null,
44
+ ...(page && { page }),
45
+ ...(size && { size }),
42
46
  },
43
47
  }
44
48
  );
@@ -61,6 +61,9 @@ export interface Order {
61
61
 
62
62
  export interface OrderResponse {
63
63
  orders: Order[];
64
+ total: number;
65
+ page: number;
66
+ size: number;
64
67
  }
65
68
 
66
69
  export interface OrderRequestResponse {
@@ -62,7 +62,7 @@ export interface ClientFacingWorkout {
62
62
  * @type {number}
63
63
  * @memberof ClientFacingWorkout
64
64
  */
65
- calories: number;
65
+ calories?: number;
66
66
  /**
67
67
  *
68
68
  * @type {ClientFacingSport}
@@ -5,7 +5,7 @@ export declare class TestkitsApi {
5
5
  client: AxiosInstance;
6
6
  constructor(baseURL: string, axios: AxiosInstance);
7
7
  get(): Promise<TestkitResponse>;
8
- get_orders(startDate: Date, endDate: Date, status?: string[], userId?: string, patientName?: string): Promise<OrderResponse>;
8
+ get_orders(startDate: Date, endDate: Date, status?: string[], userId?: string, patientName?: string, page?: number, size?: number): Promise<OrderResponse>;
9
9
  order(userId: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
10
10
  get_order(orderId: string): Promise<Order>;
11
11
  cancel_order(orderId: string): Promise<OrderRequestResponse>;
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
14
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
15
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -55,19 +66,13 @@ var TestkitsApi = /** @class */ (function () {
55
66
  });
56
67
  });
57
68
  };
58
- TestkitsApi.prototype.get_orders = function (startDate, endDate, status, userId, patientName) {
69
+ TestkitsApi.prototype.get_orders = function (startDate, endDate, status, userId, patientName, page, size) {
59
70
  return __awaiter(this, void 0, void 0, function () {
60
71
  var resp;
61
72
  return __generator(this, function (_a) {
62
73
  switch (_a.label) {
63
74
  case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/testkit/orders/'), {
64
- params: {
65
- start_date: startDate,
66
- end_date: endDate,
67
- status: status ? status : null,
68
- user_id: userId ? userId : null,
69
- patient_name: patientName ? patientName : null,
70
- },
75
+ params: __assign(__assign({ start_date: startDate, end_date: endDate, status: status ? status : null, user_id: userId ? userId : null, patient_name: patientName ? patientName : null }, (page && { page: page })), (size && { size: size })),
71
76
  })];
72
77
  case 1:
73
78
  resp = _a.sent();
@@ -42,6 +42,9 @@ export interface Order {
42
42
  }
43
43
  export interface OrderResponse {
44
44
  orders: Order[];
45
+ total: number;
46
+ page: number;
47
+ size: number;
45
48
  }
46
49
  export interface OrderRequestResponse {
47
50
  order: Order;
@@ -60,7 +60,7 @@ export interface ClientFacingWorkout {
60
60
  * @type {number}
61
61
  * @memberof ClientFacingWorkout
62
62
  */
63
- calories: number;
63
+ calories?: number;
64
64
  /**
65
65
  *
66
66
  * @type {ClientFacingSport}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.4.6",
3
+ "version": "1.4.9",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [