@heliosjs/middlewares 9.0.0 → 9.0.1
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/dist/guard.d.ts +4 -4
- package/dist/guard.js +2 -2
- package/dist/guard.js.map +1 -1
- package/package.json +2 -3
package/dist/guard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GuardClass, GuardFunction } from '@heliosjs/core/types';
|
|
2
2
|
/**
|
|
3
3
|
* Decorator to register a guard.
|
|
4
4
|
*
|
|
@@ -13,7 +13,7 @@ import { type Guard, GuardFn } from '@heliosjs/core/types';
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* // Using function guard
|
|
16
|
-
* @
|
|
16
|
+
* @GuardClass((req, res) => {
|
|
17
17
|
* return !!req.headers.authorization;
|
|
18
18
|
* })
|
|
19
19
|
* class MyController {}
|
|
@@ -26,7 +26,7 @@ import { type Guard, GuardFn } from '@heliosjs/core/types';
|
|
|
26
26
|
* }
|
|
27
27
|
* }
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @GuardClass(AuthGuard)
|
|
30
30
|
* class MyController {}
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
@@ -41,4 +41,4 @@ import { type Guard, GuardFn } from '@heliosjs/core/types';
|
|
|
41
41
|
* Metadata is stored under the CONTROLLER_CONFIGURATION key and used
|
|
42
42
|
* internally by the framework during request processing.
|
|
43
43
|
*/
|
|
44
|
-
export declare function Guard(guard:
|
|
44
|
+
export declare function Guard(guard: GuardClass | GuardFunction): (target: any, propertyKey?: string, descriptor?: PropertyDescriptor) => void;
|
package/dist/guard.js
CHANGED
|
@@ -16,7 +16,7 @@ const utils_1 = require("@heliosjs/core/utils");
|
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* // Using function guard
|
|
19
|
-
* @
|
|
19
|
+
* @GuardClass((req, res) => {
|
|
20
20
|
* return !!req.headers.authorization;
|
|
21
21
|
* })
|
|
22
22
|
* class MyController {}
|
|
@@ -29,7 +29,7 @@ const utils_1 = require("@heliosjs/core/utils");
|
|
|
29
29
|
* }
|
|
30
30
|
* }
|
|
31
31
|
*
|
|
32
|
-
* @
|
|
32
|
+
* @GuardClass(AuthGuard)
|
|
33
33
|
* class MyController {}
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
package/dist/guard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":";;AA4CA,sBAUC;AArDD,gDAA6D;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,SAAgB,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../src/guard.ts"],"names":[],"mappings":";;AA4CA,sBAUC;AArDD,gDAA6D;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,SAAgB,KAAK,CAAC,KAAiC;IACrD,OAAO,UAAU,MAAW,EAAE,WAAoB,EAAE,UAA+B;QACjF,MAAM,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAEhC,IAAI,UAAU,EAAE,CAAC;YACf,IAAA,6BAAqB,EAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,IAAA,6BAAqB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heliosjs/middlewares",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "Middlewares for @heliosjs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "yarn clean && tsc -p tsconfig.build.json",
|
|
22
22
|
"clean": "rm -rf dist",
|
|
23
|
-
"prepublishOnly": "yarn build",
|
|
24
23
|
"publish:public": "yarn publish --access public --no-git-tag-version",
|
|
25
24
|
"publish:patch": "yarn version --patch --no-git-tag-version && yarn publish --access public",
|
|
26
25
|
"publish:minor": "yarn version --minor --no-git-tag-version && yarn publish --access public",
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
"reflect-metadata": "^0.2.2"
|
|
31
30
|
},
|
|
32
31
|
"peerDependencies": {
|
|
33
|
-
"@heliosjs/core": "^3.1.
|
|
32
|
+
"@heliosjs/core": "^3.1.1",
|
|
34
33
|
"typescript": ">=4.0.0",
|
|
35
34
|
"reflect-metadata": "^0.2.2",
|
|
36
35
|
"@types/node": "^25.5.0"
|