@tryvital/vital-node 2.1.8 → 2.1.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/LabTests.ts +11 -0
- package/client/index.ts +1 -0
- package/dist/client/LabTests.d.ts +1 -0
- package/dist/client/LabTests.js +17 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/index.ts +3 -0
- package/package.json +1 -1
package/client/LabTests.ts
CHANGED
@@ -48,6 +48,17 @@ export class OrdersApi {
|
|
48
48
|
return resp.data;
|
49
49
|
}
|
50
50
|
|
51
|
+
public async getOrders(page?: number, size?: number): Promise<Order[]> {
|
52
|
+
const resp = await this.client.get(
|
53
|
+
this.baseURL.concat(`/orders?`) +
|
54
|
+
new URLSearchParams({
|
55
|
+
page: page ? page.toString() : '1',
|
56
|
+
size: size ? size.toString() : '50',
|
57
|
+
})
|
58
|
+
);
|
59
|
+
return resp.data;
|
60
|
+
}
|
61
|
+
|
51
62
|
// Cancels order.
|
52
63
|
public async cancelOrder(orderId: string): Promise<OrderRequestResponse> {
|
53
64
|
const resp = await this.client.post(
|
package/client/index.ts
CHANGED
@@ -7,6 +7,7 @@ export { WebhooksApi } from './Webhooks';
|
|
7
7
|
export { WorkoutsApi } from './Workouts';
|
8
8
|
export { AtHomePhlebotomyApi } from './AtHomePhlebotomy';
|
9
9
|
export { LabTestsApi } from './LabTests';
|
10
|
+
export { OrdersApi } from './LabTests';
|
10
11
|
export { ProfileApi } from './Profile';
|
11
12
|
export { DevicesAPI } from './Devices';
|
12
13
|
export { MealsApi } from './Meals';
|
@@ -6,6 +6,7 @@ export declare class OrdersApi {
|
|
6
6
|
constructor(baseURL: string, axios: AxiosInstance);
|
7
7
|
create_order(user_id: string, patient_details: PatientDetails, patient_address: PatientAdress, lab_test_id: string, physician?: Physician, health_insurance?: HealthInsurance): Promise<OrderRequestResponse>;
|
8
8
|
getOrder(orderId: string): Promise<Order>;
|
9
|
+
getOrders(page?: number, size?: number): Promise<Order[]>;
|
9
10
|
cancelOrder(orderId: string): Promise<OrderRequestResponse>;
|
10
11
|
}
|
11
12
|
export declare class ResultsApi {
|
package/dist/client/LabTests.js
CHANGED
@@ -77,6 +77,23 @@ var OrdersApi = /** @class */ (function () {
|
|
77
77
|
});
|
78
78
|
});
|
79
79
|
};
|
80
|
+
OrdersApi.prototype.getOrders = function (page, size) {
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
82
|
+
var resp;
|
83
|
+
return __generator(this, function (_a) {
|
84
|
+
switch (_a.label) {
|
85
|
+
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat("/orders?") +
|
86
|
+
new URLSearchParams({
|
87
|
+
page: page ? page.toString() : '1',
|
88
|
+
size: size ? size.toString() : '50',
|
89
|
+
}))];
|
90
|
+
case 1:
|
91
|
+
resp = _a.sent();
|
92
|
+
return [2 /*return*/, resp.data];
|
93
|
+
}
|
94
|
+
});
|
95
|
+
});
|
96
|
+
};
|
80
97
|
// Cancels order.
|
81
98
|
OrdersApi.prototype.cancelOrder = function (orderId) {
|
82
99
|
return __awaiter(this, void 0, void 0, function () {
|
package/dist/client/index.d.ts
CHANGED
@@ -7,6 +7,7 @@ export { WebhooksApi } from './Webhooks';
|
|
7
7
|
export { WorkoutsApi } from './Workouts';
|
8
8
|
export { AtHomePhlebotomyApi } from './AtHomePhlebotomy';
|
9
9
|
export { LabTestsApi } from './LabTests';
|
10
|
+
export { OrdersApi } from './LabTests';
|
10
11
|
export { ProfileApi } from './Profile';
|
11
12
|
export { DevicesAPI } from './Devices';
|
12
13
|
export { MealsApi } from './Meals';
|
package/dist/client/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.TestkitsApi = exports.MealsApi = exports.DevicesAPI = exports.ProfileApi = exports.LabTestsApi = exports.AtHomePhlebotomyApi = exports.WorkoutsApi = exports.WebhooksApi = exports.UserApi = exports.SleepApi = exports.LinkApi = exports.BodyApi = exports.ActivityApi = void 0;
|
3
|
+
exports.TestkitsApi = exports.MealsApi = exports.DevicesAPI = exports.ProfileApi = exports.OrdersApi = exports.LabTestsApi = exports.AtHomePhlebotomyApi = exports.WorkoutsApi = exports.WebhooksApi = exports.UserApi = exports.SleepApi = exports.LinkApi = exports.BodyApi = exports.ActivityApi = void 0;
|
4
4
|
var Activity_1 = require("./Activity");
|
5
5
|
Object.defineProperty(exports, "ActivityApi", { enumerable: true, get: function () { return Activity_1.ActivityApi; } });
|
6
6
|
var Body_1 = require("./Body");
|
@@ -19,6 +19,8 @@ var AtHomePhlebotomy_1 = require("./AtHomePhlebotomy");
|
|
19
19
|
Object.defineProperty(exports, "AtHomePhlebotomyApi", { enumerable: true, get: function () { return AtHomePhlebotomy_1.AtHomePhlebotomyApi; } });
|
20
20
|
var LabTests_1 = require("./LabTests");
|
21
21
|
Object.defineProperty(exports, "LabTestsApi", { enumerable: true, get: function () { return LabTests_1.LabTestsApi; } });
|
22
|
+
var LabTests_2 = require("./LabTests");
|
23
|
+
Object.defineProperty(exports, "OrdersApi", { enumerable: true, get: function () { return LabTests_2.OrdersApi; } });
|
22
24
|
var Profile_1 = require("./Profile");
|
23
25
|
Object.defineProperty(exports, "ProfileApi", { enumerable: true, get: function () { return Profile_1.ProfileApi; } });
|
24
26
|
var Devices_1 = require("./Devices");
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ActivityApi, AtHomePhlebotomyApi, BodyApi, LinkApi, SleepApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi, DevicesAPI, MealsApi, LabTestsApi } from './client';
|
1
|
+
import { ActivityApi, AtHomePhlebotomyApi, BodyApi, LinkApi, SleepApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi, DevicesAPI, MealsApi, LabTestsApi, OrdersApi } from './client';
|
2
2
|
import { ClientConfig } from './lib/models';
|
3
3
|
import { VitalsApi } from './client/Vitals';
|
4
4
|
import { ProviderApi } from './client/Provider';
|
@@ -14,6 +14,7 @@ export declare class VitalClient {
|
|
14
14
|
Webhooks: WebhooksApi;
|
15
15
|
Vitals: VitalsApi;
|
16
16
|
LabTests: LabTestsApi;
|
17
|
+
Orders: OrdersApi;
|
17
18
|
AtHomePhlebotomy: AtHomePhlebotomyApi;
|
18
19
|
Profile: ProfileApi;
|
19
20
|
Providers: ProviderApi;
|
package/dist/index.js
CHANGED
@@ -94,6 +94,7 @@ var VitalClient = /** @class */ (function () {
|
|
94
94
|
this.Webhooks = new client_1.WebhooksApi(baseURL.concat('/v2'), axiosApiInstance);
|
95
95
|
this.Vitals = new Vitals_1.VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
|
96
96
|
this.LabTests = new client_1.LabTestsApi(baseURL.concat('/v3'), axiosApiInstance);
|
97
|
+
this.Orders = new client_1.OrdersApi(baseURL.concat('/v3'), axiosApiInstance);
|
97
98
|
this.AtHomePhlebotomy = new client_1.AtHomePhlebotomyApi(baseURL.concat('/v3'), axiosApiInstance);
|
98
99
|
this.Profile = new client_1.ProfileApi(baseURL.concat('/v2'), axiosApiInstance);
|
99
100
|
this.Providers = new Provider_1.ProviderApi(baseURL.concat('/v2'), axiosApiInstance);
|
package/index.ts
CHANGED
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
DevicesAPI,
|
14
14
|
MealsApi,
|
15
15
|
LabTestsApi,
|
16
|
+
OrdersApi,
|
16
17
|
} from './client';
|
17
18
|
import { ClientConfig } from './lib/models';
|
18
19
|
import CONFIG from './lib/config';
|
@@ -31,6 +32,7 @@ export class VitalClient {
|
|
31
32
|
Webhooks: WebhooksApi;
|
32
33
|
Vitals: VitalsApi;
|
33
34
|
LabTests: LabTestsApi;
|
35
|
+
Orders: OrdersApi;
|
34
36
|
AtHomePhlebotomy: AtHomePhlebotomyApi;
|
35
37
|
Profile: ProfileApi;
|
36
38
|
Providers: ProviderApi;
|
@@ -78,6 +80,7 @@ export class VitalClient {
|
|
78
80
|
this.Webhooks = new WebhooksApi(baseURL.concat('/v2'), axiosApiInstance);
|
79
81
|
this.Vitals = new VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
|
80
82
|
this.LabTests = new LabTestsApi(baseURL.concat('/v3'), axiosApiInstance);
|
83
|
+
this.Orders = new OrdersApi(baseURL.concat('/v3'), axiosApiInstance);
|
81
84
|
this.AtHomePhlebotomy = new AtHomePhlebotomyApi(
|
82
85
|
baseURL.concat('/v3'),
|
83
86
|
axiosApiInstance
|