UNPKG

yandex-music

Version:

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

87 lines (86 loc) 3.34 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.Landing = void 0; const log_decorator_1 = require("../decorators/log.decorator"); class Landing { constructor(client) { this.client = client; } /** * Getting a landing page containing blocks with new releases, charts, playlists with new products, etc. * @param {block} blocks A block or a list of blocks required for issuing. * @returns Landing page. */ async get(blocks) { const params = { blocks }; return await this.client.request.get(`/landing3`, params); } /** * Getting the chart. * @returns Chart. */ async chart() { return await this.client.request.get(`/landing3/chart`); } /** * Getting a complete list of all new releases (albums). * @returns List of new albums. */ async releases() { return await this.client.request.get(`/landing3/new-releases`); } /** * Getting a complete list of all new playlists. * @returns A list of new playlists. */ async playlists() { return await this.client.request.get(`/landing3/new-playlists`); } /** * Getting podcasts from the landing page. * @returns List of podcasts. */ async podcasts() { return await this.client.request.get(`/landing3/podcasts`); } } __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", Promise) ], Landing.prototype, "get", null); __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], Landing.prototype, "chart", null); __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], Landing.prototype, "releases", null); __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], Landing.prototype, "playlists", null); __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], Landing.prototype, "podcasts", null); exports.Landing = Landing;