@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
  export declare type PasswordProviders = 'whoop' | 'renpho' | 'peloton' | 'zwift';
2
2
  export declare type OAuthProviders = 'oura' | 'fitbit' | 'garmin' | 'whoop' | 'strava' | 'wahoo';
3
+ export declare type EmailProviders = 'freestyle_libre';
3
4
  export interface ProviderLinkResponse {
4
5
  provider: PasswordProviders;
5
6
  connected: boolean;
@@ -0,0 +1,18 @@
1
+ export declare 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
+ export interface Provider {
13
+ name: string;
14
+ slug: string;
15
+ logo: string;
16
+ auth_type: 'password' | 'email' | 'oauth';
17
+ supported_resources: Resource[];
18
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Resource = void 0;
4
+ var Resource;
5
+ (function (Resource) {
6
+ Resource["WORKOUTS"] = "workouts";
7
+ Resource["ACTVITY"] = "activity";
8
+ Resource["SLEEP"] = "sleep";
9
+ Resource["BODY"] = "body";
10
+ Resource["WORKOUTS_STREAM"] = "workouts/stream";
11
+ Resource["SLEEP_STREAM"] = "sleep/stream";
12
+ Resource["HEARTRATE"] = "heartrate";
13
+ Resource["GLUCOSE"] = "glucose";
14
+ Resource["PROFILE"] = "profile";
15
+ })(Resource = exports.Resource || (exports.Resource = {}));
@@ -0,0 +1,27 @@
1
+ import { SourceClientFacing } from './user_models';
2
+ export interface RawResponse {
3
+ id: string;
4
+ user_id: string;
5
+ source_id: number;
6
+ source?: SourceClientFacing;
7
+ priority: number;
8
+ priority_id: number;
9
+ timestamp: Date;
10
+ data: Record<string, string>;
11
+ provider_id: string;
12
+ }
13
+ export interface ClientActivityRawResponse {
14
+ activity: RawResponse[];
15
+ }
16
+ export interface ClientWorkoutsRawResponse {
17
+ workouts: RawResponse[];
18
+ }
19
+ export interface ClientBodyRawResponse {
20
+ body: RawResponse[];
21
+ }
22
+ export interface ClientSleepRawResponse {
23
+ sleep: RawResponse[];
24
+ }
25
+ export interface ClientProfileRawResponse {
26
+ profile: RawResponse[];
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -51,3 +51,20 @@ export interface OrderRequestResponse {
51
51
  export interface TestkitResponse {
52
52
  testkits: Testkit[];
53
53
  }
54
+ export interface LabResultsMetadata {
55
+ age: string;
56
+ dob: string;
57
+ clia_number: string;
58
+ patient: string;
59
+ provider: string;
60
+ laboratory: string;
61
+ date_reported: string;
62
+ date_collected: string;
63
+ specimen_number: string;
64
+ date_received?: string;
65
+ clia?: string;
66
+ }
67
+ export interface LabResultsRaw {
68
+ metadata: LabResultsMetadata;
69
+ data: Record<string, string>;
70
+ }
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { ActivityApi, BodyApi, LinkApi, SleepApi, TestkitsApi, UserApi, Webhooks
2
2
  import { ClientConfig } from './lib/models';
3
3
  import { ClientCredentials } from './lib/credentials';
4
4
  import { VitalsApi } from './client/Vitals';
5
+ import { ProviderApi } from './client/Provider';
5
6
  export declare class VitalClient {
6
7
  config: ClientConfig;
7
8
  clientCredentials: ClientCredentials;
@@ -15,5 +16,6 @@ export declare class VitalClient {
15
16
  Vitals: VitalsApi;
16
17
  Testkits: TestkitsApi;
17
18
  Profile: ProfileApi;
19
+ Providers: ProviderApi;
18
20
  constructor(config: ClientConfig);
19
21
  }
package/dist/index.js CHANGED
@@ -54,6 +54,7 @@ var client_1 = require("./client");
54
54
  var config_1 = require("./lib/config");
55
55
  var credentials_1 = require("./lib/credentials");
56
56
  var Vitals_1 = require("./client/Vitals");
57
+ var Provider_1 = require("./client/Provider");
57
58
  var VitalClient = /** @class */ (function () {
58
59
  function VitalClient(config) {
59
60
  var _this = this;
@@ -81,15 +82,16 @@ var VitalClient = /** @class */ (function () {
81
82
  });
82
83
  // Hook APIS
83
84
  this.Activity = new client_1.ActivityApi(baseURL.concat('/v2'), axiosApiInstance);
84
- this.Link = new client_1.LinkApi(baseURL.concat('/v1'), axiosApiInstance);
85
+ this.Link = new client_1.LinkApi(baseURL.concat('/v2'), axiosApiInstance);
85
86
  this.Body = new client_1.BodyApi(baseURL.concat('/v2'), axiosApiInstance);
86
87
  this.Sleep = new client_1.SleepApi(baseURL.concat('/v2'), axiosApiInstance);
87
- this.User = new client_1.UserApi(baseURL.concat('/v1'), axiosApiInstance);
88
+ this.User = new client_1.UserApi(baseURL.concat('/v2'), axiosApiInstance);
88
89
  this.Workouts = new client_1.WorkoutsApi(baseURL.concat('/v2'), axiosApiInstance);
89
90
  this.Webhooks = new client_1.WebhooksApi(baseURL.concat('/v2'), axiosApiInstance);
90
91
  this.Vitals = new Vitals_1.VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
91
- this.Testkits = new client_1.TestkitsApi(baseURL.concat('/v1'), axiosApiInstance);
92
+ this.Testkits = new client_1.TestkitsApi(baseURL.concat('/v2'), axiosApiInstance);
92
93
  this.Profile = new client_1.ProfileApi(baseURL.concat('/v2'), axiosApiInstance);
94
+ this.Providers = new Provider_1.ProviderApi(baseURL.concat('/v2'), axiosApiInstance);
93
95
  }
94
96
  return VitalClient;
95
97
  }());
package/index.ts CHANGED
@@ -15,6 +15,7 @@ import { ClientConfig } from './lib/models';
15
15
  import CONFIG from './lib/config';
16
16
  import { ClientCredentials } from './lib/credentials';
17
17
  import { VitalsApi } from './client/Vitals';
18
+ import { ProviderApi } from './client/Provider';
18
19
 
19
20
  export class VitalClient {
20
21
  config: ClientConfig;
@@ -29,6 +30,7 @@ export class VitalClient {
29
30
  Vitals: VitalsApi;
30
31
  Testkits: TestkitsApi;
31
32
  Profile: ProfileApi;
33
+ Providers: ProviderApi;
32
34
 
33
35
  constructor(config: ClientConfig) {
34
36
  this.config = config;
@@ -58,14 +60,15 @@ export class VitalClient {
58
60
 
59
61
  // Hook APIS
60
62
  this.Activity = new ActivityApi(baseURL.concat('/v2'), axiosApiInstance);
61
- this.Link = new LinkApi(baseURL.concat('/v1'), axiosApiInstance);
63
+ this.Link = new LinkApi(baseURL.concat('/v2'), axiosApiInstance);
62
64
  this.Body = new BodyApi(baseURL.concat('/v2'), axiosApiInstance);
63
65
  this.Sleep = new SleepApi(baseURL.concat('/v2'), axiosApiInstance);
64
- this.User = new UserApi(baseURL.concat('/v1'), axiosApiInstance);
66
+ this.User = new UserApi(baseURL.concat('/v2'), axiosApiInstance);
65
67
  this.Workouts = new WorkoutsApi(baseURL.concat('/v2'), axiosApiInstance);
66
68
  this.Webhooks = new WebhooksApi(baseURL.concat('/v2'), axiosApiInstance);
67
69
  this.Vitals = new VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
68
- this.Testkits = new TestkitsApi(baseURL.concat('/v1'), axiosApiInstance);
70
+ this.Testkits = new TestkitsApi(baseURL.concat('/v2'), axiosApiInstance);
69
71
  this.Profile = new ProfileApi(baseURL.concat('/v2'), axiosApiInstance);
72
+ this.Providers = new ProviderApi(baseURL.concat('/v2'), axiosApiInstance);
70
73
  }
71
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "Node client for Vital",
5
5
  "author": "maitham",
6
6
  "keywords": [
@@ -42,8 +42,8 @@
42
42
  "eslint-plugin-import": "^2.24.0",
43
43
  "eslint-plugin-prettier": "^3.4.0",
44
44
  "esm": "^3.2.25",
45
- "mocha": "^8.4.0",
46
- "mocha-junit-reporter": "^1.23.1",
45
+ "mocha": "^9.2.0",
46
+ "mocha-junit-reporter": "^2.0.2",
47
47
  "nock": "^13.1.1",
48
48
  "nyc": "^15.1.0",
49
49
  "prettier": "^2.3.2",