@opra/nestjs-http 1.28.4 → 1.28.5
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/LICENSE +1 -1
- package/README.md +63 -3
- package/package.json +6 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,19 +1,79 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<a href="https://oprajs.com">
|
|
4
|
+
<img src="https://oprajs.com/img/opra-header-block.webp" width="880" alt="OPRA — Open Platform for Rich APIs" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
1
7
|
# @opra/nestjs-http
|
|
2
8
|
|
|
9
|
+
NestJS HTTP module for the OPRA framework
|
|
10
|
+
|
|
3
11
|
[![NPM Version][npm-image]][npm-url]
|
|
4
12
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
13
|
[![CI Tests][ci-test-image]][ci-test-url]
|
|
6
14
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
15
|
|
|
16
|
+
[🌐 Documentation](https://oprajs.com) · [🚀 Getting Started](https://oprajs.com/docs/introduction) · [📦 Packages](https://github.com/panates/opra#packages) · [💬 Issues](https://github.com/panates/opra/issues)
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
NestJS HTTP module for the [OPRA](https://oprajs.com) framework. Register your OPRA API inside a NestJS application in a few lines.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **`OpraHttpModule`** — Dynamically configurable NestJS module (`forRoot` / `forRootAsync`)
|
|
27
|
+
- **`OpraHttpNestjsAdapter`** — NestJS adapter integrating OPRA's HTTP handler
|
|
28
|
+
- **`OpraExceptionFilter`** — Global exception filter that maps OPRA errors to HTTP responses
|
|
29
|
+
- **`OpraMiddleware`** — Request/response middleware for the OPRA pipeline
|
|
30
|
+
- Full support for NestJS **dependency injection**, **interceptors**, and **guards**
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
8
33
|
|
|
9
|
-
|
|
10
|
-
|
|
34
|
+
```bash
|
|
35
|
+
npm install @opra/nestjs-http
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { Module } from '@nestjs/common';
|
|
42
|
+
import { OpraHttpModule } from '@opra/nestjs-http';
|
|
43
|
+
|
|
44
|
+
@Module({
|
|
45
|
+
imports: [
|
|
46
|
+
OpraHttpModule.forRoot({
|
|
47
|
+
name: 'MyAPI',
|
|
48
|
+
basePath: 'v1',
|
|
49
|
+
schemaIsPublic: true,
|
|
50
|
+
controllers: [UsersController, ProductsController],
|
|
51
|
+
providers: [UsersService, ProductsService],
|
|
52
|
+
types: [User, Product],
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
export class AppModule {}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Async configuration
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
OpraHttpModule.forRootAsync({
|
|
63
|
+
useFactory: (config: ConfigService) => ({
|
|
64
|
+
name: config.get('API_NAME'),
|
|
65
|
+
controllers: [UsersController],
|
|
66
|
+
}),
|
|
67
|
+
inject: [ConfigService],
|
|
68
|
+
})
|
|
69
|
+
```
|
|
11
70
|
|
|
12
71
|
## Node Compatibility
|
|
13
|
-
- node >= 20.x
|
|
14
72
|
|
|
73
|
+
- node >= 20.x
|
|
15
74
|
|
|
16
75
|
## License
|
|
76
|
+
|
|
17
77
|
Available under [MIT](LICENSE) license.
|
|
18
78
|
|
|
19
79
|
[npm-image]: https://img.shields.io/npm/v/@opra/nestjs-http
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/nestjs-http",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.5",
|
|
4
4
|
"description": "Opra NestJS Http Module",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://www.oprajs.com",
|
|
7
8
|
"dependencies": {
|
|
8
9
|
"@jsopen/objects": "^2.2.2",
|
|
9
10
|
"tslib": "^2.8.1"
|
|
10
11
|
},
|
|
11
12
|
"peerDependencies": {
|
|
12
|
-
"@opra/common": "^1.28.
|
|
13
|
-
"@opra/core": "^1.28.
|
|
14
|
-
"@opra/nestjs": "^1.28.
|
|
15
|
-
"@opra/http": "^1.28.
|
|
13
|
+
"@opra/common": "^1.28.5",
|
|
14
|
+
"@opra/core": "^1.28.5",
|
|
15
|
+
"@opra/nestjs": "^1.28.5",
|
|
16
|
+
"@opra/http": "^1.28.5",
|
|
16
17
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
17
18
|
"@nestjs/core": "^10.0.0 || ^11.0.0"
|
|
18
19
|
},
|