nest-scramble 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -66
- package/dist/NestScrambleModule.d.ts.map +1 -1
- package/dist/NestScrambleModule.js +16 -4
- package/dist/NestScrambleModule.js.map +1 -1
- package/dist/controllers/DocsController.d.ts +1 -0
- package/dist/controllers/DocsController.d.ts.map +1 -1
- package/dist/controllers/DocsController.js +28 -12
- package/dist/controllers/DocsController.js.map +1 -1
- package/dist/scanner/ScannerService.d.ts +0 -1
- package/dist/scanner/ScannerService.d.ts.map +1 -1
- package/dist/scanner/ScannerService.js +43 -11
- package/dist/scanner/ScannerService.js.map +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
As a NestJS developer, I was tired of drowning in `@ApiProperty` decorators just to get basic API documentation. I longed for a zero-config solution where docs just worked without polluting my code. **Nest-Scramble changes that** by using static TypeScript analysis to automatically generate:
|
|
13
13
|
|
|
14
14
|
- ✅ **OpenAPI 3.0 specifications** from your DTOs
|
|
15
|
+
- ✅ **Interactive Scalar UI documentation** with zero configuration
|
|
15
16
|
- ✅ **Postman collections** with smart mock data
|
|
16
|
-
- ✅ **Interactive documentation** with code samples
|
|
17
17
|
- ✅ **Live mocking** for rapid prototyping
|
|
18
18
|
|
|
19
19
|
**Zero configuration. Zero decorators. Just pure TypeScript.**
|
|
@@ -57,59 +57,87 @@ This approach delivers what runtime reflection simply cannot: perfect accuracy,
|
|
|
57
57
|
|
|
58
58
|
## ⚡ Quick Start (3 Steps)
|
|
59
59
|
|
|
60
|
-
### 1. Install
|
|
60
|
+
### 1. Install the Package
|
|
61
|
+
|
|
61
62
|
```bash
|
|
63
|
+
# Using npm
|
|
64
|
+
npm install nest-scramble
|
|
65
|
+
|
|
66
|
+
# Using yarn
|
|
67
|
+
yarn add nest-scramble
|
|
68
|
+
|
|
69
|
+
# Using pnpm
|
|
62
70
|
pnpm add nest-scramble
|
|
63
71
|
```
|
|
64
72
|
|
|
65
|
-
### 2. Import Module
|
|
73
|
+
### 2. Import Module in Your NestJS App
|
|
74
|
+
|
|
75
|
+
Open your `app.module.ts` (or main module) and add:
|
|
76
|
+
|
|
66
77
|
```typescript
|
|
67
|
-
|
|
78
|
+
import { Module } from '@nestjs/common';
|
|
68
79
|
import { NestScrambleModule } from 'nest-scramble';
|
|
69
80
|
|
|
70
81
|
@Module({
|
|
71
82
|
imports: [
|
|
83
|
+
// Your other modules...
|
|
72
84
|
NestScrambleModule.forRoot({
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
sourcePath: 'src', // Path to your source code
|
|
86
|
+
baseUrl: 'http://localhost:3000',
|
|
87
|
+
enableMock: true, // Enable mock endpoints
|
|
88
|
+
autoExportPostman: false, // Auto-generate Postman collection
|
|
75
89
|
}),
|
|
76
90
|
],
|
|
77
91
|
})
|
|
78
92
|
export class AppModule {}
|
|
79
93
|
```
|
|
80
94
|
|
|
81
|
-
### 3. Visit Documentation
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
### 3. Start Your App and Visit Documentation
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm run start:dev
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then open your browser:
|
|
85
102
|
|
|
86
|
-
|
|
103
|
+
- **📖 Interactive API Docs (Scalar UI)**: http://localhost:3000/docs
|
|
104
|
+
- **📄 OpenAPI JSON Spec**: http://localhost:3000/docs-json
|
|
105
|
+
- **🎭 Mock Endpoints**: http://localhost:3000/scramble-mock/*
|
|
106
|
+
- **📤 Postman Collection**: Auto-generated at `collection.json` (if enabled)
|
|
87
107
|
|
|
88
|
-
|
|
108
|
+
**That's it!** Nest-Scramble will automatically scan your controllers and generate beautiful documentation.
|
|
109
|
+
|
|
110
|
+
## ⚙️ Configuration Options
|
|
89
111
|
|
|
90
112
|
```typescript
|
|
91
113
|
NestScrambleModule.forRoot({
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// Enable live mocking
|
|
96
|
-
enableMock: true, // default: true
|
|
114
|
+
// Source directory to scan for controllers
|
|
115
|
+
sourcePath: 'src', // default: 'src'
|
|
97
116
|
|
|
98
|
-
//
|
|
99
|
-
|
|
117
|
+
// API base URL for OpenAPI spec
|
|
118
|
+
baseUrl: 'http://localhost:3000', // default: 'http://localhost:3000'
|
|
100
119
|
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
openApiOutputPath: 'openapi.json',
|
|
120
|
+
// Enable live mocking middleware
|
|
121
|
+
enableMock: true, // default: true
|
|
104
122
|
|
|
105
|
-
//
|
|
106
|
-
|
|
123
|
+
// Auto-export Postman collection on startup
|
|
124
|
+
autoExportPostman: false, // default: false
|
|
107
125
|
|
|
108
|
-
//
|
|
109
|
-
|
|
126
|
+
// Postman collection output path
|
|
127
|
+
postmanOutputPath: 'collection.json', // default: 'collection.json'
|
|
110
128
|
})
|
|
111
129
|
```
|
|
112
130
|
|
|
131
|
+
### Configuration Details
|
|
132
|
+
|
|
133
|
+
| Option | Type | Default | Description |
|
|
134
|
+
|--------|------|---------|-------------|
|
|
135
|
+
| `sourcePath` | `string` | `'src'` | Directory where your NestJS controllers are located |
|
|
136
|
+
| `baseUrl` | `string` | `'http://localhost:3000'` | Base URL for your API (used in OpenAPI spec) |
|
|
137
|
+
| `enableMock` | `boolean` | `true` | Enable `/scramble-mock/*` endpoints for testing |
|
|
138
|
+
| `autoExportPostman` | `boolean` | `false` | Automatically generate Postman collection file |
|
|
139
|
+
| `postmanOutputPath` | `string` | `'collection.json'` | Output path for Postman collection |
|
|
140
|
+
|
|
113
141
|
## 🎭 Live Mocking Guide
|
|
114
142
|
|
|
115
143
|
Nest-Scramble provides **instant API mocking** without writing controllers:
|
|
@@ -170,36 +198,43 @@ pnpm run watch-generate
|
|
|
170
198
|
```
|
|
171
199
|
Automatically regenerates docs on file changes.
|
|
172
200
|
|
|
173
|
-
## 🎨 UI
|
|
201
|
+
## 🎨 Documentation UI
|
|
174
202
|
|
|
175
|
-
###
|
|
176
|
-
For the modern Scalar documentation UI:
|
|
203
|
+
### Built-in Scalar UI
|
|
177
204
|
|
|
178
|
-
|
|
179
|
-
import { ApiReference } from '@scalar/nestjs';
|
|
205
|
+
Nest-Scramble comes with **Scalar UI** built-in via CDN. No additional packages needed!
|
|
180
206
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const scanner = new ScannerService();
|
|
189
|
-
const controllers = scanner.scanControllers('src');
|
|
190
|
-
const transformer = new OpenApiTransformer();
|
|
191
|
-
return transformer.transform(controllers);
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
}),
|
|
195
|
-
],
|
|
196
|
-
})
|
|
197
|
-
export class AppModule {}
|
|
198
|
-
```
|
|
207
|
+
When you visit `http://localhost:3000/docs`, you'll see a beautiful, interactive API documentation interface with:
|
|
208
|
+
|
|
209
|
+
- 🎯 **Interactive API Explorer** - Test endpoints directly from the browser
|
|
210
|
+
- 📝 **Auto-generated Examples** - Request/response samples for all endpoints
|
|
211
|
+
- 🔍 **Search Functionality** - Quickly find endpoints
|
|
212
|
+
- 🌙 **Dark Mode Support** - Easy on the eyes
|
|
213
|
+
- 📱 **Mobile Responsive** - Works on all devices
|
|
199
214
|
|
|
200
|
-
|
|
215
|
+
### Available Endpoints
|
|
201
216
|
|
|
202
|
-
|
|
217
|
+
| Endpoint | Description |
|
|
218
|
+
|----------|-------------|
|
|
219
|
+
| `GET /docs` | Interactive Scalar UI documentation |
|
|
220
|
+
| `GET /docs-json` | OpenAPI 3.0 JSON specification |
|
|
221
|
+
| `GET /docs/json` | Legacy endpoint (same as above) |
|
|
222
|
+
| `GET /docs/spec` | OpenAPI spec as JSON response |
|
|
223
|
+
|
|
224
|
+
### Accessing the OpenAPI Spec
|
|
225
|
+
|
|
226
|
+
You can use the OpenAPI JSON with other tools:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Download the spec
|
|
230
|
+
curl http://localhost:3000/docs-json > openapi.json
|
|
231
|
+
|
|
232
|
+
# Use with Swagger UI
|
|
233
|
+
docker run -p 8080:8080 -e SWAGGER_JSON=/openapi.json -v $(pwd):/usr/share/nginx/html/openapi.json swaggerapi/swagger-ui
|
|
234
|
+
|
|
235
|
+
# Import into Postman
|
|
236
|
+
# File > Import > Link > http://localhost:3000/docs-json
|
|
237
|
+
```
|
|
203
238
|
|
|
204
239
|
## ✅ Supported Features
|
|
205
240
|
|
|
@@ -260,26 +295,116 @@ Run the demo to verify everything works perfectly.
|
|
|
260
295
|
|
|
261
296
|
### Common Issues
|
|
262
297
|
|
|
263
|
-
**
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
298
|
+
#### 1. **"No controllers found" Warning**
|
|
299
|
+
|
|
300
|
+
If you see this warning on startup:
|
|
301
|
+
```
|
|
302
|
+
[Nest-Scramble] No controllers found in /src. Please check your sourcePath config.
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Solution:**
|
|
306
|
+
- Ensure your `sourcePath` option points to the correct directory containing your controllers
|
|
307
|
+
- Check that your controllers use the `@Controller()` decorator from `@nestjs/common`
|
|
308
|
+
- Verify your project structure matches the configured path
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
NestScrambleModule.forRoot({
|
|
312
|
+
sourcePath: 'src', // Make sure this matches your project structure
|
|
313
|
+
})
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
#### 2. **UI Not Loading / Blank Page at /docs**
|
|
317
|
+
|
|
318
|
+
**Solution:**
|
|
319
|
+
- Clear your browser cache and hard refresh (Ctrl+Shift+R / Cmd+Shift+R)
|
|
320
|
+
- Check browser console for errors
|
|
321
|
+
- Verify the `/docs-json` endpoint returns valid JSON
|
|
322
|
+
- Ensure you're using version 1.1.0 or higher: `npm list nest-scramble`
|
|
323
|
+
|
|
324
|
+
#### 3. **TypeScript Compilation Errors**
|
|
325
|
+
|
|
326
|
+
If you get errors like `Cannot find module 'nest-scramble'`:
|
|
327
|
+
|
|
328
|
+
**Solution:**
|
|
329
|
+
```bash
|
|
330
|
+
# Clear node_modules and reinstall
|
|
331
|
+
rm -rf node_modules package-lock.json
|
|
332
|
+
npm install
|
|
333
|
+
|
|
334
|
+
# Rebuild your project
|
|
335
|
+
npm run build
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
#### 4. **pnpm Dependency Conflicts**
|
|
339
|
+
|
|
340
|
+
If using pnpm and getting peer dependency warnings:
|
|
341
|
+
|
|
342
|
+
**Solution:**
|
|
343
|
+
Nest-Scramble v1.1.0+ properly declares peer dependencies. Update to the latest version:
|
|
344
|
+
```bash
|
|
345
|
+
pnpm update nest-scramble
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
#### 5. **Controllers Not Being Scanned**
|
|
349
|
+
|
|
350
|
+
The scanner looks in your **host project's** `src` folder, not the library's folder.
|
|
351
|
+
|
|
352
|
+
**Diagnostic Steps:**
|
|
353
|
+
1. Check the startup logs - they show exactly where the scanner is looking:
|
|
354
|
+
```
|
|
355
|
+
[Nest-Scramble] Scanning directory: /path/to/your/project/src
|
|
356
|
+
[Nest-Scramble] Found X controller(s)
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
2. Ensure your controllers are in TypeScript files (`.ts`) not JavaScript (`.js`)
|
|
360
|
+
|
|
361
|
+
3. Verify your `tsconfig.json` exists in the project root
|
|
362
|
+
|
|
363
|
+
#### 6. **Mock Endpoints Not Working**
|
|
364
|
+
|
|
365
|
+
If `/scramble-mock/*` returns 404:
|
|
366
|
+
|
|
367
|
+
**Solution:**
|
|
368
|
+
- Ensure `enableMock: true` in your configuration
|
|
369
|
+
- The middleware applies to all routes matching `/scramble-mock/*`
|
|
370
|
+
- Example: `http://localhost:3000/scramble-mock/users/123`
|
|
371
|
+
|
|
372
|
+
#### 7. **OpenAPI Spec is Empty or Incomplete**
|
|
373
|
+
|
|
374
|
+
**Solution:**
|
|
375
|
+
- Ensure your DTOs are TypeScript classes or interfaces (not plain objects)
|
|
376
|
+
- Check that your controller methods have proper return type annotations
|
|
377
|
+
- Verify decorators are imported from `@nestjs/common`
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
// ✅ Good - Explicit return type
|
|
381
|
+
@Get(':id')
|
|
382
|
+
getUser(@Param('id') id: string): UserDto {
|
|
383
|
+
return this.userService.findOne(id);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// ❌ Bad - No return type
|
|
387
|
+
@Get(':id')
|
|
388
|
+
getUser(@Param('id') id: string) {
|
|
389
|
+
return this.userService.findOne(id);
|
|
273
390
|
}
|
|
274
391
|
```
|
|
275
392
|
|
|
276
|
-
|
|
277
|
-
|
|
393
|
+
### Getting Help
|
|
394
|
+
|
|
395
|
+
If you're still experiencing issues:
|
|
278
396
|
|
|
279
|
-
**
|
|
280
|
-
|
|
397
|
+
1. **Check the logs** - Nest-Scramble provides detailed diagnostic output on startup
|
|
398
|
+
2. **Verify your version** - Run `npm list nest-scramble` (should be 1.1.0+)
|
|
399
|
+
3. **Open an issue** - [GitHub Issues](https://github.com/Eng-MMustafa/nest-scramble/issues)
|
|
400
|
+
4. **Join discussions** - [GitHub Discussions](https://github.com/Eng-MMustafa/nest-scramble/discussions)
|
|
281
401
|
|
|
282
|
-
|
|
402
|
+
When reporting issues, please include:
|
|
403
|
+
- Nest-Scramble version
|
|
404
|
+
- NestJS version
|
|
405
|
+
- Package manager (npm/yarn/pnpm)
|
|
406
|
+
- Startup logs
|
|
407
|
+
- Sample controller code
|
|
283
408
|
|
|
284
409
|
## 🤝 Contributing
|
|
285
410
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestScrambleModule.d.ts","sourceRoot":"","sources":["../src/NestScrambleModule.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAyB,MAAM,gBAAgB,CAAC;AAQ1F,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBACa,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"NestScrambleModule.d.ts","sourceRoot":"","sources":["../src/NestScrambleModule.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAyB,MAAM,gBAAgB,CAAC;AAQ1F,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBACa,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IAmEhE,MAAM,CAAC,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IAKrE,SAAS,CAAC,QAAQ,EAAE,kBAAkB;CAMvC"}
|
|
@@ -19,20 +19,32 @@ const DocsController_1 = require("./controllers/DocsController");
|
|
|
19
19
|
let NestScrambleModule = NestScrambleModule_1 = class NestScrambleModule {
|
|
20
20
|
static forRoot(options = {}) {
|
|
21
21
|
const { path = '/docs', enableMock = true, autoExportPostman = false, postmanOutputPath = 'collection.json', baseUrl = 'http://localhost:3000', sourcePath = 'src', } = options;
|
|
22
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
23
|
+
console.log(`🚀 [Nest-Scramble] Initializing Documentation Engine`);
|
|
24
|
+
console.log(` Developed by Mohamed Mustafa | MIT License`);
|
|
25
|
+
console.log(`${'='.repeat(60)}`);
|
|
22
26
|
const scanner = new ScannerService_1.ScannerService();
|
|
23
27
|
const controllers = scanner.scanControllers(sourcePath);
|
|
28
|
+
console.log(`\n[Nest-Scramble] Generating OpenAPI specification...`);
|
|
24
29
|
const transformer = new OpenApiTransformer_1.OpenApiTransformer(baseUrl);
|
|
25
30
|
const openApiSpec = transformer.transform(controllers, 'NestJS API', '1.0.0', baseUrl);
|
|
31
|
+
console.log(`[Nest-Scramble] OpenAPI spec generated successfully`);
|
|
26
32
|
if (autoExportPostman) {
|
|
33
|
+
console.log(`[Nest-Scramble] Exporting Postman collection...`);
|
|
27
34
|
const generator = new PostmanCollectionGenerator_1.PostmanCollectionGenerator(baseUrl);
|
|
28
35
|
const collection = generator.generateCollection(controllers);
|
|
29
36
|
require('fs').writeFileSync(postmanOutputPath, JSON.stringify(collection, null, 2));
|
|
30
|
-
console.log(`[Nest-Scramble] Postman collection exported to ${postmanOutputPath}`);
|
|
37
|
+
console.log(`[Nest-Scramble] ✓ Postman collection exported to ${postmanOutputPath}`);
|
|
31
38
|
}
|
|
32
39
|
const port = baseUrl.split(':').pop() || '3000';
|
|
33
|
-
console.log(`\n
|
|
34
|
-
console.log(
|
|
35
|
-
console.log(
|
|
40
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
41
|
+
console.log(`✅ [Nest-Scramble] Ready!`);
|
|
42
|
+
console.log(`📚 API Docs available at: http://localhost:${port}/docs`);
|
|
43
|
+
console.log(`📄 OpenAPI JSON at: http://localhost:${port}/docs-json`);
|
|
44
|
+
if (enableMock) {
|
|
45
|
+
console.log(`🎭 Mock endpoints at: http://localhost:${port}/scramble-mock/*`);
|
|
46
|
+
}
|
|
47
|
+
console.log(`${'='.repeat(60)}\n`);
|
|
36
48
|
return {
|
|
37
49
|
module: NestScrambleModule_1,
|
|
38
50
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestScrambleModule.js","sourceRoot":"","sources":["../src/NestScrambleModule.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,kEAAkE;AAClE,2CAA0F;AAC1F,wFAAqF;AACrF,gEAA6D;AAC7D,6DAA0D;AAC1D,yDAAsD;AACtD,mEAAgE;AAChE,iEAA8D;AAYvD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,UAA+B,EAAE;QAC9C,MAAM,EACJ,IAAI,GAAG,OAAO,EACd,UAAU,GAAG,IAAI,EACjB,iBAAiB,GAAG,KAAK,EACzB,iBAAiB,GAAG,iBAAiB,EACrC,OAAO,GAAG,uBAAuB,EACjC,UAAU,GAAG,KAAK,GACnB,GAAG,OAAO,CAAC;QAEZ,MAAM,OAAO,GAAG,IAAI,+BAAc,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NestScrambleModule.js","sourceRoot":"","sources":["../src/NestScrambleModule.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,kEAAkE;AAClE,2CAA0F;AAC1F,wFAAqF;AACrF,gEAA6D;AAC7D,6DAA0D;AAC1D,yDAAsD;AACtD,mEAAgE;AAChE,iEAA8D;AAYvD,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAC7B,MAAM,CAAC,OAAO,CAAC,UAA+B,EAAE;QAC9C,MAAM,EACJ,IAAI,GAAG,OAAO,EACd,UAAU,GAAG,IAAI,EACjB,iBAAiB,GAAG,KAAK,EACzB,iBAAiB,GAAG,iBAAiB,EACrC,OAAO,GAAG,uBAAuB,EACjC,UAAU,GAAG,KAAK,GACnB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F,CAAA;AA/EY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,kBAAkB,CA+E9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsController.d.ts","sourceRoot":"","sources":["../../src/controllers/DocsController.ts"],"names":[],"mappings":"AAGA,qBACa,cAAc;IAEU,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,GAAG;IAI3D,OAAO,CAAQ,GAAG,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"DocsController.d.ts","sourceRoot":"","sources":["../../src/controllers/DocsController.ts"],"names":[],"mappings":"AAGA,qBACa,cAAc;IAEU,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,GAAG;IAI3D,OAAO,CAAQ,GAAG,EAAE,GAAG;IA0BvB,cAAc,CAAQ,GAAG,EAAE,GAAG;IAa9B,oBAAoB,CAAQ,GAAG,EAAE,GAAG;IAKpC,cAAc;CAGf"}
|
|
@@ -20,33 +20,42 @@ let DocsController = class DocsController {
|
|
|
20
20
|
this.openApiSpec = openApiSpec;
|
|
21
21
|
}
|
|
22
22
|
getDocs(res) {
|
|
23
|
-
const html =
|
|
24
|
-
|
|
25
|
-
<html>
|
|
23
|
+
const html = `<!DOCTYPE html>
|
|
24
|
+
<html lang="en">
|
|
26
25
|
<head>
|
|
27
|
-
<title>Nest-Scramble
|
|
26
|
+
<title>API Documentation - Nest-Scramble</title>
|
|
28
27
|
<meta charset="utf-8" />
|
|
29
28
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
30
29
|
<style>
|
|
31
30
|
body {
|
|
32
31
|
margin: 0;
|
|
33
32
|
padding: 0;
|
|
34
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
33
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
|
|
35
34
|
}
|
|
36
35
|
</style>
|
|
37
36
|
</head>
|
|
38
37
|
<body>
|
|
39
|
-
<script id="api-reference" data-url="/docs
|
|
38
|
+
<script id="api-reference" data-url="/docs-json"></script>
|
|
40
39
|
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
41
40
|
</body>
|
|
42
|
-
</html
|
|
43
|
-
|
|
44
|
-
res.setHeader('Content-Type', 'text/html');
|
|
41
|
+
</html>`;
|
|
42
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
|
45
43
|
res.send(html);
|
|
46
44
|
}
|
|
47
45
|
getOpenApiJson(res) {
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
try {
|
|
47
|
+
const jsonString = JSON.stringify(this.openApiSpec, null, 2);
|
|
48
|
+
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|
|
49
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
50
|
+
res.send(jsonString);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error('[Nest-Scramble] Error serializing OpenAPI spec:', error);
|
|
54
|
+
res.status(500).json({ error: 'Failed to generate OpenAPI specification' });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
getOpenApiJsonLegacy(res) {
|
|
58
|
+
return this.getOpenApiJson(res);
|
|
50
59
|
}
|
|
51
60
|
getOpenApiSpec() {
|
|
52
61
|
return this.openApiSpec;
|
|
@@ -61,12 +70,19 @@ __decorate([
|
|
|
61
70
|
__metadata("design:returntype", void 0)
|
|
62
71
|
], DocsController.prototype, "getDocs", null);
|
|
63
72
|
__decorate([
|
|
64
|
-
(0, common_1.Get)('docs
|
|
73
|
+
(0, common_1.Get)('docs-json'),
|
|
65
74
|
__param(0, (0, common_1.Res)()),
|
|
66
75
|
__metadata("design:type", Function),
|
|
67
76
|
__metadata("design:paramtypes", [Object]),
|
|
68
77
|
__metadata("design:returntype", void 0)
|
|
69
78
|
], DocsController.prototype, "getOpenApiJson", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, common_1.Get)('docs/json'),
|
|
81
|
+
__param(0, (0, common_1.Res)()),
|
|
82
|
+
__metadata("design:type", Function),
|
|
83
|
+
__metadata("design:paramtypes", [Object]),
|
|
84
|
+
__metadata("design:returntype", void 0)
|
|
85
|
+
], DocsController.prototype, "getOpenApiJsonLegacy", null);
|
|
70
86
|
__decorate([
|
|
71
87
|
(0, common_1.Get)('docs/spec'),
|
|
72
88
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsController.js","sourceRoot":"","sources":["../../src/controllers/DocsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAAkE;AAClE,2CAA8D;AAGvD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAC2C,WAAgB;QAAhB,gBAAW,GAAX,WAAW,CAAK;IACxD,CAAC;IAGJ,OAAO,CAAQ,GAAQ;QACrB,MAAM,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"DocsController.js","sourceRoot":"","sources":["../../src/controllers/DocsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAAkE;AAClE,2CAA8D;AAGvD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAC2C,WAAgB;QAAhB,gBAAW,GAAX,WAAW,CAAK;IACxD,CAAC;IAGJ,OAAO,CAAQ,GAAQ;QACrB,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;QAkBT,CAAC;QAEL,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAC1D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAGD,cAAc,CAAQ,GAAQ;QAC5B,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC7D,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAC;YACjE,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAClD,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;YACxE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,0CAA0C,EAAE,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IAGD,oBAAoB,CAAQ,GAAQ;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAGD,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF,CAAA;AArDY,wCAAc;AAMzB;IADC,IAAA,YAAG,EAAC,MAAM,CAAC;IACH,WAAA,IAAA,YAAG,GAAE,CAAA;;;;6CAuBb;AAGD;IADC,IAAA,YAAG,EAAC,WAAW,CAAC;IACD,WAAA,IAAA,YAAG,GAAE,CAAA;;;;oDAUpB;AAGD;IADC,IAAA,YAAG,EAAC,WAAW,CAAC;IACK,WAAA,IAAA,YAAG,GAAE,CAAA;;;;0DAE1B;AAGD;IADC,IAAA,YAAG,EAAC,WAAW,CAAC;;;;oDAGhB;yBApDU,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,uBAAuB,CAAC,CAAA;;GAFvB,cAAc,CAqD1B"}
|
|
@@ -19,7 +19,6 @@ export interface ParameterInfo {
|
|
|
19
19
|
export declare class ScannerService {
|
|
20
20
|
private project;
|
|
21
21
|
private dtoAnalyzer;
|
|
22
|
-
constructor();
|
|
23
22
|
/**
|
|
24
23
|
* Scans the source directory for controllers and their methods
|
|
25
24
|
* @param sourcePath Path to the source directory (e.g., 'src')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScannerService.d.ts","sourceRoot":"","sources":["../../src/scanner/ScannerService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAe,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"ScannerService.d.ts","sourceRoot":"","sources":["../../src/scanner/ScannerService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAe,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,WAAW,CAAqB;IAExC;;;;OAIG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,EAAE;IAsErD,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,qBAAqB;IA4B7B,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,iBAAiB;CAiC1B"}
|
|
@@ -6,11 +6,8 @@ const ts_morph_1 = require("ts-morph");
|
|
|
6
6
|
const DtoAnalyzer_1 = require("../utils/DtoAnalyzer");
|
|
7
7
|
class ScannerService {
|
|
8
8
|
constructor() {
|
|
9
|
+
this.project = null;
|
|
9
10
|
this.dtoAnalyzer = new DtoAnalyzer_1.DtoAnalyzer();
|
|
10
|
-
this.project = new ts_morph_1.Project({
|
|
11
|
-
tsConfigFilePath: 'tsconfig.json',
|
|
12
|
-
skipAddingFilesFromTsConfig: true,
|
|
13
|
-
});
|
|
14
11
|
}
|
|
15
12
|
/**
|
|
16
13
|
* Scans the source directory for controllers and their methods
|
|
@@ -18,29 +15,64 @@ class ScannerService {
|
|
|
18
15
|
* @returns Array of ControllerInfo
|
|
19
16
|
*/
|
|
20
17
|
scanControllers(sourcePath) {
|
|
21
|
-
const
|
|
22
|
-
const fullSourcePath = `${
|
|
18
|
+
const hostProjectRoot = process.cwd();
|
|
19
|
+
const fullSourcePath = `${hostProjectRoot}/${sourcePath}`;
|
|
20
|
+
const tsconfigPath = `${hostProjectRoot}/tsconfig.json`;
|
|
21
|
+
console.log(`[Nest-Scramble] Scanning directory: ${fullSourcePath}`);
|
|
22
|
+
console.log(`[Nest-Scramble] Using tsconfig: ${tsconfigPath}`);
|
|
23
|
+
try {
|
|
24
|
+
const fs = require('fs');
|
|
25
|
+
if (!fs.existsSync(tsconfigPath)) {
|
|
26
|
+
console.warn(`[Nest-Scramble] Warning: tsconfig.json not found at ${tsconfigPath}`);
|
|
27
|
+
console.warn(`[Nest-Scramble] Creating project without tsconfig...`);
|
|
28
|
+
this.project = new ts_morph_1.Project({
|
|
29
|
+
skipAddingFilesFromTsConfig: true,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.project = new ts_morph_1.Project({
|
|
34
|
+
tsConfigFilePath: tsconfigPath,
|
|
35
|
+
skipAddingFilesFromTsConfig: true,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.warn(`[Nest-Scramble] Error initializing ts-morph project:`, error);
|
|
41
|
+
this.project = new ts_morph_1.Project({
|
|
42
|
+
skipAddingFilesFromTsConfig: true,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (!this.project) {
|
|
46
|
+
console.error(`[Nest-Scramble] Failed to initialize project scanner`);
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
23
49
|
try {
|
|
24
|
-
|
|
50
|
+
const pattern = `${fullSourcePath}/**/*.ts`;
|
|
51
|
+
console.log(`[Nest-Scramble] Adding source files with pattern: ${pattern}`);
|
|
52
|
+
this.project.addSourceFilesAtPaths(pattern);
|
|
25
53
|
}
|
|
26
54
|
catch (error) {
|
|
27
|
-
console.
|
|
55
|
+
console.error(`[Nest-Scramble] Error adding source files:`, error);
|
|
56
|
+
return [];
|
|
28
57
|
}
|
|
58
|
+
const sourceFiles = this.project.getSourceFiles();
|
|
59
|
+
console.log(`[Nest-Scramble] Loaded ${sourceFiles.length} TypeScript file(s)`);
|
|
29
60
|
const controllers = [];
|
|
30
|
-
const controllerClasses =
|
|
61
|
+
const controllerClasses = sourceFiles
|
|
31
62
|
.flatMap(file => file.getClasses())
|
|
32
63
|
.filter(cls => this.hasControllerDecorator(cls));
|
|
33
64
|
if (controllerClasses.length === 0) {
|
|
34
65
|
console.warn(`[Nest-Scramble] No controllers found in /${sourcePath}. Please check your sourcePath config.`);
|
|
35
|
-
console.warn(`[Nest-Scramble]
|
|
66
|
+
console.warn(`[Nest-Scramble] Searched in: ${fullSourcePath}`);
|
|
36
67
|
}
|
|
37
68
|
else {
|
|
38
|
-
console.log(`[Nest-Scramble] Found ${controllerClasses.length} controller(s)
|
|
69
|
+
console.log(`[Nest-Scramble] Found ${controllerClasses.length} controller(s)`);
|
|
39
70
|
}
|
|
40
71
|
for (const controllerClass of controllerClasses) {
|
|
41
72
|
const controllerInfo = this.extractControllerInfo(controllerClass);
|
|
42
73
|
if (controllerInfo) {
|
|
43
74
|
controllers.push(controllerInfo);
|
|
75
|
+
console.log(`[Nest-Scramble] - ${controllerInfo.name} (${controllerInfo.methods.length} endpoint(s))`);
|
|
44
76
|
}
|
|
45
77
|
}
|
|
46
78
|
return controllers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScannerService.js","sourceRoot":"","sources":["../../src/scanner/ScannerService.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,uCAAyF;AACzF,sDAAiE;AAsBjE,MAAa,cAAc;
|
|
1
|
+
{"version":3,"file":"ScannerService.js","sourceRoot":"","sources":["../../src/scanner/ScannerService.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,uCAAyF;AACzF,sDAAiE;AAsBjE,MAAa,cAAc;IAA3B;QACU,YAAO,GAAmB,IAAI,CAAC;QAC/B,gBAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;IA+J1C,CAAC;IA7JC;;;;OAIG;IACH,eAAe,CAAC,UAAkB;QAChC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACtC,MAAM,cAAc,GAAG,GAAG,eAAe,IAAI,UAAU,EAAE,CAAC;QAC1D,MAAM,YAAY,GAAG,GAAG,eAAe,gBAAgB,CAAC;QAExD,OAAO,CAAC,GAAG,CAAC,uCAAuC,cAAc,EAAE,CAAC,CAAC;QACrE,OAAO,CAAC,GAAG,CAAC,mCAAmC,YAAY,EAAE,CAAC,CAAC;QAE/D,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,I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CAAC,OAAO,EAAE;YACrB,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnD,SAAS,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;SACjE,CAAC,CAAC,CAAC;QAEJ,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;QAExE,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;YACtB,UAAU;YACV,KAAK;YACL,UAAU;YACV,UAAU;SACX,CAAC;IACJ,CAAC;CACF;AAjKD,wCAiKC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nest-scramble",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A next-generation, decorator-free API documentation engine and intelligent mock server for NestJS, engineered by Mohamed Mustafa",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,6 +47,12 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@nestjs/common": "^10.0.0",
|
|
50
|
-
"@nestjs/core": "^10.0.0"
|
|
50
|
+
"@nestjs/core": "^10.0.0",
|
|
51
|
+
"reflect-metadata": "^0.1.13 || ^0.2.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"reflect-metadata": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
}
|