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

infogare-api.js

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infogare-api.js - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

2

package.json
{
"name": "infogare-api.js",
"version": "1.0.5",
"version": "1.0.6",
"main": "src/core/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -256,4 +256,32 @@ const User = require('./User');

}
/**
* Get a train from a station
* @param {string} uid The UID of the user
* @param {string} id The station ID
* @param {string} trainId The train ID
* @returns {Train} The train
*/
async getTrain(uid, id, trainId) {
if (!uid) {
throw new Error('uid is required');
}
if (!id) {
throw new Error('id is required');
}
if (!trainId) {
throw new Error('trainId is required');
}
if (!this.appId) {
throw new Error('appId is required');
}
const response = await fetch(`${App.apiEndpoint}/user/${uid}/gares/${id}/trains/${trainId}?appId=${this.appId}`);
if (!response.ok) {
throw new StationException(response, 'train ' + trainId);
}
const train = new Train(await response.json());
return train;
}
}
module.exports = App;
class Train {
constructor(data) {
this.name = data.name;
this.id = data.id;

@@ -25,6 +24,2 @@ this.alternance = data.alternance;

}
getName() {
return this.name;
}

@@ -31,0 +26,0 @@ getId() {

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