@tryvital/vital-node 1.4.0 → 1.4.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/Link.ts +4 -1
- package/client/Testkits.ts +9 -1
- package/client/Webhooks.ts +1 -1
- package/dist/client/Link.js +9 -12
- package/dist/client/Testkits.d.ts +1 -1
- package/dist/client/Testkits.js +8 -2
- package/dist/client/Webhooks.d.ts +1 -1
- package/package.json +2 -2
package/client/Link.ts
CHANGED
@@ -26,8 +26,11 @@ export class LinkApi {
|
|
26
26
|
user_key: userId,
|
27
27
|
provider,
|
28
28
|
redirect_url,
|
29
|
-
...(filter_on_providers || {}),
|
30
29
|
};
|
30
|
+
if (filter_on_providers) {
|
31
|
+
// @ts-ignore
|
32
|
+
default_params['filter_on_providers'] = filter_on_providers;
|
33
|
+
}
|
31
34
|
const resp = await this.client.post(
|
32
35
|
this.baseURL.concat('/link/token/'),
|
33
36
|
default_params
|
package/client/Testkits.ts
CHANGED
@@ -27,11 +27,19 @@ export class TestkitsApi {
|
|
27
27
|
startDate: Date,
|
28
28
|
endDate: Date,
|
29
29
|
status?: string[],
|
30
|
+
userId?: string,
|
31
|
+
patientName?: string
|
30
32
|
): Promise<OrderResponse> {
|
31
33
|
const resp = await this.client.get(
|
32
34
|
this.baseURL.concat('/testkit/orders/'),
|
33
35
|
{
|
34
|
-
params: {
|
36
|
+
params: {
|
37
|
+
start_date: startDate,
|
38
|
+
end_date: endDate,
|
39
|
+
status: status ? status : null,
|
40
|
+
user_id: userId ? userId : null,
|
41
|
+
patient_name: patientName ? patientName : null,
|
42
|
+
},
|
35
43
|
}
|
36
44
|
);
|
37
45
|
return resp.data;
|
package/client/Webhooks.ts
CHANGED
package/dist/client/Link.js
CHANGED
@@ -1,15 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
3
|
-
__assign = Object.assign || function(t) {
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
-
s = arguments[i];
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
-
t[p] = s[p];
|
8
|
-
}
|
9
|
-
return t;
|
10
|
-
};
|
11
|
-
return __assign.apply(this, arguments);
|
12
|
-
};
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -62,7 +51,15 @@ var LinkApi = /** @class */ (function () {
|
|
62
51
|
return __generator(this, function (_a) {
|
63
52
|
switch (_a.label) {
|
64
53
|
case 0:
|
65
|
-
default_params =
|
54
|
+
default_params = {
|
55
|
+
user_key: userId,
|
56
|
+
provider: provider,
|
57
|
+
redirect_url: redirect_url,
|
58
|
+
};
|
59
|
+
if (filter_on_providers) {
|
60
|
+
// @ts-ignore
|
61
|
+
default_params['filter_on_providers'] = filter_on_providers;
|
62
|
+
}
|
66
63
|
return [4 /*yield*/, this.client.post(this.baseURL.concat('/link/token/'), default_params)];
|
67
64
|
case 1:
|
68
65
|
resp = _a.sent();
|
@@ -5,7 +5,7 @@ export declare class TestkitsApi {
|
|
5
5
|
client: AxiosInstance;
|
6
6
|
constructor(baseURL: string, axios: AxiosInstance);
|
7
7
|
get(): Promise<TestkitResponse>;
|
8
|
-
get_orders(startDate: Date, endDate: Date, status?: string[]): Promise<OrderResponse>;
|
8
|
+
get_orders(startDate: Date, endDate: Date, status?: string[], userId?: string, patientName?: string): Promise<OrderResponse>;
|
9
9
|
order(userId: string, testkitId: string, patientAddress: PatientAdress, patientDetails: PatientDetails): Promise<OrderRequestResponse>;
|
10
10
|
get_order(orderId: string): Promise<Order>;
|
11
11
|
cancel_order(orderId: string): Promise<OrderRequestResponse>;
|
package/dist/client/Testkits.js
CHANGED
@@ -55,13 +55,19 @@ var TestkitsApi = /** @class */ (function () {
|
|
55
55
|
});
|
56
56
|
});
|
57
57
|
};
|
58
|
-
TestkitsApi.prototype.get_orders = function (startDate, endDate, status) {
|
58
|
+
TestkitsApi.prototype.get_orders = function (startDate, endDate, status, userId, patientName) {
|
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
63
|
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/testkit/orders/'), {
|
64
|
-
params: {
|
64
|
+
params: {
|
65
|
+
start_date: startDate,
|
66
|
+
end_date: endDate,
|
67
|
+
status: status ? status : null,
|
68
|
+
user_id: userId ? userId : null,
|
69
|
+
patient_name: patientName ? patientName : null,
|
70
|
+
},
|
65
71
|
})];
|
66
72
|
case 1:
|
67
73
|
resp = _a.sent();
|
@@ -3,5 +3,5 @@ export declare class WebhooksApi {
|
|
3
3
|
baseURL: string;
|
4
4
|
client: AxiosInstance;
|
5
5
|
constructor(baseURL: string, axios: AxiosInstance);
|
6
|
-
constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string):
|
6
|
+
constructWebhookEvent(payload: string, headers: Record<string, string>, secret: string): Record<string, any> | Record<string, any>[];
|
7
7
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tryvital/vital-node",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.4",
|
4
4
|
"description": "Node client for Vital",
|
5
5
|
"author": "maitham",
|
6
6
|
"keywords": [
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"axios": ">=0.21.2",
|
27
27
|
"axios-retry": "^3.2.4",
|
28
28
|
"crypto": "^1.0.1",
|
29
|
-
"svix": "0.
|
29
|
+
"svix": "0.64.2"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
32
|
"@testdeck/mocha": "^0.1.2",
|