"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CronJob = exports.Queue = void 0;
const client_1 = require("./client");
const config_1 = require("./client/config");
(0, config_1.registerDevelopmentDefaults)({
    applicationPort: 3000,
});
function Queue(route, handler, options) {
    const quirrel = new client_1.QuirrelClient({
        options,
        handler,
        route,
    });
    async function action({ request }) {
        const body = await request.text();
        const response = await quirrel.respondTo(body, Object.fromEntries(request.headers.entries()));
        return new Response(response.body, {
            headers: response.headers,
            status: response.status,
        });
    }
    action.enqueue = (payload, options) => quirrel.enqueue(payload, options);
    action.enqueueMany = (jobs) => quirrel.enqueueMany(jobs);
    action.delete = (jobId) => quirrel.delete(jobId);
    action.invoke = (jobId) => quirrel.invoke(jobId);
    action.get = () => quirrel.get();
    action.getById = (jobId) => quirrel.getById(jobId);
    return action;
}
exports.Queue = Queue;
function CronJob(route, cronSchedule, handler, options) {
    return Queue(route, handler, options);
}
exports.CronJob = CronJob;
//# sourceMappingURL=remix.js.map