Feat: es modules (#139)
* All file imports change from commonjs to es-module * Improved plex error responses back from api * Converted viewHistory to es module * Es-module requires file extension, updated all imports * Fix esmodule not having __dirname defined in scope * Replace dynamic-require with fs readFileSync * Short message service module function is exported as default * Resolved lint issues & ignore import/extension rule until typescript * All tests file imports changed from commonjs to es-module * Import json fixtures with new helper
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
const Plex = require("src/plex/plex");
|
||||
const configuration = require("src/config/configuration").getInstance();
|
||||
const plex = new Plex(configuration.get("plex", "ip"));
|
||||
const establishedDatabase = require("src/database/database");
|
||||
import Plex from "../src/plex/plexRepository";
|
||||
import establishedDatabase from "../src/database/database";
|
||||
import Configuration from "../src/config/configuration";
|
||||
|
||||
const configuration = Configuration.getInstance();
|
||||
const plex = new Plex(
|
||||
configuration.get("plex", "ip"),
|
||||
configuration.get("plex", "token")
|
||||
);
|
||||
|
||||
const queries = {
|
||||
getRequestsNotYetInPlex: `SELECT * FROM requests WHERE status = 'requested' OR status = 'downloading'`,
|
||||
|
||||
Reference in New Issue
Block a user