@tryvital/vital-node 1.0.7 → 1.1.1

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.
Files changed (42) hide show
  1. package/client/Activity.ts +16 -0
  2. package/client/Body.ts +17 -0
  3. package/client/Link.ts +16 -0
  4. package/client/Profile.ts +17 -1
  5. package/client/Provider.ts +17 -0
  6. package/client/Sleep.ts +17 -1
  7. package/client/Testkits.ts +16 -0
  8. package/client/Webhooks.ts +1 -1
  9. package/client/Workouts.ts +16 -0
  10. package/client/models/link_models.ts +2 -0
  11. package/client/models/provider_models.ts +19 -0
  12. package/client/models/raw_response.ts +31 -0
  13. package/client/models/testkit_models.ts +19 -0
  14. package/dist/client/Activity.d.ts +2 -0
  15. package/dist/client/Activity.js +15 -0
  16. package/dist/client/Body.d.ts +2 -0
  17. package/dist/client/Body.js +15 -0
  18. package/dist/client/Link.d.ts +2 -1
  19. package/dist/client/Link.js +15 -0
  20. package/dist/client/Profile.d.ts +2 -0
  21. package/dist/client/Profile.js +15 -0
  22. package/dist/client/Provider.d.ts +8 -0
  23. package/dist/client/Provider.js +60 -0
  24. package/dist/client/Sleep.d.ts +2 -0
  25. package/dist/client/Sleep.js +15 -0
  26. package/dist/client/Testkits.d.ts +3 -1
  27. package/dist/client/Testkits.js +26 -0
  28. package/dist/client/Webhooks.d.ts +1 -1
  29. package/dist/client/Webhooks.js +1 -1
  30. package/dist/client/Workouts.d.ts +2 -0
  31. package/dist/client/Workouts.js +15 -0
  32. package/dist/client/models/link_models.d.ts +1 -0
  33. package/dist/client/models/provider_models.d.ts +18 -0
  34. package/dist/client/models/provider_models.js +15 -0
  35. package/dist/client/models/raw_response.d.ts +27 -0
  36. package/dist/client/models/raw_response.js +2 -0
  37. package/dist/client/models/testkit_models.d.ts +17 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +5 -3
  40. package/index.ts +6 -3
  41. package/package.json +3 -3
  42. package/yarn-error.log +0 -4023
@@ -1,5 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientActivityResponse } from './models/activity';
3
+ import { ClientActivityRawResponse } from './models/raw_response';
3
4
 
4
5
  export class ActivityApi {
5
6
  baseURL: string;
@@ -23,4 +24,19 @@ export class ActivityApi {
23
24
  );
24
25
  return resp.data;
25
26
  }
27
+
28
+ public async get_raw(
29
+ userKey: string,
30
+ startDate: Date,
31
+ endDate: Date,
32
+ provider?: string
33
+ ): Promise<ClientActivityRawResponse> {
34
+ const resp = await this.client.get(
35
+ this.baseURL.concat(`/summary/activity/${userKey}/raw`),
36
+ {
37
+ params: { start_date: startDate, end_date: endDate, provider },
38
+ }
39
+ );
40
+ return resp.data;
41
+ }
26
42
  }
package/client/Body.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientBodyResponse } from './models/body_model';
3
+ import { ClientBodyRawResponse } from './models/raw_response';
3
4
 
4
5
  export class BodyApi {
5
6
  baseURL: string;
@@ -24,4 +25,20 @@ export class BodyApi {
24
25
  );
25
26
  return resp.data;
26
27
  }
28
+
29
+
30
+ public async get_raw(
31
+ userKey: string,
32
+ startDate: Date,
33
+ endDate: Date,
34
+ provider?: string
35
+ ): Promise<ClientBodyRawResponse> {
36
+ const resp = await this.client.get(
37
+ this.baseURL.concat(`/summary/body/${userKey}/raw`),
38
+ {
39
+ params: { start_date: startDate, end_date: endDate, provider },
40
+ }
41
+ );
42
+ return resp.data;
43
+ }
27
44
  }
