UNPKG

@spasea/uz-booking-client

Version:
38 lines (37 loc) 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const requestable_1 = require("../lib/requestable"); class Wagon extends requestable_1.default { /** * Construct station class. * @param {string} [lang] - language * @param {auth} [auth] - the credentials to authenticate to UzBoojking. If auth is * not provided requests will be made unauthenticated * @param {string} [apiBase] - the base UzBooking API URL */ constructor(lang, auth, apiBase) { super(lang, auth, apiBase, true); } /** * Find station by name * @param {number} from - departure station id * @param {number} to - target station id * @param {string} date - departure date * @param {string} trainNumber - train number * @param {string} wagonType - wagon type * @param {Function} callback - callback function * @returns {Promise} - the promise for the http request */ list(from, to, date, trainNumber, wagonType, // tslint:disable-next-line callback) { return this.request('POST', 'train_wagons/', { date, from, to, train: trainNumber, wagon_type_id: wagonType, }, 'form', false, callback); } } exports.default = Wagon;