c3nav
Version:
A c3nav API client
38 lines (37 loc) • 1.71 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LevelListAPI = void 0;
const Endpoints_1 = require("../Endpoints");
const APIBase_1 = require("./APIBase");
/**
* A Level is a Location – so if it is visible, you can use its ID in the Location API as well.
*/
class LevelListAPI extends APIBase_1.APIBase {
constructor(apiClient, options) {
super(apiClient, options);
}
getDetail(id, options) {
return __awaiter(this, void 0, void 0, function* () {
const endpoint = Endpoints_1.Endpoint.Level.levels(id);
const { data } = yield this.apiClient.get(endpoint, { data: options });
return data;
});
}
getList(options) {
return __awaiter(this, void 0, void 0, function* () {
const endpoint = Endpoints_1.Endpoint.Level.levels();
const { data } = yield this.apiClient.get(endpoint, { data: options });
return data;
});
}
}
exports.LevelListAPI = LevelListAPI;