@tryvital/vital-node 1.0.0 → 1.0.4
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.
- package/client/Sleep.ts +2 -2
- package/client/Testkits.ts +5 -2
- package/client/models/link_models.ts +1 -0
- package/client/models/profile_model.ts +1 -1
- package/client/models/sleep_models.ts +13 -0
- package/dist/client/Sleep.d.ts +2 -2
- package/dist/client/Testkits.d.ts +1 -1
- package/dist/client/Testkits.js +3 -1
- package/dist/client/models/link_models.d.ts +1 -0
- package/dist/client/models/profile_model.d.ts +1 -1
- package/dist/client/models/sleep_models.d.ts +12 -0
- package/package.json +1 -1
package/client/Sleep.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
2
|
-
import { ClientSleepResponse } from './models/sleep_models';
|
2
|
+
import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
|
3
3
|
|
4
4
|
export class SleepApi {
|
5
5
|
baseURL: string;
|
@@ -24,7 +24,7 @@ export class SleepApi {
|
|
24
24
|
return resp.data;
|
25
25
|
}
|
26
26
|
|
27
|
-
public async getStream(sleepId: string): Promise<
|
27
|
+
public async getStream(sleepId: string): Promise<ClientSleepStreamResponse> {
|
28
28
|
const resp = await this.client.get(
|
29
29
|
this.baseURL.concat(`/timeseries/sleep/${sleepId}/stream`)
|
30
30
|
);
|
package/client/Testkits.ts
CHANGED
@@ -59,9 +59,12 @@ export class TestkitsApi {
|
|
59
59
|
return resp.data;
|
60
60
|
}
|
61
61
|
|
62
|
-
public async get_results(orderId: string): Promise<
|
62
|
+
public async get_results(orderId: string): Promise<string> {
|
63
63
|
const resp = await this.client.get(
|
64
|
-
this.baseURL.concat(`/testkit/orders/${orderId}/results`)
|
64
|
+
this.baseURL.concat(`/testkit/orders/${orderId}/results`),
|
65
|
+
{
|
66
|
+
responseType: 'arraybuffer',
|
67
|
+
}
|
65
68
|
);
|
66
69
|
return resp.data;
|
67
70
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TimeseriesPoint } from './activity';
|
1
2
|
import { SourceClientFacing } from './user_models';
|
2
3
|
|
3
4
|
/**
|
@@ -136,3 +137,15 @@ export interface ClientSleepResponse {
|
|
136
137
|
*/
|
137
138
|
sleep: ClientFacingSleep[];
|
138
139
|
}
|
140
|
+
|
141
|
+
export interface ClientSleepStreamResponse {
|
142
|
+
/**
|
143
|
+
*
|
144
|
+
* @type {Array<ClientFacingSleep>}
|
145
|
+
* @memberof ClientSleepResponse
|
146
|
+
*/
|
147
|
+
hrv: TimeseriesPoint[];
|
148
|
+
heartrate: TimeseriesPoint[];
|
149
|
+
respiratory_rate: TimeseriesPoint[];
|
150
|
+
hypnogram: TimeseriesPoint[];
|
151
|
+
}
|
package/dist/client/Sleep.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
2
|
-
import { ClientSleepResponse } from './models/sleep_models';
|
2
|
+
import { ClientSleepResponse, ClientSleepStreamResponse } from './models/sleep_models';
|
3
3
|
export declare class SleepApi {
|
4
4
|
baseURL: string;
|
5
5
|
client: AxiosInstance;
|
6
6
|
constructor(baseURL: string, axios: AxiosInstance);
|
7
7
|
get(userKey: string, startDate: Date, endDate: Date, provider?: string): Promise<ClientSleepResponse>;
|
8
|
-
getStream(sleepId: string): Promise<
|
8
|
+
getStream(sleepId: string): Promise<ClientSleepStreamResponse>;
|
9
9
|
}
|
@@ -8,5 +8,5 @@ export declare class TestkitsApi {
|
|
8
8
|
get_orders(startDate: Date, endDate: Date): Promise<OrderResponse>;
|
9
9
|
order(userKey: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
|
10
10
|
get_order(orderId: string): Promise<Order>;
|
11
|
-
get_results(orderId: string): Promise<
|
11
|
+
get_results(orderId: string): Promise<string>;
|
12
12
|
}
|
package/dist/client/Testkits.js
CHANGED
@@ -106,7 +106,9 @@ var TestkitsApi = /** @class */ (function () {
|
|
106
106
|
var resp;
|
107
107
|
return __generator(this, function (_a) {
|
108
108
|
switch (_a.label) {
|
109
|
-
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/testkit/orders/" + orderId + "/results")
|
109
|
+
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/testkit/orders/" + orderId + "/results"), {
|
110
|
+
responseType: 'arraybuffer',
|
111
|
+
})];
|
110
112
|
case 1:
|
111
113
|
resp = _a.sent();
|
112
114
|
return [2 /*return*/, resp.data];
|
@@ -3,6 +3,7 @@ export declare type OAuthProviders = 'oura' | 'fitbit' | 'garmin' | 'whoop' | 's
|
|
3
3
|
export interface ProviderLinkResponse {
|
4
4
|
provider: PasswordProviders;
|
5
5
|
connected: boolean;
|
6
|
+
provider_id?: string;
|
6
7
|
}
|
7
8
|
export interface LinkTokenExchangeResponse {
|
8
9
|
link_token: string;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { TimeseriesPoint } from './activity';
|
1
2
|
import { SourceClientFacing } from './user_models';
|
2
3
|
/**
|
3
4
|
*
|
@@ -134,3 +135,14 @@ export interface ClientSleepResponse {
|
|
134
135
|
*/
|
135
136
|
sleep: ClientFacingSleep[];
|
136
137
|
}
|
138
|
+
export interface ClientSleepStreamResponse {
|
139
|
+
/**
|
140
|
+
*
|
141
|
+
* @type {Array<ClientFacingSleep>}
|
142
|
+
* @memberof ClientSleepResponse
|
143
|
+
*/
|
144
|
+
hrv: TimeseriesPoint[];
|
145
|
+
heartrate: TimeseriesPoint[];
|
146
|
+
respiratory_rate: TimeseriesPoint[];
|
147
|
+
hypnogram: TimeseriesPoint[];
|
148
|
+
}
|