@globalart/nestjs-swagger 1.2.3
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 +204 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +15 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.js +99 -0
- package/dist/dtos/index.d.ts +6 -0
- package/dist/dtos/index.js +32 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/interfaces/index.d.ts +18 -0
- package/dist/interfaces/index.js +2 -0
- package/package.json +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# @globalart/nestjs-swagger
|
|
2
|
+
|
|
3
|
+
A simple documentation builder for NestJS Swagger module that simplifies creating OpenAPI documentation for your REST APIs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @globalart/nestjs-swagger
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
or
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @globalart/nestjs-swagger
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Description
|
|
18
|
+
|
|
19
|
+
This package provides a convenient `SwaggerDocumentation` decorator for automatic Swagger documentation generation in NestJS applications. It significantly simplifies the process of adding documentation to your endpoints by providing a unified interface for describing operations and possible errors.
|
|
20
|
+
|
|
21
|
+
## Key Features
|
|
22
|
+
|
|
23
|
+
- 📝 Simple decorator for endpoint documentation
|
|
24
|
+
- 🔧 Pre-configured descriptions for standard HTTP errors
|
|
25
|
+
- 📊 Support for paginated responses
|
|
26
|
+
- 🎯 Support for arrays in responses
|
|
27
|
+
- 📋 Automatic schema generation for DTOs
|
|
28
|
+
- 🛡️ Full TypeScript typing
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { Controller, Get } from '@nestjs/common';
|
|
34
|
+
import { SwaggerDocumentation, ERROR_DESCRIPTIONS } from '@globalart/nestjs-swagger';
|
|
35
|
+
|
|
36
|
+
@Controller('users')
|
|
37
|
+
export class UsersController {
|
|
38
|
+
@Get()
|
|
39
|
+
@SwaggerDocumentation({
|
|
40
|
+
endpointDescription: 'Get list of all users',
|
|
41
|
+
endpointSummary: 'List users',
|
|
42
|
+
error400Description: ERROR_DESCRIPTIONS.BAD_REQUEST,
|
|
43
|
+
error401Description: ERROR_DESCRIPTIONS.UNAUTHORIZED,
|
|
44
|
+
error500Description: ERROR_DESCRIPTIONS.INTERNAL_SERVER_ERROR
|
|
45
|
+
})
|
|
46
|
+
async getAllUsers() {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API Reference
|
|
53
|
+
|
|
54
|
+
### SwaggerDocumentation
|
|
55
|
+
|
|
56
|
+
Decorator for automatic Swagger documentation generation.
|
|
57
|
+
|
|
58
|
+
#### Parameters
|
|
59
|
+
|
|
60
|
+
| Parameter | Type | Description |
|
|
61
|
+
| --------------------- | ---------- | ------------------------------------ |
|
|
62
|
+
| `endpointDescription` | `string` | Detailed endpoint description |
|
|
63
|
+
| `endpointSummary` | `string` | Brief endpoint description |
|
|
64
|
+
| `responseDto` | `Function` | DTO class for response |
|
|
65
|
+
| `isArray` | `boolean` | Indicates that response is an array |
|
|
66
|
+
| `isPaginated` | `boolean` | Indicates that response is paginated |
|
|
67
|
+
| `error400Description` | `string` | 400 error description |
|
|
68
|
+
| `error401Description` | `string` | 401 error description |
|
|
69
|
+
| `error403Description` | `string` | 403 error description |
|
|
70
|
+
| `error404Description` | `string` | 404 error description |
|
|
71
|
+
| `error409Description` | `string` | 409 error description |
|
|
72
|
+
| `error422Description` | `string` | 422 error description |
|
|
73
|
+
| `error429Description` | `string` | 429 error description |
|
|
74
|
+
| `error500Description` | `string` | 500 error description |
|
|
75
|
+
| `error503Description` | `string` | 503 error description |
|
|
76
|
+
|
|
77
|
+
### ERROR_DESCRIPTIONS
|
|
78
|
+
|
|
79
|
+
Object with pre-configured error descriptions:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
export const ERROR_DESCRIPTIONS = {
|
|
83
|
+
BAD_REQUEST: "Invalid request data or parameters",
|
|
84
|
+
UNAUTHORIZED: "Authentication required",
|
|
85
|
+
FORBIDDEN: "Access denied",
|
|
86
|
+
NOT_FOUND: "Resource not found",
|
|
87
|
+
CONFLICT: "Resource already exists or conflict detected",
|
|
88
|
+
UNPROCESSABLE_ENTITY: "Validation error",
|
|
89
|
+
RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Too many requests",
|
|
90
|
+
INTERNAL_SERVER_ERROR: "Internal server error",
|
|
91
|
+
SERVICE_UNAVAILABLE: "Service temporarily unavailable"
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Usage Examples
|
|
96
|
+
|
|
97
|
+
### Basic Usage
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
import { Controller, Get } from '@nestjs/common';
|
|
101
|
+
import { SwaggerDocumentation, ERROR_DESCRIPTIONS } from '@globalart/nestjs-swagger';
|
|
102
|
+
|
|
103
|
+
@Controller()
|
|
104
|
+
export class AppController {
|
|
105
|
+
@Get('hello')
|
|
106
|
+
@SwaggerDocumentation({
|
|
107
|
+
endpointDescription: 'Simple greeting endpoint',
|
|
108
|
+
endpointSummary: 'Greeting',
|
|
109
|
+
error400Description: ERROR_DESCRIPTIONS.BAD_REQUEST,
|
|
110
|
+
error401Description: ERROR_DESCRIPTIONS.UNAUTHORIZED,
|
|
111
|
+
error403Description: ERROR_DESCRIPTIONS.FORBIDDEN,
|
|
112
|
+
error404Description: ERROR_DESCRIPTIONS.NOT_FOUND,
|
|
113
|
+
error429Description: ERROR_DESCRIPTIONS.RATE_LIMIT_EXCEEDED,
|
|
114
|
+
error500Description: ERROR_DESCRIPTIONS.INTERNAL_SERVER_ERROR
|
|
115
|
+
})
|
|
116
|
+
async hello() {
|
|
117
|
+
return 'Hello World';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Using with DTO
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
126
|
+
|
|
127
|
+
export class UserDto {
|
|
128
|
+
@ApiProperty()
|
|
129
|
+
id: number;
|
|
130
|
+
|
|
131
|
+
@ApiProperty()
|
|
132
|
+
name: string;
|
|
133
|
+
|
|
134
|
+
@ApiProperty()
|
|
135
|
+
email: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@Controller('users')
|
|
139
|
+
export class UsersController {
|
|
140
|
+
@Get(':id')
|
|
141
|
+
@SwaggerDocumentation({
|
|
142
|
+
endpointDescription: 'Get user by ID',
|
|
143
|
+
endpointSummary: 'Get user',
|
|
144
|
+
responseDto: UserDto,
|
|
145
|
+
error404Description: ERROR_DESCRIPTIONS.NOT_FOUND,
|
|
146
|
+
error500Description: ERROR_DESCRIPTIONS.INTERNAL_SERVER_ERROR
|
|
147
|
+
})
|
|
148
|
+
async getUserById(@Param('id') id: number) {
|
|
149
|
+
// user retrieval logic
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Working with Arrays
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
@Controller('users')
|
|
158
|
+
export class UsersController {
|
|
159
|
+
@Get()
|
|
160
|
+
@SwaggerDocumentation({
|
|
161
|
+
endpointDescription: 'Get list of all users',
|
|
162
|
+
endpointSummary: 'List users',
|
|
163
|
+
responseDto: UserDto,
|
|
164
|
+
isArray: true,
|
|
165
|
+
error500Description: ERROR_DESCRIPTIONS.INTERNAL_SERVER_ERROR
|
|
166
|
+
})
|
|
167
|
+
async getAllUsers() {
|
|
168
|
+
// user list retrieval logic
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Paginated Responses
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
@Controller('users')
|
|
177
|
+
export class UsersController {
|
|
178
|
+
@Get()
|
|
179
|
+
@SwaggerDocumentation({
|
|
180
|
+
endpointDescription: 'Get paginated list of users',
|
|
181
|
+
endpointSummary: 'Paginated user list',
|
|
182
|
+
responseDto: UserDto,
|
|
183
|
+
isPaginated: true,
|
|
184
|
+
error400Description: ERROR_DESCRIPTIONS.BAD_REQUEST,
|
|
185
|
+
error500Description: ERROR_DESCRIPTIONS.INTERNAL_SERVER_ERROR
|
|
186
|
+
})
|
|
187
|
+
async getPaginatedUsers(@Query() query: PaginationDto) {
|
|
188
|
+
// pagination logic
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Paginated Response Structure
|
|
194
|
+
|
|
195
|
+
When using `isPaginated: true`, the response is automatically wrapped in the structure:
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
{
|
|
199
|
+
data: T[], // array of objects of the specified DTO
|
|
200
|
+
totalCount: number, // total number of records
|
|
201
|
+
offset: number, // offset
|
|
202
|
+
limit: number // limit of records per page
|
|
203
|
+
}
|
|
204
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const API_RESPONSE_DESCRIPTION = "If the server is available, it always responds with code 200 or 201. Error code 400 and higher will replace the ok field: it equals false and the error text in the error field. If the input data does not pass validation, the error field contains an object with invalid fields and error text";
|
|
2
|
+
export declare const ERROR_DESCRIPTIONS: {
|
|
3
|
+
BAD_REQUEST: string;
|
|
4
|
+
UNAUTHORIZED: string;
|
|
5
|
+
FORBIDDEN: string;
|
|
6
|
+
NOT_FOUND: string;
|
|
7
|
+
CONFLICT: string;
|
|
8
|
+
UNPROCESSABLE_ENTITY: string;
|
|
9
|
+
RATE_LIMIT_EXCEEDED: string;
|
|
10
|
+
INTERNAL_SERVER_ERROR: string;
|
|
11
|
+
SERVICE_UNAVAILABLE: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERROR_DESCRIPTIONS = exports.API_RESPONSE_DESCRIPTION = void 0;
|
|
4
|
+
exports.API_RESPONSE_DESCRIPTION = "If the server is available, it always responds with code 200 or 201. Error code 400 and higher will replace the ok field: it equals false and the error text in the error field. If the input data does not pass validation, the error field contains an object with invalid fields and error text";
|
|
5
|
+
exports.ERROR_DESCRIPTIONS = {
|
|
6
|
+
BAD_REQUEST: "Invalid request data or parameters",
|
|
7
|
+
UNAUTHORIZED: "Authentication required",
|
|
8
|
+
FORBIDDEN: "Access denied",
|
|
9
|
+
NOT_FOUND: "Resource not found",
|
|
10
|
+
CONFLICT: "Resource already exists or conflict detected",
|
|
11
|
+
UNPROCESSABLE_ENTITY: "Validation error",
|
|
12
|
+
RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Too many requests",
|
|
13
|
+
INTERNAL_SERVER_ERROR: "Internal server error",
|
|
14
|
+
SERVICE_UNAVAILABLE: "Service temporarily unavailable",
|
|
15
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SwaggerDocumentationOptions } from "../interfaces";
|
|
2
|
+
export declare const SwaggerDocumentation: (data: SwaggerDocumentationOptions) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwaggerDocumentation = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const dtos_1 = require("../dtos");
|
|
8
|
+
// SwaggerDocumentation is a decorator function to generate Swagger documentation for endpoints based on the provided options.
|
|
9
|
+
const SwaggerDocumentation = (data) => {
|
|
10
|
+
const decorators = [
|
|
11
|
+
(0, swagger_1.ApiOperation)({
|
|
12
|
+
description: data.endpointDescription,
|
|
13
|
+
summary: data.endpointSummary,
|
|
14
|
+
}),
|
|
15
|
+
];
|
|
16
|
+
if (data.error400Description) {
|
|
17
|
+
decorators.push((0, swagger_1.ApiBadRequestResponse)({
|
|
18
|
+
description: data.error400Description,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
if (data.error401Description) {
|
|
22
|
+
decorators.push((0, swagger_1.ApiUnauthorizedResponse)({
|
|
23
|
+
description: data.error401Description,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
if (data.error403Description) {
|
|
27
|
+
decorators.push((0, swagger_1.ApiForbiddenResponse)({
|
|
28
|
+
description: data.error403Description,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
if (data.error404Description) {
|
|
32
|
+
decorators.push((0, swagger_1.ApiNotFoundResponse)({
|
|
33
|
+
description: data.error404Description,
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
if (data.error409Description) {
|
|
37
|
+
decorators.push((0, swagger_1.ApiConflictResponse)({
|
|
38
|
+
description: data.error409Description,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
if (data.error422Description) {
|
|
42
|
+
decorators.push((0, swagger_1.ApiUnprocessableEntityResponse)({
|
|
43
|
+
description: data.error422Description,
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
if (data.error429Description) {
|
|
47
|
+
decorators.push((0, swagger_1.ApiTooManyRequestsResponse)({
|
|
48
|
+
description: data.error429Description,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
if (data.error500Description) {
|
|
52
|
+
decorators.push((0, swagger_1.ApiInternalServerErrorResponse)({
|
|
53
|
+
description: data.error500Description,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
if (data.error503Description) {
|
|
57
|
+
decorators.push((0, swagger_1.ApiServiceUnavailableResponse)({
|
|
58
|
+
description: data.error503Description,
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
if (data.isPaginated && data.responseDto) {
|
|
62
|
+
decorators.push((0, swagger_1.ApiOkResponse)({
|
|
63
|
+
schema: {
|
|
64
|
+
allOf: [
|
|
65
|
+
{ $ref: (0, swagger_1.getSchemaPath)(dtos_1.PaginatedResponseDto) },
|
|
66
|
+
{
|
|
67
|
+
properties: {
|
|
68
|
+
data: {
|
|
69
|
+
type: "array",
|
|
70
|
+
items: {
|
|
71
|
+
$ref: (0, swagger_1.getSchemaPath)(data.responseDto),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
description: constants_1.API_RESPONSE_DESCRIPTION,
|
|
79
|
+
}), (0, swagger_1.ApiExtraModels)(data.responseDto, dtos_1.PaginatedResponseDto));
|
|
80
|
+
}
|
|
81
|
+
else if (data.responseDto) {
|
|
82
|
+
decorators.push((0, swagger_1.ApiOkResponse)({
|
|
83
|
+
schema: data.isArray
|
|
84
|
+
? {
|
|
85
|
+
type: "array",
|
|
86
|
+
items: { $ref: (0, swagger_1.getSchemaPath)(data.responseDto) },
|
|
87
|
+
}
|
|
88
|
+
: { $ref: (0, swagger_1.getSchemaPath)(data.responseDto) },
|
|
89
|
+
description: constants_1.API_RESPONSE_DESCRIPTION,
|
|
90
|
+
}), (0, swagger_1.ApiExtraModels)(data.responseDto));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
decorators.push((0, swagger_1.ApiOkResponse)({
|
|
94
|
+
description: constants_1.API_RESPONSE_DESCRIPTION,
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
return (0, common_1.applyDecorators)(...decorators);
|
|
98
|
+
};
|
|
99
|
+
exports.SwaggerDocumentation = SwaggerDocumentation;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PaginatedResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class PaginatedResponseDto {
|
|
15
|
+
data;
|
|
16
|
+
totalCount;
|
|
17
|
+
offset;
|
|
18
|
+
limit;
|
|
19
|
+
}
|
|
20
|
+
exports.PaginatedResponseDto = PaginatedResponseDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], PaginatedResponseDto.prototype, "totalCount", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiProperty)(),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], PaginatedResponseDto.prototype, "offset", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiProperty)(),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], PaginatedResponseDto.prototype, "limit", void 0);
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./decorators"), exports);
|
|
19
|
+
__exportStar(require("./interfaces"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SwaggerDocumentationErrorStatus {
|
|
2
|
+
error400Description?: string;
|
|
3
|
+
error401Description?: string;
|
|
4
|
+
error403Description?: string;
|
|
5
|
+
error404Description?: string;
|
|
6
|
+
error409Description?: string;
|
|
7
|
+
error422Description?: string;
|
|
8
|
+
error429Description?: string;
|
|
9
|
+
error500Description?: string;
|
|
10
|
+
error503Description?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SwaggerDocumentationOptions extends SwaggerDocumentationErrorStatus {
|
|
13
|
+
endpointDescription?: string;
|
|
14
|
+
endpointSummary?: string;
|
|
15
|
+
responseDto?: Function;
|
|
16
|
+
isArray?: boolean;
|
|
17
|
+
isPaginated?: boolean;
|
|
18
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@globalart/nestjs-swagger",
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "A simple documentation builder for NestJS Swagger Module",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "GlobalArt, Inc"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"require": "./dist/index.js",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/GlobalArtInc/nestjs-toolkit.git#main"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"nestjs",
|
|
29
|
+
"swagger",
|
|
30
|
+
"documentation"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"format": "prettier --write \"**/*.ts\"",
|
|
34
|
+
"test": "jest --runInBand --passWithNoTests",
|
|
35
|
+
"test:cov": "jest --coverage --passWithNoTests",
|
|
36
|
+
"coveralls": "yarn run test:cov --coverageReporters=text-lcov | coveralls",
|
|
37
|
+
"build": "rm -rf ./dist && tsc",
|
|
38
|
+
"prepublishOnly": "npm run build",
|
|
39
|
+
"publish:dev": "npm publish --access public --tag dev",
|
|
40
|
+
"publish:npm": "release-it"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@nestjs/common": "^11.1.0",
|
|
44
|
+
"@nestjs/core": "^11.1.0",
|
|
45
|
+
"@nestjs/swagger": "^11.2.0",
|
|
46
|
+
"@nestjs/testing": "^11.1.0",
|
|
47
|
+
"@nestjs/typeorm": "^11.0.0",
|
|
48
|
+
"mysql": "^2.17.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/jest": "^30.0.0",
|
|
52
|
+
"@types/node": "^24.0.7",
|
|
53
|
+
"coveralls": "^3.0.5",
|
|
54
|
+
"jest": "^30.0.2",
|
|
55
|
+
"prettier": "^3.5.3",
|
|
56
|
+
"reflect-metadata": "^0.2.2",
|
|
57
|
+
"release-it": "19.0.3",
|
|
58
|
+
"rxjs": "^7.8.1",
|
|
59
|
+
"ts-jest": "^29.3.2",
|
|
60
|
+
"ts-node": "^10.0.0",
|
|
61
|
+
"typeorm": "0.3.25",
|
|
62
|
+
"typescript": "^5.8.3"
|
|
63
|
+
},
|
|
64
|
+
"jest": {
|
|
65
|
+
"coveragePathIgnorePatterns": [
|
|
66
|
+
"src/__tests__"
|
|
67
|
+
],
|
|
68
|
+
"moduleFileExtensions": [
|
|
69
|
+
"js",
|
|
70
|
+
"json",
|
|
71
|
+
"ts"
|
|
72
|
+
],
|
|
73
|
+
"rootDir": "src",
|
|
74
|
+
"testRegex": ".spec.ts$",
|
|
75
|
+
"transform": {
|
|
76
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
|
77
|
+
},
|
|
78
|
+
"coverageDirectory": "../coverage"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public"
|
|
82
|
+
}
|
|
83
|
+
}
|