"use strict";async function getPages(){return(await db_1.models.page.findAll({where:{status:!0}})).map(e=>e.get({plain:!0}))}Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;exports.getPages=getPages;const db_1=require("@b/db"),redis_1=require("@b/utils/redis"),redis=redis_1.RedisSingleton.getInstance(),query_1=require("@b/utils/query"),utils_1=require("./utils");exports.metadata={summary:"Lists all pages",description:"Fetches a comprehensive list of all pages available on the platform.",operationId:"listAllPages",tags:["Page"],requiresAuth:!1,responses:{200:{description:"Pages retrieved successfully",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:utils_1.basePageSchema}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Pages"),500:query_1.serverErrorResponse}};exports.default=async()=>{try{const e=await redis.get("pages");if(e)return JSON.parse(e)}catch(e){console.error("Redis error:",e)}const e=await getPages();await redis.set("pages",JSON.stringify(e),"EX",43200);return e};