"use strict";
/*
* This file will run the local_editor site locally, and set up the needed API endpoints to use it
*
* */
/*
* Blueprint-Scripts CLI - runTrial.(ts/js)
*
* PURPOSE - to run a Blueprint string that is currently saved in a file, and have the data saved into a local folder
* Very basic, just meant to serve as a CLI method to call 'runTrial' essentially. Afterwards, then writes the exact 'Trial'
* to the current directory, so it can be used for other purposes.
*
* Data written out will be be directed to a JSON file by default, but if CSV is desired use --csv (or -c) flag
*
* */
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv = __importStar(require("dotenv"));
const path_1 = __importDefault(require("path"));
const Factory_1 = require("../src/Factory");
const FactoryDatabase_1 = require("../src/FactoryDatabase");
const FactoryLocalBackend_1 = require("../src/FactoryLocalBackend");
dotenv.config();
const bpFile = path_1.default.join(process.cwd(), 'factory/examples/45spm_base.bp');
/*
* CREATE A WAY TO START FACTORY RUNNER WITHOUT INDIVIDUAL VALUES - RATHER, A CONFIG FILE
* specify path, or leave default for 'factory.config.json'
*
* if installed as a package, needs to be easy to use with raw values - dont need to say modlist name, rather list the mods you want to have!
* or scenario - list the scenario name that should be present, no questions asked if it does or not
*
* etc etc
*
* otherwise, API can go from DB mostly and allow user to change things on the frontend
*
* */
function main() {
    return __awaiter(this, void 0, void 0, function* () {
        yield Factory_1.Factory.initialize({
            installDir: '/home/overflow/Apps/factorio_auto_v5',
            hideConsole: false,
            // user info is provided auto-magically from oldenv.txt
        });
        yield FactoryDatabase_1.FactoryDatabase.initialize();
        yield FactoryLocalBackend_1.FactoryLocalBackend.startServer();
    });
}
main().then((t) => __awaiter(void 0, void 0, void 0, function* () {
    console.log('Started');
})).catch((e) => {
    console.error(e);
});
//# sourceMappingURL=runLocalBackend.js.map