"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const cache_1=require("@b/utils/cache"),query_1=require("@b/utils/query"),console_1=require("@b/utils/console");exports.metadata={summary:"Retrieves the application settings",description:"This endpoint retrieves the application settings.",operationId:"getSettings",tags:["Settings"],requiresAuth:!1,responses:{200:{description:"Application settings retrieved successfully",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:{key:{type:"string",description:"Setting key"},value:{type:"string",description:"Setting value"}}}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Settings"),500:query_1.serverErrorResponse}};exports.default=async()=>{try{const e=cache_1.CacheManager.getInstance(),t=Array.from((await e.getSettings()).entries()).map(([e,t])=>({key:e,value:t}));return{settings:t,extensions:Array.from((await e.getExtensions()).keys())}}catch(e){console_1.logger.error("SETTINGS","Error fetching settings and extensions",e);return query_1.serverErrorResponse}};