package/client/Link.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  LinkTokenExchangeResponse,
5
5
  PasswordProviders,
6
6
  OAuthProviders,
7
+ EmailProviders,
7
8
  } from './models/link_models';
8
9
  import { SourceWithLinkInfo } from './models/user_models';
9
10
 
@@ -43,6 +44,21 @@ export class LinkApi {
43
44
  return resp.data;
44
45
  }
45
46
 
47
+ public async connectEmailProvider(
48
+ linkToken: string,
49
+ provider: EmailProviders,
50
+ email: string
51
+ ): Promise<ProviderLinkResponse> {
52
+ const resp = await this.client.post(
53
+ this.baseURL.concat(`/link/provider/email/${provider}`),
54
+ {
55
+ email,
56
+ },
57
+ { headers: { LinkToken: linkToken } }
58
+ );
59
+ return resp.data;
60
+ }
61
+
46
62
  public async getOAuthLink(
47
63
  linkToken: string,
48
64
  provider: OAuthProviders
package/client/Profile.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ClientFacingProfile } from './models/profile_model';
2
+ import { ClientFacingProfile, } from './models/profile_model';
3
+ import { ClientProfileRawResponse } from './models/raw_response';
3
4
 
4
5
  export class ProfileApi {
5
6
  baseURL: string;
@@ -22,4 +23,19 @@ export class ProfileApi {
22
23
  );
23
24
  return resp.data;
24
25
  }
26
+
27
+ public async get_raw(
28
+ userKey: string,
29
+ startDate: Date,
30
+ endDate: Date,
31
+ provider?: string
32
+ ): Promise<ClientProfileRawResponse> {
33
+ const resp = await this.client.get(
34
+ this.baseURL.concat(`/summary/profile/${userKey}/raw`),
35
+ {
36
+ params: { start_date: startDate, end_date: endDate, provider },
37
+ }
38
+ );
39
+ return resp.data;
40
+ }
25
41
  }
@@ -0,0 +1,17 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { Provider } from './models/provider_models';
3
+
4
+ export class ProviderApi {
5
+ baseURL: string;
6
+ client: AxiosInstance;
7
+
8
+ constructor(baseURL: string, axios: AxiosInstance) {
9
+ this.baseURL = baseURL;
10
+ this.client = axios;
11
+ }
12
+
13
+ public async getSupportedProviders(): Promise<Provider[]> {
14
+ const resp = await this.client.get(this.baseURL.concat(`/providers/`));
15
+ return resp.data;
16
+ }
17
+ }
package/client/Sleep.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
2
+ import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
3
+ import { ClientSleepRawResponse } from './models/raw_response';
3
4
 
4
5
  export class SleepApi {
5
6
  baseURL: string;
@@ -30,4 +31,19 @@ export class SleepApi {
30
31
  );
31
32
  return resp.data;
32
33
  }
34
+
35
+ public async get_raw(
36
+ userKey: string,
37
+ startDate: Date,
38
+ endDate: Date,
39
+ provider?: string
40
+ ): Promise<ClientSleepRawResponse> {
41
+ const resp = await this.client.get(
42
+ this.baseURL.concat(`/summary/sleep/${userKey}/raw`),
43
+ {
44
+ params: { start_date: startDate, end_date: endDate, provider },
45
+ }
46
+ );
47
+ return resp.data;
48
+ }
33
49
  }
@@ -1,5 +1,7 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import {
3
+ LabResultsMetadata,
4
+ LabResultsRaw,
3
5
  Order,
4
6
  OrderRequestResponse,
5
7
  OrderResponse,
@@ -68,4 +70,18 @@ export class TestkitsApi {
68
70
  );
69
71
  return resp.data;
70
72
  }
