"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: 5173,
});
function Queue(route, handler, options) {
    const quirrel = new client_1.QuirrelClient({
        options,
        handler,
        route,
    });
    async function svelteHandler({ request }) {
        const { body, headers, status } = await quirrel.respondTo(await request.text(), request.headers);
        return new Response(body, { headers, status });
    }
    svelteHandler.enqueue = (payload, options) => quirrel.enqueue(payload, options);
    svelteHandler.enqueueMany = (jobs) => quirrel.enqueueMany(jobs);
    svelteHandler.delete = (jobId) => quirrel.delete(jobId);
    svelteHandler.invoke = (jobId) => quirrel.invoke(jobId);
    svelteHandler.get = () => quirrel.get();
    svelteHandler.getById = (jobId) => quirrel.getById(jobId);
    return svelteHandler;
}
exports.Queue = Queue;
function CronJob(route, cronSchedule, handler, options) {
    return Queue(route, handler, options);
}
exports.CronJob = CronJob;
//# sourceMappingURL=sveltekit.js.map