import { QuirrelClient, } from "./client";
import { registerDevelopmentDefaults } from "./client/config";
registerDevelopmentDefaults({
    applicationPort: 3000,
});
export function Queue(route, handler, options) {
    const quirrel = new 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;
}
export function CronJob(route, cronSchedule, handler, options) {
    return Queue(route, handler, options);
}
//# sourceMappingURL=remix.js.map