UNPKG

@5minds/processcube_engine

Version:

The ProcessCube Engine. Stores and executes BPMNs.

55 lines (49 loc) 1.47 kB
const swaggerJsdoc = require('swagger-jsdoc'); const path = require('path'); const fs = require('fs'); const restSettingsPath = path.join(__dirname, '..', 'src', 'Contracts', 'ApiRestSettings.ts'); const sdkPath = path.join(__dirname, '..', 'node_modules', '@5minds', 'processcube_engine_sdk', 'dist', '**', '*.d.ts'); const apiPaths = [restSettingsPath, sdkPath]; const targetPath = path.join(__dirname, '..', 'docs', 'swagger', 'swagger.json'); const options = { failOnErrors: true, definition: { openapi: '3.0.0', info: { title: '5Minds ProcessCube Engine API', version: '1.0', description: 'This is the swagger ui documentation of the 5Minds ProcessCube Engine API.', license: { name: 'MIT', }, contact: { name: '5Minds IT-Solutions GmbH & Co. KG', }, }, components: { securitySchemes: { bearerAuth: { type: 'http', in: 'header', scheme: 'bearer', description: 'An Identity Token is required to make requests against the API.\nDummy token: ZHVtbXlfdG9rZW4=', }, }, schemas: {}, }, servers: [ { description: 'current', url: '/atlas_engine/api/v1', }, ], security: [ { bearerAuth: [], }, ], }, apis: apiPaths, }; const openapiSpecification = swaggerJsdoc(options); fs.writeFileSync(targetPath, JSON.stringify(openapiSpecification, null, 2));