@tsed/common 7.0.0-beta.1 → 7.0.0-beta.4
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/lib/cjs/builder/PlatformBuilder.js +38 -27
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/builder/PlatformControllerBuilder.js +5 -8
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -1
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.js +2 -2
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -1
- package/lib/cjs/domain/EndpointMetadata.js +2 -66
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -1
- package/lib/cjs/domain/PlatformContext.js.map +1 -1
- package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -1
- package/lib/cjs/exports.js +31 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +68 -30
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -1
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +8 -8
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +25 -13
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js +1 -1
- package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/FakeAdapter.js +55 -0
- package/lib/cjs/services/FakeAdapter.js.map +1 -0
- package/lib/cjs/services/Platform.js +30 -9
- package/lib/cjs/services/Platform.js.map +1 -1
- package/lib/cjs/services/PlatformAdapter.js +14 -0
- package/lib/cjs/services/PlatformAdapter.js.map +1 -0
- package/lib/cjs/services/PlatformApplication.js +9 -11
- package/lib/cjs/services/PlatformApplication.js.map +1 -1
- package/lib/cjs/services/PlatformHandler.js +10 -8
- package/lib/cjs/services/PlatformHandler.js.map +1 -1
- package/lib/cjs/services/PlatformMiddlewaresChain.js +56 -15
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -1
- package/lib/cjs/services/PlatformRequest.js +2 -2
- package/lib/cjs/services/PlatformResponse.js +5 -5
- package/lib/cjs/services/PlatformResponse.js.map +1 -1
- package/lib/cjs/services/PlatformRouter.js +14 -32
- package/lib/cjs/services/PlatformRouter.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +3 -2
- package/lib/cjs/services/PlatformTest.js.map +1 -1
- package/lib/cjs/utils/__mock__/Test1.js +8 -0
- package/lib/cjs/utils/__mock__/Test1.js.map +1 -0
- package/lib/cjs/utils/__mock__/Test2.js +8 -0
- package/lib/cjs/utils/__mock__/Test2.js.map +1 -0
- package/lib/cjs/utils/createContext.js +2 -2
- package/lib/cjs/utils/createContext.js.map +1 -1
- package/lib/cjs/utils/createHandlerMetadata.js +2 -2
- package/lib/cjs/utils/createHandlerMetadata.js.map +1 -1
- package/lib/cjs/utils/createHttpServer.js +3 -2
- package/lib/cjs/utils/createHttpServer.js.map +1 -1
- package/lib/cjs/utils/createHttpsServer.js +3 -2
- package/lib/cjs/utils/createHttpsServer.js.map +1 -1
- package/lib/cjs/utils/createInjector.js +11 -3
- package/lib/cjs/utils/createInjector.js.map +1 -1
- package/lib/cjs/utils/importProviders.js +29 -0
- package/lib/cjs/utils/importProviders.js.map +1 -0
- package/lib/cjs/utils/setResponseHeaders.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +25 -14
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/builder/PlatformControllerBuilder.js +8 -11
- package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -1
- package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -1
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/esm/decorators/multer/multerFileSize.js +1 -1
- package/lib/esm/decorators/multer/multerOptions.js +1 -1
- package/lib/esm/decorators/multer/multipartFile.js +1 -1
- package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
- package/lib/esm/domain/ControllerProvider.js +1 -1
- package/lib/esm/domain/EndpointMetadata.js +1 -66
- package/lib/esm/domain/EndpointMetadata.js.map +1 -1
- package/lib/esm/domain/HandlerMetadata.js +1 -1
- package/lib/esm/domain/PlatformContext.js +3 -3
- package/lib/esm/domain/PlatformContext.js.map +1 -1
- package/lib/esm/domain/PlatformRouteDetails.js.map +1 -1
- package/lib/esm/exports.js +13 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +68 -27
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -1
- package/lib/esm/middlewares/PlatformMulterMiddleware.js +16 -5
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/FakeAdapter.js +51 -0
- package/lib/esm/services/FakeAdapter.js.map +1 -0
- package/lib/esm/services/Platform.js +31 -10
- package/lib/esm/services/Platform.js.map +1 -1
- package/lib/esm/services/PlatformAdapter.js +10 -0
- package/lib/esm/services/PlatformAdapter.js.map +1 -0
- package/lib/esm/services/PlatformApplication.js +11 -13
- package/lib/esm/services/PlatformApplication.js.map +1 -1
- package/lib/esm/services/PlatformHandler.js +11 -9
- package/lib/esm/services/PlatformHandler.js.map +1 -1
- package/lib/esm/services/PlatformMiddlewaresChain.js +61 -20
- package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -1
- package/lib/esm/services/PlatformResponse.js +1 -1
- package/lib/esm/services/PlatformResponse.js.map +1 -1
- package/lib/esm/services/PlatformRouter.js +13 -31
- package/lib/esm/services/PlatformRouter.js.map +1 -1
- package/lib/esm/services/PlatformTest.js +7 -7
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/esm/utils/__mock__/Test1.js +4 -0
- package/lib/esm/utils/__mock__/Test1.js.map +1 -0
- package/lib/esm/utils/__mock__/Test2.js +4 -0
- package/lib/esm/utils/__mock__/Test2.js.map +1 -0
- package/lib/esm/utils/createContext.js +5 -5
- package/lib/esm/utils/createContext.js.map +1 -1
- package/lib/esm/utils/createHandlerMetadata.js +3 -3
- package/lib/esm/utils/createHandlerMetadata.js.map +1 -1
- package/lib/esm/utils/createHttpServer.js +4 -3
- package/lib/esm/utils/createHttpServer.js.map +1 -1
- package/lib/esm/utils/createHttpsServer.js +4 -3
- package/lib/esm/utils/createHttpsServer.js.map +1 -1
- package/lib/esm/utils/createInjector.js +18 -10
- package/lib/esm/utils/createInjector.js.map +1 -1
- package/lib/esm/utils/importProviders.js +25 -0
- package/lib/esm/utils/importProviders.js.map +1 -0
- package/lib/esm/utils/setResponseHeaders.js.map +1 -1
- package/lib/esm/utils/useCtxHandler.js +1 -1
- package/lib/types/builder/PlatformBuilder.d.ts +7 -6
- package/lib/types/builder/PlatformControllerBuilder.d.ts +2 -1
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +6 -130
- package/lib/types/config/services/PlatformConfiguration.d.ts +2 -1
- package/lib/types/domain/EndpointMetadata.d.ts +1 -50
- package/lib/types/domain/PlatformContext.d.ts +1 -1
- package/lib/types/domain/PlatformRouteDetails.d.ts +2 -3
- package/lib/types/exports.d.ts +12 -0
- package/lib/types/index.d.ts +65 -17
- package/lib/types/interfaces/PlatformRouteOptions.d.ts +1 -1
- package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +8 -3
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +2 -1
- package/lib/types/services/FakeAdapter.d.ts +30 -0
- package/lib/types/services/Platform.d.ts +10 -1
- package/lib/types/services/PlatformAdapter.d.ts +47 -0
- package/lib/types/services/PlatformApplication.d.ts +3 -3
- package/lib/types/services/PlatformHandler.d.ts +1 -1
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -2
- package/lib/types/services/PlatformResponse.d.ts +6 -6
- package/lib/types/services/PlatformRouter.d.ts +10 -7
- package/lib/types/services/PlatformTest.d.ts +2 -2
- package/lib/types/utils/__mock__/Test1.d.ts +3 -0
- package/lib/types/utils/__mock__/Test2.d.ts +3 -0
- package/lib/types/utils/createHandlerMetadata.d.ts +1 -1
- package/lib/types/utils/createHttpServer.d.ts +1 -1
- package/lib/types/utils/createHttpsServer.d.ts +2 -1
- package/lib/types/utils/createInjector.d.ts +5 -3
- package/lib/types/utils/importProviders.d.ts +10 -0
- package/package.json +38 -26
- package/readme.md +50 -57
- package/tsconfig.compile.esm.json +2 -12
- package/lib/cjs/config/index.js +0 -7
- package/lib/cjs/config/index.js.map +0 -1
- package/lib/cjs/config/interfaces/index.js +0 -8
- package/lib/cjs/config/interfaces/index.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -21
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/decorators/method/acceptMime.js +0 -28
- package/lib/cjs/decorators/method/acceptMime.js.map +0 -1
- package/lib/cjs/decorators/method/endpointFn.js +0 -15
- package/lib/cjs/decorators/method/endpointFn.js.map +0 -1
- package/lib/cjs/decorators/method/location.js +0 -6
- package/lib/cjs/decorators/method/location.js.map +0 -1
- package/lib/cjs/decorators/method/redirect.js +0 -6
- package/lib/cjs/decorators/method/redirect.js.map +0 -1
- package/lib/cjs/decorators/method/route.js +0 -13
- package/lib/cjs/decorators/method/route.js.map +0 -1
- package/lib/cjs/decorators/method/view.js +0 -34
- package/lib/cjs/decorators/method/view.js.map +0 -1
- package/lib/cjs/decorators/multer/index.js +0 -7
- package/lib/cjs/decorators/multer/index.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -10
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/PathType.js +0 -3
- package/lib/cjs/interfaces/PathType.js.map +0 -1
- package/lib/cjs/interfaces/PlatformAdapter.js +0 -3
- package/lib/cjs/interfaces/PlatformAdapter.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -21
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/middlewares/index.js +0 -7
- package/lib/cjs/middlewares/index.js.map +0 -1
- package/lib/cjs/services/FakeRawDriver.js +0 -26
- package/lib/cjs/services/FakeRawDriver.js.map +0 -1
- package/lib/cjs/services/index.js +0 -12
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -11
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/esm/config/index.js +0 -4
- package/lib/esm/config/index.js.map +0 -1
- package/lib/esm/config/interfaces/index.js +0 -5
- package/lib/esm/config/interfaces/index.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -18
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/decorators/method/acceptMime.js +0 -24
- package/lib/esm/decorators/method/acceptMime.js.map +0 -1
- package/lib/esm/decorators/method/endpointFn.js +0 -11
- package/lib/esm/decorators/method/endpointFn.js.map +0 -1
- package/lib/esm/decorators/method/location.js +0 -2
- package/lib/esm/decorators/method/location.js.map +0 -1
- package/lib/esm/decorators/method/redirect.js +0 -2
- package/lib/esm/decorators/method/redirect.js.map +0 -1
- package/lib/esm/decorators/method/route.js +0 -2
- package/lib/esm/decorators/method/route.js.map +0 -1
- package/lib/esm/decorators/method/view.js +0 -30
- package/lib/esm/decorators/method/view.js.map +0 -1
- package/lib/esm/decorators/multer/index.js +0 -4
- package/lib/esm/decorators/multer/index.js.map +0 -1
- package/lib/esm/domain/index.js +0 -7
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/PathType.js +0 -2
- package/lib/esm/interfaces/PathType.js.map +0 -1
- package/lib/esm/interfaces/PlatformAdapter.js +0 -2
- package/lib/esm/interfaces/PlatformAdapter.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -18
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/middlewares/index.js +0 -4
- package/lib/esm/middlewares/index.js.map +0 -1
- package/lib/esm/services/FakeRawDriver.js +0 -22
- package/lib/esm/services/FakeRawDriver.js.map +0 -1
- package/lib/esm/services/index.js +0 -9
- package/lib/esm/services/index.js.map +0 -1
- package/lib/esm/utils/index.js +0 -8
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/types/config/index.d.ts +0 -3
- package/lib/types/config/interfaces/index.d.ts +0 -97
- package/lib/types/decorators/index.d.ts +0 -14
- package/lib/types/decorators/method/acceptMime.d.ts +0 -19
- package/lib/types/decorators/method/endpointFn.d.ts +0 -9
- package/lib/types/decorators/method/location.d.ts +0 -1
- package/lib/types/decorators/method/redirect.d.ts +0 -1
- package/lib/types/decorators/method/route.d.ts +0 -1
- package/lib/types/decorators/method/view.d.ts +0 -25
- package/lib/types/decorators/multer/index.d.ts +0 -3
- package/lib/types/domain/index.d.ts +0 -6
- package/lib/types/interfaces/PathType.d.ts +0 -1
- package/lib/types/interfaces/PlatformAdapter.d.ts +0 -19
- package/lib/types/interfaces/index.d.ts +0 -17
- package/lib/types/middlewares/index.d.ts +0 -3
- package/lib/types/services/FakeRawDriver.d.ts +0 -15
- package/lib/types/services/index.d.ts +0 -8
- package/lib/types/utils/index.d.ts +0 -7
package/readme.md
CHANGED
|
@@ -31,32 +31,32 @@
|
|
|
31
31
|
|
|
32
32
|
## What it is
|
|
33
33
|
|
|
34
|
-
Ts.ED is a framework on top of Express that helps you to write your application in TypeScript (or in ES6). It provides a lot of decorators
|
|
34
|
+
Ts.ED is a framework on top of Express that helps you to write your application in TypeScript (or in ES6). It provides a lot of decorators
|
|
35
35
|
to make your code more readable and less error-prone.
|
|
36
36
|
|
|
37
37
|
## Features
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
- Use our CLI to create a new project https://cli.tsed.io
|
|
40
|
+
- Support TypeORM, Mongoose, GraphQL, Socket.io, Swagger-ui, Passport.js, etc...
|
|
41
|
+
- Define class as Controller,
|
|
42
|
+
- Define class as Service (IoC),
|
|
43
|
+
- Define class as Middleware and MiddlewareError,
|
|
44
|
+
- Define class as Converter (POJ to Model and Model to POJ),
|
|
45
|
+
- Define root path for an entire controller and versioning your Rest API,
|
|
46
|
+
- Define as sub-route path for a method,
|
|
47
|
+
- Define routes on GET, POST, PUT, DELETE and HEAD verbs,
|
|
48
|
+
- Define middlewares on routes,
|
|
49
|
+
- Define required parameters,
|
|
50
|
+
- Inject data from query string, path parameters, entire body, cookies, session or header,
|
|
51
|
+
- Inject Request, Response, Next object from Express request,
|
|
52
|
+
- Template (View),
|
|
53
|
+
- Testing.
|
|
54
54
|
|
|
55
55
|
## Documentation
|
|
56
56
|
|
|
57
57
|
Documentation is available on [https://tsed.io](https://tsed.io)
|
|
58
58
|
|
|
59
|
-
## Getting started
|
|
59
|
+
## Getting started
|
|
60
60
|
|
|
61
61
|
See our [getting started here](https://tsed.io/getting-started/) to create new Ts.ED project or use
|
|
62
62
|
our [CLI](https://cli.tsed.io)
|
|
@@ -65,8 +65,8 @@ our [CLI](https://cli.tsed.io)
|
|
|
65
65
|
|
|
66
66
|
Examples are available on [https://tsed.io/tutorials/](https://tsed.io/tutorials/)
|
|
67
67
|
|
|
68
|
-
|
|
69
68
|
## Overview
|
|
69
|
+
|
|
70
70
|
### Server example
|
|
71
71
|
|
|
72
72
|
Here an example to create a Server with Ts.ED:
|
|
@@ -75,37 +75,19 @@ Here an example to create a Server with Ts.ED:
|
|
|
75
75
|
import {Configuration, Inject} from "@tsed/di";
|
|
76
76
|
import {PlatformApplication} from "@tsed/common";
|
|
77
77
|
import "@tsed/platform-express";
|
|
78
|
-
import
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
import Path from "path";
|
|
79
|
+
import cookieParser from "cookie-parser";
|
|
80
|
+
import compress from "compression";
|
|
81
|
+
import methodOverride from "method-override";
|
|
81
82
|
|
|
82
83
|
@Configuration({
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
port: 3000,
|
|
85
|
+
middlewares: [cookieParser(), compress({}), methodOverride()]
|
|
85
86
|
})
|
|
86
|
-
export class Server {
|
|
87
|
-
@Inject()
|
|
88
|
-
app: PlatformApplication;
|
|
89
|
-
|
|
90
|
-
public $beforeRoutesInit() {
|
|
91
|
-
const cookieParser = require('cookie-parser'),
|
|
92
|
-
bodyParser = require('body-parser'),
|
|
93
|
-
compress = require('compression'),
|
|
94
|
-
methodOverride = require('method-override');
|
|
95
|
-
|
|
96
|
-
this.app
|
|
97
|
-
.use(cookieParser())
|
|
98
|
-
.use(compress({}))
|
|
99
|
-
.use(methodOverride())
|
|
100
|
-
.use(bodyParser.json())
|
|
101
|
-
.use(bodyParser.urlencoded({
|
|
102
|
-
extended: true
|
|
103
|
-
}));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
87
|
+
export class Server {}
|
|
106
88
|
```
|
|
107
89
|
|
|
108
|
-
To run your server, you have to use Platform API to bootstrap your application with the expected
|
|
90
|
+
To run your server, you have to use Platform API to bootstrap your application with the expected
|
|
109
91
|
platform like Express.
|
|
110
92
|
|
|
111
93
|
```typescript
|
|
@@ -137,21 +119,34 @@ This is a simple controller to expose user resource. It use decorators to build
|
|
|
137
119
|
```typescript
|
|
138
120
|
import {Inject} from "@tsed/di";
|
|
139
121
|
import {Summary} from "@tsed/swagger";
|
|
140
|
-
import {
|
|
122
|
+
import {
|
|
123
|
+
Returns,
|
|
124
|
+
ReturnsArray,
|
|
125
|
+
Controller,
|
|
126
|
+
Get,
|
|
127
|
+
QueryParams,
|
|
128
|
+
PathParams,
|
|
129
|
+
Delete,
|
|
130
|
+
Post,
|
|
131
|
+
Required,
|
|
132
|
+
BodyParams,
|
|
133
|
+
Status,
|
|
134
|
+
Put
|
|
135
|
+
} from "@tsed/common";
|
|
141
136
|
import {BadRequest} from "@tsed/exceptions";
|
|
142
137
|
import {UsersService} from "../services/UsersService";
|
|
143
|
-
import {User} from "../models/User";
|
|
138
|
+
import {User} from "../models/User";
|
|
144
139
|
|
|
145
140
|
@Controller("/users")
|
|
146
141
|
export class UsersCtrl {
|
|
147
142
|
@Inject()
|
|
148
|
-
usersService: UsersService;
|
|
143
|
+
protected usersService: UsersService;
|
|
149
144
|
|
|
150
145
|
@Get("/:id")
|
|
151
146
|
@Summary("Get a user from his Id")
|
|
152
147
|
@Returns(User)
|
|
153
148
|
async getUser(@PathParams("id") id: string): Promise<User> {
|
|
154
|
-
|
|
149
|
+
return this.usersService.findById(id);
|
|
155
150
|
}
|
|
156
151
|
|
|
157
152
|
@Post("/")
|
|
@@ -168,41 +163,40 @@ export class UsersCtrl {
|
|
|
168
163
|
@Returns(User)
|
|
169
164
|
async putUser(@PathParams("id") id: string, @Required() @BodyParams() user: User): Promise<User> {
|
|
170
165
|
if (user.id !== id) {
|
|
171
|
-
throw new BadRequest("ID mismatch with the given payload")
|
|
166
|
+
throw new BadRequest("ID mismatch with the given payload");
|
|
172
167
|
}
|
|
173
168
|
|
|
174
169
|
return this.usersService.save(user);
|
|
175
170
|
}
|
|
176
|
-
|
|
171
|
+
|
|
177
172
|
@Delete("/:id")
|
|
178
173
|
@Summary("Remove a user")
|
|
179
174
|
@Status(204)
|
|
180
|
-
async deleteUser(@PathParams("id") @Required() id: string
|
|
181
|
-
|
|
175
|
+
async deleteUser(@PathParams("id") @Required() id: string): Promise<User> {
|
|
176
|
+
await this.usersService.delete(user);
|
|
182
177
|
}
|
|
183
|
-
|
|
178
|
+
|
|
184
179
|
@Get("/")
|
|
185
180
|
@Summary("Get all users")
|
|
186
181
|
@ReturnsArray(User)
|
|
187
|
-
async findUser(@QueryParams("name") name: string){
|
|
182
|
+
async findUser(@QueryParams("name") name: string) {
|
|
188
183
|
return this.usersService.find({name});
|
|
189
184
|
}
|
|
190
185
|
}
|
|
191
186
|
```
|
|
192
187
|
|
|
193
188
|
## Contributors
|
|
189
|
+
|
|
194
190
|
Please read [contributing guidelines here](./CONTRIBUTING.md).
|
|
195
191
|
|
|
196
192
|
<a href="https://github.com/tsedio/tsed/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
197
193
|
|
|
198
|
-
|
|
199
194
|
## Backers
|
|
200
195
|
|
|
201
196
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
202
197
|
|
|
203
198
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
|
|
204
199
|
|
|
205
|
-
|
|
206
200
|
## Sponsors
|
|
207
201
|
|
|
208
202
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -220,4 +214,3 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
220
214
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
221
215
|
|
|
222
216
|
[travis]: https://travis-ci.org/
|
|
223
|
-
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"include": ["src"],
|
|
12
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
13
|
}
|
package/lib/cjs/config/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./interfaces"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./services/PlatformConfiguration"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./services/PlatformConfiguration"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,gFAAiD;AACjD,gFAAiD","sourcesContent":["export * from \"./interfaces\";\nexport * from \"./services/PlatformConfiguration\";\nexport * from \"./services/PlatformConfiguration\";\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./PlatformLoggerSettings"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./EndpointDirectoriesSettings"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./PlatformStaticsSettings"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./PlatformMulterSettings"), exports);
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/config/interfaces/index.ts"],"names":[],"mappings":";;;AA6FA,wEAAyC;AACzC,6EAA8C;AAC9C,yEAA0C;AAC1C,wEAAyC","sourcesContent":["import {Env} from \"@tsed/core\";\nimport {ConverterSettings} from \"./ConverterSettings\";\nimport {EndpointDirectoriesSettings} from \"./EndpointDirectoriesSettings\";\nimport {PlatformLoggerSettings} from \"./PlatformLoggerSettings\";\nimport {PlatformMulterSettings} from \"./PlatformMulterSettings\";\nimport {PlatformStaticsSettings} from \"./PlatformStaticsSettings\";\nimport type Http from \"http\";\nimport type Https from \"https\";\n\ndeclare global {\n namespace TsED {\n interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {}\n interface Configuration {\n /**\n * The root directory where you build run project. By default, it's equal to `process.cwd().\n */\n rootDir: string;\n /**\n * The environment profile. By default the environment profile is equals to `NODE_ENV`.\n */\n env: Env;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n port: string | number;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n httpPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.\n * - `passphrase` <string> A string containing the passphrase for the private key or pfx.\n * - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)\n * - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known \"root\" CAs (like VeriSign) will be used. These are used to authorize connections.\n */\n httpOptions: Http.ServerOptions;\n /**\n * Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).\n */\n httpsPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.\n * - `passphrase` <string> A string containing the passphrase for the private key or pfx.\n * - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)\n * - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known \"root\" CAs (like VeriSign) will be used. These are used to authorize connections.\n */\n httpsOptions: Https.ServerOptions;\n /**\n * Mount all controllers under a directories to an endpoint.\n */\n mount: EndpointDirectoriesSettings;\n /**\n * List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).\n */\n componentsScan: (string | RegExp)[];\n /**\n * Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.\n */\n disableComponentsScan: boolean;\n /**\n * List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.\n */\n exclude: string[];\n /**\n * Configure the mimes accepted by default by the server.\n */\n acceptMimes: string[];\n /**\n * Enable debug mode. By default debug is false.\n */\n debug: boolean;\n /**\n * Converter configuration.\n */\n converter: Partial<ConverterSettings>;\n /**\n * Logger configuration.\n */\n logger?: LoggerConfiguration;\n /**\n * Object to mount all directories under to his endpoints. See more on [Serve Static](/tutorials/serve-static-files.md).\n */\n statics: PlatformStaticsSettings;\n /**\n * Object configure Multer. See more on [Upload file](/tutorials/serve-static-files.md).\n */\n multer: PlatformMulterSettings;\n }\n }\n}\n\nexport * from \"./PlatformLoggerSettings\";\nexport * from \"./EndpointDirectoriesSettings\";\nexport * from \"./PlatformStaticsSettings\";\nexport * from \"./PlatformMulterSettings\";\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./httpServer"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./httpsServer"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./multer"), exports);
|
|
7
|
-
// Method
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./method/route"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./method/acceptMime"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./method/location"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./method/redirect"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./method/endpointFn"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./method/view"), exports);
|
|
14
|
-
// Params
|
|
15
|
-
(0, tslib_1.__exportStar)(require("./params/response"), exports);
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./params/request"), exports);
|
|
17
|
-
(0, tslib_1.__exportStar)(require("./params/next"), exports);
|
|
18
|
-
(0, tslib_1.__exportStar)(require("./params/error"), exports);
|
|
19
|
-
// utils
|
|
20
|
-
(0, tslib_1.__exportStar)(require("../utils/mapReturnedResponse"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,6DAA8B;AAE9B,wDAAyB;AAEzB,SAAS;AACT,8DAA+B;AAC/B,mEAAoC;AACpC,iEAAkC;AAClC,iEAAkC;AAClC,mEAAoC;AACpC,6DAA8B;AAE9B,SAAS;AACT,iEAAkC;AAClC,gEAAiC;AACjC,6DAA8B;AAC9B,8DAA+B;AAE/B,QAAQ;AACR,4EAA6C","sourcesContent":["export * from \"./httpServer\";\nexport * from \"./httpsServer\";\n\nexport * from \"./multer\";\n\n// Method\nexport * from \"./method/route\";\nexport * from \"./method/acceptMime\";\nexport * from \"./method/location\";\nexport * from \"./method/redirect\";\nexport * from \"./method/endpointFn\";\nexport * from \"./method/view\";\n\n// Params\nexport * from \"./params/response\";\nexport * from \"./params/request\";\nexport * from \"./params/next\";\nexport * from \"./params/error\";\n\n// utils\nexport * from \"../utils/mapReturnedResponse\";\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AcceptMime = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const schema_1 = require("@tsed/schema");
|
|
6
|
-
/**
|
|
7
|
-
* Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* @Controller('/mypath')
|
|
11
|
-
* export class MyCtrl {
|
|
12
|
-
*
|
|
13
|
-
* @Get('/')
|
|
14
|
-
* @AcceptMime('application/json')
|
|
15
|
-
* public getResource(){}
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @param mimes
|
|
20
|
-
* @decorator
|
|
21
|
-
* @operation
|
|
22
|
-
* @response
|
|
23
|
-
*/
|
|
24
|
-
function AcceptMime(...mimes) {
|
|
25
|
-
return (0, core_1.useDecorators)((0, schema_1.Produces)(...mimes), (0, core_1.StoreSet)("acceptMimes", mimes));
|
|
26
|
-
}
|
|
27
|
-
exports.AcceptMime = AcceptMime;
|
|
28
|
-
//# sourceMappingURL=acceptMime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acceptMime.js","sourceRoot":"","sources":["../../../../src/decorators/method/acceptMime.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,UAAU,CAAC,GAAG,KAAe;IAC3C,OAAO,IAAA,oBAAa,EAAC,IAAA,iBAAQ,EAAC,GAAG,KAAK,CAAC,EAAE,IAAA,eAAQ,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3E,CAAC;AAFD,gCAEC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {Produces} from \"@tsed/schema\";\n\n/**\n * Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.\n *\n * ```typescript\n * @Controller('/mypath')\n * export class MyCtrl {\n *\n * @Get('/')\n * @AcceptMime('application/json')\n * public getResource(){}\n * }\n * ```\n *\n * @param mimes\n * @decorator\n * @operation\n * @response\n */\nexport function AcceptMime(...mimes: string[]): Function {\n return useDecorators(Produces(...mimes), StoreSet(\"acceptMimes\", mimes));\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EndpointFn = void 0;
|
|
4
|
-
const schema_1 = require("@tsed/schema");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @param fn
|
|
8
|
-
* @decorator
|
|
9
|
-
* @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
|
|
10
|
-
*/
|
|
11
|
-
function EndpointFn(fn) {
|
|
12
|
-
return (0, schema_1.JsonEntityFn)(fn);
|
|
13
|
-
}
|
|
14
|
-
exports.EndpointFn = EndpointFn;
|
|
15
|
-
//# sourceMappingURL=endpointFn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpointFn.js","sourceRoot":"","sources":["../../../../src/decorators/method/endpointFn.ts"],"names":[],"mappings":";;;AACA,yCAA0C;AAG1C;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,EAAyE;IAClG,OAAO,IAAA,qBAAY,EAAmB,EAAE,CAAQ,CAAC;AACnD,CAAC;AAFD,gCAEC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport {JsonEntityFn} from \"@tsed/schema\";\nimport {EndpointMetadata} from \"../../domain\";\n\n/**\n *\n * @param fn\n * @decorator\n * @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.\n */\nexport function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator {\n return JsonEntityFn<EndpointMetadata>(fn) as any;\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Location = void 0;
|
|
4
|
-
var schema_1 = require("@tsed/schema");
|
|
5
|
-
Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return schema_1.Location; } });
|
|
6
|
-
//# sourceMappingURL=location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../src/decorators/method/location.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA9B,kGAAA,QAAQ,OAAA","sourcesContent":["export {Location} from \"@tsed/schema\";\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Redirect = void 0;
|
|
4
|
-
var schema_1 = require("@tsed/schema");
|
|
5
|
-
Object.defineProperty(exports, "Redirect", { enumerable: true, get: function () { return schema_1.Redirect; } });
|
|
6
|
-
//# sourceMappingURL=redirect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/decorators/method/redirect.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA9B,kGAAA,QAAQ,OAAA","sourcesContent":["export {Redirect} from \"@tsed/schema\";\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.All = exports.Options = exports.Head = exports.Delete = exports.Patch = exports.Put = exports.Post = exports.Get = void 0;
|
|
4
|
-
var schema_1 = require("@tsed/schema");
|
|
5
|
-
Object.defineProperty(exports, "Get", { enumerable: true, get: function () { return schema_1.Get; } });
|
|
6
|
-
Object.defineProperty(exports, "Post", { enumerable: true, get: function () { return schema_1.Post; } });
|
|
7
|
-
Object.defineProperty(exports, "Put", { enumerable: true, get: function () { return schema_1.Put; } });
|
|
8
|
-
Object.defineProperty(exports, "Patch", { enumerable: true, get: function () { return schema_1.Patch; } });
|
|
9
|
-
Object.defineProperty(exports, "Delete", { enumerable: true, get: function () { return schema_1.Delete; } });
|
|
10
|
-
Object.defineProperty(exports, "Head", { enumerable: true, get: function () { return schema_1.Head; } });
|
|
11
|
-
Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return schema_1.Options; } });
|
|
12
|
-
Object.defineProperty(exports, "All", { enumerable: true, get: function () { return schema_1.All; } });
|
|
13
|
-
//# sourceMappingURL=route.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/decorators/method/route.ts"],"names":[],"mappings":";;;AAAA,uCAA+E;AAAvE,6FAAA,GAAG,OAAA;AAAE,8FAAA,IAAI,OAAA;AAAE,6FAAA,GAAG,OAAA;AAAE,+FAAA,KAAK,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,8FAAA,IAAI,OAAA;AAAE,iGAAA,OAAO,OAAA;AAAE,6FAAA,GAAG,OAAA","sourcesContent":["export {Get, Post, Put, Patch, Delete, Head, Options, All} from \"@tsed/schema\";\n"]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.View = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
/**
|
|
6
|
-
* Use a view and sends the rendered HTML string to the client. Optional parameter:
|
|
7
|
-
*
|
|
8
|
-
* * viewOptions, an object whose properties define local variables for the view.
|
|
9
|
-
*
|
|
10
|
-
* The view argument is a string that is the file path of the view file to render.
|
|
11
|
-
* This can be an absolute path, or a path relative to the views setting.
|
|
12
|
-
* If the path does not contain a file extension, then the view engine setting determines the file extension.
|
|
13
|
-
* If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
|
|
14
|
-
* and render it using the loaded module’s __express function.
|
|
15
|
-
*
|
|
16
|
-
* For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
|
|
17
|
-
*
|
|
18
|
-
* > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
|
|
19
|
-
* and as so for security reasons should not contain input from the end-user.
|
|
20
|
-
*
|
|
21
|
-
* @param path Relative path to the view file.
|
|
22
|
-
* @param options Additional options
|
|
23
|
-
* @decorator
|
|
24
|
-
* @operation
|
|
25
|
-
* @response
|
|
26
|
-
* @ignores
|
|
27
|
-
* @deprecated Use View decorator from @tsed/platform-views instead.
|
|
28
|
-
*/
|
|
29
|
-
// istanbul ignore next
|
|
30
|
-
function View(path, options) {
|
|
31
|
-
return (0, core_1.StoreSet)("view", { path, options });
|
|
32
|
-
}
|
|
33
|
-
exports.View = View;
|
|
34
|
-
//# sourceMappingURL=view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/decorators/method/view.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,uBAAuB;AACvB,SAAgB,IAAI,CAAC,IAAY,EAAE,OAAgB;IACjD,OAAO,IAAA,eAAQ,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAQ,CAAC;AAClD,CAAC;AAFD,oBAEC","sourcesContent":["import {StoreSet} from \"@tsed/core\";\n\n/**\n * Use a view and sends the rendered HTML string to the client. Optional parameter:\n *\n * * viewOptions, an object whose properties define local variables for the view.\n *\n * The view argument is a string that is the file path of the view file to render.\n * This can be an absolute path, or a path relative to the views setting.\n * If the path does not contain a file extension, then the view engine setting determines the file extension.\n * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())\n * and render it using the loaded module’s __express function.\n *\n * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).\n *\n * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,\n * and as so for security reasons should not contain input from the end-user.\n *\n * @param path Relative path to the view file.\n * @param options Additional options\n * @decorator\n * @operation\n * @response\n * @ignores\n * @deprecated Use View decorator from @tsed/platform-views instead.\n */\n// istanbul ignore next\nexport function View(path: string, options?: Object): MethodDecorator {\n return StoreSet(\"view\", {path, options}) as any;\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./multerFileSize"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./multerOptions"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./multipartFile"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorators/multer/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,+DAAgC;AAChC,+DAAgC","sourcesContent":["export * from \"./multerFileSize\";\nexport * from \"./multerOptions\";\nexport * from \"./multipartFile\";\n"]}
|
package/lib/cjs/domain/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./AnyToPromiseWithCtx"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./PlatformContext"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./PlatformRouteDetails"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./ControllerProvider"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./EndpointMetadata"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./HandlerMetadata"), exports);
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,qEAAsC;AACtC,iEAAkC;AAClC,sEAAuC;AACvC,oEAAqC;AACrC,kEAAmC;AACnC,iEAAkC","sourcesContent":["export * from \"./AnyToPromiseWithCtx\";\nexport * from \"./PlatformContext\";\nexport * from \"./PlatformRouteDetails\";\nexport * from \"./ControllerProvider\";\nexport * from \"./EndpointMetadata\";\nexport * from \"./HandlerMetadata\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PathType.js","sourceRoot":"","sources":["../../../src/interfaces/PathType.ts"],"names":[],"mappings":"","sourcesContent":["export type PathType = string | RegExp | (string | RegExp)[];\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformAdapter.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformAdapter.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {IProvider} from \"@tsed/di\";\n\nexport interface PlatformAdapter<App = TsED.Application, Router = TsED.Router> {\n /**\n * Load providers in top priority\n */\n readonly providers: IProvider[];\n /**\n * Called after the injector instantiation\n */\n onInit?: () => any;\n beforeLoadRoutes?: () => Promise<any>;\n afterLoadRoutes?: () => Promise<any>;\n useRouter?: () => any;\n useContext?: () => any;\n}\n\nexport interface PlatformBuilderSettings<App = TsED.Application, Router = TsED.Router> extends Partial<TsED.Configuration> {\n adapter?: Type<PlatformAdapter<App, Router>>;\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./ResponseErrorObject"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./HandlerType"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./PlatformRouteOptions"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./BeforeInit"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./AfterInit"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./AfterRoutesInit"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./BeforeListen"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./AfterListen"), exports);
|
|
12
|
-
(0, tslib_1.__exportStar)(require("./BeforeRoutesInit"), exports);
|
|
13
|
-
(0, tslib_1.__exportStar)(require("./AfterRoutesInit"), exports);
|
|
14
|
-
(0, tslib_1.__exportStar)(require("./OnRoutesInit"), exports);
|
|
15
|
-
(0, tslib_1.__exportStar)(require("./OnReady"), exports);
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./OnRequest"), exports);
|
|
17
|
-
(0, tslib_1.__exportStar)(require("./OnResponse"), exports);
|
|
18
|
-
(0, tslib_1.__exportStar)(require("./Route"), exports);
|
|
19
|
-
(0, tslib_1.__exportStar)(require("./IncomingEvent"), exports);
|
|
20
|
-
(0, tslib_1.__exportStar)(require("./PlatformAdapter"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,qEAAsC;AACtC,6DAA8B;AAC9B,sEAAuC;AACvC,4DAA6B;AAC7B,2DAA4B;AAC5B,iEAAkC;AAClC,8DAA+B;AAC/B,6DAA8B;AAC9B,kEAAmC;AACnC,iEAAkC;AAClC,8DAA+B;AAC/B,yDAA0B;AAC1B,2DAA4B;AAC5B,4DAA6B;AAC7B,uDAAwB;AACxB,+DAAgC;AAChC,iEAAkC","sourcesContent":["export * from \"./ResponseErrorObject\";\nexport * from \"./HandlerType\";\nexport * from \"./PlatformRouteOptions\";\nexport * from \"./BeforeInit\";\nexport * from \"./AfterInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./BeforeListen\";\nexport * from \"./AfterListen\";\nexport * from \"./BeforeRoutesInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./OnRoutesInit\";\nexport * from \"./OnReady\";\nexport * from \"./OnRequest\";\nexport * from \"./OnResponse\";\nexport * from \"./Route\";\nexport * from \"./IncomingEvent\";\nexport * from \"./PlatformAdapter\";\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./bindEndpointMiddleware"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./PlatformMulterMiddleware"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./PlatformAcceptMimesMiddleware"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,wEAAyC;AACzC,0EAA2C;AAC3C,+EAAgD","sourcesContent":["export * from \"./bindEndpointMiddleware\";\nexport * from \"./PlatformMulterMiddleware\";\nexport * from \"./PlatformAcceptMimesMiddleware\";\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFakeRawDriver = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
const createFakeRawDriver = () => {
|
|
8
|
-
// istanbul ignore next
|
|
9
|
-
function FakeRawDriver() { }
|
|
10
|
-
// istanbul ignore next
|
|
11
|
-
function use() {
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
FakeRawDriver.use = use;
|
|
15
|
-
FakeRawDriver.all = use;
|
|
16
|
-
FakeRawDriver.get = use;
|
|
17
|
-
FakeRawDriver.patch = use;
|
|
18
|
-
FakeRawDriver.post = use;
|
|
19
|
-
FakeRawDriver.put = use;
|
|
20
|
-
FakeRawDriver.head = use;
|
|
21
|
-
FakeRawDriver.delete = use;
|
|
22
|
-
FakeRawDriver.options = use;
|
|
23
|
-
return FakeRawDriver;
|
|
24
|
-
};
|
|
25
|
-
exports.createFakeRawDriver = createFakeRawDriver;
|
|
26
|
-
//# sourceMappingURL=FakeRawDriver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FakeRawDriver.js","sourceRoot":"","sources":["../../../src/services/FakeRawDriver.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,uBAAuB;IACvB,SAAS,aAAa,KAAI,CAAC;IAE3B,uBAAuB;IACvB,SAAS,GAAG;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC;IAC1B,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;IAC3B,aAAa,CAAC,OAAO,GAAG,GAAG,CAAC;IAE5B,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B","sourcesContent":["/**\n * @ignore\n */\nexport const createFakeRawDriver = () => {\n // istanbul ignore next\n function FakeRawDriver() {}\n\n // istanbul ignore next\n function use() {\n return this;\n }\n\n FakeRawDriver.use = use;\n FakeRawDriver.all = use;\n FakeRawDriver.get = use;\n FakeRawDriver.patch = use;\n FakeRawDriver.post = use;\n FakeRawDriver.put = use;\n FakeRawDriver.head = use;\n FakeRawDriver.delete = use;\n FakeRawDriver.options = use;\n\n return FakeRawDriver;\n};\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./Platform"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./PlatformApplication"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./PlatformHandler"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./PlatformRequest"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./PlatformResponse"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./PlatformRouter"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./PlatformTest"), exports);
|
|
11
|
-
(0, tslib_1.__exportStar)(require("./PlatformMiddlewaresChain"), exports);
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;AAAA,0DAA2B;AAC3B,qEAAsC;AACtC,iEAAkC;AAClC,iEAAkC;AAClC,kEAAmC;AACnC,gEAAiC;AACjC,8DAA+B;AAC/B,0EAA2C","sourcesContent":["export * from \"./Platform\";\nexport * from \"./PlatformApplication\";\nexport * from \"./PlatformHandler\";\nexport * from \"./PlatformRequest\";\nexport * from \"./PlatformResponse\";\nexport * from \"./PlatformRouter\";\nexport * from \"./PlatformTest\";\nexport * from \"./PlatformMiddlewaresChain\";\n"]}
|
package/lib/cjs/utils/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./createInjector"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./createHttpServer"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./createHttpsServer"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./printRoutes"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./listenServer"), exports);
|
|
9
|
-
(0, tslib_1.__exportStar)(require("./createContext"), exports);
|
|
10
|
-
(0, tslib_1.__exportStar)(require("./useCtxHandler"), exports);
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,kEAAmC;AACnC,mEAAoC;AACpC,6DAA8B;AAC9B,8DAA+B;AAC/B,+DAAgC;AAChC,+DAAgC","sourcesContent":["export * from \"./createInjector\";\nexport * from \"./createHttpServer\";\nexport * from \"./createHttpsServer\";\nexport * from \"./printRoutes\";\nexport * from \"./listenServer\";\nexport * from \"./createContext\";\nexport * from \"./useCtxHandler\";\n"]}
|
package/lib/esm/config/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC","sourcesContent":["export * from \"./interfaces\";\nexport * from \"./services/PlatformConfiguration\";\nexport * from \"./services/PlatformConfiguration\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/config/interfaces/index.ts"],"names":[],"mappings":"AA6FA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC","sourcesContent":["import {Env} from \"@tsed/core\";\nimport {ConverterSettings} from \"./ConverterSettings\";\nimport {EndpointDirectoriesSettings} from \"./EndpointDirectoriesSettings\";\nimport {PlatformLoggerSettings} from \"./PlatformLoggerSettings\";\nimport {PlatformMulterSettings} from \"./PlatformMulterSettings\";\nimport {PlatformStaticsSettings} from \"./PlatformStaticsSettings\";\nimport type Http from \"http\";\nimport type Https from \"https\";\n\ndeclare global {\n namespace TsED {\n interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {}\n interface Configuration {\n /**\n * The root directory where you build run project. By default, it's equal to `process.cwd().\n */\n rootDir: string;\n /**\n * The environment profile. By default the environment profile is equals to `NODE_ENV`.\n */\n env: Env;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n port: string | number;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n httpPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.\n * - `passphrase` <string> A string containing the passphrase for the private key or pfx.\n * - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)\n * - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known \"root\" CAs (like VeriSign) will be used. These are used to authorize connections.\n */\n httpOptions: Http.ServerOptions;\n /**\n * Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).\n */\n httpsPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.\n * - `passphrase` <string> A string containing the passphrase for the private key or pfx.\n * - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)\n * - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known \"root\" CAs (like VeriSign) will be used. These are used to authorize connections.\n */\n httpsOptions: Https.ServerOptions;\n /**\n * Mount all controllers under a directories to an endpoint.\n */\n mount: EndpointDirectoriesSettings;\n /**\n * List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).\n */\n componentsScan: (string | RegExp)[];\n /**\n * Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.\n */\n disableComponentsScan: boolean;\n /**\n * List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.\n */\n exclude: string[];\n /**\n * Configure the mimes accepted by default by the server.\n */\n acceptMimes: string[];\n /**\n * Enable debug mode. By default debug is false.\n */\n debug: boolean;\n /**\n * Converter configuration.\n */\n converter: Partial<ConverterSettings>;\n /**\n * Logger configuration.\n */\n logger?: LoggerConfiguration;\n /**\n * Object to mount all directories under to his endpoints. See more on [Serve Static](/tutorials/serve-static-files.md).\n */\n statics: PlatformStaticsSettings;\n /**\n * Object configure Multer. See more on [Upload file](/tutorials/serve-static-files.md).\n */\n multer: PlatformMulterSettings;\n }\n }\n}\n\nexport * from \"./PlatformLoggerSettings\";\nexport * from \"./EndpointDirectoriesSettings\";\nexport * from \"./PlatformStaticsSettings\";\nexport * from \"./PlatformMulterSettings\";\n"]}
|