2024-10-28 23:27:40 +05:30
import swaggerJSDoc from 'swagger-jsdoc' ;
import path from 'path' ;
const options = {
definition : {
openapi : '3.0.0' ,
info : {
title : 'Maxun API Documentation' ,
version : '1.0.0' ,
2024-12-11 14:53:18 +05:30
description : 'Maxun lets you get the data your robot extracted and run robots via API. All you need to do is input the Maxun API key by clicking Authorize below.' ,
2024-10-28 23:27:40 +05:30
} ,
2024-10-28 23:45:15 +05:30
components : {
securitySchemes : {
2024-10-28 23:59:07 +05:30
api_key : {
2024-10-28 23:45:15 +05:30
type : 'apiKey' ,
in : 'header' ,
name : 'x-api-key' ,
description : 'API key for authorization. You can find your API key in the "API Key" section on Maxun Dashboard.' ,
} ,
} ,
} ,
security : [
{
2024-10-28 23:59:07 +05:30
api_key : [ ] , // Apply this security scheme globally
2024-10-28 23:45:15 +05:30
} ,
] ,
2024-10-28 23:27:40 +05:30
} ,
2024-10-30 21:06:39 +05:30
apis : process.env.NODE_ENV === 'production' ? [ path . join ( __dirname , '../api/*.js' ) ] : [ path . join ( __dirname , '../api/*.ts' ) ]
2024-10-28 23:27:40 +05:30
} ;
const swaggerSpec = swaggerJSDoc ( options ) ;
export default swaggerSpec ;