@tsed/platform-middlewares 7.70.2 → 7.71.0
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/decorators/useAuth.js +4 -4
- package/lib/cjs/decorators/useAuth.js.map +1 -1
- package/lib/cjs/decorators/useBeforeEach.js +3 -3
- package/lib/cjs/decorators/useBeforeEach.js.map +1 -1
- package/lib/cjs/index.js +14 -14
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/decorators/useAuth.js.map +1 -1
- package/lib/esm/decorators/useBeforeEach.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/types/index.d.ts +12 -12
- package/lib/types/utils/getMiddlewaresForHook.d.ts +1 -1
- package/package.json +10 -10
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UseAuth = void 0;
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const authOptions_js_1 = require("./authOptions.js");
|
|
6
|
+
const useBefore_js_1 = require("./useBefore.js");
|
|
7
7
|
/**
|
|
8
8
|
* Use custom authentication strategy on your endpoint.
|
|
9
9
|
*
|
|
@@ -30,9 +30,9 @@ function UseAuth(guardAuth, options = {}) {
|
|
|
30
30
|
case core_1.DecoratorTypes.METHOD:
|
|
31
31
|
return (0, core_1.useDecorators)((0, core_1.StoreFn)((store) => {
|
|
32
32
|
if (!store.has(guardAuth)) {
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, useBefore_js_1.UseBefore)(guardAuth);
|
|
34
34
|
}
|
|
35
|
-
}), (0,
|
|
35
|
+
}), (0, authOptions_js_1.AuthOptions)(guardAuth, options))(...args);
|
|
36
36
|
case core_1.DecoratorTypes.CLASS:
|
|
37
37
|
(0, core_1.decorateMethodsOf)(args[0], UseAuth(guardAuth, options));
|
|
38
38
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/decorators/useAuth.ts"],"names":[],"mappings":";;;AAAA,qCAUoB;AACpB
|
|
1
|
+
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/decorators/useAuth.ts"],"names":[],"mappings":";;;AAAA,qCAUoB;AACpB,qDAA6C;AAC7C,iDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,OAAO,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACjF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,OAAO,IAAA,oBAAa,EAClB,IAAA,cAAO,EAAC,CAAC,KAAY,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;wBACzB,OAAO,IAAA,wBAAS,EAAC,SAAS,CAAC,CAAC;qBAC7B;gBACH,CAAC,CAAC,EACF,IAAA,4BAAW,EAAC,SAAS,EAAE,OAAO,CAAC,CAChC,CAAC,GAAG,IAAI,CAAC,CAAC;YAEb,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBACxD,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACrD;IACH,CAAC,CAAC;AACJ,CAAC;AArBD,0BAqBC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UseBeforeEach = void 0;
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
|
-
const
|
|
5
|
+
const useBefore_js_1 = require("./useBefore.js");
|
|
6
6
|
/**
|
|
7
7
|
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
8
8
|
* the base of the requested path matches `path.
|
|
@@ -27,9 +27,9 @@ function UseBeforeEach(...args) {
|
|
|
27
27
|
return (...decoratorArgs) => {
|
|
28
28
|
switch ((0, core_1.decoratorTypeOf)(decoratorArgs)) {
|
|
29
29
|
case core_1.DecoratorTypes.METHOD:
|
|
30
|
-
return (0,
|
|
30
|
+
return (0, useBefore_js_1.UseBefore)(...args)(...decoratorArgs);
|
|
31
31
|
case core_1.DecoratorTypes.CLASS:
|
|
32
|
-
(0, core_1.decorateMethodsOf)(decoratorArgs[0], (0,
|
|
32
|
+
(0, core_1.decorateMethodsOf)(decoratorArgs[0], (0, useBefore_js_1.UseBefore)(...args));
|
|
33
33
|
break;
|
|
34
34
|
default:
|
|
35
35
|
throw new core_1.UnsupportedDecoratorType(UseBeforeEach, decoratorArgs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":";;;AAAA,qCAA6H;AAC7H,
|
|
1
|
+
{"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":";;;AAAA,qCAA6H;AAC7H,iDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,aAAa,CAAC,GAAG,IAAW;IAC1C,OAAO,CAAI,GAAG,aAAkC,EAAqC,EAAE;QACrF,QAAQ,IAAA,sBAAe,EAAC,aAAa,CAAC,EAAE;YACtC,KAAK,qBAAc,CAAC,MAAM;gBACxB,OAAO,IAAA,wBAAS,EAAC,GAAG,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAE9C,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAA,wBAAS,EAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBACxD,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;SACpE;IACH,CAAC,CAAC;AACJ,CAAC;AAdD,sCAcC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file Automatically generated by barrelsby.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const tslib_1 = require("tslib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
tslib_1.__exportStar(require("./
|
|
11
|
-
tslib_1.__exportStar(require("./decorators/
|
|
12
|
-
tslib_1.__exportStar(require("./decorators/
|
|
13
|
-
tslib_1.__exportStar(require("./decorators/
|
|
14
|
-
tslib_1.__exportStar(require("./decorators/
|
|
15
|
-
tslib_1.__exportStar(require("./
|
|
16
|
-
tslib_1.__exportStar(require("./
|
|
17
|
-
tslib_1.__exportStar(require("./
|
|
4
|
+
/**
|
|
5
|
+
* @file Automatically generated by @tsed/barrels.
|
|
6
|
+
*/
|
|
7
|
+
tslib_1.__exportStar(require("./constants/constants.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./decorators/authOptions.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./decorators/middleware.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./decorators/use.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./decorators/useAfter.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./decorators/useAuth.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./decorators/useBefore.js"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./decorators/useBeforeEach.js"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./domain/MiddlewareMethods.js"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./domain/PlatformMiddlewareSettings.js"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./utils/getMiddlewaresForHook.js"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAyC;AACzC,sEAA4C;AAC5C,qEAA2C;AAC3C,8DAAoC;AACpC,mEAAyC;AACzC,kEAAwC;AACxC,oEAA0C;AAC1C,wEAA8C;AAC9C,wEAA8C;AAC9C,iFAAuD;AACvD,2EAAiD"}
|
|
@@ -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;AACpB,OAAO,EAAC,WAAW,EAAC,MAAM,
|
|
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;AACpB,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;YAC7B,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,aAAa,CAClB,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;wBACzB,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;qBAC7B;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;gBACxD,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACrD;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAuB,eAAe,EAAE,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAC7H,OAAO,EAAC,SAAS,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAuB,eAAe,EAAE,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAC7H,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,IAAW;IAC1C,OAAO,CAAI,GAAG,aAAkC,EAAqC,EAAE;QACrF,QAAQ,eAAe,CAAC,aAAa,CAAC,EAAE;YACtC,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAE9C,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBACxD,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;SACpE;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Automatically generated by
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
3
|
*/
|
|
4
|
-
export * from "./constants/constants";
|
|
5
|
-
export * from "./decorators/authOptions";
|
|
6
|
-
export * from "./decorators/middleware";
|
|
7
|
-
export * from "./decorators/use";
|
|
8
|
-
export * from "./decorators/useAfter";
|
|
9
|
-
export * from "./decorators/useAuth";
|
|
10
|
-
export * from "./decorators/useBefore";
|
|
11
|
-
export * from "./decorators/useBeforeEach";
|
|
12
|
-
export * from "./domain/MiddlewareMethods";
|
|
13
|
-
export * from "./domain/PlatformMiddlewareSettings";
|
|
14
|
-
export * from "./utils/getMiddlewaresForHook";
|
|
4
|
+
export * from "./constants/constants.js";
|
|
5
|
+
export * from "./decorators/authOptions.js";
|
|
6
|
+
export * from "./decorators/middleware.js";
|
|
7
|
+
export * from "./decorators/use.js";
|
|
8
|
+
export * from "./decorators/useAfter.js";
|
|
9
|
+
export * from "./decorators/useAuth.js";
|
|
10
|
+
export * from "./decorators/useBefore.js";
|
|
11
|
+
export * from "./decorators/useBeforeEach.js";
|
|
12
|
+
export * from "./domain/MiddlewareMethods.js";
|
|
13
|
+
export * from "./domain/PlatformMiddlewareSettings.js";
|
|
14
|
+
export * from "./utils/getMiddlewaresForHook.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DIConfiguration } from "@tsed/di";
|
|
2
|
-
import { PlatformMiddlewareLoadingOptions } from "../domain/PlatformMiddlewareSettings";
|
|
2
|
+
import { PlatformMiddlewareLoadingOptions } from "../domain/PlatformMiddlewareSettings.js";
|
|
3
3
|
export declare function getMiddlewaresForHook(hook: string, settings: DIConfiguration, defaultHook?: string): PlatformMiddlewareLoadingOptions[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-middlewares",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.71.0",
|
|
4
4
|
"description": "Middlewares module for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "yarn barrels && yarn build:ts",
|
|
17
|
-
"barrels": "
|
|
17
|
+
"barrels": "barrels",
|
|
18
18
|
"test": "jest --max-workers=2 && jest-coverage-thresholds-bumper",
|
|
19
19
|
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json"
|
|
20
20
|
},
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"tslib": "2.6.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsed/
|
|
26
|
-
"@tsed/
|
|
27
|
-
"@tsed/
|
|
28
|
-
"@tsed/
|
|
29
|
-
"
|
|
25
|
+
"@tsed/barrels": "7.71.0",
|
|
26
|
+
"@tsed/core": "7.71.0",
|
|
27
|
+
"@tsed/di": "7.71.0",
|
|
28
|
+
"@tsed/schema": "7.71.0",
|
|
29
|
+
"@tsed/typescript": "7.71.0",
|
|
30
30
|
"eslint": "^8.57.0",
|
|
31
31
|
"jest": "^29.7.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@tsed/core": "7.
|
|
35
|
-
"@tsed/di": "7.
|
|
36
|
-
"@tsed/schema": "7.
|
|
34
|
+
"@tsed/core": "7.71.0",
|
|
35
|
+
"@tsed/di": "7.71.0",
|
|
36
|
+
"@tsed/schema": "7.71.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@tsed/core": {
|