73
+
74
+ public async getMetadata(orderId: string): Promise<LabResultsMetadata> {
75
+ const resp = await this.client.get(
76
+ this.baseURL.concat(`/testkit/orders/${orderId}/results/metadata`)
77
+ );
78
+ return resp.data;
79
+ }
80
+
81
+ public async getRawResults(orderId: string): Promise<LabResultsRaw> {
82
+ const resp = await this.client.get(
83
+ this.baseURL.concat(`/testkit/orders/${orderId}/results/raw`)
84
+ );
85
+ return resp.data;
86
+ }
71
87
  }
@@ -9,7 +9,7 @@ export class WebhooksApi {
9
9
  this.client = axios;
10
10
  }
11
11
 
12
- public static constructWebhookEvent(
12
+ public constructWebhookEvent(
13
13
  payload: string,
14
14
  headers: Record<string, string>,
15
15
  secret: string
@@ -1,4 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
+ import { ClientWorkoutsRawResponse } from './models/raw_response';
2
3
  import {
3
4
  ClientWorkoutResponse,
4
5
  ClientWorkoutStreamResponse,
@@ -35,4 +36,19 @@ export class WorkoutsApi {
35
36
  );
36
37
  return resp.data;
37
38
  }
39
+
40
+ public async get_raw(
41
+ userKey: string,
42
+ startDate: Date,
43
+ endDate: Date,
44
+ provider?: string
45
+ ): Promise<ClientWorkoutsRawResponse> {
46
+ const resp = await this.client.get(
47
+ this.baseURL.concat(`/summary/workouts/${userKey}/raw`),
48
+ {
49
+ params: { start_date: startDate, end_date: endDate, provider },
50
+ }
51
+ );
52
+ return resp.data;
53
+ }
38
54
  }
@@ -7,6 +7,8 @@ export type OAuthProviders =
7
7
  | 'strava'
8
8
  | 'wahoo';
9
9
 
10
+ export type EmailProviders = 'freestyle_libre';
11
+
10
12
  export interface ProviderLinkResponse {
11
13
  provider: PasswordProviders;
12
14
  connected: boolean;
@@ -0,0 +1,19 @@
1
+ export enum Resource {
2
+ WORKOUTS = 'workouts',
3
+ ACTVITY = 'activity',
4
+ SLEEP = 'sleep',
5
+ BODY = 'body',
6
+ WORKOUTS_STREAM = 'workouts/stream',
7
+ SLEEP_STREAM = 'sleep/stream',
8
+ HEARTRATE = 'heartrate',
9
+ GLUCOSE = 'glucose',
10
+ PROFILE = 'profile',
11
+ }
12
+
13
+ export interface Provider {
14
+ name: string;
15
+ slug: string;
16
+ logo: string;
17
+ auth_type: 'password' | 'email' | 'oauth';
18
+ supported_resources: Resource[];
19
+ }
@@ -0,0 +1,31 @@
1
+ import { SourceClientFacing } from './user_models';
2
+
3
+ export interface RawResponse {
4
+ id: string;
5
+ user_id: string;
6
+ source_id: number;
7
+ source?: SourceClientFacing;
8
+ priority: number;
9
+ priority_id: number;
10
+ timestamp: Date;
11
+ data: Record<string, string>
12
+ provider_id: string;
13
+ }
14
+
15
+ export interface ClientActivityRawResponse {
16
+ activity: RawResponse[];
17
+ }
18
+ export interface ClientWorkoutsRawResponse {
19
+ workouts: RawResponse[];
20
+ }
21
+ export interface ClientBodyRawResponse {
22
+ body: RawResponse[];
23
+ }
24
+
25
+ export interface ClientSleepRawResponse {
26
+ sleep: RawResponse[];
27
+ }
28
+
29
+ export interface ClientProfileRawResponse {
30
+ profile: RawResponse[];
31
+ }
@@ -68,3 +68,22 @@ export interface OrderRequestResponse {
68
68
  export interface TestkitResponse {
69
69
  testkits: Testkit[];
70
70
  }
71
+
72
+ export interface LabResultsMetadata {
73
+ age: string;
74
+ dob: string;
75
+ clia_number: string;
76
+ patient: string;
77
+ provider: string;
78
+ laboratory: string;
79
+ date_reported: string;
80
+ date_collected: string;
81
+ specimen_number: string;
82
+ date_received?: string;
83
+ clia?: string;
84
+ }
85
+
86
+ export interface LabResultsRaw {
87
+ metadata: LabResultsMetadata;
88
+ data: Record<string, string>;
89
+ }
@@ -1,8 +1,10 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientActivityResponse } from './models/activity';
3
+ import { ClientActivityRawResponse } from './models/raw_response';
3
4
  export declare class ActivityApi {
4
5
  baseURL: string;
5
6
  client: AxiosInstance;
6
7
  constructor(baseURL: string, axios: AxiosInstance);
7
8
  get(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientActivityResponse>;
9
+ get_raw(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientActivityRawResponse>;
8
10
  }
@@ -57,6 +57,21 @@ var ActivityApi = /** @class */ (function () {
57
57
  });
58
58
  });
59
59
  };
60
+ ActivityApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var resp;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/activity/" + userKey + "/raw"), {
66
+ params: { start_date: startDate, end_date: endDate, provider: provider },
67
+ })];
68
+ case 1:
69
+ resp = _a.sent();
70
+ return [2 /*return*/, resp.data];
71
+ }
72
+ });
73
+ });
74
+ };
60
75
  return ActivityApi;
