osu-api-extended
Version:
Advanced osu! api wrapper cover all V2 and V1 endpoints, and provide useful tools
33 lines (32 loc) • 1.75 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.changelogs_details = void 0;
const handleErrors_1 = require("../../utility/handleErrors");
const request_1 = require("../../utility/request");
const changelogs_details = (params, addons) => __awaiter(void 0, void 0, void 0, function* () {
if ((params === null || params === void 0 ? void 0 : params.stream_name) == null) {
return (0, handleErrors_1.handleErrors)(new Error(`Specify stream name`));
}
;
if ((params === null || params === void 0 ? void 0 : params.build_version) == null) {
return (0, handleErrors_1.handleErrors)(new Error(`Specify build version`));
}
;
const data = yield (0, request_1.request)(`https://osu.ppy.sh/api/v2/changelog/${params.stream_name}/${params.build_version}`, {
method: 'GET',
addons,
});
if (data.error)
return (0, handleErrors_1.handleErrors)(new Error(data.error));
return data;
});
exports.changelogs_details = changelogs_details;
;