From 009d2893704cf5edb6d4a95b55a28d08a1cfb6ce Mon Sep 17 00:00:00 2001 From: BolverBlitz Date: Sun, 10 Mar 2024 07:45:55 +0100 Subject: [PATCH] Added line to Departures --- index.js | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4cd8556..625cb43 100644 --- a/index.js +++ b/index.js @@ -130,6 +130,7 @@ class openvgn { * This will list all departures from a given stop. * @param {String} target Stop ID or VAG haltid * @param {Object} parameter Quary parameter + * @param {String} [parameter.Line] Only return departures of one line * @param {String} [parameter.Product] Only return departures of one or multiple products * @param {Number} [parameter.TimeSpan] Return departures until that time * @param {Number} [parameter.TimeDelay] Look for now + x in minutes @@ -142,6 +143,8 @@ class openvgn { source = "vag"; }; let url = `${this.api_url}/abfahrten.json/${source}/${target}`; + if(parameter.Line) url = `${url}/${parameter.Line}`; + if (parameter) { url = `${url}?${this.#encodeQueryData(parameter, "Departures")}`; }; diff --git a/package.json b/package.json index 3c751c3..4712da6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oepnv-nuremberg", - "version": "0.3.1", + "version": "0.3.2", "description": "A wrapper for multiple datapoints from VAG and VGN", "main": "index.js", "scripts": {