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

@tryvital/vital-node

Package Overview
Dependencies
Maintainers
1
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 1.6.4 to 1.6.5

.github/workflows/test-build.yaml

1

client/index.ts

@@ -12,1 +12,2 @@ export { ActivityApi } from './Activity';

export { MealsApi } from './Meals';
export { TestkitsApi } from "./Testkits";

2

client/LabTests.ts

@@ -11,3 +11,3 @@ import { AxiosInstance } from 'axios';

Physician,
} from './models/testkit_models';
} from './models/lab_tests_model';

@@ -14,0 +14,0 @@

@@ -1,7 +0,5 @@

import internal = require("stream");
import { IntegrationKeyOut } from "svix";
export interface PatientAdress {
receiver_name: string;
street: string;
first_line: string;
second_line?: string;
city: string;

@@ -12,3 +10,2 @@ state: string;

phone_number: string;
street_number?: string;
}

@@ -19,15 +16,3 @@

gender: string;
email: string;
}
export interface Physician {
first_name: string;
last_name: string;
npi: string;
email?: string;
licensed_states?: string[];
created_at?: string;
updated_at?: string;
}
export interface Marker {

@@ -49,26 +34,14 @@ name: string;

export interface TestkitEvent {
id: number;
created_at: string;
status: string;
}
export interface Order {
user_id: string;
id: string;
team_id: string;
created_on: Date;
updated_on: Date;
patient_details: PatientDetails;
patient_address: PatientAdress;
lab_test: Testkit;
// TODO CHECK WHAT DETAILS IS
details: Object;
created_at: string;
updated_at: string;
events: TestkitEvent;
user_key?: string;
sample_id?: string;
notes?: string;
status?:
status:
| 'ordered'

@@ -89,4 +62,18 @@ | 'transit_customer'

| "lost";
user_key: string;
testkit_id: string;
testkit: Testkit;
inbound_tracking_number?: string;
outbound_tracking_number?: string;
outbound_courier?: string;
inbound_courier?: string;
}
export interface OrderResponse {
orders: Order[];
total: number;
page: number;
size: number;
}
export interface OrderRequestResponse {

@@ -98,21 +85,2 @@ order: Order;

export interface LabClientFacing {
slug: string;
name: string;
first_line_address: string;
city: string;
zipcode: string;
}
export interface ClientFacingLabTest {
id: string;
slug: string;
name: string;
sample_type: string;
method: string;
price: number;
is_active: boolean;
lab: LabClientFacing;
markers: Marker;
}
export interface TestkitResponse {

@@ -125,15 +93,16 @@ testkits: Testkit[];

dob: string;
clia_number: string;
patient: string;
provider: string;
laboratory: string;
date_reported: string;
date_collected: string;
specimen_number: string;
date_received?: string;
clia?: string;
provider?: string;
laboratory?: string;
date_received?: string;
}
export interface LabResultsResponse {
export interface LabResultsRaw {
metadata: LabResultsMetadata;
results: Object;
}
results: Record<string, string>;
}

@@ -12,1 +12,2 @@ export { ActivityApi } from './Activity';

export { MealsApi } from './Meals';
export { TestkitsApi } from "./Testkits";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MealsApi = exports.DevicesAPI = exports.ProfileApi = exports.LabTestsApi = exports.WorkoutsApi = exports.WebhooksApi = exports.UserApi = exports.SleepApi = exports.LinkApi = exports.BodyApi = exports.ActivityApi = void 0;
exports.TestkitsApi = exports.MealsApi = exports.DevicesAPI = exports.ProfileApi = exports.LabTestsApi = exports.WorkoutsApi = exports.WebhooksApi = exports.UserApi = exports.SleepApi = exports.LinkApi = exports.BodyApi = exports.ActivityApi = void 0;
var Activity_1 = require("./Activity");

@@ -26,1 +26,3 @@ Object.defineProperty(exports, "ActivityApi", { enumerable: true, get: function () { return Activity_1.ActivityApi; } });

Object.defineProperty(exports, "MealsApi", { enumerable: true, get: function () { return Meals_1.MealsApi; } });
var Testkits_1 = require("./Testkits");
Object.defineProperty(exports, "TestkitsApi", { enumerable: true, get: function () { return Testkits_1.TestkitsApi; } });
import { AxiosInstance } from 'axios';
import { ClientFacingLabTest, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician } from './models/testkit_models';
import { ClientFacingLabTest, LabResultsMetadata, LabResultsResponse, Order, OrderRequestResponse, PatientAdress, PatientDetails, Physician } from './models/lab_tests_model';
export declare class OrdersApi {

@@ -4,0 +4,0 @@ baseURL: string;

export interface PatientAdress {
receiver_name: string;
street: string;
first_line: string;
second_line?: string;
city: string;

@@ -9,3 +10,2 @@ state: string;

phone_number: string;
street_number?: string;
}

@@ -15,13 +15,3 @@ export interface PatientDetails {

gender: string;
email: string;
}
export interface Physician {
first_name: string;
last_name: string;
npi: string;
email?: string;
licensed_states?: string[];
created_at?: string;
updated_at?: string;
}
export interface Marker {

@@ -41,23 +31,28 @@ name: string;

}
export interface TestkitEvent {
id: number;
created_at: string;
status: string;
}
export interface Order {
user_id: string;
id: string;
team_id: string;
created_on: Date;
updated_on: Date;
patient_details: PatientDetails;
patient_address: PatientAdress;
lab_test: Testkit;
details: Object;
created_at: string;
updated_at: string;
events: TestkitEvent;
user_key?: string;
sample_id?: string;
notes?: string;
status?: 'ordered' | 'transit_customer' | 'out_for_delivery' | 'with_customer' | 'transit_lab' | 'delivered_to_lab' | 'processing_lab' | 'completed' | 'failure_to_deliver_to_customer' | 'failure_to_deliver_to_lab' | 'cancelled' | 'do_not_process' | 'unknown' | "rejected" | "lost";
status: 'ordered' | 'transit_customer' | 'out_for_delivery' | 'with_customer' | 'transit_lab' | 'delivered_to_lab' | 'processing_lab' | 'completed' | 'failure_to_deliver_to_customer' | 'failure_to_deliver_to_lab' | 'cancelled' | 'do_not_process' | 'unknown' | "rejected" | "lost";
user_key: string;
testkit_id: string;
testkit: Testkit;
inbound_tracking_number?: string;
outbound_tracking_number?: string;
outbound_courier?: string;
inbound_courier?: string;
}
export interface OrderResponse {
orders: Order[];
total: number;
page: number;
size: number;
}
export interface OrderRequestResponse {

@@ -68,20 +63,2 @@ order: Order;

}
export interface LabClientFacing {
slug: string;
name: string;
first_line_address: string;
city: string;
zipcode: string;
}
export interface ClientFacingLabTest {
id: string;
slug: string;
name: string;
sample_type: string;
method: string;
price: number;
is_active: boolean;
lab: LabClientFacing;
markers: Marker;
}
export interface TestkitResponse {

@@ -93,14 +70,15 @@ testkits: Testkit[];

dob: string;
clia_number: string;
patient: string;
provider: string;
laboratory: string;
date_reported: string;
date_collected: string;
specimen_number: string;
date_received?: string;
clia?: string;
provider?: string;
laboratory?: string;
date_received?: string;
}
export interface LabResultsResponse {
export interface LabResultsRaw {
metadata: LabResultsMetadata;
results: Object;
results: Record<string, string>;
}

@@ -1,10 +0,7 @@

import { ActivityApi, BodyApi, LinkApi, SleepApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi, DevicesAPI, MealsApi } from './client';
import { ActivityApi, BodyApi, LinkApi, SleepApi, UserApi, WebhooksApi, WorkoutsApi, ProfileApi, DevicesAPI, MealsApi, TestkitsApi } from './client';
import { ClientConfig } from './lib/models';
import { ClientCredentials } from './lib/credentials';
import { VitalsApi } from './client/Vitals';
import { ProviderApi } from './client/Provider';
import { LabTestsApi } from './client/LabTests';
export declare class VitalClient {
config: ClientConfig;
clientCredentials: ClientCredentials;
Activity: ActivityApi;

@@ -19,3 +16,3 @@ Link: LinkApi;

Vitals: VitalsApi;
LabTests: LabTestsApi;
Testkits: TestkitsApi;
Profile: ProfileApi;

@@ -22,0 +19,0 @@ Providers: ProviderApi;

@@ -55,6 +55,4 @@ "use strict";

var config_1 = require("./lib/config");
var credentials_1 = require("./lib/credentials");
var Vitals_1 = require("./client/Vitals");
var Provider_1 = require("./client/Provider");
var LabTests_1 = require("./client/LabTests");
var VitalClient = /** @class */ (function () {

@@ -65,8 +63,3 @@ function VitalClient(config) {

if (!config.api_key) {
try {
this.clientCredentials = new credentials_1.ClientCredentials(config);
}
catch (error) {
throw new Error("You must provide either an API key or a client ID and secret");
}
throw new Error("You must provide an API key");
}

@@ -86,20 +79,8 @@ var baseURL;

axiosApiInstance.interceptors.request.use(function (config) { return __awaiter(_this, void 0, void 0, function () {
var headers, token;
var headers;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
headers = config.headers;
if (!this.config.api_key) return [3 /*break*/, 1];
headers["x-vital-api-key"] = this.config.api_key;
return [3 /*break*/, 3];
case 1: return [4 /*yield*/, this.clientCredentials.access_token()];
case 2:
token = _a.sent();
headers["Authorization"] = "Bearer " + token;
headers["x-vital-client-id"] = this.config.client_id;
_a.label = 3;
case 3:
config.headers = __assign({}, headers);
return [2 /*return*/, config];
}
headers = config.headers;
headers["x-vital-api-key"] = this.config.api_key;
config.headers = __assign({}, headers);
return [2 /*return*/, config];
});

@@ -118,3 +99,3 @@ }); }, function (error) {

this.Vitals = new Vitals_1.VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
this.LabTests = new LabTests_1.LabTestsApi(baseURL.concat('/v3'), axiosApiInstance);
this.Testkits = new client_1.TestkitsApi(baseURL.concat('/v2'), axiosApiInstance);
this.Profile = new client_1.ProfileApi(baseURL.concat('/v2'), axiosApiInstance);

@@ -121,0 +102,0 @@ this.Providers = new Provider_1.ProviderApi(baseURL.concat('/v2'), axiosApiInstance);

@@ -13,14 +13,12 @@ import axios from 'axios';

DevicesAPI,
MealsApi
MealsApi,
TestkitsApi
} from './client';
import { ClientConfig } from './lib/models';
import CONFIG from './lib/config';
import { ClientCredentials } from './lib/credentials';
import { VitalsApi } from './client/Vitals';
import { ProviderApi } from './client/Provider';
import { LabTestsApi } from './client/LabTests';
export class VitalClient {
config: ClientConfig;
clientCredentials: ClientCredentials;
Activity: ActivityApi;

@@ -35,3 +33,3 @@ Link: LinkApi;

Vitals: VitalsApi;
LabTests: LabTestsApi;
Testkits: TestkitsApi;
Profile: ProfileApi;

@@ -44,7 +42,3 @@ Providers: ProviderApi;

if(!config.api_key){
try {
this.clientCredentials = new ClientCredentials(config);
} catch (error) {
throw new Error("You must provide either an API key or a client ID and secret");
}
throw new Error("You must provide an API key");
}

@@ -67,9 +61,3 @@ let baseURL;

const headers = config.headers;
if(this.config.api_key){
headers["x-vital-api-key"] = this.config.api_key;
} else {
const token = await this.clientCredentials.access_token();
headers["Authorization"] = `Bearer ${token}`;
headers["x-vital-client-id"] = this.config.client_id;
}
headers["x-vital-api-key"] = this.config.api_key;
config.headers = {

@@ -94,3 +82,3 @@ ...headers,

this.Vitals = new VitalsApi(baseURL.concat('/v2'), axiosApiInstance);
this.LabTests = new LabTestsApi(baseURL.concat('/v3'), axiosApiInstance);
this.Testkits = new TestkitsApi(baseURL.concat('/v2'), axiosApiInstance);
this.Profile = new ProfileApi(baseURL.concat('/v2'), axiosApiInstance);

@@ -97,0 +85,0 @@ this.Providers = new ProviderApi(baseURL.concat('/v2'), axiosApiInstance);

{
"name": "@tryvital/vital-node",
"version": "1.6.4",
"version": "1.6.5",
"description": "Node client for Vital",

@@ -25,3 +25,2 @@ "author": "maitham",

"dependencies": {
"auth0": "^2.35.1",
"axios": ">=0.21.2 <1.0.0",

@@ -28,0 +27,0 @@ "axios-retry": "^3.2.4",

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