@tryvital/vital-node 1.0.9 → 1.2.0

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 (62) hide show
  1. package/client/Activity.ts +4 -4
  2. package/client/Body.ts +4 -5
  3. package/client/Devices.ts +25 -0
  4. package/client/Link.ts +2 -2
  5. package/client/Profile.ts +5 -5
  6. package/client/Provider.ts +17 -0
  7. package/client/Sleep.ts +8 -5
  8. package/client/Testkits.ts +18 -2
  9. package/client/User.ts +19 -10
  10. package/client/Vitals.ts +10 -10
  11. package/client/Webhooks.ts +1 -1
  12. package/client/Workouts.ts +4 -4
  13. package/client/index.ts +1 -0
  14. package/client/models/body_model.ts +1 -1
  15. package/client/models/profile_model.ts +1 -1
  16. package/client/models/provider_models.ts +19 -0
  17. package/client/models/provider_specific.ts +1 -1
  18. package/client/models/raw_response.ts +14 -1
  19. package/client/models/sleep_models.ts +1 -1
  20. package/client/models/testkit_models.ts +19 -0
  21. package/client/models/user_models.ts +2 -2
  22. package/client/models/workout_models.ts +1 -1
  23. package/dist/client/Activity.d.ts +2 -2
  24. package/dist/client/Activity.js +4 -4
  25. package/dist/client/Body.d.ts +2 -2
  26. package/dist/client/Body.js +4 -4
  27. package/dist/client/Devices.d.ts +8 -0
  28. package/dist/client/Devices.js +62 -0
  29. package/dist/client/Link.d.ts +1 -1
  30. package/dist/client/Link.js +2 -2
  31. package/dist/client/Profile.d.ts +2 -2
  32. package/dist/client/Profile.js +4 -4
  33. package/dist/client/Provider.d.ts +8 -0
  34. package/dist/client/Provider.js +60 -0
  35. package/dist/client/Sleep.d.ts +2 -2
  36. package/dist/client/Sleep.js +4 -4
  37. package/dist/client/Testkits.d.ts +4 -2
  38. package/dist/client/Testkits.js +28 -2
  39. package/dist/client/User.d.ts +7 -6
  40. package/dist/client/User.js +21 -8
  41. package/dist/client/Vitals.d.ts +5 -5
  42. package/dist/client/Vitals.js +10 -10
  43. package/dist/client/Webhooks.d.ts +1 -1
  44. package/dist/client/Webhooks.js +1 -1
  45. package/dist/client/Workouts.d.ts +2 -2
  46. package/dist/client/Workouts.js +4 -4
  47. package/dist/client/index.d.ts +1 -0
  48. package/dist/client/index.js +3 -1
  49. package/dist/client/models/body_model.d.ts +1 -1
  50. package/dist/client/models/profile_model.d.ts +1 -1
  51. package/dist/client/models/provider_models.d.ts +18 -0
  52. package/dist/client/models/provider_models.js +15 -0
  53. package/dist/client/models/provider_specific.d.ts +1 -1
  54. package/dist/client/models/raw_response.d.ts +11 -0
  55. package/dist/client/models/sleep_models.d.ts +1 -1
  56. package/dist/client/models/testkit_models.d.ts +17 -0
  57. package/dist/client/models/user_models.d.ts +2 -2
  58. package/dist/client/models/workout_models.d.ts +1 -1
  59. package/dist/index.d.ts +4 -1
  60. package/dist/index.js +3 -0
  61. package/index.ts +6 -0
  62. package/package.json +3 -3
@@ -10,6 +10,14 @@ export interface RawResponse {
10
10
  data: Record<string, string>;
11
11
  provider_id: string;
12
12
  }
13
+ export interface DeviceRawResponse {
14
+ id: string;
15
+ user_id: string;
16
+ source_id: number;
17
+ source?: SourceClientFacing;
18
+ data: Record<string, string>;
19
+ provider_id: string;
20
+ }
13
21
  export interface ClientActivityRawResponse {
14
22
  activity: RawResponse[];
15
23
  }