61
76
  }());
62
77
  exports.ActivityApi = ActivityApi;
@@ -1,8 +1,10 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientBodyResponse } from './models/body_model';
3
+ import { ClientBodyRawResponse } from './models/raw_response';
3
4
  export declare class BodyApi {
4
5
  baseURL: string;
5
6
  client: AxiosInstance;
6
7
  constructor(baseURL: string, axios: AxiosInstance);
7
8
  get(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientBodyResponse>;
9
+ get_raw(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientBodyRawResponse>;
8
10
  }
@@ -57,6 +57,21 @@ var BodyApi = /** @class */ (function () {
57
57
  });
58
58
  });
59
59
  };
60
+ BodyApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var resp;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/body/" + userKey + "/raw"), {
66
+ params: { start_date: startDate, end_date: endDate, provider: provider },
67
+ })];
68
+ case 1:
69
+ resp = _a.sent();
70
+ return [2 /*return*/, resp.data];
71
+ }
72
+ });
73
+ });
74
+ };
60
75
  return BodyApi;
61
76
  }());
62
77
  exports.BodyApi = BodyApi;
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ProviderLinkResponse, LinkTokenExchangeResponse, PasswordProviders, OAuthProviders } from './models/link_models';
2
+ import { ProviderLinkResponse, LinkTokenExchangeResponse, PasswordProviders, OAuthProviders, EmailProviders } from './models/link_models';
3
3
  import { SourceWithLinkInfo } from './models/user_models';
4
4
  export declare class LinkApi {
5
5
  baseURL: string;
@@ -7,5 +7,6 @@ export declare class LinkApi {
7
7
  constructor(baseURL: string, axios: AxiosInstance);
8
8
  create(userKey: string, provider?: string): Promise<LinkTokenExchangeResponse>;
9
9
  connectProvider(linkToken: string, provider: PasswordProviders, username: string, password: string): Promise<ProviderLinkResponse>;
10
+ connectEmailProvider(linkToken: string, provider: EmailProviders, email: string): Promise<ProviderLinkResponse>;
10
11
  getOAuthLink(linkToken: string, provider: OAuthProviders): Promise<SourceWithLinkInfo>;
11
12
  }
@@ -75,6 +75,21 @@ var LinkApi = /** @class */ (function () {
75
75
  });
76
76
  });
77
77
  };
