@tsed/common 6.95.9 → 6.96.2
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 +1 -1
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/domain/AnyToPromiseWithCtx.js +1 -9
- package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -1
- package/lib/cjs/domain/PlatformContext.js +8 -1
- package/lib/cjs/domain/PlatformContext.js.map +1 -1
- package/lib/cjs/services/PlatformHandler.js +3 -5
- package/lib/cjs/services/PlatformHandler.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +1 -2
- package/lib/cjs/services/PlatformTest.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +1 -1
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/domain/AnyToPromiseWithCtx.js +2 -10
- package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -1
- package/lib/esm/domain/PlatformContext.js +8 -1
- package/lib/esm/domain/PlatformContext.js.map +1 -1
- package/lib/esm/services/PlatformHandler.js +3 -5
- package/lib/esm/services/PlatformHandler.js.map +1 -1
- package/lib/esm/services/PlatformTest.js +2 -3
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/types/services/PlatformTest.d.ts +2 -2
- package/package.json +15 -15
- package/lib/cjs/PlatformModule.d.ts +0 -6
- package/lib/cjs/builder/PlatformBuilder.d.ts +0 -104
- package/lib/cjs/builder/PlatformControllerBuilder.d.ts +0 -17
- package/lib/cjs/config/index.d.ts +0 -3
- package/lib/cjs/config/interfaces/ConverterSettings.d.ts +0 -6
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.d.ts +0 -3
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.d.ts +0 -44
- package/lib/cjs/config/interfaces/PlatformMulterSettings.d.ts +0 -138
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.d.ts +0 -17
- package/lib/cjs/config/interfaces/index.d.ts +0 -97
- package/lib/cjs/config/services/PlatformConfiguration.d.ts +0 -81
- package/lib/cjs/constants/routerOptions.d.ts +0 -1
- package/lib/cjs/decorators/httpServer.d.ts +0 -28
- package/lib/cjs/decorators/httpsServer.d.ts +0 -28
- package/lib/cjs/decorators/index.d.ts +0 -16
- package/lib/cjs/decorators/method/acceptMime.d.ts +0 -19
- package/lib/cjs/decorators/method/endpointFn.d.ts +0 -9
- package/lib/cjs/decorators/method/location.d.ts +0 -1
- package/lib/cjs/decorators/method/redirect.d.ts +0 -1
- package/lib/cjs/decorators/method/route.d.ts +0 -1
- package/lib/cjs/decorators/method/view.d.ts +0 -25
- package/lib/cjs/decorators/multer/index.d.ts +0 -3
- package/lib/cjs/decorators/multer/multerFileSize.d.ts +0 -27
- package/lib/cjs/decorators/multer/multerOptions.d.ts +0 -41
- package/lib/cjs/decorators/multer/multipartFile.d.ts +0 -47
- package/lib/cjs/decorators/params/endpointInfo.d.ts +0 -13
- package/lib/cjs/decorators/params/error.d.ts +0 -7
- package/lib/cjs/decorators/params/next.d.ts +0 -22
- package/lib/cjs/decorators/params/request.d.ts +0 -46
- package/lib/cjs/decorators/params/response.d.ts +0 -40
- package/lib/cjs/decorators/params/responseData.d.ts +0 -9
- package/lib/cjs/domain/AnyToPromiseWithCtx.d.ts +0 -18
- package/lib/cjs/domain/ControllerProvider.d.ts +0 -24
- package/lib/cjs/domain/EndpointMetadata.d.ts +0 -50
- package/lib/cjs/domain/HandlerMetadata.d.ts +0 -32
- package/lib/cjs/domain/PlatformContext.d.ts +0 -65
- package/lib/cjs/domain/PlatformRouteDetails.d.ts +0 -23
- package/lib/cjs/domain/PropertyMetadata.d.ts +0 -17
- package/lib/cjs/domain/index.d.ts +0 -7
- package/lib/cjs/index.d.ts +0 -22
- package/lib/cjs/interfaces/AfterInit.d.ts +0 -3
- package/lib/cjs/interfaces/AfterListen.d.ts +0 -3
- package/lib/cjs/interfaces/AfterRoutesInit.d.ts +0 -3
- package/lib/cjs/interfaces/BeforeInit.d.ts +0 -3
- package/lib/cjs/interfaces/BeforeListen.d.ts +0 -3
- package/lib/cjs/interfaces/BeforeRoutesInit.d.ts +0 -3
- package/lib/cjs/interfaces/HandlerType.d.ts +0 -12
- package/lib/cjs/interfaces/IncomingEvent.d.ts +0 -6
- package/lib/cjs/interfaces/OnReady.d.ts +0 -3
- package/lib/cjs/interfaces/OnRequest.d.ts +0 -4
- package/lib/cjs/interfaces/OnResponse.d.ts +0 -4
- package/lib/cjs/interfaces/OnRoutesInit.d.ts +0 -3
- package/lib/cjs/interfaces/PathType.d.ts +0 -1
- package/lib/cjs/interfaces/PlatformAdapter.d.ts +0 -19
- package/lib/cjs/interfaces/PlatformRouteOptions.d.ts +0 -16
- package/lib/cjs/interfaces/ResponseErrorObject.d.ts +0 -8
- package/lib/cjs/interfaces/Route.d.ts +0 -10
- package/lib/cjs/interfaces/index.d.ts +0 -17
- package/lib/cjs/middlewares/AcceptMimesMiddleware.d.ts +0 -10
- package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.d.ts +0 -9
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.d.ts +0 -10
- package/lib/cjs/middlewares/PlatformMulterMiddleware.d.ts +0 -19
- package/lib/cjs/middlewares/__mock__/FakeCtrl.d.ts +0 -2
- package/lib/cjs/middlewares/bindEndpointMiddleware.d.ts +0 -5
- package/lib/cjs/middlewares/index.d.ts +0 -5
- package/lib/cjs/services/FakeRawDriver.d.ts +0 -15
- package/lib/cjs/services/Platform.d.ts +0 -37
- package/lib/cjs/services/PlatformApplication.d.ts +0 -21
- package/lib/cjs/services/PlatformHandler.d.ts +0 -80
- package/lib/cjs/services/PlatformMiddlewaresChain.d.ts +0 -6
- package/lib/cjs/services/PlatformRequest.d.ts +0 -112
- package/lib/cjs/services/PlatformResponse.d.ts +0 -161
- package/lib/cjs/services/PlatformRouter.d.ts +0 -48
- package/lib/cjs/services/PlatformTest.d.ts +0 -58
- package/lib/cjs/services/index.d.ts +0 -8
- package/lib/cjs/utils/createContext.d.ts +0 -9
- package/lib/cjs/utils/createHandlerMetadata.d.ts +0 -8
- package/lib/cjs/utils/createHttpServer.d.ts +0 -4
- package/lib/cjs/utils/createHttpsServer.d.ts +0 -4
- package/lib/cjs/utils/createInjector.d.ts +0 -7
- package/lib/cjs/utils/getConfiguration.d.ts +0 -2
- package/lib/cjs/utils/getStaticsOptions.d.ts +0 -5
- package/lib/cjs/utils/index.d.ts +0 -8
- package/lib/cjs/utils/listenServer.d.ts +0 -7
- package/lib/cjs/utils/loadInjector.d.ts +0 -6
- package/lib/cjs/utils/mapReturnedResponse.d.ts +0 -4
- package/lib/cjs/utils/printRoutes.d.ts +0 -2
- package/lib/cjs/utils/setResponseHeaders.d.ts +0 -5
- package/lib/cjs/utils/useCtxHandler.d.ts +0 -13
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Env, getHostInfoFromPort } from "@tsed/core";
|
|
3
|
-
import { DIConfiguration } from "@tsed/di";
|
|
4
|
-
import Https from "https";
|
|
5
|
-
import { EndpointDirectoriesSettings, PlatformLoggerSettings } from "../interfaces";
|
|
6
|
-
import { ConverterSettings } from "../interfaces/ConverterSettings";
|
|
7
|
-
/**
|
|
8
|
-
* `PlatformConfiguration` contains all information about your Server configuration.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PlatformConfiguration extends DIConfiguration {
|
|
11
|
-
constructor();
|
|
12
|
-
get version(): string;
|
|
13
|
-
set version(v: string);
|
|
14
|
-
get rootDir(): string;
|
|
15
|
-
set rootDir(value: string);
|
|
16
|
-
get port(): string | number | false;
|
|
17
|
-
set port(value: string | number | false);
|
|
18
|
-
get httpsOptions(): Https.ServerOptions;
|
|
19
|
-
set httpsOptions(value: Https.ServerOptions);
|
|
20
|
-
get httpPort(): string | number | false;
|
|
21
|
-
set httpPort(value: string | number | false);
|
|
22
|
-
get httpsPort(): string | number | false;
|
|
23
|
-
set httpsPort(value: string | number | false);
|
|
24
|
-
get env(): Env;
|
|
25
|
-
set env(value: Env);
|
|
26
|
-
get mount(): EndpointDirectoriesSettings;
|
|
27
|
-
set mount(value: EndpointDirectoriesSettings);
|
|
28
|
-
get componentsScan(): string[];
|
|
29
|
-
set componentsScan(value: string[]);
|
|
30
|
-
get statics(): EndpointDirectoriesSettings;
|
|
31
|
-
set statics(value: EndpointDirectoriesSettings);
|
|
32
|
-
get acceptMimes(): string[];
|
|
33
|
-
set acceptMimes(value: string[]);
|
|
34
|
-
get debug(): boolean;
|
|
35
|
-
set debug(debug: boolean);
|
|
36
|
-
get converter(): Partial<ConverterSettings>;
|
|
37
|
-
set converter(options: Partial<ConverterSettings>);
|
|
38
|
-
get logger(): Partial<PlatformLoggerSettings>;
|
|
39
|
-
set logger(value: Partial<PlatformLoggerSettings>);
|
|
40
|
-
get exclude(): string[];
|
|
41
|
-
set exclude(exclude: string[]);
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @returns {string|number}
|
|
45
|
-
*/
|
|
46
|
-
getHttpPort(): ReturnType<typeof getHostInfoFromPort>;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param settings
|
|
50
|
-
*/
|
|
51
|
-
setHttpPort(settings: {
|
|
52
|
-
address: string;
|
|
53
|
-
port: number;
|
|
54
|
-
}): void;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @returns {string|number}
|
|
58
|
-
*/
|
|
59
|
-
getHttpsPort(): {
|
|
60
|
-
protocol: string;
|
|
61
|
-
address: string;
|
|
62
|
-
port: number;
|
|
63
|
-
toString(): string;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* @param settings
|
|
68
|
-
*/
|
|
69
|
-
setHttpsPort(settings: {
|
|
70
|
-
address: string;
|
|
71
|
-
port: number;
|
|
72
|
-
}): void;
|
|
73
|
-
getBestHost(): {
|
|
74
|
-
protocol: string;
|
|
75
|
-
address: string;
|
|
76
|
-
port: number;
|
|
77
|
-
toString(): string;
|
|
78
|
-
} | {
|
|
79
|
-
toString(): string;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ROUTER_OPTIONS: unique symbol;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Http from "http";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Http.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "http"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpServer = Http.Server;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Https from "https";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Https.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpsServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpsServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "https"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpsServer = Https.Server;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from "./httpServer";
|
|
2
|
-
export * from "./httpsServer";
|
|
3
|
-
export * from "./multer";
|
|
4
|
-
export * from "./method/route";
|
|
5
|
-
export * from "./method/acceptMime";
|
|
6
|
-
export * from "./method/location";
|
|
7
|
-
export * from "./method/redirect";
|
|
8
|
-
export * from "./method/endpointFn";
|
|
9
|
-
export * from "./method/view";
|
|
10
|
-
export * from "./params/responseData";
|
|
11
|
-
export * from "./params/response";
|
|
12
|
-
export * from "./params/request";
|
|
13
|
-
export * from "./params/next";
|
|
14
|
-
export * from "./params/error";
|
|
15
|
-
export * from "./params/endpointInfo";
|
|
16
|
-
export * from "../utils/mapReturnedResponse";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 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.
|
|
3
|
-
*
|
|
4
|
-
* ```typescript
|
|
5
|
-
* @Controller('/mypath')
|
|
6
|
-
* export class MyCtrl {
|
|
7
|
-
*
|
|
8
|
-
* @Get('/')
|
|
9
|
-
* @AcceptMime('application/json')
|
|
10
|
-
* public getResource(){}
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @param mimes
|
|
15
|
-
* @decorator
|
|
16
|
-
* @operation
|
|
17
|
-
* @response
|
|
18
|
-
*/
|
|
19
|
-
export declare function AcceptMime(...mimes: string[]): Function;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DecoratorParameters } from "@tsed/core";
|
|
2
|
-
import { EndpointMetadata } from "../../domain";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param fn
|
|
6
|
-
* @decorator
|
|
7
|
-
* @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Location } from "@tsed/schema";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Redirect } from "@tsed/schema";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Get, Post, Put, Patch, Delete, Head, Options, All } from "@tsed/schema";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use a view and sends the rendered HTML string to the client. Optional parameter:
|
|
3
|
-
*
|
|
4
|
-
* * viewOptions, an object whose properties define local variables for the view.
|
|
5
|
-
*
|
|
6
|
-
* The view argument is a string that is the file path of the view file to render.
|
|
7
|
-
* This can be an absolute path, or a path relative to the views setting.
|
|
8
|
-
* If the path does not contain a file extension, then the view engine setting determines the file extension.
|
|
9
|
-
* If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
|
|
10
|
-
* and render it using the loaded module’s __express function.
|
|
11
|
-
*
|
|
12
|
-
* For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
|
|
13
|
-
*
|
|
14
|
-
* > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
|
|
15
|
-
* and as so for security reasons should not contain input from the end-user.
|
|
16
|
-
*
|
|
17
|
-
* @param path Relative path to the view file.
|
|
18
|
-
* @param options Additional options
|
|
19
|
-
* @decorator
|
|
20
|
-
* @operation
|
|
21
|
-
* @response
|
|
22
|
-
* @ignores
|
|
23
|
-
* @deprecated Use View decorator from @tsed/platform-views instead.
|
|
24
|
-
*/
|
|
25
|
-
export declare function View(path: string, options?: Object): MethodDecorator;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define file size limit.
|
|
3
|
-
*
|
|
4
|
-
* ```typescript
|
|
5
|
-
* import {Controller, Post} from "@tsed/common";
|
|
6
|
-
* import {MulterOptions, MultipartFile} from "@tsed/common";
|
|
7
|
-
* import {Multer} from "@types/multer";
|
|
8
|
-
*
|
|
9
|
-
* type MulterFile = Express.Multer.File;
|
|
10
|
-
*
|
|
11
|
-
* @Controller('/')
|
|
12
|
-
* class MyCtrl {
|
|
13
|
-
* @Post('/file2')
|
|
14
|
-
* @MulterFileSize(1024) // (Ko). Applied for all fields
|
|
15
|
-
* private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
|
|
16
|
-
*
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* > See the tutorial on the [multer configuration](/tutorials/multer.md).
|
|
22
|
-
* @param fileSize
|
|
23
|
-
* @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @multer
|
|
26
|
-
*/
|
|
27
|
-
export declare function MulterFileSize(fileSize: number): MethodDecorator;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { PlatformMulterSettings } from "../../config/interfaces/PlatformMulterSettings";
|
|
2
|
-
/**
|
|
3
|
-
* Define multer option for all MultipartFile
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import {Controller, Post, PlatformMulterFile, MultipartFile, MulterOptions} from "@tsed/common";
|
|
7
|
-
*
|
|
8
|
-
* @Controller('/')
|
|
9
|
-
* class MyCtrl {
|
|
10
|
-
* @Post('/file')
|
|
11
|
-
* private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
|
|
12
|
-
*
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* @Post('/file')
|
|
16
|
-
* @MulterOptions({dest: "/other-dir"})
|
|
17
|
-
* private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
|
|
18
|
-
*
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* @Post('/file2')
|
|
22
|
-
* @MulterOptions({dest: "/other-dir"})
|
|
23
|
-
* private uploadFile(@MultipartFile("file1") file: PlatformMulterFile, @MultipartFile("file2") file2: PlatformMulterFile) {
|
|
24
|
-
*
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* @Post('/files')
|
|
28
|
-
* private uploadFile(@MultipartFile("file1") files: PlatformMulterFile[]) {
|
|
29
|
-
*
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* See the tutorial on the [multer configuration](/tutorials/multer.md).
|
|
35
|
-
*
|
|
36
|
-
* @param {multer.Options} options
|
|
37
|
-
* @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
|
|
38
|
-
* @decorator
|
|
39
|
-
* @multer
|
|
40
|
-
*/
|
|
41
|
-
export declare function MulterOptions(options: PlatformMulterSettings): MethodDecorator;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { PlatformMulterFile } from "../../config/interfaces/PlatformMulterSettings";
|
|
2
|
-
/**
|
|
3
|
-
* Define a parameter as Multipart file.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* import {Controller, Post} from "@tsed/common";
|
|
7
|
-
* import {MulterOptions, MultipartFile} from "@tsed/common";
|
|
8
|
-
* import {Multer} from "@types/multer";
|
|
9
|
-
*
|
|
10
|
-
* type MulterFile = Express.Multer.File;
|
|
11
|
-
*
|
|
12
|
-
* @Controller('/')
|
|
13
|
-
* class MyCtrl {
|
|
14
|
-
* @Post('/file')
|
|
15
|
-
* private uploadFile(@MultipartFile("file1") file: MulterFile) {
|
|
16
|
-
*
|
|
17
|
-
* }
|
|
18
|
-
*
|
|
19
|
-
* @Post('/file')
|
|
20
|
-
* @MulterOptions({dest: "/other-dir"})
|
|
21
|
-
* private uploadFile(@MultipartFile("file1") file: MulterFile) {
|
|
22
|
-
*
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* @Post('/file2')
|
|
26
|
-
* @MulterOptions({dest: "/other-dir"})
|
|
27
|
-
* private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
|
|
28
|
-
*
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
* @Post('/files')
|
|
32
|
-
* private uploadFile(@MultipartFile("file1") files: MulterFile[]) {
|
|
33
|
-
*
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* > See the tutorial on the [multer configuration](/tutorials/multer.md).
|
|
39
|
-
*
|
|
40
|
-
* @param name
|
|
41
|
-
* @param maxCount
|
|
42
|
-
* @returns Function
|
|
43
|
-
* @decorator
|
|
44
|
-
* @input
|
|
45
|
-
*/
|
|
46
|
-
export declare function MultipartFile(name: string, maxCount?: number): ParameterDecorator;
|
|
47
|
-
export declare type MultipartFile = PlatformMulterFile;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EndpointMetadata } from "../../domain/EndpointMetadata";
|
|
2
|
-
/**
|
|
3
|
-
* Get the current endpoint metadata.
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare function EndpointInfo(): Function;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
export declare type EndpointInfo = EndpointMetadata;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the Next function (for express application and middleware).
|
|
3
|
-
*
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
*/
|
|
8
|
-
export declare function Next(): ParameterDecorator;
|
|
9
|
-
declare global {
|
|
10
|
-
namespace TsED {
|
|
11
|
-
interface NextFunction extends Function {
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get the Next function (for express application and middleware).
|
|
17
|
-
*
|
|
18
|
-
* @decorator
|
|
19
|
-
* @operation
|
|
20
|
-
* @input
|
|
21
|
-
*/
|
|
22
|
-
export declare type Next = TsED.NextFunction;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { ParamOptions } from "@tsed/platform-params";
|
|
3
|
-
/**
|
|
4
|
-
* Request service.
|
|
5
|
-
*
|
|
6
|
-
* @decorator
|
|
7
|
-
* @operation
|
|
8
|
-
* @input
|
|
9
|
-
*/
|
|
10
|
-
export declare function Request(expression: string, useType: Type<any>): ParameterDecorator;
|
|
11
|
-
export declare function Request(expression: string): ParameterDecorator;
|
|
12
|
-
export declare function Request(useType: Type<any>): ParameterDecorator;
|
|
13
|
-
export declare function Request(options: ParamOptions<any>): ParameterDecorator;
|
|
14
|
-
export declare function Request(): ParameterDecorator;
|
|
15
|
-
/**
|
|
16
|
-
* Request service.
|
|
17
|
-
*
|
|
18
|
-
* @alias Request
|
|
19
|
-
* @decorator
|
|
20
|
-
* @operation
|
|
21
|
-
* @input
|
|
22
|
-
*/
|
|
23
|
-
export declare function Req(expression: string, useType: Type<any>): ParameterDecorator;
|
|
24
|
-
export declare function Req(expression: string): ParameterDecorator;
|
|
25
|
-
export declare function Req(useType: Type<any>): ParameterDecorator;
|
|
26
|
-
export declare function Req(options: Partial<ParamOptions>): ParameterDecorator;
|
|
27
|
-
export declare function Req(): ParameterDecorator;
|
|
28
|
-
/**
|
|
29
|
-
* Request service.
|
|
30
|
-
*
|
|
31
|
-
* @decorator
|
|
32
|
-
* @operation
|
|
33
|
-
* @input
|
|
34
|
-
*/
|
|
35
|
-
export interface Request extends TsED.Request {
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Request service.
|
|
39
|
-
*
|
|
40
|
-
* @alias Request
|
|
41
|
-
* @decorator
|
|
42
|
-
* @operation
|
|
43
|
-
* @input
|
|
44
|
-
*/
|
|
45
|
-
export interface Req extends Request {
|
|
46
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Response service.
|
|
3
|
-
*
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @response
|
|
8
|
-
*/
|
|
9
|
-
export declare function Response(): ParameterDecorator;
|
|
10
|
-
/**
|
|
11
|
-
* Request service.
|
|
12
|
-
*
|
|
13
|
-
* @alias Response
|
|
14
|
-
* @decorator
|
|
15
|
-
* @operation
|
|
16
|
-
* @input
|
|
17
|
-
* @response
|
|
18
|
-
*/
|
|
19
|
-
export declare function Res(): ParameterDecorator;
|
|
20
|
-
/**
|
|
21
|
-
* Response service.
|
|
22
|
-
*
|
|
23
|
-
* @decorator
|
|
24
|
-
* @operation
|
|
25
|
-
* @input
|
|
26
|
-
* @response
|
|
27
|
-
*/
|
|
28
|
-
export interface Response extends TsED.Response {
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Response service.
|
|
32
|
-
*
|
|
33
|
-
* @alias Response
|
|
34
|
-
* @decorator
|
|
35
|
-
* @operation
|
|
36
|
-
* @input
|
|
37
|
-
* @response
|
|
38
|
-
*/
|
|
39
|
-
export interface Res extends Response {
|
|
40
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
3
|
-
*
|
|
4
|
-
* @decorator
|
|
5
|
-
* @operation
|
|
6
|
-
* @input
|
|
7
|
-
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ResponseData(): ParameterDecorator;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AnyPromiseResult, AnyToPromise } from "@tsed/core";
|
|
2
|
-
import { PlatformContext } from "./PlatformContext";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
*/
|
|
6
|
-
export interface HandlerContextOptions {
|
|
7
|
-
$ctx: PlatformContext;
|
|
8
|
-
err?: any;
|
|
9
|
-
}
|
|
10
|
-
export declare class AnyToPromiseWithCtx extends AnyToPromise {
|
|
11
|
-
$ctx: PlatformContext;
|
|
12
|
-
err: unknown;
|
|
13
|
-
constructor({ $ctx, err }: HandlerContextOptions);
|
|
14
|
-
isDone(): boolean;
|
|
15
|
-
call(cb: Function): Promise<AnyPromiseResult<any>>;
|
|
16
|
-
destroy(): void;
|
|
17
|
-
isCanceledResponse(process: any): boolean;
|
|
18
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ControllerMiddlewares, Provider, TokenProvider } from "@tsed/di";
|
|
2
|
-
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
3
|
-
readonly tokenRouter: string;
|
|
4
|
-
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
get routerOptions(): any;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param value
|
|
12
|
-
*/
|
|
13
|
-
set routerOptions(value: any);
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @returns {any[]}
|
|
17
|
-
*/
|
|
18
|
-
get middlewares(): ControllerMiddlewares;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param middlewares
|
|
22
|
-
*/
|
|
23
|
-
set middlewares(middlewares: ControllerMiddlewares);
|
|
24
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { ParamMetadata } from "@tsed/platform-params";
|
|
3
|
-
import { JsonMethodStore } from "@tsed/schema";
|
|
4
|
-
export interface EndpointViewOptions {
|
|
5
|
-
path: string;
|
|
6
|
-
options: any;
|
|
7
|
-
}
|
|
8
|
-
export interface EndpointRedirectOptions {
|
|
9
|
-
status: number | undefined;
|
|
10
|
-
url: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* EndpointMetadata contains metadata about a controller and his method.
|
|
14
|
-
* Each annotation (@Get, @Body...) attached to a method are stored in a endpoint.
|
|
15
|
-
* EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.
|
|
16
|
-
*
|
|
17
|
-
* Example :
|
|
18
|
-
*
|
|
19
|
-
* @Controller("/my-path")
|
|
20
|
-
* provide MyClass {
|
|
21
|
-
*
|
|
22
|
-
* @Get("/")
|
|
23
|
-
* @Authenticated()
|
|
24
|
-
* public myMethod(){}
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
export declare class EndpointMetadata extends JsonMethodStore {
|
|
29
|
-
get targetName(): string;
|
|
30
|
-
get params(): ParamMetadata[];
|
|
31
|
-
get view(): EndpointViewOptions;
|
|
32
|
-
set view(view: EndpointViewOptions);
|
|
33
|
-
get acceptMimes(): string[];
|
|
34
|
-
set acceptMimes(mimes: string[]);
|
|
35
|
-
/**
|
|
36
|
-
* Get an endpoint.
|
|
37
|
-
* @param target
|
|
38
|
-
* @param propertyKey
|
|
39
|
-
* @param descriptor
|
|
40
|
-
*/
|
|
41
|
-
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
|
|
42
|
-
addOperationPath(method: string, path: string | RegExp, options?: any): import("@tsed/schema").JsonOperation;
|
|
43
|
-
/**
|
|
44
|
-
* Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
|
|
45
|
-
*
|
|
46
|
-
* @param key
|
|
47
|
-
* @returns {any}
|
|
48
|
-
*/
|
|
49
|
-
get<T = any>(key: any): T;
|
|
50
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { ProviderScope } from "@tsed/di";
|
|
3
|
-
import { JsonParameterStore } from "@tsed/schema";
|
|
4
|
-
import { HandlerType } from "../interfaces/HandlerType";
|
|
5
|
-
import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
6
|
-
export interface HandlerMetadataOptions {
|
|
7
|
-
target: (Type<any> | Function) & {
|
|
8
|
-
type?: HandlerType;
|
|
9
|
-
};
|
|
10
|
-
routeOptions?: PlatformRouteWithoutHandlers;
|
|
11
|
-
token?: Type<any>;
|
|
12
|
-
propertyKey?: string | symbol;
|
|
13
|
-
scope?: ProviderScope;
|
|
14
|
-
type?: HandlerType;
|
|
15
|
-
}
|
|
16
|
-
export declare class HandlerMetadata {
|
|
17
|
-
readonly target: any;
|
|
18
|
-
readonly token: Type<any>;
|
|
19
|
-
readonly propertyKey: string | symbol;
|
|
20
|
-
readonly injectable: boolean;
|
|
21
|
-
readonly type: HandlerType;
|
|
22
|
-
readonly hasNextFunction: boolean;
|
|
23
|
-
readonly routeOptions: Partial<PlatformRouteOptions>;
|
|
24
|
-
readonly scope: ProviderScope;
|
|
25
|
-
handler: any;
|
|
26
|
-
constructor(options: HandlerMetadataOptions);
|
|
27
|
-
get hasErrorParam(): boolean;
|
|
28
|
-
getParams(): JsonParameterStore[];
|
|
29
|
-
hasParamType(paramType: any): boolean;
|
|
30
|
-
isFinal(): boolean;
|
|
31
|
-
toString(): string;
|
|
32
|
-
}
|