@spasea/uz-booking-client
Version:
Unofficial UZ api client
42 lines (41 loc) • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const requestable_1 = require("../lib/requestable");
class Coach 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);
}
/**
* List coaches in wagon
* @param {number} from - departure station id
* @param {number} to - target station id
* @param {string} date - departure date
* @param {string} trainNumber - train number
* @param {number} wagonNum - wagon number
* @param {string} wagonType - wagon type
* @param {string} wagonClass - wagon class
* @param {Function} cb - callback function
* @returns {Promise} - the promise for the http request
*/
list(from, to, date, trainNumber, wagonNum, wagonType, wagonClass,
// tslint:disable-next-line
callback) {
return this.request('POST', 'train_wagon/', {
date,
from,
to,
train: trainNumber,
wagonClass,
wagonNum,
wagonType,
}, 'form', false, callback);
}
}
exports.default = Coach;