lunify.js
Version:
A basic api wrapper for the spotify api covering the oauth routes.
47 lines • 2.06 kB
JavaScript
;
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 player_1 = require("../player");
__exportStar(require("./Oauth"), exports);
class PartialUser {
constructor(client, oauth) {
this.client = client;
this.oauth = oauth;
this.player = new player_1.Player(client, this);
}
}
exports.PartialUser = PartialUser;
class User extends PartialUser {
constructor(client, oauth, data) {
var _a, _b, _c, _d;
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: ((_a = data.explicit_content) === null || _a === void 0 ? void 0 : _a.filter_enabled) || null, locked: ((_b = data.explicit_content) === null || _b === void 0 ? void 0 : _b.filter_locked) || null };
this.externalUrls = data.external_urls;
this.followers = { url: (_c = data.followers) === null || _c === void 0 ? void 0 : _c.href, total: (_d = data.followers) === null || _d === void 0 ? void 0 : _d.total };
this.url = data.href;
this.id = data.id;
this.images = data.images;
this.product = data.product;
}
}
exports.User = User;
//# sourceMappingURL=index.js.map