UNPKG

screenscraper-js

Version:
29 lines (28 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScreenScraperJS = void 0; const game_1 = require("./game"); const search_1 = require("./search"); const systems_1 = require("./systems"); class ScreenScraperJS { constructor({ devId, devPassword, userName, userPassword, }) { this.searchGames = (params) => (0, search_1.searchGames)(Object.assign(Object.assign({}, params), { devid: this.devid, devpassword: this.devpassword, ssid: this.ssid, sspassword: this.sspassword })); this.getSystems = ({ softwareName } = {}) => (0, systems_1.getSystems)({ softwareName, devid: this.devid, devpassword: this.devpassword, ssid: this.ssid, sspassword: this.sspassword, }); this.getGame = (params) => (0, game_1.getGame)(Object.assign(Object.assign({}, params), { devid: this.devid, devpassword: this.devpassword, ssid: this.ssid, sspassword: this.sspassword })); if (!devId || !devPassword) { throw new Error("devid and devpassword are required"); } this.devid = devId; this.devpassword = devPassword; this.ssid = userName; this.sspassword = userPassword; } } exports.ScreenScraperJS = ScreenScraperJS; exports.default = ScreenScraperJS;