@@ -25,3 +33,6 @@ export interface ClientSleepRawResponse {
25
33
  export interface ClientProfileRawResponse {
26
34
  profile: RawResponse[];
27
35
  }
36
+ export interface ClientDevicesRawResponse {
37
+ devices: DeviceRawResponse[];
38
+ }
@@ -121,7 +121,7 @@ export interface ClientFacingSleep {
121
121
  */
122
122
  source: SourceClientFacing;
123
123
  /**
124
- * User key returned by vital create user key request. This key should be stored in your database against the user and used for all interactions with the vital api.
124
+ * User id returned by vital create user id request. This id should be stored in your database against the user and used for all interactions with the vital api.
125
125
  * @type {string}
126
126
  * @memberof ClientFacingSleep
127
127
  */
@@ -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
+ }
@@ -1,6 +1,6 @@
1
- export interface UserKeyResponse {
1
+ export interface UserIdResponse {
2
2
  client_user_id: string;
3
- user_key: string;
3
+ user_id: string;
4
4
  }
5
5
  export interface SuccessResponse {
6
6
  success: boolean;
@@ -80,7 +80,7 @@ export interface ClientFacingWorkout {
80
80
  */
81
81
  hr_zones: number[];
82
82
  /**
83
- * User key returned by vital create user key request. This key should be stored in your database against the user and used for all interactions with the vital api.
83
+ * User id returned by vital create user id request. This id should be stored in your database against the user and used for all interactions with the vital api.
84
84
  * @type {string}
85
85
  * @memberof ClientFacingWorkout
86
86
  */
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { ActivityApi, BodyApi, LinkApi, SleepApi, TestkitsApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi } from './client';
1
+ import { ActivityApi, BodyApi, LinkApi, SleepApi, TestkitsApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi, DevicesAPI } from './client';
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,7 @@ export declare class VitalClient {
15
16
  Vitals: VitalsApi;
16
17
  Testkits: TestkitsApi;
17
18
  Profile: ProfileApi;
19
+ Providers: ProviderApi;
20
+ Devices: DevicesAPI;
18
21
  constructor(config: ClientConfig);
19
22
  }
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;
@@ -90,6 +91,8 @@ var VitalClient = /** @class */ (function () {
90
91
  this.Vitals = new Vitals_1.VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
91
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);
95
+ this.Devices = new client_1.DevicesAPI(baseURL.concat('/v2'), axiosApiInstance);
93
96
  }
94
97
  return VitalClient;
95
98
  }());
package/index.ts CHANGED
@@ -10,11 +10,13 @@ import {
10
10
  WebhooksApi,
11
11
  WorkoutsApi,
12
12
  ProfileApi,
13
+ DevicesAPI,
13
14
  } from './client';
14
15
  import { ClientConfig } from './lib/models';
15
16
  import CONFIG from './lib/config';
16
17
  import { ClientCredentials } from './lib/credentials';
17
18
  import { VitalsApi } from './client/Vitals';
19
+ import { ProviderApi } from './client/Provider';
18
20
 
19
21
  export class VitalClient {
20
22
  config: ClientConfig;
@@ -29,6 +31,8 @@ export class VitalClient {
29
31
  Vitals: VitalsApi;
30
32
  Testkits: TestkitsApi;
31
33
  Profile: ProfileApi;
34
+ Providers: ProviderApi;
35
+ Devices: DevicesAPI;
32
36
 
33
37
  constructor(config: ClientConfig) {
34
38
  this.config = config;
@@ -67,5 +71,7 @@ export class VitalClient {
67
71
  this.Vitals = new VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
68
72
  this.Testkits = new TestkitsApi(baseURL.concat('/v2'), axiosApiInstance);
69
73
  this.Profile = new ProfileApi(baseURL.concat('/v2'), axiosApiInstance);
74
+ this.Providers = new ProviderApi(baseURL.concat('/v2'), axiosApiInstance);
75
+ this.Devices = new DevicesAPI(baseURL.concat('/v2'), axiosApiInstance);
70
76
  }
71
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-node",
3
- "version": "1.0.9",
3
+ "version": "1.2.0",
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",