import { createSwaggerSpec } from 'next-swagger-doc';

export const getApiDocs = async () => {
  const spec = createSwaggerSpec({
    apiFolder: 'src/app/api', // define api folder under app folder
    definition: {
      openapi: '3.0.0',
      info: {
        title: 'Maddy Panel API',
        version: '1.0',
      },
      components: {
        securitySchemes: {
          api_key: {
            type: 'http',
            scheme: 'bearer',
            name: 'API key',
          },
        },
      },
      security: [],
    },
  });
  return spec;
};