"use strict";
(() => {
var exports = {};
exports.id = 485;
exports.ids = [485];
exports.modules = {

/***/ 3513:
/***/ ((module) => {

module.exports = require("boolean-parser");

/***/ }),

/***/ 2748:
/***/ ((module) => {

module.exports = require("luxon");

/***/ }),

/***/ 1185:
/***/ ((module) => {

module.exports = require("mongoose");

/***/ }),

/***/ 6555:
/***/ ((module) => {

module.exports = import("uuid");;

/***/ }),

/***/ 8514:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ handler)
/* harmony export */ });
/* harmony import */ var boolean_parser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3513);
/* harmony import */ var boolean_parser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(boolean_parser__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var util_bqToMango__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6499);
/* harmony import */ var mongo_db__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9306);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([mongo_db__WEBPACK_IMPORTED_MODULE_2__]);
mongo_db__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];



async function handler(req, res) {
    const q = Array.isArray(req.query.q) ? req.query.q[0] : req.query.q;
    const m = q ? (0,util_bqToMango__WEBPACK_IMPORTED_MODULE_1__/* .bqToMango */ .D0)(boolean_parser__WEBPACK_IMPORTED_MODULE_0___default().parseBooleanQuery(q), util_bqToMango__WEBPACK_IMPORTED_MODULE_1__/* .jobFacets */ .LA) : null;
    const jobs = await mongo_db__WEBPACK_IMPORTED_MODULE_2__/* .Job.find */ .oI.find({
        ...m ?? {}
    }).populate({
        path: "logs",
        options: {
            sort: {
                createdAt: "desc"
            },
            limit: 1
        }
    }).sort({
        updatedAt: "desc"
    }).exec();
    res.status(200).json({
        jobs
    });
};

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [306,499], () => (__webpack_exec__(8514)));
module.exports = __webpack_exports__;

})();