@tryvital/vital-node 1.4.3 → 1.4.4

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.
@@ -27,11 +27,19 @@ export class TestkitsApi {
27
27
  startDate: Date,
28
28
  endDate: Date,
29
29
  status?: string[],
30
+ userId?: string,
31
+ patientName?: string
30
32
  ): Promise<OrderResponse> {
31
33
  const resp = await this.client.get(
32
34
  this.baseURL.concat('/testkit/orders/'),
33
35
  {
34
- params: { start_date: startDate, end_date: endDate, status: status ? status : null},
36
+ params: {
37
+ start_date: startDate,
38
+ end_date: endDate,
39
+ status: status ? status : null,
40
+ user_id: userId ? userId : null,
41
+ patient_name: patientName ? patientName : null,
42
+ },
35
43
  }
36
44
  );
37
45
  return resp.data;
@@ -13,7 +13,7 @@ export class WebhooksApi {
13
13
  payload: string,
14
14
  headers: Record<string, string>,
15
15
  secret: string
16
- ): unknown {
16
+ ): Record<string, any> | Record<string, any>[] {
17
17
  const wh = new Webhook(secret);
18
18
  return wh.verify(payload, headers);
19
19
  }
@@ -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[]): Promise<OrderResponse>;
8
+ get_orders(startDate: Date, endDate: Date, status?: string[], userId?: string, patientName?: string): 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>;
@@ -55,13 +55,19 @@ var TestkitsApi = /** @class */ (function () {
55
55
  });
56
56
  });
57
57
  };
58
- TestkitsApi.prototype.get_orders = function (startDate, endDate, status) {
58
+ TestkitsApi.prototype.get_orders = function (startDate, endDate, status, userId, patientName) {
59
59
  return __awaiter(this, void 0, void 0, function () {
60
60
  var resp;
61
61
  return __generator(this, function (_a) {
62
62
  switch (_a.label) {
63
63
  case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/testkit/orders/'), {
64
- params: { start_date: startDate, end_date: endDate, status: status ? status : null },
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
+ },
65
71
  })];
66
72
  case 1:
67
73
  resp = _a.sent();
@@ -3,5 +3,5 @@ export declare class WebhooksApi {
3
3
  baseURL: string;
4
4
  client: AxiosInstance;
5
5
  constructor(baseURL: string, axios: AxiosInstance);
6
- constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string): unknown;
6
+ constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string): Record<string, any> | Record<string, any>[];
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [