Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tryvital/vital-node

Package Overview
Dependencies
Maintainers
3
Versions
239
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryvital/vital-node - npm Package Compare versions

Comparing version 2.1.6 to 2.1.7

16

client/LabTests.ts
import { AxiosInstance } from 'axios';
import {
AreaInfo,
ClientFacingLabTest,
HealthInsurance,
LabResultsMetadata,

@@ -27,3 +29,4 @@ LabResultsResponse,

lab_test_id: string,
physician?: Physician
physician?: Physician,
health_insurance?: HealthInsurance
): Promise<OrderRequestResponse> {

@@ -36,2 +39,3 @@ const resp = await this.client.post(this.baseURL.concat('/order'), {

physician: physician ? physician : null,
health_insurance: health_insurance ? health_insurance : null,
});

@@ -92,2 +96,12 @@ return resp.data;

}
// GET lab-testing information about a geographical area,
// such as whether the area is served by our Phlebotomy network.
public async getAreaInfo(zip_code: string): Promise<AreaInfo> {
const resp = await this.client.get(
this.baseURL.concat('/area/info?') +
new URLSearchParams({ zip_code: zip_code })
);
return resp.data;
}
}

@@ -94,0 +108,0 @@

@@ -14,5 +14,12 @@ import { SourceClientFacing } from './user_models';

* @memberof ClientFacingActivity
* @deprecated Use calendar_date instead
*/
date: Date;
/**
* Date for specified record (YYYY-MM-DD)
* @type {String}
* @memberof ClientFacingActivity
*/
calendar_date: string;
/**
* Total energy consumption during the day including Basal Metabolic Rate in kilocalories.::kilocalories

@@ -29,2 +36,8 @@ * @type {number}

calories_active: number;
/**
* Number of floors climbed by the user::count
* @type {number}
* @memberof ClientFacingActivity
*/
floors_climbed?: number;
/**

@@ -61,2 +74,8 @@ * Total number of steps registered during the day.::steps

/**
* Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
* @type {number}
* @memberof ClientFacingActivity
*/
timezone_offset?: number;
/**
* Source the data has come from.

@@ -63,0 +82,0 @@ * @type {SourceClientFacing}

@@ -20,2 +20,12 @@ export interface PatientAdress {

export interface HealthInsurance {
front_image: Image;
back_image: Image;
}
export interface Image {
content: string;
content_type: 'image/jpeg' | 'image/jpg' | 'image/png';
}
export interface Physician {

@@ -55,3 +65,3 @@ first_name: string;

patient_address: PatientAdress;
physician: Physician
physician: Physician;
lab_test: Testkit;

@@ -130,1 +140,10 @@ // TODO CHECK WHAT DETAILS IS

}
export interface AreaInfo {
zip_code: string;
phlebotomy: PhlebotomyAreaInfo;
}
export interface PhlebotomyAreaInfo {
is_served: boolean;
}

@@ -20,5 +20,12 @@ import { TimeseriesPoint } from './activity';

* @memberof ClientFacingSleep
* @deprecated Use calendar_date instead
*/
date: Date;
/**
* Date for specified record (YYYY-MM-DD). This generally matches the sleep end date.
* @type {String}
* @memberof ClientFacingSleep
*/
calendar_date: string;
/**
* UTC Time when the sleep period started

@@ -120,2 +127,8 @@ * @type {Date}

/**
* Average skin temperature.::celcius
* @type {number}
* @memberof ClientFacingSleep
*/
skin_temperature?: number;
/**
* Source the data has come from.

@@ -122,0 +135,0 @@ * @type {SourceClientFacing}

@@ -61,2 +61,8 @@ import { SourceClientFacing } from './user_models';

/**
* Date for specified record (YYYY-MM-DD)
* @type {String}
* @memberof ClientFacingWorkout
*/
calendar_date: string;
/**
* Calories burned during the workout::kCal

@@ -157,2 +163,8 @@ * @type {number}

map?: string;
/**
* Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
* @type {number}
* @memberof ClientFacingActivity
*/
timezone_offset?: number;
}

@@ -159,0 +171,0 @@

@@ -28,2 +28,47 @@ import { AxiosInstance } from 'axios';

