"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Client = void 0; const Constants_1 = require("./Constants"); const Utils_1 = require("./Utils"); const Requester_1 = require("./Requester"); const Client_1 = require("./Artists/Client"); const Client_2 = require("./Songs/Client"); class Client { constructor(key, config = {}) { var _a; this.key = key; this.config = config; if (!["string", "undefined"].includes(typeof key)) { throw new Error(Constants_1.Constants.INV_TOKEN); } if (!(0, Utils_1.checkConfig)(config)) { throw new Error(Constants_1.Constants.INV_CONFIG_OBJ); } this.songs = new Client_2.SongsClient(this); this.artists = new Client_1.ArtistsClient(this); this.api = new Requester_1.Requester(((_a = this.config.origin) === null || _a === void 0 ? void 0 : _a.api) || Constants_1.Constants.BASE_URL, { headers: { "User-Agent": Constants_1.Constants.DEF_USER_AGENT, Authorization: `Bearer ${this.key}`, }, }); } } exports.Client = Client;