UNPKG

yandex-music

Version:

Creative and progressive Node.js framework for applications that interact with yandex music

50 lines (49 loc) 2.1 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Albums = void 0; const log_decorator_1 = require("../decorators/log.decorator"); const utils_1 = require("../utils"); class Albums { constructor(client) { this.client = client; } /** * Getting an album by its unique ID along with tracks. * @param {Union} id The unique ID of the album. * @returns Album */ async with(id) { return await this.client.request.get(`/albums/${id}/with-tracks`); } /** * Getting the album/albums. * @param {List} ids The unique identifier of the album or albums. * @returns Album or Albums. */ async get(ids) { const [url, params] = (0, utils_1.list)("album", ids); return await this.client.request.get(url, params); } } __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise) ], Albums.prototype, "with", null); __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", [Array]), __metadata("design:returntype", Promise) ], Albums.prototype, "get", null); exports.Albums = Albums;