@tryvital/vital-node 1.4.1 → 1.4.5

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
  }
@@ -1,4 +1,4 @@
1
- export type PasswordProviders = 'whoop' | 'renpho' | 'peloton' | 'zwift';
1
+ export type PasswordProviders = 'whoop' | 'renpho' | 'peloton' | 'zwift' | 'hammerhead';
2
2
  export type OAuthProviders =
3
3
  | 'oura'
4
4
  | 'fitbit'
@@ -49,4 +49,5 @@ export enum Providers {
49
49
  Peloton = 'peloton',
50
50
  Wahoo = 'wahoo',
51
51
  Zwift = 'zwift',
52
+ Hammerhead = 'hammerhead',
52
53
  }
@@ -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
  }
@@ -1,4 +1,4 @@
1
- export declare type PasswordProviders = 'whoop' | 'renpho' | 'peloton' | 'zwift';
1
+ export declare type PasswordProviders = 'whoop' | 'renpho' | 'peloton' | 'zwift' | 'hammerhead';
2
2
  export declare type OAuthProviders = 'oura' | 'fitbit' | 'garmin' | 'whoop' | 'strava' | 'wahoo';
3
3
  export declare type EmailProviders = 'freestyle_libre';
4
4
  export interface ProviderLinkResponse {
@@ -41,5 +41,6 @@ export declare enum Providers {
41
41
  Renpho = "renpho",
42
42
  Peloton = "peloton",
43
43
  Wahoo = "wahoo",
44
- Zwift = "zwift"
44
+ Zwift = "zwift",
45
+ Hammerhead = "hammerhead"
45
46
  }
@@ -12,4 +12,5 @@ var Providers;
12
12
  Providers["Peloton"] = "peloton";
13
13
  Providers["Wahoo"] = "wahoo";
14
14
  Providers["Zwift"] = "zwift";
15
+ Providers["Hammerhead"] = "hammerhead";
15
16
  })(Providers = exports.Providers || (exports.Providers = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.4.1",
3
+ "version": "1.4.5",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "axios": ">=0.21.2",
27
27
  "axios-retry": "^3.2.4",
28
28
  "crypto": "^1.0.1",
29
- "svix": "0.42.3"
29
+ "svix": "0.64.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@testdeck/mocha": "^0.1.2",