#!/usr/bin/env node
import "dotenv/config"; // Load Envars
import Qualiteer from "qualiteer";
import { Initiator, Executor } from "qualiteer/clients";

// Start server
const qltr = new Qualiteer();
await qltr.start();

const url = "https://Qualiteer.elijahparker3.repl.co";

// Create an initiator and make a job request
const primary = new Initiator(url);
const job = { command: ["node", "dev/other.js"], name: "testing", image: "node" };
await primary.newJob(job, null, () => console.log("Primary Job Concluded"));

/*const { clients } = qltr.jobs;
const skId = Object.keys(clients)[0];
const { jobs } = clients[skId];
const serverJob = jobs[0];

const exec = new Executor(url, serverJob);
exec.runJob();
*/
