@tsed/platform-middlewares 6.95.9 → 6.95.10
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/package.json +7 -7
- package/lib/cjs/constants/index.d.ts +0 -1
- package/lib/cjs/decorators/authOptions.d.ts +0 -42
- package/lib/cjs/decorators/middleware.d.ts +0 -7
- package/lib/cjs/decorators/use.d.ts +0 -22
- package/lib/cjs/decorators/useAfter.d.ts +0 -21
- package/lib/cjs/decorators/useAuth.d.ts +0 -23
- package/lib/cjs/decorators/useBefore.d.ts +0 -21
- package/lib/cjs/decorators/useBeforeEach.d.ts +0 -21
- package/lib/cjs/domain/MiddlewareMethods.d.ts +0 -8
- package/lib/cjs/domain/PlatformMiddlewareSettings.d.ts +0 -17
- package/lib/cjs/index.d.ts +0 -10
- package/lib/cjs/utils/getMiddlewaresForHook.d.ts +0 -2
- package/lib/cjs/utils/mapUseOptions.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-middlewares",
|
|
3
|
-
"version": "6.95.
|
|
3
|
+
"version": "6.95.10",
|
|
4
4
|
"description": "Middlewares module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"tslib": "2.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@tsed/core": "6.95.
|
|
25
|
-
"@tsed/di": "6.95.
|
|
26
|
-
"@tsed/schema": "6.95.
|
|
24
|
+
"@tsed/core": "6.95.10",
|
|
25
|
+
"@tsed/di": "6.95.10",
|
|
26
|
+
"@tsed/schema": "6.95.10"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@tsed/core": "^6.95.
|
|
30
|
-
"@tsed/di": "^6.95.
|
|
31
|
-
"@tsed/schema": "^6.95.
|
|
29
|
+
"@tsed/core": "^6.95.10",
|
|
30
|
+
"@tsed/di": "^6.95.10",
|
|
31
|
+
"@tsed/schema": "^6.95.10"
|
|
32
32
|
},
|
|
33
33
|
"repository": "https://github.com/tsedio/tsed",
|
|
34
34
|
"bugs": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const HTTP_METHODS: string[];
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
export interface IAuthOptions {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Since v6. Use @Returns from @tsed/schema
|
|
5
|
-
*/
|
|
6
|
-
responses?: {
|
|
7
|
-
[statusCode: string]: {
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Since v6. Use @Security from @tsed/schema
|
|
13
|
-
*/
|
|
14
|
-
security?: {
|
|
15
|
-
[securityName: string]: string[];
|
|
16
|
-
}[] | {
|
|
17
|
-
[securityName: string]: string[];
|
|
18
|
-
};
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Change authentication options.
|
|
23
|
-
*
|
|
24
|
-
* ```typescript
|
|
25
|
-
* @Controller('/mypath')
|
|
26
|
-
* @UseAuth(MyAuthStrategy, {role: ''})
|
|
27
|
-
* class MyCtrl {
|
|
28
|
-
*
|
|
29
|
-
* @Get('/')
|
|
30
|
-
* @AuthOptions(MyAuthStrategy, {role: 'admin'})
|
|
31
|
-
* public getResource(){}
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @param guardAuth
|
|
36
|
-
* @param options {Object} Object passed to the customer auth strategy
|
|
37
|
-
* @returns {Function}
|
|
38
|
-
* @decorator
|
|
39
|
-
* @decorator
|
|
40
|
-
* @operation
|
|
41
|
-
*/
|
|
42
|
-
export declare function AuthOptions(guardAuth: Type<any>, options?: IAuthOptions): Function;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
3
|
-
* the base of the requested path matches `path.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* @Controller('/')
|
|
7
|
-
* @Use(Middleware1)
|
|
8
|
-
* export class Ctrl {
|
|
9
|
-
*
|
|
10
|
-
* @Get('/')
|
|
11
|
-
* @Use(Middleware2)
|
|
12
|
-
* get() { }
|
|
13
|
-
* }
|
|
14
|
-
*
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @returns {Function}
|
|
18
|
-
* @param args
|
|
19
|
-
* @decorator
|
|
20
|
-
* @operation
|
|
21
|
-
*/
|
|
22
|
-
export declare function Use(...args: any[]): Function;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
3
|
-
* the base of the requested path matches `path.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* @Controller('/')
|
|
7
|
-
* @UseAfter(Middleware1)
|
|
8
|
-
* export class Ctrl {
|
|
9
|
-
*
|
|
10
|
-
* @Get('/')
|
|
11
|
-
* @UseAfter(Middleware2)
|
|
12
|
-
* get() { }
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @returns {function(any, any, any): *}
|
|
17
|
-
* @param args
|
|
18
|
-
* @decorator
|
|
19
|
-
* @operation
|
|
20
|
-
*/
|
|
21
|
-
export declare function UseAfter(...args: any[]): Function;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { IAuthOptions } from "./authOptions";
|
|
3
|
-
/**
|
|
4
|
-
* Use custom authentication strategy on your endpoint.
|
|
5
|
-
*
|
|
6
|
-
* ```typescript
|
|
7
|
-
* @Controller('/mypath')
|
|
8
|
-
* @UseAuth(MyAuthStrategy)
|
|
9
|
-
* class MyCtrl {
|
|
10
|
-
*
|
|
11
|
-
* @Get('/')
|
|
12
|
-
* @UseAuth(MyAuthStrategy, {role: 'admin'})
|
|
13
|
-
* public getResource(){}
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @param guardAuth {Type<any>} A middleware which implement a custom auth strategy
|
|
18
|
-
* @param options {Object} Object passed to the customer auth strategy
|
|
19
|
-
* @returns {Function}
|
|
20
|
-
* @decorator
|
|
21
|
-
* @operation
|
|
22
|
-
*/
|
|
23
|
-
export declare function UseAuth(guardAuth: Type<any>, options?: IAuthOptions): Function;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
3
|
-
* the base of the requested path matches `path.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* @Controller('/')
|
|
7
|
-
* @UseBefore(Middleware1) // called only one time before all endpoint
|
|
8
|
-
* export class Ctrl {
|
|
9
|
-
*
|
|
10
|
-
* @Get('/')
|
|
11
|
-
* @UseBefore(Middleware2)
|
|
12
|
-
* get() { }
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @returns {function(any, any, any): *}
|
|
17
|
-
* @param args
|
|
18
|
-
* @decorator
|
|
19
|
-
* @operation
|
|
20
|
-
*/
|
|
21
|
-
export declare function UseBefore(...args: any[]): Function;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
3
|
-
* the base of the requested path matches `path.
|
|
4
|
-
*
|
|
5
|
-
* ```typescript
|
|
6
|
-
* @Controller('/')
|
|
7
|
-
* @UseBeforeEach(Middleware1) // Called before each endpoint
|
|
8
|
-
* export class Ctrl {
|
|
9
|
-
*
|
|
10
|
-
* @Get('/')
|
|
11
|
-
* get() { }
|
|
12
|
-
* }
|
|
13
|
-
*
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @returns {Function}
|
|
17
|
-
* @param args
|
|
18
|
-
* @decorator
|
|
19
|
-
* @operation
|
|
20
|
-
*/
|
|
21
|
-
export declare function UseBeforeEach(...args: any[]): Function;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Env, Type } from "@tsed/core";
|
|
2
|
-
export declare type PlatformMiddlewareLoadingOptions = {
|
|
3
|
-
env?: Env;
|
|
4
|
-
use: Function | Type<any>;
|
|
5
|
-
hook?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare type PlatformMiddlewareSettings = Function | Type<any> | PlatformMiddlewareLoadingOptions | any;
|
|
8
|
-
declare global {
|
|
9
|
-
namespace TsED {
|
|
10
|
-
interface Configuration {
|
|
11
|
-
/**
|
|
12
|
-
* Load middlewares on the $beforeRoutesInit hook (or on the specified hook event name).
|
|
13
|
-
*/
|
|
14
|
-
middlewares: PlatformMiddlewareSettings[];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./decorators/middleware";
|
|
2
|
-
export * from "./decorators/authOptions";
|
|
3
|
-
export * from "./decorators/use";
|
|
4
|
-
export * from "./decorators/useAfter";
|
|
5
|
-
export * from "./decorators/useAuth";
|
|
6
|
-
export * from "./decorators/useBefore";
|
|
7
|
-
export * from "./decorators/useBeforeEach";
|
|
8
|
-
export * from "./domain/MiddlewareMethods";
|
|
9
|
-
export * from "./domain/PlatformMiddlewareSettings";
|
|
10
|
-
export * from "./utils/getMiddlewaresForHook";
|