@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
81 lines (80 loc) • 2.92 kB
JavaScript
;
var __webpack_modules__ = {
"@premieroctet/next-admin/schema": function(module) {
module.exports = import("@premieroctet/next-admin/schema").then(function(module) {
return module;
});
}
};
var __webpack_module_cache__ = {};
function __webpack_require__(moduleId) {
var cachedModule = __webpack_module_cache__[moduleId];
if (void 0 !== cachedModule) return cachedModule.exports;
var module = __webpack_module_cache__[moduleId] = {
exports: {}
};
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
(()=>{
__webpack_require__.d = (exports1, definition)=>{
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
enumerable: true,
get: definition[key]
});
};
})();
(()=>{
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
__webpack_require__.r = (exports1)=>{
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
value: 'Module'
});
Object.defineProperty(exports1, '__esModule', {
value: true
});
};
})();
var __webpack_exports__ = {};
(()=>{
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
getResources: ()=>getResources,
getSchema: ()=>getSchema,
initGlobals: ()=>initGlobals
});
let schema = null;
let resources = null;
const initGlobals = async ()=>{
try {
if (schema && resources) return;
const schemaDef = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@premieroctet/next-admin/schema"));
schema = schemaDef.default;
resources = Object.keys(schema.definitions).filter((modelName)=>!schema.definitions[modelName].enum);
} catch (e) {
console.error(e);
throw new Error("Schema not found, make sure you added the generator to your schema.prisma file");
}
};
const getSchema = ()=>{
if (!schema) throw new Error("Schema not initialized");
return schema;
};
const getResources = ()=>{
if (!resources) throw new Error("Resources not initialized");
return resources;
};
})();
exports.getResources = __webpack_exports__.getResources;
exports.getSchema = __webpack_exports__.getSchema;
exports.initGlobals = __webpack_exports__.initGlobals;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
"getResources",
"getSchema",
"initGlobals"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
value: true
});