"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),query_1=require("@b/utils/query");exports.metadata={summary:"Retrieves all roles",operationId:"getRoles",tags:["Auth"],description:"Retrieves all roles",requiresAuth:!1,responses:{200:{description:"Roles retrieved successfully",content:{"application/json":{schema:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"ID of the role"},name:{type:"string",description:"Name of the role"},permissions:{type:"array",items:{type:"object",properties:{id:{type:"string",description:"ID of the permission"},name:{type:"string",description:"Name of the permission"}},required:["id","name"]}}},required:["id","name","permissions"]}}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Role"),500:query_1.serverErrorResponse}};exports.default=async()=>(await db_1.models.role.findAll({include:[{model:db_1.models.permission,as:"permissions",through:{attributes:[]},attributes:["id","name"]}]})).map(e=>e.get({plain:!0}));