@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
@@ -11,13 +11,13 @@ export class ActivityApi {
11
11
  }
12
12
 
13
13
  public async get(
14
- userKey: string,
14
+ userId: string,
15
15
  startDate: Date,
16
16
  endDate: Date,
17
17
  provider?: string
18
18
  ): Promise<ClientActivityResponse> {
19
19
  const resp = await this.client.get(
20
- this.baseURL.concat(`/summary/activity/${userKey}`),
20
+ this.baseURL.concat(`/summary/activity/${userId}`),
21
21
  {
22
22
  params: { start_date: startDate, end_date: endDate, provider },
23
23
  }
@@ -26,13 +26,13 @@ export class ActivityApi {
26
26
  }
27
27
 
28
28
  public async get_raw(
29
- userKey: string,
29
+ userId: string,
30
30
  startDate: Date,
31
31
  endDate: Date,
32
32
  provider?: string
33
33
  ): Promise<ClientActivityRawResponse> {
34
34
  const resp = await this.client.get(
35
- this.baseURL.concat(`/summary/activity/${userKey}/raw`),
35
+ this.baseURL.concat(`/summary/activity/${userId}/raw`),
36
36
  {
37
37
  params: { start_date: startDate, end_date: endDate, provider },
38
38
  }
package/client/Body.ts CHANGED
@@ -12,13 +12,13 @@ export class BodyApi {
12
12
  }
13
13
 
14
14
  public async get(
15
- userKey: string,
15
+ userId: string,
16
16
  startDate: Date,
17
17
  endDate: Date,
18
18
  provider?: string
19
19
  ): Promise<ClientBodyResponse> {
20
20
  const resp = await this.client.get(
21
- this.baseURL.concat(`/summary/body/${userKey}`),
21
+ this.baseURL.concat(`/summary/body/${userId}`),
22
22
  {
23
23
  params: { start_date: startDate, end_date: endDate, provider },
24
24
  }
@@ -26,15 +26,14 @@ export class BodyApi {
26
26
  return resp.data;
27
27
  }
28
28
 
29
-
30
29
  public async get_raw(
31
- userKey: string,
30
+ userId: string,
32
31
  startDate: Date,
33
32
  endDate: Date,
34
33
  provider?: string
35
34
  ): Promise<ClientBodyRawResponse> {
36
35
  const resp = await this.client.get(
37
- this.baseURL.concat(`/summary/body/${userKey}/raw`),
36
+ this.baseURL.concat(`/summary/body/${userId}/raw`),
38
37
  {
39
38
  params: { start_date: startDate, end_date: endDate, provider },
40
39
  }
@@ -0,0 +1,25 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { ClientDevicesRawResponse } from './models/raw_response';
3
+
4
+ export class DevicesAPI {
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 get_raw(
14
+ userId: string,
15
+ provider?: string
16
+ ): Promise<ClientDevicesRawResponse> {
17
+ const resp = await this.client.get(
18
+ this.baseURL.concat(`/summary/devices/${userId}/raw`),
19
+ {
20
+ params: { provider },
21
+ }
22
+ );
23
+ return resp.data;
24
+ }
25
+ }
package/client/Link.ts CHANGED
@@ -17,11 +17,11 @@ export class LinkApi {
17
17
  }
18
18
 
19
19
  public async create(
20
- userKey: string,
20
+ userId: string,
21
21
  provider: string = null
22
22
  ): Promise<LinkTokenExchangeResponse> {
23
23
  const resp = await this.client.post(this.baseURL.concat('/link/token/'), {
24
- user_key: userKey,
24
+ user_key: userId,
25
25
  provider,
26
26
  });
27
27
  return resp.data;
package/client/Profile.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ClientFacingProfile, } from './models/profile_model';
2
+ import { ClientFacingProfile } from './models/profile_model';
3
3
  import { ClientProfileRawResponse } from './models/raw_response';
4
4
 
5
5
  export class ProfileApi {
@@ -12,11 +12,11 @@ export class ProfileApi {
12
12
  }
13
13
 
14
14
  public async get(
15
- userKey: string,
15
+ userId: string,
16
16
  provider?: string
17
17
  ): Promise<ClientFacingProfile> {
18
18
  const resp = await this.client.get(
19
- this.baseURL.concat(`/summary/profile/${userKey}`),
19
+ this.baseURL.concat(`/summary/profile/${userId}`),
20
20
  {
21
21
  params: { provider },
22
22
  }
@@ -25,13 +25,13 @@ export class ProfileApi {
25
25
  }
26
26
 
27
27
  public async get_raw(
28
- userKey: string,
28
+ userId: string,
29
29
  startDate: Date,
30
30
  endDate: Date,
31
31
  provider?: string
32
32
  ): Promise<ClientProfileRawResponse> {
33
33
  const resp = await this.client.get(
34
- this.baseURL.concat(`/summary/profile/${userKey}/raw`),
34
+ this.baseURL.concat(`/summary/profile/${userId}/raw`),
35
35
  {
36
36
  params: { start_date: startDate, end_date: endDate, provider },
37
37
  }
@@ -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,8 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
2
+ import {
3
+ ClientSleepResponse,
4
+ ClientSleepStreamResponse,
5
+ } from './models/sleep_models';
3
6
  import { ClientSleepRawResponse } from './models/raw_response';
4
7
 
5
8
  export class SleepApi {
@@ -11,13 +14,13 @@ export class SleepApi {
11
14
  }
12
15
 
13
16
  public async get(
14
- userKey: string,
17
+ userId: string,
15
18
  startDate: Date,
16
19
  endDate: Date,
17
20
  provider?: string
18
21
  ): Promise<ClientSleepResponse> {
19
22
  const resp = await this.client.get(
20
- this.baseURL.concat(`/summary/sleep/${userKey}`),
23
+ this.baseURL.concat(`/summary/sleep/${userId}`),
21
24
  {
22
25
  params: { start_date: startDate, end_date: endDate, provider },
23
26
  }
@@ -33,13 +36,13 @@ export class SleepApi {
33
36
  }
34
37
 
35
38
  public async get_raw(
36
- userKey: string,
39
+ userId: string,
37
40
  startDate: Date,
38
41
  endDate: Date,
39
42
  provider?: string
40
43
  ): Promise<ClientSleepRawResponse> {
41
44
  const resp = await this.client.get(
42
- this.baseURL.concat(`/summary/sleep/${userKey}/raw`),
45
+ this.baseURL.concat(`/summary/sleep/${userId}/raw`),
43
46
  {
44
47
  params: { start_date: startDate, end_date: endDate, provider },
45
48
  }
@@ -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,
@@ -35,7 +37,7 @@ export class TestkitsApi {
35
37
  }
36
38
 
37
39
  public async order(
38
- userKey: string,
40
+ userId: string,
39
41
  testkitId: string,
40
42
  patientAddress: PatientAdress,
41
43
  patientDetails: PatientDetails
@@ -43,7 +45,7 @@ export class TestkitsApi {
43
45
  const resp = await this.client.post(
44
46
  this.baseURL.concat('/testkit/orders'),
45
47
  {
46
- user_key: userKey,
48
+ user_key: userId,
47
49
  testkit_id: testkitId,
48
50
  patient_address: patientAddress,
49
51
  patient_details: patientDetails,
@@ -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
  }
package/client/User.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import {
3
- UserKeyResponse,
3
+ UserIdResponse,
4
4
  SuccessResponse,
5
5
  ClientFacingUser,
6
6
  Providers,
@@ -15,16 +15,16 @@ export class UserApi {
15
15
  this.client = axios;
16
16
  }
17
17
 
18
- public async create(clientUserId: string): Promise<UserKeyResponse> {
18
+ public async create(clientUserId: string): Promise<UserIdResponse> {
19
19
  const resp = await this.client.post(this.baseURL.concat('/user/key'), {
20
20
  client_user_id: clientUserId,
21
21
  });
22
22
  return resp.data;
23
23
  }
24
24
 
25
- public async delete(userKey: string): Promise<SuccessResponse> {
25
+ public async delete(userId: string): Promise<SuccessResponse> {
26
26
  const resp = await this.client.delete(
27
- this.baseURL.concat(`/user/${userKey}`)
27
+ this.baseURL.concat(`/user/${userId}`)
28
28
  );
29
29
  return resp.data;
30
30
  }
@@ -34,8 +34,8 @@ export class UserApi {
34
34
  return resp.data;
35
35
  }
36
36
 
37
- public async get(userKey: string): Promise<ClientFacingUser> {
38
- const resp = await this.client.get(this.baseURL.concat(`/user/${userKey}`));
37
+ public async get(userId: string): Promise<ClientFacingUser> {
38
+ const resp = await this.client.get(this.baseURL.concat(`/user/${userId}`));
39
39
  return resp.data;
40
40
  }
41
41
 
@@ -46,19 +46,28 @@ export class UserApi {
46
46
  return resp.data;
47
47
  }
48
48
 
49
- public async providers(userKey: string): Promise<ProvidersResponse> {
49
+ public async providers(userId: string): Promise<ProvidersResponse> {
50
50
  const resp = await this.client.get(
51
- this.baseURL.concat(`/user/providers/${userKey}`)
51
+ this.baseURL.concat(`/user/providers/${userId}`)
52
52
  );
53
53
  return resp.data;
54
54
  }
55
55
 
56
56
  public async deregisterProvider(
57
- userKey: string,
57
+ userId: string,
58
58
  provider: Providers
59
59
  ): Promise<SuccessResponse> {
60
60
  const resp = await this.client.delete(
61
- this.baseURL.concat(`/user/${userKey}/${provider}`)
61
+ this.baseURL.concat(`/user/${userId}/${provider}`)
62
+ );
63
+ return resp.data;
64
+ }
65
+
66
+ public async refresh(
67
+ userId: string,
68
+ ): Promise<SuccessResponse> {
69
+ const resp = await this.client.post(
70
+ this.baseURL.concat(`/user/refresh/${userId}`)
62
71
  );
63
72
  return resp.data;
64
73
  }
package/client/Vitals.ts CHANGED
@@ -27,13 +27,13 @@ export class VitalsApi {
27
27
 
28
28
  public async cholesterol(
29
29
  type: 'ldl' | 'total' | 'triglycerides' | 'hdl',
30
- userKey: string,
30
+ userId: string,
31
31
  startDate: Date,
32
32
  endDate: Date,
33
33
  provider?: string
34
34
  ): Promise<TimeseriesPoint[]> {
35
35
  return this.timeseriesData(
36
- userKey,
36
+ userId,
37
37
  `cholesterol/${type}`,
38
38
  startDate,
39
39
  endDate,
@@ -42,13 +42,13 @@ export class VitalsApi {
42
42
  }
43
43
 
44
44
  public async glucose(
45
- userKey: string,
45
+ userId: string,
46
46
  startDate: Date,
47
47
  endDate: Date,
48
48
  provider?: string
49
49
  ): Promise<TimeseriesPoint[]> {
50
50
  return this.timeseriesData(
51
- userKey,
51
+ userId,
52
52
  'glucose',
53
53
  startDate,
54
54
  endDate,
@@ -57,31 +57,31 @@ export class VitalsApi {
57
57
  }
58
58
 
59
59
  public async ige(
60
- userKey: string,
60
+ userId: string,
61
61
  startDate: Date,
62
62
  endDate: Date,
63
63
  provider?: string
64
64
  ): Promise<TimeseriesPoint[]> {
65
- return this.timeseriesData(userKey, 'ige', startDate, endDate, provider);
65
+ return this.timeseriesData(userId, 'ige', startDate, endDate, provider);
66
66
  }
67
67
 
68
68
  public async igg(
69
- userKey: string,
69
+ userId: string,
70
70
  startDate: Date,
71
71
  endDate: Date,
72
72
  provider?: string
73
73
  ): Promise<TimeseriesPoint[]> {
74
- return this.timeseriesData(userKey, 'igg', startDate, endDate, provider);
74
+ return this.timeseriesData(userId, 'igg', startDate, endDate, provider);
75
75
  }
76
76
 
77
77
  public async heartrate(
78
- userKey: string,
78
+ userId: string,
79
79
  startDate: Date,
80
80
  endDate: Date,
81
81
  provider?: string
82
82
  ): Promise<TimeseriesPoint[]> {
83
83
  return this.timeseriesData(
84
- userKey,
84
+ userId,
85
85
  'heartrate',
86
86
  startDate,
87
87
  endDate,
@@ -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
@@ -14,13 +14,13 @@ export class WorkoutsApi {
14
14
  }
15
15
 
16
16
  public async get(
17
- userKey: string,
17
+ userId: string,
18
18
  startDate: Date,
19
19
  endDate: Date,
20
20
  provider?: string
21
21
  ): Promise<ClientWorkoutResponse> {
22
22
  const resp = await this.client.get(
23
- this.baseURL.concat(`/summary/workouts/${userKey}`),
23
+ this.baseURL.concat(`/summary/workouts/${userId}`),
24
24
  {
25
25
  params: { start_date: startDate, end_date: endDate, provider },
26
26
  }
@@ -38,13 +38,13 @@ export class WorkoutsApi {
38
38
  }
39
39
 
40
40
  public async get_raw(
41
- userKey: string,
41
+ userId: string,
42
42
  startDate: Date,
43
43
  endDate: Date,
44
44
  provider?: string
45
45
  ): Promise<ClientWorkoutsRawResponse> {
46
46
  const resp = await this.client.get(
47
- this.baseURL.concat(`/summary/workouts/${userKey}/raw`),
47
+ this.baseURL.concat(`/summary/workouts/${userId}/raw`),
48
48
  {
49
49
  params: { start_date: startDate, end_date: endDate, provider },
50
50
  }
package/client/index.ts CHANGED
@@ -7,3 +7,4 @@ export { WebhooksApi } from './Webhooks';
7
7
  export { WorkoutsApi } from './Workouts';
8
8
  export { TestkitsApi } from './Testkits';
9
9
  export { ProfileApi } from './Profile';
10
+ export { DevicesAPI } from './Devices';
@@ -37,7 +37,7 @@ export interface ClientFacingBody {
37
37
  */
38
38
  source: SourceClientFacing;
39
39
  /**
40
- * 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.
40
+ * 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.
41
41
  * @type {string}
42
42
  * @memberof ClientFacingBody
43
43
  */
@@ -26,7 +26,7 @@ export interface ClientFacingProfile {
26
26
  */
27
27
  source: SourceClientFacing;
28
28
  /**
29
- * 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.
29
+ * 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.
30
30
  * @type {string}
31
31
  * @memberof ClientFacingBody
32
32
  */
@@ -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
+ }
@@ -29,7 +29,7 @@ export interface ClientFacingSourceSpecific {
29
29
  */
30
30
  data: unknown;
31
31
  /**
32
- * 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.
32
+ * 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.
33
33
  * @type {string}
34
34
  * @memberof ClientFacingSourceSpecific
35
35
  */
@@ -8,7 +8,16 @@ export interface RawResponse {
8
8
  priority: number;
9
9
  priority_id: number;
10
10
  timestamp: Date;
11
- data: Record<string, string>
11
+ data: Record<string, string>;
12
+ provider_id: string;
13
+ }
14
+
15
+ export interface DeviceRawResponse {
16
+ id: string;
17
+ user_id: string;
18
+ source_id: number;
19
+ source?: SourceClientFacing;
20
+ data: Record<string, string>;
12
21
  provider_id: string;
13
22
  }
14
23
 
@@ -29,3 +38,7 @@ export interface ClientSleepRawResponse {
29
38
  export interface ClientProfileRawResponse {
30
39
  profile: RawResponse[];
31
40
  }
41
+
42
+ export interface ClientDevicesRawResponse {
43
+ devices: DeviceRawResponse[];
44
+ }
@@ -122,7 +122,7 @@ export interface ClientFacingSleep {
122
122
  */
123
123
  source: SourceClientFacing;
124
124
  /**
125
- * 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.
125
+ * 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.
126
126
  * @type {string}
127
127
  * @memberof ClientFacingSleep
128
128
  */
@@ -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,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
 
6
6
  export interface SuccessResponse {
@@ -82,7 +82,7 @@ export interface ClientFacingWorkout {
82
82
  */
83
83
  hr_zones: number[];
84
84
  /**
85
- * 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.
85
+ * 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.
86
86
  * @type {string}
87
87
  * @memberof ClientFacingWorkout
88
88
  */
@@ -5,6 +5,6 @@ export declare class ActivityApi {
5
5
  baseURL: string;
6
6
  client: AxiosInstance;
7
7
  constructor(baseURL: string, axios: AxiosInstance);
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
+ get(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientActivityResponse>;
9
+ get_raw(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientActivityRawResponse>;
10
10
  }
@@ -42,12 +42,12 @@ var ActivityApi = /** @class */ (function () {
42
42
  this.baseURL = baseURL;
43
43
  this.client = axios;
44
44
  }
45
- ActivityApi.prototype.get = function (userKey, startDate, endDate, provider) {
45
+ ActivityApi.prototype.get = function (userId, startDate, endDate, provider) {
46
46
  return __awaiter(this, void 0, void 0, function () {
47
47
  var resp;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
50
- case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/activity/" + userKey), {
50
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/activity/" + userId), {
51
51
  params: { start_date: startDate, end_date: endDate, provider: provider },
52
52
  })];
53
53
  case 1:
@@ -57,12 +57,12 @@ var ActivityApi = /** @class */ (function () {
57
57
  });
58
58
  });
59
59
  };
60
- ActivityApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
60
+ ActivityApi.prototype.get_raw = function (userId, startDate, endDate, provider) {
61
61
  return __awaiter(this, void 0, void 0, function () {
62
62
  var resp;
63
63
  return __generator(this, function (_a) {
64
64
  switch (_a.label) {
65
- case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/activity/" + userKey + "/raw"), {
65
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/activity/" + userId + "/raw"), {
66
66
  params: { start_date: startDate, end_date: endDate, provider: provider },
67
67
  })];
68
68
  case 1:
@@ -5,6 +5,6 @@ export declare class BodyApi {
5
5
  baseURL: string;
6
6
  client: AxiosInstance;
7
7
  constructor(baseURL: string, axios: AxiosInstance);
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
+ get(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientBodyResponse>;
9
+ get_raw(userId: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientBodyRawResponse>;
10
10
  }
@@ -42,12 +42,12 @@ var BodyApi = /** @class */ (function () {
42
42
  this.baseURL = baseURL;
43
43
  this.client = axios;
44
44
  }
45
- BodyApi.prototype.get = function (userKey, startDate, endDate, provider) {
45
+ BodyApi.prototype.get = function (userId, startDate, endDate, provider) {
46
46
  return __awaiter(this, void 0, void 0, function () {
47
47
  var resp;
48
48
  return __generator(this, function (_a) {
49
49
  switch (_a.label) {
50
- case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/body/" + userKey), {
50
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/body/" + userId), {
51
51
  params: { start_date: startDate, end_date: endDate, provider: provider },
52
52
  })];
53
53
  case 1:
@@ -57,12 +57,12 @@ var BodyApi = /** @class */ (function () {
57
57
  });
58
58
  });
59
59
  };
60
- BodyApi.prototype.get_raw = function (userKey, startDate, endDate, provider) {
60
+ BodyApi.prototype.get_raw = function (userId, startDate, endDate, provider) {
61
61
  return __awaiter(this, void 0, void 0, function () {
62
62
  var resp;
63
63
  return __generator(this, function (_a) {
64
64
  switch (_a.label) {
65
- case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/body/" + userKey + "/raw"), {
65
+ case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/summary/body/" + userId + "/raw"), {
66
66
  params: { start_date: startDate, end_date: endDate, provider: provider },
67
67
  })];
68
68
  case 1:
@@ -0,0 +1,8 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { ClientDevicesRawResponse } from './models/raw_response';
3
+ export declare class DevicesAPI {
4
+ baseURL: string;
5
+ client: AxiosInstance;
6
+ constructor(baseURL: string, axios: AxiosInstance);
7
+ get_raw(userId: string, provider?: string): Promise<ClientDevicesRawResponse>;
8
+ }