UNPKG

lunify.js

Version:

A basic api wrapper for the spotify api covering the oauth routes.

67 lines 2.19 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.User = exports.PartialUser = void 0; const __1 = require("../.."); const player_1 = require("../player"); __exportStar(require("./Oauth"), exports); class PartialUser { client; oauth; /** * Control user playback */ player; playlists; constructor(client, oauth) { this.client = client; this.oauth = oauth; this.player = new player_1.Player(client, this); this.playlists = new __1.UserPlaylistsManager(client, this); } } exports.PartialUser = PartialUser; class User extends PartialUser { client; oauth; country; displayName; email; explicitContent; externalUrls; followers; url; id; images; product; constructor(client, oauth, data) { super(client, oauth); this.client = client; this.oauth = oauth; this.country = data.country; this.displayName = data.display_name; this.email = data.email; this.explicitContent = { enabled: data.explicit_content?.filter_enabled || null, locked: data.explicit_content?.filter_locked || null }; this.externalUrls = data.external_urls; this.followers = { url: data.followers.href, total: data.followers.total }; this.url = data.href; this.id = data.id; this.images = data.images; this.product = data.product; } } exports.User = User; //# sourceMappingURL=index.js.map