78
+ LinkApi.prototype.connectEmailProvider = function (linkToken, provider, email) {
79
+ return __awaiter(this, void 0, void 0, function () {
80
+ var resp;
81
+ return __generator(this, function (_a) {
82
+ switch (_a.label) {
83
+ case 0: return [4 /*yield*/, this.client.post(this.baseURL.concat("/link/provider/email/" + provider), {
84
+ email: email,
85
+ }, { headers: { LinkToken: linkToken } })];
86
+ case 1:
87
+ resp = _a.sent();
88
+ return [2 /*return*/, resp.data];
89
+ }
90
+ });
91
+ });
92
+ };
78
93
  LinkApi.prototype.getOAuthLink = function (linkToken, provider) {
79
94
  return __awaiter(this, void 0, void 0, function () {
80
95
  var resp;
@@ -1,8 +1,10 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientFacingProfile } from './models/profile_model';
3
+ import { ClientProfileRawResponse } from './models/raw_response';
3
4
  export declare class ProfileApi {
4
5
  baseURL: string;
5
6
  client: AxiosInstance;
6
7
  constructor(baseURL: string, axios: AxiosInstance);
7
8
  get(userKey: string, provider?: string): Promise<ClientFacingProfile>;
9
+ get_raw(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientProfileRawResponse>;
8
10
  }
@@ -57,6 +57,21 @@ var ProfileApi = /** @class */ (function () {
57
57
  });
58
58
  });
59
59
  };
60
+ ProfileApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var resp;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/profile/" + userKey + "/raw"), {
66
+ params: { start_date: startDate, end_date: endDate, provider: provider },
67
+ })];
68
+ case 1:
69
+ resp = _a.sent();
70
+ return [2 /*return*/, resp.data];
71
+ }
72
+ });
73
+ });
74
+ };
60
75
  return ProfileApi;
61
76
  }());
62
77
  exports.ProfileApi = ProfileApi;
@@ -0,0 +1,8 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { Provider } from './models/provider_models';
3
+ export declare class ProviderApi {
4
+ baseURL: string;
5
+ client: AxiosInstance;
6
+ constructor(baseURL: string, axios: AxiosInstance);
7
+ getSupportedProviders(): Promise<Provider[]>;
8
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ProviderApi = void 0;
40
+ var ProviderApi = /** @class */ (function () {
41
+ function ProviderApi(baseURL, axios) {
42
+ this.baseURL = baseURL;
43
+ this.client = axios;
44
+ }
45
+ ProviderApi.prototype.getSupportedProviders = function () {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ var resp;
48
+ return __generator(this, function (_a) {
49
+ switch (_a.label) {
50
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/providers/"))];
51
+ case 1:
52
+ resp = _a.sent();
53
+ return [2 /*return*/, resp.data];
54
+ }
55
+ });
56
+ });
57
+ };
58
+ return ProviderApi;
59
+ }());
60
+ exports.ProviderApi = ProviderApi;
@@ -1,9 +1,11 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
3
+ import { ClientSleepRawResponse } from './models/raw_response';
3
4
  export declare class SleepApi {
4
5
  baseURL: string;
5
6
  client: AxiosInstance;
6
7
  constructor(baseURL: string, axios: AxiosInstance);
7
8
  get(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientSleepResponse>;
8
9
  getStream(sleepId: string): Promise<ClientSleepStreamResponse>;
10
+ get_raw(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientSleepRawResponse>;
9
11
  }
@@ -70,6 +70,21 @@ var SleepApi = /** @class */ (function () {
70
70
  });
71
71
  });
72
72
  };
73
+ SleepApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
74
+ return __awaiter(this, void 0, void 0, function () {
75
+ var resp;
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/sleep/" + userKey + "/raw"), {
79
+ params: { start_date: startDate, end_date: endDate, provider: provider },
80
+ })];
81
+ case 1:
82
+ resp = _a.sent();
83
+ return [2 /*return*/, resp.data];
84
+ }
85
+ });
86
+ });
87
+ };
73
88
  return SleepApi;
74
89
  }());