public async bloodOxygen(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string,
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'blood_oxygen',
startDate,
endDate,
provider
);
}
public async bloodPressure(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string,
): Promise<TimeseriesBloodPressurePoint[]> {
return this.timeseriesData<TimeseriesBloodPressurePoint>(
userId,
'blood_pressure',
startDate,
endDate,
provider
);
}
public async caffeine(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'caffeine',
startDate,
endDate,
provider
);
}
public async cholesterol(

@@ -60,2 +105,47 @@ type: 'ldl' | 'total' | 'triglycerides' | 'hdl',

public async heartrate(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'heartrate',
startDate,
endDate,
provider
);
}
public async hrv(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'hrv',
startDate,
endDate,
provider
);
}
public async hypnogram(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'hypnogram',
startDate,
endDate,
provider
);
}
public async ige(

@@ -79,3 +169,3 @@ userId: string,

public async heartrate(
public async mindfulnessMinutes(
userId: string,

@@ -88,3 +178,3 @@ startDate: Date,

userId,
'heartrate',
'mindfulness_minutes',
startDate,

@@ -96,12 +186,26 @@ endDate,

public async bloodOxygen(
public async respiratoryRate(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'respiratory_rate',
startDate,
endDate,
provider
);
}
public async steps(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'blood_oxygen',
'steps',
startDate,

@@ -113,12 +217,11 @@ endDate,

public async bloodPressure(
public async water(
userId: string,
startDate: Date,
endDate?: Date,
provider?: string,
): Promise<TimeseriesBloodPressurePoint[]> {
return this.timeseriesData<TimeseriesBloodPressurePoint>(
provider?: string
): Promise<TimeseriesPoint[]> {
return this.timeseriesData(
userId,
'blood_pressure',
'water',
startDate,

@@ -125,0 +228,0 @@ endDate,

5

dist/client/LabTests.d.ts
import { AxiosInstance } from 'axios';
import { ClientFacingLabTest, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician } from './models/lab_tests_model';
import { AreaInfo, ClientFacingLabTest, HealthInsurance, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician } from './models/lab_tests_model';
export declare class OrdersApi {

@@ -7,3 +7,3 @@ baseURL: string;

constructor(baseURL: string, axios: AxiosInstance);
create_order(user_id: string, patient_details: PatientDetails, patient_address: PatientAdress, lab_test_id: string, physician?: Physician): Promise<OrderRequestResponse>;
create_order(user_id: string, patient_details: PatientDetails, patient_address: PatientAdress, lab_test_id: string, physician?: Physician, health_insurance?: HealthInsurance): Promise<OrderRequestResponse>;
getOrder(orderId: string): Promise<Order>;

@@ -19,2 +19,3 @@ cancelOrder(orderId: string): Promise<OrderRequestResponse>;

getResultsMetadata(orderId: string): Promise<LabResultsMetadata>;
getAreaInfo(zip_code: string): Promise<AreaInfo>;
}

@@ -21,0 +22,0 @@ export declare class LabTestsApi {

@@ -46,3 +46,3 @@ "use strict";

// Create new order
OrdersApi.prototype.create_order = function (user_id, patient_details, patient_address, lab_test_id, physician) {
OrdersApi.prototype.create_order = function (user_id, patient_details, patient_address, lab_test_id, physician, health_insurance) {
return __awaiter(this, void 0, void 0, function () {

@@ -58,2 +58,3 @@ var resp;

physician: physician ? physician : null,
health_insurance: health_insurance ? health_insurance : null,
})];

@@ -147,2 +148,18 @@ case 1:

};
// GET lab-testing information about a geographical area,
// such as whether the area is served by our Phlebotomy network.
ResultsApi.prototype.getAreaInfo = function (zip_code) {
return __awaiter(this, void 0, void 0, function () {
var resp;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.client.get(this.baseURL.concat('/area/info?') +
new URLSearchParams({ zip_code: zip_code }))];
case 1:
resp = _a.sent();
return [2 /*return*/, resp.data];
}
});
});
};
return ResultsApi;

@@ -149,0 +166,0 @@ }());

@@ -13,5 +13,12 @@ import { SourceClientFacing } from './user_models';

* @memberof ClientFacingActivity
* @deprecated Use calendar_date instead
*/
date: Date;
/**
* Date for specified record (YYYY-MM-DD)
* @type {String}
* @memberof ClientFacingActivity
*/
calendar_date: string;
/**
* Total energy consumption during the day including Basal Metabolic Rate in kilocalories.::kilocalories

@@ -29,2 +36,8 @@ * @type {number}

/**
* Number of floors climbed by the user::count
* @type {number}
* @memberof ClientFacingActivity
*/
floors_climbed?: number;
/**
* Total number of steps registered during the day.::steps

@@ -60,6 +73,12 @@ * @type {number}

/**
* Source the data has come from.
* @type {SourceClientFacing}
* Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
* @type {number}
* @memberof ClientFacingActivity
*/
timezone_offset?: number;
/**
* Source the data has come from.
* @type {SourceClientFacing}
* @memberof ClientFacingActivity
*/
source: SourceClientFacing;

@@ -66,0 +85,0 @@ user_id: string;

@@ -18,2 +18,10 @@ export interface PatientAdress {

}
export interface HealthInsurance {
front_image: Image;
back_image: Image;
}
export interface Image {
content: string;
content_type: 'image/jpeg' | 'image/jpg' | 'image/png';
}
export interface Physician {

@@ -102,1 +110,8 @@ first_name: string;

}
export interface AreaInfo {
zip_code: string;
phlebotomy: PhlebotomyAreaInfo;
}
export interface PhlebotomyAreaInfo {
is_served: boolean;
}

@@ -19,5 +19,12 @@ import { TimeseriesPoint } from './activity';

* @memberof ClientFacingSleep
* @deprecated Use calendar_date instead
*/
date: Date;
/**
* Date for specified record (YYYY-MM-DD). This generally matches the sleep end date.
* @type {String}
* @memberof ClientFacingSleep
*/
calendar_date: string;
/**
* UTC Time when the sleep period started

@@ -119,2 +126,8 @@ * @type {Date}

/**
* Average skin temperature.::celcius
* @type {number}
* @memberof ClientFacingSleep
*/
skin_temperature?: number;
/**
* Source the data has come from.

@@ -121,0 +134,0 @@ * @type {SourceClientFacing}

@@ -59,2 +59,8 @@ import { SourceClientFacing } from './user_models';

/**
* Date for specified record (YYYY-MM-DD)
* @type {String}
* @memberof ClientFacingWorkout
*/
calendar_date: string;
/**
* Calories burned during the workout::kCal

@@ -150,2 +156,8 @@ * @type {number}

map?: string;
/**
* Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
* @type {number}
* @memberof ClientFacingActivity
*/
timezone_offset?: number;
}

@@ -152,0 +164,0 @@ export interface ClientWorkoutResponse {

@@ -8,9 +8,16 @@ import { AxiosInstance } from 'axios';

private timeseriesData;
bloodOxygen(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
bloodPressure(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesBloodPressurePoint[]>;
caffeine(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
cholesterol(type: 'ldl' | 'total' | 'triglycerides' | 'hdl', userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
glucose(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
heartrate(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
hrv(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
hypnogram(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
ige(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
igg(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
heartrate(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
bloodOxygen(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
bloodPressure(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesBloodPressurePoint[]>;
mindfulnessMinutes(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
respiratoryRate(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
steps(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
water(userId: string, startDate: Date, endDate?: Date, provider?: string): Promise<TimeseriesPoint[]>;
}

@@ -60,2 +60,23 @@ "use strict";

};
VitalsApi.prototype.bloodOxygen = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'blood_oxygen', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.bloodPressure = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'blood_pressure', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.caffeine = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'caffeine', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.cholesterol = function (type, userId, startDate, endDate, provider) {

@@ -75,2 +96,23 @@ return __awaiter(this, void 0, void 0, function () {

};
VitalsApi.prototype.heartrate = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'heartrate', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.hrv = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'hrv', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.hypnogram = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'hypnogram', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.ige = function (userId, startDate, endDate, provider) {

@@ -90,25 +132,32 @@ return __awaiter(this, void 0, void 0, function () {

};
VitalsApi.prototype.heartrate = function (userId, startDate, endDate, provider) {
VitalsApi.prototype.mindfulnessMinutes = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'heartrate', startDate, endDate, provider)];
return [2 /*return*/, this.timeseriesData(userId, 'mindfulness_minutes', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.bloodOxygen = function (userId, startDate, endDate, provider) {
VitalsApi.prototype.respiratoryRate = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'blood_oxygen', startDate, endDate, provider)];
return [2 /*return*/, this.timeseriesData(userId, 'respiratory_rate', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.bloodPressure = function (userId, startDate, endDate, provider) {
VitalsApi.prototype.steps = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'blood_pressure', startDate, endDate, provider)];
return [2 /*return*/, this.timeseriesData(userId, 'steps', startDate, endDate, provider)];
});
});
};
VitalsApi.prototype.water = function (userId, startDate, endDate, provider) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.timeseriesData(userId, 'water', startDate, endDate, provider)];
});
});
};
return VitalsApi;
}());
exports.VitalsApi = VitalsApi;
{
"name": "@tryvital/vital-node",
"version": "2.1.6",
"version": "2.1.7",
"description": "Node client for Vital",

@@ -58,2 +58,2 @@ "author": "maitham",

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc