{"_id":"@bytedocs/nestjs","_rev":"2-8d01015b529bd8e636d184a3689f45a7","name":"@bytedocs/nestjs","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@bytedocs/nestjs","version":"1.0.0","keywords":["nestjs","api","documentation","swagger","openapi","bytedocs","auto-detect","ai"],"author":{"name":"ByteDocs Dev Team","email":"bytedocs.dev@gmail.com"},"license":"MIT","_id":"@bytedocs/nestjs@1.0.0","maintainers":[{"name":"aibnuhibban","email":"abd.ibnuhibban@gmail.com"}],"homepage":"https://github.com/idnexacloud/bytedocs-nestjs#readme","bugs":{"url":"https://github.com/idnexacloud/bytedocs-nestjs/issues"},"dist":{"shasum":"24e5c3efe22413565428dac045a3cfc78eb2976f","tarball":"https://registry.npmjs.org/@bytedocs/nestjs/-/nestjs-1.0.0.tgz","fileCount":40,"integrity":"sha512-swZxNnz/s2NRHAq7oZUXItHJh5oaBp46qOPYsKZHOWJxg/2IPzol4Ws60V/n6TSm389Jl6QX5UtyG2EX/Hw4DQ==","signatures":[{"sig":"MEUCIE1hY0quAG5kv4N7ly21dx/czTy9BA3A4/Vz8nch+adWAiEAgHZVBpuGOLsDQ36YY4R3jmQzVmcawn2/jkC1ZmH4kWs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":571350},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"5532d6d7592d60301026131f7740bc029813c065","scripts":{"dev":"tsc --watch","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"aibnuhibban","email":"abd.ibnuhibban@gmail.com"},"repository":{"url":"git+https://github.com/idnexacloud/bytedocs-nestjs.git","type":"git"},"_npmVersion":"10.7.0","description":"Alternative to Swagger with better design, auto-detection, and AI integration for NestJS","directories":{},"_nodeVersion":"20.15.1","dependencies":{"rxjs":"^7.8.0","axios":"^1.6.0","js-yaml":"^4.1.0","handlebars":"^4.7.8","typescript":"^5.0.0","@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0","reflect-metadata":"^0.1.13","@nestjs/platform-express":"^10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0","@types/express":"^4.17.17","@types/js-yaml":"^4.0.9"},"peerDependencies":{"@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs_1.0.0_1762152627544_0.08335974090432474","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bytedocs/nestjs","version":"1.0.1","description":"Alternative to Swagger with better design, auto-detection, and AI integration for NestJS","main":"dist/index.js","types":"dist/index.d.ts","keywords":["nestjs","api","documentation","swagger","openapi","bytedocs","auto-detect","ai"],"license":"MIT","author":{"name":"ByteDocs Dev Team","email":"bytedocs.dev@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/idnexacloud/bytedocs-nestjs.git"},"scripts":{"build":"tsc","dev":"tsc --watch","prepublishOnly":"npm run build"},"dependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0","@nestjs/platform-express":"^10.0.0","axios":"^1.6.0","handlebars":"^4.7.8","js-yaml":"^4.1.0","reflect-metadata":"^0.1.13","rxjs":"^7.8.0","typescript":"^5.0.0"},"devDependencies":{"@types/express":"^4.17.17","@types/js-yaml":"^4.0.9","@types/node":"^20.0.0","typescript":"^5.0.0"},"peerDependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0"},"_id":"@bytedocs/nestjs@1.0.1","gitHead":"a2b4664b2cca39a2538a316a0b8f5360697f8f85","bugs":{"url":"https://github.com/idnexacloud/bytedocs-nestjs/issues"},"homepage":"https://github.com/idnexacloud/bytedocs-nestjs#readme","_nodeVersion":"20.15.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-3A2c/faYE39FW165rbpY4M78xiiZjjTd8tt4A03iL8FGirpq/q/jkm+yBQsPMtJ926NWKSfaiWQQzVUoZC8B7A==","shasum":"af73d5d9cc8cb11853e108b8ddf76d10ee053a01","tarball":"https://registry.npmjs.org/@bytedocs/nestjs/-/nestjs-1.0.1.tgz","fileCount":40,"unpackedSize":571350,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAu0dVedE78XxmMUH3v58HKRzAudluuZVqEbeEFFxTzrAiAzNf3ge41PWfiYkf7KEQ3QjPlpNAOgUhwarfOdV8zHxA=="}]},"_npmUser":{"name":"aibnuhibban","email":"abd.ibnuhibban@gmail.com"},"directories":{},"maintainers":[{"name":"aibnuhibban","email":"abd.ibnuhibban@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs_1.0.1_1762279313036_0.4350470869698124"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-03T06:50:27.470Z","modified":"2025-11-04T18:01:53.474Z","1.0.0":"2025-11-03T06:50:27.779Z","1.0.1":"2025-11-04T18:01:53.229Z"},"bugs":{"url":"https://github.com/idnexacloud/bytedocs-nestjs/issues"},"author":{"name":"ByteDocs Dev Team","email":"bytedocs.dev@gmail.com"},"license":"MIT","homepage":"https://github.com/idnexacloud/bytedocs-nestjs#readme","keywords":["nestjs","api","documentation","swagger","openapi","bytedocs","auto-detect","ai"],"repository":{"type":"git","url":"git+https://github.com/idnexacloud/bytedocs-nestjs.git"},"description":"Alternative to Swagger with better design, auto-detection, and AI integration for NestJS","maintainers":[{"name":"aibnuhibban","email":"abd.ibnuhibban@gmail.com"}],"readme":"# ByteDocs NestJS Package\n\n[![npm version](https://badge.fury.io/js/@bytedocs%2Fnestjs.svg)](https://badge.fury.io/js/@bytedocs%2Fnestjs)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**ByteDocs NestJS** is a modern alternative to Swagger with better design, auto-detection, and AI integration for NestJS applications. It automatically generates beautiful API documentation from your NestJS routes with zero configuration required.\n\n## Features\n\n- 🚀 **Auto Route Detection** - Automatically discovers and documents all your NestJS routes using AST parsing\n- 🔍 **Deep Object Detection** - Automatically detects and displays nested object structures, DTOs, and entities\n- 📄 **OpenAPI YAML Export** - Export complete OpenAPI 3.0 spec in YAML format with one click\n- 🎨 **Beautiful Modern UI** - Clean, responsive interface with dark mode support\n- 🤖 **AI Integration** - Built-in AI assistant to help users understand your API\n- 📱 **Mobile Responsive** - Works perfectly on all device sizes\n- 📊 **OpenAPI Compatible** - Generates standard OpenAPI 3.0 specifications with zero validation errors\n- ⚡ **Zero Configuration** - Works out of the box with sensible defaults\n- 🔧 **Highly Customizable** - Configure everything to match your needs\n\n## Installation\n\nInstall the package via npm:\n\n```bash\nnpm install @bytedocs/nestjs\n```\n\n## Quick Start\n\n### 1. Import and Configure the Module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { ByteDocsModule } from '@bytedocs/nestjs';\n\n@Module({\n  imports: [\n    ByteDocsModule.forRoot({\n      title: 'My API Documentation',\n      version: '1.0.0',\n      description: 'Comprehensive API for my application',\n      baseURLs: [\n        { name: 'Production', url: 'https://api.myapp.com' },\n        { name: 'Development', url: 'http://localhost:3000' },\n      ],\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### 2. Access Your Documentation\n\nByteDocs automatically detects all your routes! Just visit `/docs` to see your documentation.\n\n### 3. Enhance with Decorators (Optional)\n\nUse ByteDocs decorators to enhance your documentation:\n\n```typescript\nimport { Controller, Get, Post, Body, Param } from '@nestjs/common';\nimport {\n  ApiDoc,\n  ApiParameter,\n  ApiRequestBody,\n  ApiResponse\n} from '@bytedocs/nestjs';\n\n@Controller('users')\nexport class UsersController {\n  @Get()\n  @ApiDoc('Get all users', 'Retrieve a paginated list of users')\n  @ApiParameter('page', {\n    in: 'query',\n    type: 'number',\n    required: false,\n    description: 'Page number for pagination'\n  })\n  @ApiParameter('limit', {\n    in: 'query',\n    type: 'number',\n    required: false,\n    description: 'Number of users per page'\n  })\n  @ApiResponse(200, {\n    description: 'List of users',\n    example: { data: [], meta: { total: 0 } }\n  })\n  async findAll(@Query() query: any) {\n    // Your implementation\n  }\n\n  @Post()\n  @ApiDoc('Create a new user')\n  @ApiRequestBody({\n    description: 'User data',\n    example: { name: 'John Doe', email: 'john@example.com' }\n  })\n  @ApiResponse(201, {\n    description: 'User created successfully',\n    example: { id: 1, name: 'John Doe', email: 'john@example.com' }\n  })\n  async create(@Body() createUserDto: any) {\n    // Your implementation\n  }\n\n  @Get(':id')\n  @ApiDoc('Get user by ID')\n  @ApiParameter('id', {\n    in: 'path',\n    type: 'number',\n    required: true,\n    description: 'User ID'\n  })\n  async findOne(@Param('id') id: string) {\n    // Your implementation\n  }\n}\n```\n\n## Configuration\n\n### Basic Configuration\n\n```typescript\nByteDocsModule.forRoot({\n  title: 'My API Documentation',\n  version: '1.0.0',\n  description: 'Comprehensive API for my application',\n\n  baseURLs: [\n    { name: 'Production', url: 'https://api.myapp.com' },\n    { name: 'Staging', url: 'https://staging-api.myapp.com' },\n    { name: 'Local', url: 'http://localhost:3000' },\n  ],\n\n  docsPath: '/docs',\n  autoDetect: true,\n  excludePaths: ['health', 'metrics'],\n})\n```\n\n### AI Integration\n\nEnable AI assistance for your API documentation:\n\n```typescript\nByteDocsModule.forRoot({\n  title: 'My API Documentation',\n\n  aiConfig: {\n    enabled: true,\n    provider: 'openai', // openai, gemini, claude, openrouter\n    apiKey: process.env.BYTEDOCS_AI_API_KEY,\n\n    features: {\n      chatEnabled: true,\n      model: 'gpt-4o-mini',\n      maxTokens: 1000,\n      temperature: 0.7,\n    },\n  },\n})\n```\n\nAdd to your `.env` file:\n\n```env\nBYTEDOCS_AI_API_KEY=sk-your-api-key-here\n```\n\n### UI Customization\n\n```typescript\nByteDocsModule.forRoot({\n  title: 'My API Documentation',\n\n  uiConfig: {\n    theme: 'auto', // light, dark, auto\n    showTryIt: true,\n    showSchemas: true,\n    customCss: '/assets/custom-docs.css',\n    favicon: '/assets/api-favicon.ico',\n  },\n})\n```\n\n## API Endpoints\n\nOnce installed, ByteDocs provides these endpoints:\n\n- `GET /docs` - Main documentation interface\n- `GET /docs/api-data.json` - Raw documentation data\n- `GET /docs/openapi.json` - OpenAPI 3.0 specification\n- `POST /docs/chat` - AI chat endpoint (if enabled)\n\n## Environment Variables\n\n```env\n# AI Configuration (optional)\nBYTEDOCS_AI_API_KEY=sk-your-key-here\n```\n\n## Available Decorators\n\n### Route Documentation\n- `@ApiDoc(summary, description?)` - Document endpoint with summary and description\n- `@ApiTags(...tags)` - Add tags to group endpoints\n- `@ApiDeprecated(reason?)` - Mark endpoint as deprecated\n- `@ApiExclude()` - Exclude endpoint from documentation\n\n### Parameters\n- `@ApiParameter(name, options)` - Document a single parameter\n- `@ApiParameters(parameters[])` - Document multiple parameters\n\n### Request/Response\n- `@ApiRequestBody(options)` - Document request body\n- `@ApiResponse(statusCode, options)` - Document a response\n- `@ApiResponses(responses[])` - Document multiple responses\n\n## Supported AI Providers\n\n### OpenAI\n```typescript\naiConfig: {\n  provider: 'openai',\n  apiKey: process.env.OPENAI_API_KEY,\n  features: {\n    model: 'gpt-4o-mini', // or gpt-4, gpt-3.5-turbo\n  },\n}\n```\n\n### Google Gemini (Coming Soon)\n```typescript\naiConfig: {\n  provider: 'gemini',\n  apiKey: process.env.GEMINI_API_KEY,\n  features: {\n    model: 'gemini-1.5-flash',\n  },\n}\n```\n\n### Claude (Coming Soon)\n```typescript\naiConfig: {\n  provider: 'claude',\n  apiKey: process.env.ANTHROPIC_API_KEY,\n  features: {\n    model: 'claude-3-sonnet-20240229',\n  },\n}\n```\n\n## Requirements\n\n- Node.js 16+\n- NestJS 10+\n\n## Migration from Swagger\n\nByteDocs can work alongside existing Swagger documentation. Simply install and configure ByteDocs, and it will automatically detect your routes without interfering with existing Swagger decorators.\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Support\n\n- 📖 [Documentation](https://github.com/idnexacloud/bytedocs-node)\n- 🐛 [Report Issues](https://github.com/idnexacloud/bytedocs-node/issues)\n- 💬 [Discussions](https://github.com/idnexacloud/bytedocs-node/discussions)","readmeFilename":"README.md"}