{"_id":"@asad_dev/leo-generator","_rev":"6-97b1c74818322ad5f9561a6e21161d9d","name":"@asad_dev/leo-generator","dist-tags":{"latest":"1.7.1"},"versions":{"1.6.0":{"name":"@asad_dev/leo-generator","version":"1.6.0","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","_id":"@asad_dev/leo-generator@1.6.0","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"homepage":"https://github.com/unknow69/leo-generator#readme","bugs":{"url":"https://github.com/unknow69/leo-generator/issues"},"bin":{"leo-generate":"dist/index.js"},"dist":{"shasum":"28e8be881b844a874fd9434f1c75190d40f597e6","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.6.0.tgz","fileCount":38,"integrity":"sha512-uqWsGIi3LnA1+w1ZO+G66p+6hpTMVgl5/77L5KoR/0Wgg8pwXxtfGc/9QyC6BnrZaohf+Qj1pC47BMw8dJ50ag==","signatures":[{"sig":"MEYCIQDbouopwPXksJeT7U+EmyFHZ/iuafxwRrphWKB+bQLLcQIhAIwz7v5B5+1yDQ0mpTmSUd3Rv9m3l8Wb3JcXLwNwzZal","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":200839},"main":"dist/index.js","gitHead":"fdd968a5f31322fd77215402fc2bbddcdc6832a7","scripts":{"build":"tsc && npm run copy-templates","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\"","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build"},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"repository":{"url":"git+https://github.com/unknow69/leo-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5","@types/handlebars":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/leo-generator_1.6.0_1766900641241_0.6520948480778137","host":"s3://npm-registry-packages-npm-production"}},"1.6.1":{"name":"@asad_dev/leo-generator","version":"1.6.1","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","_id":"@asad_dev/leo-generator@1.6.1","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"homepage":"https://github.com/unknow69/leo-generator#readme","bugs":{"url":"https://github.com/unknow69/leo-generator/issues"},"bin":{"leo-generate":"dist/index.js"},"dist":{"shasum":"61dff3440edfee49a41227475392fa7e32ac07f3","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.6.1.tgz","fileCount":38,"integrity":"sha512-fMO42vS60o1cTv7Irfmcy+KMFrfjfhtXvdfiGQIqPIrzMbtA1d1k7OGvhSNfgqlc4B3R5ptcpz97aMLyy96oMQ==","signatures":[{"sig":"MEUCIQDOyNgmak6x/KJAWy0PRCdVLQCsJt8e0h5Tn6amt7Fz5AIgdBwttzB2HaTo8NC1sEea1YbjecFs4yFawf/XiOEUs3U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203041},"main":"dist/index.js","gitHead":"5512437c3081404182e76447d43e393e9ee3507f","scripts":{"build":"tsc && npm run copy-templates","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\"","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build"},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"repository":{"url":"git+https://github.com/unknow69/leo-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5","@types/handlebars":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/leo-generator_1.6.1_1766902334187_0.8419066506321222","host":"s3://npm-registry-packages-npm-production"}},"1.6.2":{"name":"@asad_dev/leo-generator","version":"1.6.2","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","_id":"@asad_dev/leo-generator@1.6.2","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"homepage":"https://github.com/unknow69/leo-generator#readme","bugs":{"url":"https://github.com/unknow69/leo-generator/issues"},"bin":{"leo-generate":"dist/index.js"},"dist":{"shasum":"d3133d8b3c2a6675d79d9aacd6a9606b0c8f17f5","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.6.2.tgz","fileCount":38,"integrity":"sha512-CK7kYuVjmhE5aByhFLxA4QllEcbJOzyOy9mtRgytZ9WyF8kBODtNv94g2x3loAkqQKTa+OLi9bkQz3joXnfu8g==","signatures":[{"sig":"MEQCIFxhu8/hQniMXcI6HIe3cyhbtsiF0aESjPK+y/1N7MxXAiAhxs4lAhzq9m9B5CSOwp+bCjEQO2Js157AnmWC0glpPA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203603},"main":"dist/index.js","gitHead":"5512437c3081404182e76447d43e393e9ee3507f","scripts":{"build":"tsc && npm run copy-templates","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\"","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build"},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"repository":{"url":"git+https://github.com/unknow69/leo-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5","@types/handlebars":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/leo-generator_1.6.2_1766904467148_0.9381279251438548","host":"s3://npm-registry-packages-npm-production"}},"1.6.3":{"name":"@asad_dev/leo-generator","version":"1.6.3","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","_id":"@asad_dev/leo-generator@1.6.3","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"homepage":"https://github.com/Asaduzzama-n/module-generator#readme","bugs":{"url":"https://github.com/Asaduzzama-n/module-generator/issues"},"bin":{"leo-generate":"dist/index.js"},"dist":{"shasum":"2e62882e299740bcad17e092bd01e86c2de00410","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.6.3.tgz","fileCount":38,"integrity":"sha512-7jZN/yOPGHNGGzK9OyTRLIYrITAGzlDSG7fW1rRqDy2sXUUpHYFPyZP1TPbDBJcvse+0U2x/Tkew/R1j+O7qiQ==","signatures":[{"sig":"MEUCIQCeUKsjGu9YjQZ0qpADgnKxjOUTXT7OY2a62fPK919bIAIgAXMwmE+9innFYG3EUWQvlBJ9hZFHZG0n9NrGgs/OwRY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203624},"main":"dist/index.js","gitHead":"8b0d78d3b3dcd65c418158c5a370084514adbb74","scripts":{"build":"tsc && npm run copy-templates","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\"","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build"},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"repository":{"url":"git+https://github.com/Asaduzzama-n/module-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5","@types/handlebars":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/leo-generator_1.6.3_1766904901400_0.5775973444451536","host":"s3://npm-registry-packages-npm-production"}},"1.7.0":{"name":"@asad_dev/leo-generator","version":"1.7.0","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","_id":"@asad_dev/leo-generator@1.7.0","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"homepage":"https://github.com/Asaduzzama-n/module-generator#readme","bugs":{"url":"https://github.com/Asaduzzama-n/module-generator/issues"},"bin":{"leo-generate":"dist/index.js"},"dist":{"shasum":"c087ba9218a5af46ccf01574668fca022d379913","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.7.0.tgz","fileCount":38,"integrity":"sha512-ZNfxBu0FohglDfUU7r7MVXVR5ctqROUZdvdTCfQCHycm8cyApWCuzjoc51CEkPpTf3QVEPk3+16049TzEKjX7w==","signatures":[{"sig":"MEYCIQDRDXCmqHO+4mV7uCbkwSxM5zvzbaiXVJ4T2ZfI2/YJJgIhAP+B+L7pLZc3Pe2r1LuGkh7587yBsWn+vGbl+B3/+pTg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":211312},"main":"dist/index.js","gitHead":"8b0d78d3b3dcd65c418158c5a370084514adbb74","scripts":{"build":"tsc && npm run copy-templates","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\"","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build"},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"repository":{"url":"git+https://github.com/Asaduzzama-n/module-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","directories":{},"_nodeVersion":"22.21.1","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5","@types/handlebars":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/leo-generator_1.7.0_1766906845734_0.3111059891126873","host":"s3://npm-registry-packages-npm-production"}},"1.7.1":{"name":"@asad_dev/leo-generator","version":"1.7.1","description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","main":"dist/index.js","bin":{"leo-generate":"dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/Asaduzzama-n/module-generator.git"},"homepage":"https://github.com/Asaduzzama-n/module-generator#readme","bugs":{"url":"https://github.com/Asaduzzama-n/module-generator/issues"},"scripts":{"build":"tsc && npm run copy-templates","copy-templates":"if not exist dist\\templates mkdir dist\\templates && xcopy /E /I /Y src\\templates\\*.hbs dist\\templates\\","prepublishOnly":"npm run build","postinstall":"node -e \"try { require('fs').chmodSync(require('path').join(__dirname, 'dist/index.js'), '755') } catch(e) {}\""},"keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"author":{"name":"Asaduzzaman"},"license":"MIT","dependencies":{"commander":"^11.1.0","handlebars":"^4.7.8"},"devDependencies":{"@types/node":"^20.10.5","@types/handlebars":"^4.1.0","typescript":"^5.3.3"},"_id":"@asad_dev/leo-generator@1.7.1","gitHead":"dcc4928119ee9d0c905f1aa3db36cb7def9baddb","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-5nTWS6MDnspFg/8fR/gmCXDIB5lBC3WfYGkY0x6XvDXqqojTL4XtXO/LCcQPcYKOTUIkZSXtJcof2fWcLz9jng==","shasum":"bbf94cea6599af5e70ba1a7274d5d909f3bfe133","tarball":"https://registry.npmjs.org/@asad_dev/leo-generator/-/leo-generator-1.7.1.tgz","fileCount":38,"unpackedSize":211846,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDgJOUNG54M98yqtAk03ntMLjdTCf91qQTMyUFxk/rGaAiEAxrAft0ciy9FvxROPfCtW7iIcQyJpBurISbJEa9tlQ04="}]},"_npmUser":{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"},"directories":{},"maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/leo-generator_1.7.1_1766907251169_0.87482056746587"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-28T05:44:01.167Z","modified":"2025-12-28T07:34:11.494Z","1.6.0":"2025-12-28T05:44:01.381Z","1.6.1":"2025-12-28T06:12:14.345Z","1.6.2":"2025-12-28T06:47:47.272Z","1.6.3":"2025-12-28T06:55:01.546Z","1.7.0":"2025-12-28T07:27:25.882Z","1.7.1":"2025-12-28T07:34:11.314Z"},"bugs":{"url":"https://github.com/Asaduzzama-n/module-generator/issues"},"author":{"name":"Asaduzzaman"},"license":"MIT","homepage":"https://github.com/Asaduzzama-n/module-generator#readme","keywords":["leo","messi","goat","express","mongoose","generator","module","cli","postman","swagger","api","documentation","typescript","crud"],"repository":{"type":"git","url":"git+https://github.com/Asaduzzama-n/module-generator.git"},"description":"Enhanced Express module generator with Mongoose models, automated Postman Cloud sync, and Swagger documentation","maintainers":[{"name":"asad_dev","email":"asaduzzaman.dev1@gmail.com"}],"readme":"# Leo Generate - Enhanced Module Generator (v1.7.1)\r\n\r\nA powerful, production-ready module generator for Express.js applications with Mongoose models, automated Postman Cloud sync, and Swagger documentation.\r\n\r\n\r\n## 🚀 Features\r\n\r\n### Core Module Generation\r\n- 📁 Complete folder structure with TypeScript support\r\n- 🧩 Advanced TypeScript interfaces with nested types\r\n- 🔄 Mongoose models with complex schema support\r\n- 🎮 Production-ready Express controllers with pagination\r\n- 🛠️ Enhanced service layer with error handling\r\n- 🛣️ RESTful routes with validation middleware\r\n- ✅ Zod validation with nested object support\r\n- ✅ Zod validation with nested object support\r\n- 🎨 Clean and consistent code structure\r\n- 🚮 Optional file cleanup on delete (with `--file:true`)\r\n\r\n### Advanced Field Support\r\n- 🔣 Enum fields with predefined values\r\n- 🏗️ Complex nested objects and arrays\r\n- 📊 Array of objects with defined structures\r\n- 🔗 ObjectId references with auto-population\r\n- 📁 File upload handling\r\n- 🔍 Search and pagination support\r\n\r\n### Smart Documentation Generation\r\n- 📮 **Automatic Postman Collections** - Generate complete API collections\r\n- ☁️ **Automated Postman Sync** - Automatically sync APIs to Postman Cloud collections\r\n- 📖 **Swagger Documentation** - Auto-generate OpenAPI 3.0 specs\r\n- 🔄 **Intelligent Documentation Updates** - Analyzes your code changes and updates docs accordingly\r\n- 🧠 **Code-Aware Parsing** - Reads both interface and model files for accurate field extraction\r\n- 📂 **Organized Output** - Separate folders for documentation types\r\n- ⚡ **Dynamic Values** - Pre-request scripts auto-generate random values for testing\r\n- ✅ **100% Syntax Support** - Handles ALL field types the generator can create\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm install @asad_dev/leo-generator --global\r\n```\r\n\r\nOr use with npx:\r\n\r\n```bash\r\nnpx leo-generate\r\n```\r\n\r\n## 🎯 Quick Start\r\n\r\n### Basic Module Generation\r\n\r\n```bash\r\n# Primary command (recommended)\r\nleo-generate generate User name:string email:string age:number\r\n\r\n# Short alias\r\nleo-generate g User name:string email:string\r\n\r\n# Legacy support (still works)\r\nleo-generate User name:string email:string age:number\r\n```\r\n\r\n## 📋 **Quick Command Reference**\r\n\r\n| Command | Purpose | Example |\r\n|---------|---------|---------|\r\n| `generate <name> [fields...]` | Create new module | `leo-generate generate User name:string email:string` |\r\n| `g <name> [fields...]` | Short alias for generate | `leo-generate g Product name:string price:number` |\r\n| `update-docs` | Update all documentation | `leo-generate update-docs` |\r\n| `docs` | Short alias for update-docs | `leo-generate docs` |\r\n| `pull-postman` | Fetch collection from cloud | `leo-generate pull-postman` |\r\n| `<name> [fields...]` | Legacy syntax | `leo-generate User name:string email:string` |\r\n\r\n### **Common Options**\r\n- `--no-postman` - Skip Postman collection generation\r\n- `--no-swagger` - Skip Swagger documentation generation  \r\n- `--postman-dir <path>` - Custom Postman output directory\r\n- `--swagger-file <path>` - Custom Swagger file path\r\n- `--modules-dir <path>` - Custom modules directory\r\n\r\nThis creates:\r\n\r\n```\r\nsrc/app/modules/user/\r\n├── user.interface.ts   // Enhanced TypeScript interfaces\r\n├── user.model.ts      // Mongoose model with validation\r\n├── user.controller.ts // Production-ready controllers\r\n├── user.service.ts    // Enhanced service layer\r\n├── user.route.ts      // RESTful routes\r\n├── user.validation.ts // Zod validation schemas\r\n└── user.constants.ts  // Constants\r\n\r\npostman/\r\n└── user.postman_collection.json  // Auto-generated Postman collection\r\n\r\nswagger.json  // Updated with new endpoints\r\n```\r\n\r\n## 🛠️ Commands\r\n\r\n### Generate Module\r\n```bash\r\nleo-generate generate <ModuleName> [fields...] [options]\r\n\r\n# Options:\r\n--no-postman          # Skip Postman collection generation\r\n--no-swagger          # Skip Swagger documentation\r\n--postman-dir <path>  # Custom Postman output directory\r\n--swagger-file <path> # Custom Swagger file path\r\n--modules-dir <path>  # Custom modules directory\r\n--routes-file <path>  # Custom routes file\r\n--file:true           # Enable file upload support (generates async cleanup helpers)\r\n--skip <files...>     # Skip specific file types (e.g., interface model constants)\r\n```\r\n\r\n### Smart Documentation Updates\r\n```bash\r\n# Intelligently updates documentation for all existing modules\r\nleo-generate update-docs\r\n\r\n# Aliases:\r\nleo-generate docs\r\n\r\n# The system automatically:\r\n# ✅ Scans all modules in your project\r\n# ✅ Reads both interface and model files  \r\n# ✅ Extracts current field definitions\r\n# ✅ Generates accurate Postman collections\r\n# ✅ Updates Swagger documentation\r\n# ✅ Handles complex nested structures\r\n# ✅ Preserves enum values and references\r\n\r\n# Options:\r\n--modules-dir <path>  # Path to modules directory\r\n--no-postman          # Skip Postman updates\r\n--no-swagger          # Skip Swagger updates\r\n--postman-dir <path>  # Custom Postman output directory\r\n--swagger-file <path> # Custom Swagger file path\r\n```\r\n\r\n## 🏗️ Advanced Examples\r\n\r\n### Complex Nested Structures\r\n\r\n```bash\r\n# E-commerce Order with nested items\r\nleo-generate generate Order \\\r\n  customer:objectid:User \\\r\n  items:array:object:name:string:price:number:quantity:number \\\r\n  status:enum[pending,processing,shipped,delivered] \\\r\n  shippingAddress:object:street:string:city:string:zipCode:string \\\r\n  totalAmount:number \\\r\n  createdAt:date\r\n```\r\n\r\n### Blog System with References\r\n\r\n```bash\r\n# Blog post with author reference and tags\r\nleo-generate generate Post \\\r\n  title!:string \\\r\n  content!:string \\\r\n  author:objectid:User \\\r\n  tags:array:string \\\r\n  status:enum[draft,published,archived] \\\r\n  publishedAt?:date \\\r\n  viewCount:number\r\n```\r\n\r\n### Product Catalog with Variants\r\n\r\n```bash\r\n# Product with multiple variants\r\nleo-generate generate Product \\\r\n  name!:string \\\r\n  description:string \\\r\n  category:enum[Electronics,Clothing,Books,Home] \\\r\n  variants:array:object:size:string:color:string:price:number:stock:number \\\r\n  images:array:string \\\r\n  isActive:boolean\r\n```\r\n\r\n## 📋 Field Types & Syntax\r\n\r\n### Basic Types\r\n```bash\r\nname:string          # String field\r\nage:number           # Number field\r\nisActive:boolean     # Boolean field\r\ncreatedAt:date       # Date field\r\n```\r\n\r\n### Modifiers\r\n```bash\r\nname!:string         # Required field\r\nemail?:string        # Optional field\r\n```\r\n\r\n### Enums\r\n```bash\r\nstatus:enum[active,inactive,pending]\r\nrole:enum[admin,user,moderator]\r\n```\r\n\r\n### References\r\n```bash\r\nauthor:objectid:User              # Single reference\r\ncategories:array:objectid:Category # Array of references\r\n```\r\n\r\n### Complex Structures\r\n```bash\r\n# Array of objects\r\nitems:array:object:name:string:price:number:quantity:number\r\n\r\n# Nested object\r\naddress:object:street:string:city:string:country:string\r\n\r\n# Mixed arrays\r\ntags:array:string\r\nscores:array:number\r\n```\r\n\r\n## 🎮 Generated API Features\r\n\r\n### Enhanced Controllers\r\n- ✅ Pagination support with meta information\r\n- 🔍 Search functionality across string fields\r\n- 📊 Sorting with customizable fields\r\n- 🛡️ Input validation and sanitization\r\n- 📁 File upload handling\r\n- ⚡ Error handling with proper HTTP status codes\r\n\r\n### Production-Ready Services\r\n- 🔒 ObjectId validation\r\n- 🔄 Auto-population of references\r\n- 🗑️ Proper file cleanup on deletion\r\n- 📈 Optimized queries with lean()\r\n- 🔍 Advanced search with regex\r\n- 📊 Aggregation support\r\n\r\n### API Endpoints\r\nFor a module named \"Product\":\r\n\r\n```\r\nPOST   /api/v1/products              # Create product\r\nGET    /api/v1/products              # Get all (with pagination, search, sort)\r\nGET    /api/v1/products/:id          # Get single product\r\nPATCH  /api/v1/products/:id          # Update product\r\nDELETE /api/v1/products/:id          # Delete product\r\n\r\nQuery Parameters for GET /api/v1/products:\r\n?page=1&limit=10&search=keyword&sortBy=createdAt&sortOrder=desc\r\n```\r\n\r\n## 📮 Postman Integration\r\n\r\n### Auto-Generated Collections\r\n- 🔄 Complete CRUD operations\r\n- 📝 Sample request bodies with realistic data\r\n- 🔗 Environment variables for base URL\r\n- 📊 Proper HTTP methods and headers\r\n- 🎯 Parameter examples for all endpoints\r\n\r\n### Collection Structure\r\n```json\r\n{\r\n  \"info\": {\r\n    \"name\": \"Product API\",\r\n    \"schema\": \"https://schema.getpostman.com/json/collection/v2.1.0/collection.json\"\r\n  },\r\n  \"item\": [\r\n    {\r\n      \"name\": \"Create Product\",\r\n      \"request\": {\r\n        \"method\": \"POST\",\r\n        \"body\": {\r\n          \"mode\": \"raw\",\r\n          \"raw\": \"{\\n  \\\"name\\\": \\\"sample_name\\\",\\n  \\\"price\\\": 123\\n}\"\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n## ☁️ Automated Postman Cloud Sync\r\n\r\nLeo Generate can automatically sync your generated collections to the Postman Cloud.\r\n\r\n### Configuration\r\nUpdate your `.env` file or `package.json` with your Postman credentials:\r\n\r\n```env\r\nPOSTMAN_API_KEY=your_api_key\r\nPOSTMAN_COLLECTION_ID=your_collection_uid\r\n```\r\n\r\n### How it Works\r\n1. When you run `generate` or `update-docs`, the system checks for credentials.\r\n2. It fetches your existing collection from Postman Cloud.\r\n3. It intelligently merges the new/updated module folder into the collection.\r\n4. It updates the cloud collection via the Postman API.\r\n\r\n## 🗑️ Intelligent File Cleanup\r\n\r\nWhen generating a module with `--file:true`, the system adds asynchronous cleanup logic:\r\n\r\n- **Service Layer**: Automatically `await`s file removal on record deletion or creation failure.\r\n- **Helper Utility**: Generates a robust `removeFile` helper using `fs/promises`.\r\n- **Path Logic**: Automatically handles `/images/` prefix and path normalization.\r\n\r\n### Auto-Generated Documentation\r\n- 📋 OpenAPI 3.0 specification\r\n- 🏷️ Proper tags and descriptions\r\n- 📝 Request/response schemas\r\n- 🔍 Parameter documentation\r\n- ✅ Validation rules included\r\n- 🔄 Automatic updates on module changes\r\n\r\n### Schema Generation\r\n```yaml\r\ncomponents:\r\n  schemas:\r\n    Product:\r\n      type: object\r\n      properties:\r\n        _id:\r\n          type: string\r\n          description: MongoDB ObjectId\r\n        name:\r\n          type: string\r\n          description: name field\r\n        price:\r\n          type: number\r\n          description: price field\r\n        createdAt:\r\n          type: string\r\n          format: date-time\r\n      required:\r\n        - _id\r\n        - name\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\n### Via package.json\r\n```json\r\n{\r\n  \"moduleGenerator\": {\r\n    \"modulesDir\": \"src/app/modules\",\r\n    \"routesFile\": \"src/routes/index.ts\"\r\n  }\r\n}\r\n```\r\n\r\n### Via CLI Options\r\n```bash\r\nleo-generate generate User name:string \\\r\n  --modules-dir src/modules \\\r\n  --routes-file src/routes.ts \\\r\n  --postman-dir collections \\\r\n  --swagger-file api-docs.json\r\n```\r\n\r\n### Export Full Postman Collection\r\n```bash\r\n# Fetches the entire collection from Postman Cloud and saves it locally\r\nleo-generate pull-postman\r\n\r\n# Aliases:\r\nleo-generate pull\r\nleo-generate export\r\n\r\n# Options:\r\n-o, --output <path>  # Custom output file path (default: postman/full_collection.postman_collection.json)\r\n```\r\n\r\n## 🧠 Enhanced Documentation Intelligence (v1.2.0)\r\n\r\n### **Code-Aware Documentation Updates**\r\nThe enhanced system now intelligently analyzes your code changes:\r\n\r\n```bash\r\n# Example: You modify an Order model\r\n# BEFORE: items had name, price, quantity\r\n# AFTER: items only have name (removed price, quantity)\r\n\r\n# Simply run:\r\nleo-generate update-docs\r\n\r\n# The system will:\r\n# ✅ Read your modified interface and model files\r\n# ✅ Detect that items now only have 'name' field\r\n# ✅ Update Postman collections: {\"items\": [{\"name\": \"sample_name\"}]}\r\n# ✅ Update Swagger schemas to reflect current structure\r\n# ✅ Handle ALL field types: enums, arrays, nested objects, references\r\n```\r\n\r\n### **100% Syntax Support**\r\nEvery field type the generator can create is fully supported in updates:\r\n\r\n| Syntax | Generated Sample | Update Support |\r\n|--------|------------------|----------------|\r\n| `name:string` | `\"name\": \"sample_name\"` | ✅ Perfect |\r\n| `age:number` | `\"age\": 123` | ✅ Perfect |\r\n| `tags:array:string` | `\"tags\": [\"sample_item\"]` | ✅ Perfect |\r\n| `scores:array:number` | `\"scores\": [123]` | ✅ Perfect |\r\n| `status:enum[active,inactive]` | `\"status\": \"active\"` | ✅ Perfect |\r\n| `author:objectid:User` | `\"author\": \"507f1f77...\"` | ✅ Perfect |\r\n| `items:array:object:name:string:price:number` | `\"items\": [{\"name\": \"...\", \"price\": 123}]` | ✅ Perfect |\r\n\r\n## 🔄 Migration from v1.1\r\n\r\nThe new version maintains backward compatibility:\r\n\r\n```bash\r\n# Old way (still works)\r\nleo-generate User name:string email:string\r\n\r\n# New way (recommended)\r\nleo-generate generate User name:string email:string\r\n\r\n# Enhanced documentation updates\r\nleo-generate update-docs\r\n```\r\n\r\n## 🎯 Best Practices\r\n\r\n### Module Design\r\n1. Use singular names for modules (e.g., \"User\" not \"Users\")\r\n2. Mark required fields with \"!\" suffix\r\n3. Use descriptive field names\r\n4. Group related fields logically\r\n5. Consider using enums for status fields\r\n\r\n### Field Naming\r\n```bash\r\n# Good\r\nleo-generate generate User name!:string email!:string status:enum[active,inactive]\r\n\r\n# Avoid\r\nleo-generate generate Users NAME:string Email:string stat:string\r\n```\r\n\r\n### Complex Structures\r\n```bash\r\n# Prefer structured objects over loose data\r\nleo-generate generate Order \\\r\n  items:array:object:productId:objectid:Product:quantity:number:price:number \\\r\n  # Instead of: items:array:string\r\n```\r\n\r\n## 🚀 Performance Features\r\n\r\n### Optimized Queries\r\n- 📊 Lean queries for list operations\r\n- 🔍 Indexed search fields\r\n- 📈 Aggregation pipeline support\r\n- 🔄 Efficient population of references\r\n\r\n### Caching Ready\r\n- 🏪 Service layer designed for caching integration\r\n- 🔑 Consistent data access patterns\r\n- ⚡ Optimized for Redis integration\r\n\r\n## 🛡️ Security Features\r\n\r\n### Input Validation\r\n- ✅ Zod schema validation\r\n- 🛡️ XSS protection ready\r\n- 📝 Sanitized inputs\r\n- 🔒 Type-safe operations\r\n\r\n### File Upload Security\r\n- 📁 Proper file type validation\r\n- 🗑️ Automatic cleanup on errors\r\n- 📊 Size limit enforcement ready\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n### Development Setup\r\n```bash\r\ngit clone <repository>\r\ncd leo-generator\r\nnpm install\r\nnpm run build\r\n```\r\n\r\n## 📄 License\r\n\r\nMIT\r\n\r\n---\r\n\r\n**Leo Generate** - Because generating quality code should be as smooth as Leo's dribbling! ⚽\r\n","readmeFilename":"README.md"}