@tryvital/vital-node 0.3.5 → 0.3.9
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/Testkits.ts +14 -9
- package/client/User.ts +2 -2
- package/client/models/activity.ts +3 -3
- package/client/models/testkit_models.ts +16 -2
- package/client/models/user_models.ts +4 -0
- package/dist/client/Testkits.d.ts +3 -3
- package/dist/client/Testkits.js +6 -3
- package/dist/client/User.d.ts +2 -2
- package/dist/client/models/activity.d.ts +3 -3
- package/dist/client/models/testkit_models.d.ts +15 -2
- package/dist/client/models/user_models.d.ts +3 -0
- package/package.json +1 -1
package/client/Testkits.ts
CHANGED
@@ -5,14 +5,9 @@ import {
|
|
5
5
|
OrderRequestResponse,
|
6
6
|
OrderResponse,
|
7
7
|
PatientAdress,
|
8
|
-
|
8
|
+
PatientDetails,
|
9
9
|
TestkitResponse,
|
10
10
|
} from './models/testkit_models';
|
11
|
-
import {
|
12
|
-
ClientWebhookResponse,
|
13
|
-
WebhookEventTypes,
|
14
|
-
ClientFacingWebhook,
|
15
|
-
} from './models/webhook_models';
|
16
11
|
|
17
12
|
export class TestkitsApi {
|
18
13
|
baseURL: string;
|
@@ -27,15 +22,24 @@ export class TestkitsApi {
|
|
27
22
|
return resp.data;
|
28
23
|
}
|
29
24
|
|
30
|
-
public async get_orders(
|
31
|
-
|
25
|
+
public async get_orders(
|
26
|
+
startDate: Date,
|
27
|
+
endDate: Date
|
28
|
+
): Promise<OrderResponse> {
|
29
|
+
const resp = await this.client.get(
|
30
|
+
this.baseURL.concat('/testkit/orders/'),
|
31
|
+
{
|
32
|
+
params: { start_date: startDate, end_date: endDate },
|
33
|
+
}
|
34
|
+
);
|
32
35
|
return resp.data;
|
33
36
|
}
|
34
37
|
|
35
38
|
public async order(
|
36
39
|
userKey: string,
|
37
40
|
testkitId: string,
|
38
|
-
patientAddress: PatientAdress
|
41
|
+
patientAddress: PatientAdress,
|
42
|
+
patientDetails: PatientDetails
|
39
43
|
): Promise<OrderRequestResponse> {
|
40
44
|
const resp = await this.client.post(
|
41
45
|
this.baseURL.concat('/testkit/orders'),
|
@@ -43,6 +47,7 @@ export class TestkitsApi {
|
|
43
47
|
user_key: userKey,
|
44
48
|
testkit_id: testkitId,
|
45
49
|
patient_address: patientAddress,
|
50
|
+
patient_details: patientDetails,
|
46
51
|
}
|
47
52
|
);
|
48
53
|
return resp.data;
|
package/client/User.ts
CHANGED
@@ -3,8 +3,8 @@ import {
|
|
3
3
|
UserKeyResponse,
|
4
4
|
SuccessResponse,
|
5
5
|
ClientFacingUser,
|
6
|
-
SourceClientFacing,
|
7
6
|
Providers,
|
7
|
+
ProvidersResponse,
|
8
8
|
} from './models/user_models';
|
9
9
|
|
10
10
|
export class UserApi {
|
@@ -46,7 +46,7 @@ export class UserApi {
|
|
46
46
|
return resp.data;
|
47
47
|
}
|
48
48
|
|
49
|
-
public async providers(userKey: string): Promise<
|
49
|
+
public async providers(userKey: string): Promise<ProvidersResponse> {
|
50
50
|
const resp = await this.client.get(
|
51
51
|
this.baseURL.concat(`/user/providers/${userKey}`)
|
52
52
|
);
|
@@ -18,13 +18,13 @@ export interface ClientFacingActivity {
|
|
18
18
|
* @type {number}
|
19
19
|
* @memberof ClientFacingActivity
|
20
20
|
*/
|
21
|
-
|
21
|
+
calories_total: number;
|
22
22
|
/**
|
23
23
|
* Energy consumption caused by the physical activity of the day in kilocalories.::kilocalories
|
24
24
|
* @type {number}
|
25
25
|
* @memberof ClientFacingActivity
|
26
26
|
*/
|
27
|
-
|
27
|
+
calories_active: number;
|
28
28
|
/**
|
29
29
|
* Total number of steps registered during the day.::steps
|
30
30
|
* @type {number}
|
@@ -36,7 +36,7 @@ export interface ClientFacingActivity {
|
|
36
36
|
* @type {number}
|
37
37
|
* @memberof ClientFacingActivity
|
38
38
|
*/
|
39
|
-
|
39
|
+
daily_movement?: number;
|
40
40
|
/**
|
41
41
|
* Number of minutes during the day with low intensity activity (e.g. household work).::minutes
|
42
42
|
* @type {number}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export interface PatientAdress {
|
2
2
|
receiver_name: string;
|
3
|
-
|
4
|
-
|
3
|
+
street_number: string;
|
4
|
+
street: string;
|
5
5
|
city: string;
|
6
6
|
state: string;
|
7
7
|
zip: string;
|
@@ -9,10 +9,24 @@ export interface PatientAdress {
|
|
9
9
|
phone_number: string;
|
10
10
|
}
|
11
11
|
|
12
|
+
export interface PatientDetails {
|
13
|
+
dob: string;
|
14
|
+
gender: string;
|
15
|
+
}
|
16
|
+
export interface Marker {
|
17
|
+
name: string;
|
18
|
+
slug: string;
|
19
|
+
description?: string;
|
20
|
+
}
|
21
|
+
|
12
22
|
export interface Testkit {
|
13
23
|
id: string;
|
14
24
|
name: string;
|
15
25
|
description: string;
|
26
|
+
markers: Marker[];
|
27
|
+
turnaround_time_lower: number;
|
28
|
+
turnaround_time_upper: number;
|
29
|
+
price: number;
|
16
30
|
}
|
17
31
|
|
18
32
|
export interface Order {
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
2
|
-
import { Order, OrderRequestResponse, OrderResponse, PatientAdress, TestkitResponse } from './models/testkit_models';
|
2
|
+
import { Order, OrderRequestResponse, OrderResponse, PatientAdress, PatientDetails, TestkitResponse } from './models/testkit_models';
|
3
3
|
export declare class TestkitsApi {
|
4
4
|
baseURL: string;
|
5
5
|
client: AxiosInstance;
|
6
6
|
constructor(baseURL: string, axios: AxiosInstance);
|
7
7
|
get(): Promise<TestkitResponse>;
|
8
|
-
get_orders(): Promise<OrderResponse>;
|
9
|
-
order(userKey: string, testkitId: string, patientAddress: PatientAdress): Promise<OrderRequestResponse>;
|
8
|
+
get_orders(startDate: Date, endDate: Date): Promise<OrderResponse>;
|
9
|
+
order(userKey: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
|
10
10
|
get_order(orderId: string): Promise<Order>;
|
11
11
|
}
|
package/dist/client/Testkits.js
CHANGED
@@ -55,12 +55,14 @@ var TestkitsApi = /** @class */ (function () {
|
|
55
55
|
});
|
56
56
|
});
|
57
57
|
};
|
58
|
-
TestkitsApi.prototype.get_orders = function () {
|
58
|
+
TestkitsApi.prototype.get_orders = function (startDate, endDate) {
|
59
59
|
return __awaiter(this, void 0, void 0, function () {
|
60
60
|
var resp;
|
61
61
|
return __generator(this, function (_a) {
|
62
62
|
switch (_a.label) {
|
63
|
-
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/testkit/orders')
|
63
|
+
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/testkit/orders/'), {
|
64
|
+
params: { start_date: startDate, end_date: endDate },
|
65
|
+
})];
|
64
66
|
case 1:
|
65
67
|
resp = _a.sent();
|
66
68
|
return [2 /*return*/, resp.data];
|
@@ -68,7 +70,7 @@ var TestkitsApi = /** @class */ (function () {
|
|
68
70
|
});
|
69
71
|
});
|
70
72
|
};
|
71
|
-
TestkitsApi.prototype.order = function (userKey, testkitId, patientAddress) {
|
73
|
+
TestkitsApi.prototype.order = function (userKey, testkitId, patientAddress, patientDetails) {
|
72
74
|
return __awaiter(this, void 0, void 0, function () {
|
73
75
|
var resp;
|
74
76
|
return __generator(this, function (_a) {
|
@@ -77,6 +79,7 @@ var TestkitsApi = /** @class */ (function () {
|
|
77
79
|
user_key: userKey,
|
78
80
|
testkit_id: testkitId,
|
79
81
|
patient_address: patientAddress,
|
82
|
+
patient_details: patientDetails,
|
80
83
|
})];
|
81
84
|
case 1:
|
82
85
|
resp = _a.sent();
|
package/dist/client/User.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
2
|
-
import { UserKeyResponse, SuccessResponse, ClientFacingUser,
|
2
|
+
import { UserKeyResponse, SuccessResponse, ClientFacingUser, Providers, ProvidersResponse } from './models/user_models';
|
3
3
|
export declare class UserApi {
|
4
4
|
baseURL: string;
|
5
5
|
client: AxiosInstance;
|
@@ -9,6 +9,6 @@ export declare class UserApi {
|
|
9
9
|
getAll(): Promise<Array<ClientFacingUser>>;
|
10
10
|
get(userKey: string): Promise<ClientFacingUser>;
|
11
11
|
resolve(clientUserId: string): Promise<ClientFacingUser>;
|
12
|
-
providers(userKey: string): Promise<
|
12
|
+
providers(userKey: string): Promise<ProvidersResponse>;
|
13
13
|
deregisterProvider(userKey: string, provider: Providers): Promise<SuccessResponse>;
|
14
14
|
}
|
@@ -17,13 +17,13 @@ export interface ClientFacingActivity {
|
|
17
17
|
* @type {number}
|
18
18
|
* @memberof ClientFacingActivity
|
19
19
|
*/
|
20
|
-
|
20
|
+
calories_total: number;
|
21
21
|
/**
|
22
22
|
* Energy consumption caused by the physical activity of the day in kilocalories.::kilocalories
|
23
23
|
* @type {number}
|
24
24
|
* @memberof ClientFacingActivity
|
25
25
|
*/
|
26
|
-
|
26
|
+
calories_active: number;
|
27
27
|
/**
|
28
28
|
* Total number of steps registered during the day.::steps
|
29
29
|
* @type {number}
|
@@ -35,7 +35,7 @@ export interface ClientFacingActivity {
|
|
35
35
|
* @type {number}
|
36
36
|
* @memberof ClientFacingActivity
|
37
37
|
*/
|
38
|
-
|
38
|
+
daily_movement?: number;
|
39
39
|
/**
|
40
40
|
* Number of minutes during the day with low intensity activity (e.g. household work).::minutes
|
41
41
|
* @type {number}
|
@@ -1,17 +1,30 @@
|
|
1
1
|
export interface PatientAdress {
|
2
2
|
receiver_name: string;
|
3
|
-
|
4
|
-
|
3
|
+
street_number: string;
|
4
|
+
street: string;
|
5
5
|
city: string;
|
6
6
|
state: string;
|
7
7
|
zip: string;
|
8
8
|
country: string;
|
9
9
|
phone_number: string;
|
10
10
|
}
|
11
|
+
export interface PatientDetails {
|
12
|
+
dob: string;
|
13
|
+
gender: string;
|
14
|
+
}
|
15
|
+
export interface Marker {
|
16
|
+
name: string;
|
17
|
+
slug: string;
|
18
|
+
description?: string;
|
19
|
+
}
|
11
20
|
export interface Testkit {
|
12
21
|
id: string;
|
13
22
|
name: string;
|
14
23
|
description: string;
|
24
|
+
markers: Marker[];
|
25
|
+
turnaround_time_lower: number;
|
26
|
+
turnaround_time_upper: number;
|
27
|
+
price: number;
|
15
28
|
}
|
16
29
|
export interface Order {
|
17
30
|
id: string;
|