@tsed/platform-middlewares 8.0.0-beta.9 → 8.0.0-rc.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
|
|
1
|
+
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, Store, UnsupportedDecoratorType } from "@tsed/core";
|
|
2
2
|
import { JsonEntityFn } from "@tsed/schema";
|
|
3
3
|
/**
|
|
4
4
|
* Change authentication options.
|
|
@@ -30,7 +30,12 @@ export function AuthOptions(guardAuth, options = {}) {
|
|
|
30
30
|
store.merge(guardAuth, options, true);
|
|
31
31
|
})(...args);
|
|
32
32
|
case DecoratorTypes.CLASS:
|
|
33
|
-
decorateMethodsOf(args[0],
|
|
33
|
+
decorateMethodsOf(args[0], (_, property) => {
|
|
34
|
+
Store.fromMethod(args[0], property).merge(guardAuth, options, true);
|
|
35
|
+
});
|
|
36
|
+
// methodsOf(args[0]).forEach(({propertyKey}) => {
|
|
37
|
+
//
|
|
38
|
+
// });
|
|
34
39
|
break;
|
|
35
40
|
default:
|
|
36
41
|
throw new UnsupportedDecoratorType(AuthOptions, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,eAAe,EACf,cAAc,
|
|
1
|
+
{"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,eAAe,EACf,cAAc,EACd,KAAK,EAEL,wBAAwB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,WAAW,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACrF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE;oBAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;oBAE3B,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;gBACxC,CAAC,CAAC,CAAC,GAAI,IAAkC,CAAC,CAAC;YAE7C,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAM,EAAE,QAAgB,EAAE,EAAE;oBACtD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;gBACH,kDAAkD;gBAClD,EAAE;gBACF,MAAM;gBACN,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -31,7 +31,12 @@ export function UseAuth(guardAuth, options = {}) {
|
|
|
31
31
|
}
|
|
32
32
|
}), AuthOptions(guardAuth, options))(...args);
|
|
33
33
|
case DecoratorTypes.CLASS:
|
|
34
|
-
decorateMethodsOf(args[0],
|
|
34
|
+
decorateMethodsOf(args[0], StoreFn((store) => {
|
|
35
|
+
if (!store.has(guardAuth)) {
|
|
36
|
+
return UseBefore(guardAuth);
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
AuthOptions(guardAuth, options)(...args);
|
|
35
40
|
break;
|
|
36
41
|
default:
|
|
37
42
|
throw new UnsupportedDecoratorType(UseAuth, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/decorators/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,eAAe,EACf,cAAc,EAEd,OAAO,EAEP,wBAAwB,EACxB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,OAAO,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACjF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,aAAa,CAClB,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC1B,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;oBAC9B,CAAC;gBACH,CAAC,CAAC,EACF,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAChC,CAAC,GAAG,IAAI,CAAC,CAAC;YAEb,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/decorators/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,eAAe,EACf,cAAc,EAEd,OAAO,EAEP,wBAAwB,EACxB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,OAAO,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACjF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,aAAa,CAClB,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC1B,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;oBAC9B,CAAC;gBACH,CAAC,CAAC,EACF,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAChC,CAAC,GAAG,IAAI,CAAC,CAAC;YAEb,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CACf,IAAI,CAAC,CAAC,CAAC,EACP,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC1B,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;oBAC9B,CAAC;gBACH,CAAC,CAAC,CACH,CAAC;gBAEF,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;gBACzC,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/platform-middlewares",
|
|
3
3
|
"description": "Middlewares module for Ts.ED Framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0.0-
|
|
5
|
+
"version": "8.0.0-rc.2",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"tslib": "2.7.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tsed/barrels": "8.0.0-
|
|
29
|
-
"@tsed/core": "8.0.0-
|
|
30
|
-
"@tsed/di": "8.0.0-
|
|
31
|
-
"@tsed/schema": "8.0.0-
|
|
32
|
-
"@tsed/typescript": "8.0.0-
|
|
28
|
+
"@tsed/barrels": "8.0.0-rc.2",
|
|
29
|
+
"@tsed/core": "8.0.0-rc.2",
|
|
30
|
+
"@tsed/di": "8.0.0-rc.2",
|
|
31
|
+
"@tsed/schema": "8.0.0-rc.2",
|
|
32
|
+
"@tsed/typescript": "8.0.0-rc.2",
|
|
33
33
|
"eslint": "9.12.0",
|
|
34
34
|
"typescript": "5.4.5",
|
|
35
35
|
"vitest": "2.1.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@tsed/core": "8.0.0-
|
|
39
|
-
"@tsed/di": "8.0.0-
|
|
40
|
-
"@tsed/schema": "8.0.0-
|
|
38
|
+
"@tsed/core": "8.0.0-rc.2",
|
|
39
|
+
"@tsed/di": "8.0.0-rc.2",
|
|
40
|
+
"@tsed/schema": "8.0.0-rc.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@tsed/core": {
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
"author": "Romain Lenzotti",
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"publishConfig": {
|
|
61
|
-
"tag": "
|
|
61
|
+
"tag": "rc"
|
|
62
62
|
}
|
|
63
63
|
}
|
package/vitest.config.mts
CHANGED