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
238
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 0.3.0 to 0.3.1

5

dist/index.js

@@ -52,2 +52,3 @@ "use strict";

var axios_1 = require("axios");
var axios_retry_1 = require("axios-retry");
var client_1 = require("./client");

@@ -63,2 +64,6 @@ var config_1 = require("./lib/config");

var axiosApiInstance = axios_1.default.create();
axios_retry_1.default(axiosApiInstance, {
retries: 3,
retryDelay: axios_retry_1.default.exponentialDelay,
});
axiosApiInstance.interceptors.request.use(function (config) { return __awaiter(_this, void 0, void 0, function () {

@@ -65,0 +70,0 @@ var token;

8

dist/lib/config.js

@@ -15,7 +15,7 @@ "use strict";

baseUrls: {
prod: 'https://api-tryvital-io.relay.evervault.com',
production: 'https://api-tryvital-io.relay.evervault.com',
dev: 'https://api-dev-tryvital-io.relay.evervault.com',
sandbox: 'https://api-sandbox-tryvital-io.relay.evervault.com',
prod: 'https://api.tryvital.io',
production: 'https://api.tryvital.io',
dev: 'https://api.dev.tryvital.io',
sandbox: 'https://api.sandbox.tryvital.io',
},
};

@@ -60,3 +60,6 @@ "use strict";

resp = _a.sent();
return [2 /*return*/, { token: resp.access_token, exp: +new Date() + resp.expires_in }];
return [2 /*return*/, {
token: resp.access_token,
exp: +new Date() + resp.expires_in - 20,
}];
}

@@ -71,3 +74,3 @@ });

currentTime = +new Date();
if (!(!this.accessToken || currentTime > this.accessToken.exp)) return [3 /*break*/, 2];
if (!(!this.accessToken || currentTime >= this.accessToken.exp)) return [3 /*break*/, 2];
_a = this;

@@ -74,0 +77,0 @@ return [4 /*yield*/, this.getAccessToken()];

import axios from 'axios';
import axiosRetry from 'axios-retry';
import {

@@ -34,2 +35,7 @@ ActivityApi,

axiosRetry(axiosApiInstance, {
retries: 3,
retryDelay: axiosRetry.exponentialDelay,
});
axiosApiInstance.interceptors.request.use(

@@ -36,0 +42,0 @@ async (config) => {

@@ -13,7 +13,7 @@ export default {

baseUrls: {
prod: 'https://api-tryvital-io.relay.evervault.com',
production: 'https://api-tryvital-io.relay.evervault.com',
dev: 'https://api-dev-tryvital-io.relay.evervault.com',
sandbox: 'https://api-sandbox-tryvital-io.relay.evervault.com',
prod: 'https://api.tryvital.io',
production: 'https://api.tryvital.io',
dev: 'https://api.dev.tryvital.io',
sandbox: 'https://api.sandbox.tryvital.io',
},
};

@@ -22,3 +22,6 @@ import { AccessToken, ClientConfig } from './models';

});
return { token: resp.access_token, exp: +new Date() + resp.expires_in };
return {
token: resp.access_token,
exp: +new Date() + resp.expires_in - 20,
};
};

@@ -28,3 +31,3 @@

const currentTime = +new Date();
if (!this.accessToken || currentTime > this.accessToken.exp) {
if (!this.accessToken || currentTime >= this.accessToken.exp) {
this.accessToken = await this.getAccessToken();

@@ -31,0 +34,0 @@ return this.accessToken.token;

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

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

"axios": "^0.21.1",
"axios-retry": "^3.2.4",
"crypto": "^1.0.1"

@@ -27,0 +28,0 @@ },

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