75
90
  exports.SleepApi = SleepApi;
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { Order, OrderRequestResponse, OrderResponse, PatientAdress, PatientDetails, TestkitResponse } from './models/testkit_models';
2
+ import { LabResultsMetadata, LabResultsRaw, Order, OrderRequestResponse, OrderResponse, PatientAdress, PatientDetails, TestkitResponse } from './models/testkit_models';
3
3
  export declare class TestkitsApi {
4
4
  baseURL: string;
5
5
  client: AxiosInstance;
@@ -9,4 +9,6 @@ export declare class TestkitsApi {
9
9
  order(userKey: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
10
10
  get_order(orderId: string): Promise<Order>;
11
11
  get_results(orderId: string): Promise<string>;
12
+ getMetadata(orderId: string): Promise<LabResultsMetadata>;
13
+ getRawResults(orderId: string): Promise<LabResultsRaw>;
12
14
  }
@@ -116,6 +116,32 @@ var TestkitsApi = /** @class */ (function () {
116
116
  });
117
117
  });
118
118
  };
119
+ TestkitsApi.prototype.getMetadata = function (orderId) {
120
+ return __awaiter(this, void 0, void 0, function () {
121
+ var resp;
122
+ return __generator(this, function (_a) {
123
+ switch (_a.label) {
124
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/testkit/orders/" + orderId + "/results/metadata"))];
125
+ case 1:
126
+ resp = _a.sent();
127
+ return [2 /*return*/, resp.data];
128
+ }
129
+ });
130
+ });
131
+ };
132
+ TestkitsApi.prototype.getRawResults = function (orderId) {
133
+ return __awaiter(this, void 0, void 0, function () {
134
+ var resp;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/testkit/orders/" + orderId + "/results/raw"))];
138
+ case 1:
139
+ resp = _a.sent();
140
+ return [2 /*return*/, resp.data];
141
+ }
142
+ });
143
+ });
144
+ };
119
145
  return TestkitsApi;
120
146
  }());
121
147
  exports.TestkitsApi = TestkitsApi;
@@ -3,5 +3,5 @@ export declare class WebhooksApi {
3
3
  baseURL: string;
4
4
  client: AxiosInstance;
5
5
  constructor(baseURL: string, axios: AxiosInstance);
6
- static constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string): unknown;
6
+ constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string): unknown;
7
7
  }
@@ -7,7 +7,7 @@ var WebhooksApi = /** @class */ (function () {
7
7
  this.baseURL = baseURL;
8
8
  this.client = axios;
9
9
  }
10
- WebhooksApi.constructWebhookEvent = function (payload, headers, secret) {
10
+ WebhooksApi.prototype.constructWebhookEvent = function (payload, headers, secret) {
11
11
  var wh = new svix_1.Webhook(secret);
12
12
  return wh.verify(payload, headers);
13
13
  };
@@ -1,4 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
+ import { ClientWorkoutsRawResponse } from './models/raw_response';
2
3
  import { ClientWorkoutResponse, ClientWorkoutStreamResponse } from './models/workout_models';
3
4
  export declare class WorkoutsApi {
4
5
  baseURL: string;
@@ -6,4 +7,5 @@ export declare class WorkoutsApi {
6
7
  constructor(baseURL: string, axios: AxiosInstance);
7
8
  get(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientWorkoutResponse>;
8
9
  getStream(workoutId: string): Promise<ClientWorkoutStreamResponse>;
10
+ get_raw(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientWorkoutsRawResponse>;
9
11
  }
@@ -70,6 +70,21 @@ var WorkoutsApi = /** @class */ (function () {
70
70
  });
71
71
  });
72
72
  };
73
+ WorkoutsApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
74
+ return __awaiter(this, void 0, void 0, function () {
75
+ var resp;
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/workouts/" + userKey + "/raw"), {
79
+ params: { start_date: startDate, end_date: endDate, provider: provider },
80
+ })];
81
+ case 1:
82
+ resp = _a.sent();
83
+ return [2 /*return*/, resp.data];
84
+ }
85
+ });
86
+ });
87
+ };
73
88
  return WorkoutsApi;
74
89
  }());
75
90
  exports.WorkoutsApi = WorkoutsApi;