@tsed/platform-middlewares 7.0.0-beta.2 → 7.0.0-beta.5
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/constants/{index.js → constants.js} +1 -1
- package/lib/cjs/constants/constants.js.map +1 -0
- package/lib/cjs/decorators/use.js.map +1 -1
- package/lib/cjs/index.js +14 -13
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/esm/constants/{index.js → constants.js} +1 -1
- package/lib/esm/constants/constants.js.map +1 -0
- package/lib/esm/decorators/use.js.map +1 -1
- package/lib/esm/decorators/useAuth.js +2 -2
- package/lib/esm/decorators/useBeforeEach.js +1 -1
- package/lib/esm/index.js +14 -13
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/types/constants/{index.d.ts → constants.d.ts} +0 -0
- package/lib/types/index.d.ts +5 -1
- package/package.json +24 -11
- package/readme.md +1 -2
- package/tsconfig.compile.esm.json +1 -12
- package/lib/cjs/constants/index.js.map +0 -1
- package/lib/cjs/utils/mapUseOptions.js +0 -26
- package/lib/cjs/utils/mapUseOptions.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/utils/mapUseOptions.js +0 -22
- package/lib/esm/utils/mapUseOptions.js.map +0 -1
- package/lib/types/utils/mapUseOptions.d.ts +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,KAAK;IACL,UAAU;IACV,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,QAAQ;IACR,YAAY;CACb,CAAC","sourcesContent":["export const HTTP_METHODS = [\n \"all\",\n \"checkout\",\n \"connect\",\n \"copy\",\n \"delete\",\n \"get\",\n \"head\",\n \"lock\",\n \"merge\",\n \"mkactivity\",\n \"mkcol\",\n \"move\",\n \"m-search\",\n \"notify\",\n \"options\",\n \"param\",\n \"patch\",\n \"post\",\n \"propfind\",\n \"propatch\",\n \"purge\",\n \"put\",\n \"report\",\n \"search\",\n \"subscribe\",\n \"trace\",\n \"unlock\",\n \"unsuscribe\"\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/decorators/use.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/decorators/use.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yCAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,GAAG,CAAC,GAAG,IAAW;IAChC,OAAO,IAAA,qBAAY,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,qBAAc,CAAC,MAAM;gBACxB,OAAO,IAAA,cAAK,EAAC,GAAG,IAAI,CAAC,CAAC;YAExB,KAAK,qBAAc,CAAC,KAAK;gBACvB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE;oBAChC,GAAG,EAAE,IAAI;iBACV,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAhBD,kBAgBC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn, Route} from \"@tsed/schema\";\n\n/**\n * Mounts the specified middleware function or functions at the specified path: the middleware function is executed when\n * the base of the requested path matches `path.\n *\n * ```typescript\n * @Controller('/')\n * @Use(Middleware1)\n * export class Ctrl {\n *\n * @Get('/')\n * @Use(Middleware2)\n * get() { }\n * }\n *\n * ```\n *\n * @returns {Function}\n * @param args\n * @decorator\n * @operation\n */\nexport function Use(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n return Route(...args);\n\n case DecoratorTypes.CLASS:\n entity.store.merge(\"middlewares\", {\n use: args\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(Use, parameters);\n }\n });\n}\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// utils
|
|
16
|
-
(0, tslib_1.__exportStar)(require("./utils/getMiddlewaresForHook"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./constants/constants"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./decorators/authOptions"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./decorators/middleware"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./decorators/use"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./decorators/useAfter"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./decorators/useAuth"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./decorators/useBefore"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./decorators/useBeforeEach"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./domain/MiddlewareMethods"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./domain/PlatformMiddlewareSettings"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./utils/getMiddlewaresForHook"), exports);
|
|
17
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;;;AAEH,gEAAsC;AACtC,mEAAyC;AACzC,kEAAwC;AACxC,2DAAiC;AACjC,gEAAsC;AACtC,+DAAqC;AACrC,iEAAuC;AACvC,qEAA2C;AAC3C,qEAA2C;AAC3C,8EAAoD;AACpD,wEAA8C","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./constants/constants\";\nexport * from \"./decorators/authOptions\";\nexport * from \"./decorators/middleware\";\nexport * from \"./decorators/use\";\nexport * from \"./decorators/useAfter\";\nexport * from \"./decorators/useAuth\";\nexport * from \"./decorators/useBefore\";\nexport * from \"./decorators/useBeforeEach\";\nexport * from \"./domain/MiddlewareMethods\";\nexport * from \"./domain/PlatformMiddlewareSettings\";\nexport * from \"./utils/getMiddlewaresForHook\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK;IACL,UAAU;IACV,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,QAAQ;IACR,YAAY;CACb,CAAC","sourcesContent":["export const HTTP_METHODS = [\n \"all\",\n \"checkout\",\n \"connect\",\n \"copy\",\n \"delete\",\n \"get\",\n \"head\",\n \"lock\",\n \"merge\",\n \"mkactivity\",\n \"mkcol\",\n \"move\",\n \"m-search\",\n \"notify\",\n \"options\",\n \"param\",\n \"patch\",\n \"post\",\n \"propfind\",\n \"propatch\",\n \"purge\",\n \"put\",\n \"report\",\n \"search\",\n \"subscribe\",\n \"trace\",\n \"unlock\",\n \"unsuscribe\"\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/decorators/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/decorators/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,IAAW;IAChC,OAAO,YAAY,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,cAAc,CAAC,MAAM;gBACxB,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAExB,KAAK,cAAc,CAAC,KAAK;gBACvB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE;oBAChC,GAAG,EAAE,IAAI;iBACV,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn, Route} from \"@tsed/schema\";\n\n/**\n * Mounts the specified middleware function or functions at the specified path: the middleware function is executed when\n * the base of the requested path matches `path.\n *\n * ```typescript\n * @Controller('/')\n * @Use(Middleware1)\n * export class Ctrl {\n *\n * @Get('/')\n * @Use(Middleware2)\n * get() { }\n * }\n *\n * ```\n *\n * @returns {Function}\n * @param args\n * @decorator\n * @operation\n */\nexport function Use(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n return Route(...args);\n\n case DecoratorTypes.CLASS:\n entity.store.merge(\"middlewares\", {\n use: args\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(Use, parameters);\n }\n });\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, StoreFn, UnsupportedDecoratorType, useDecorators } from "@tsed/core";
|
|
2
|
-
import { AuthOptions } from "./authOptions";
|
|
3
|
-
import { UseBefore } from "./useBefore";
|
|
2
|
+
import { AuthOptions } from "./authOptions.js";
|
|
3
|
+
import { UseBefore } from "./useBefore.js";
|
|
4
4
|
/**
|
|
5
5
|
* Use custom authentication strategy on your endpoint.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
|
|
2
|
-
import { UseBefore } from "./useBefore";
|
|
2
|
+
import { UseBefore } from "./useBefore.js";
|
|
3
3
|
/**
|
|
4
4
|
* Mounts the specified middleware function or functions at the specified path: the middleware function is executed when
|
|
5
5
|
* the base of the requested path matches `path.
|
package/lib/esm/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./decorators/
|
|
6
|
-
export * from "./decorators/
|
|
7
|
-
export * from "./decorators/
|
|
8
|
-
export * from "./decorators/
|
|
9
|
-
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
|
|
13
|
-
export * from "./
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
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";
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./constants/constants\";\nexport * from \"./decorators/authOptions\";\nexport * from \"./decorators/middleware\";\nexport * from \"./decorators/use\";\nexport * from \"./decorators/useAfter\";\nexport * from \"./decorators/useAuth\";\nexport * from \"./decorators/useBefore\";\nexport * from \"./decorators/useBeforeEach\";\nexport * from \"./domain/MiddlewareMethods\";\nexport * from \"./domain/PlatformMiddlewareSettings\";\nexport * from \"./utils/getMiddlewaresForHook\";\n"]}
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./constants/constants";
|
|
2
5
|
export * from "./decorators/authOptions";
|
|
6
|
+
export * from "./decorators/middleware";
|
|
3
7
|
export * from "./decorators/use";
|
|
4
8
|
export * from "./decorators/useAfter";
|
|
5
9
|
export * from "./decorators/useAuth";
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-middlewares",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.5",
|
|
4
4
|
"description": "Middlewares module for Ts.ED Framework",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
11
|
"types": "./lib/types/index.d.ts",
|
|
@@ -13,28 +14,40 @@
|
|
|
13
14
|
"default": "./lib/esm/index.js"
|
|
14
15
|
},
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
17
18
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
19
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
20
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\""
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"tslib": "2.
|
|
23
|
+
"tslib": "2.3.1"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
|
-
"@tsed/core": "7.0.0-beta.
|
|
25
|
-
"@tsed/di": "7.0.0-beta.
|
|
26
|
-
"@tsed/schema": "7.0.0-beta.
|
|
26
|
+
"@tsed/core": "7.0.0-beta.5",
|
|
27
|
+
"@tsed/di": "7.0.0-beta.5",
|
|
28
|
+
"@tsed/schema": "7.0.0-beta.5"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
|
-
"@tsed/core": "^7.0.0-beta.
|
|
30
|
-
"@tsed/di": "^7.0.0-beta.
|
|
31
|
-
"@tsed/schema": "^7.0.0-beta.
|
|
31
|
+
"@tsed/core": "^7.0.0-beta.5",
|
|
32
|
+
"@tsed/di": "^7.0.0-beta.5",
|
|
33
|
+
"@tsed/schema": "^7.0.0-beta.5"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"@tsed/core": {
|
|
37
|
+
"optional": true
|
|
38
|
+
},
|
|
39
|
+
"@tsed/di": {
|
|
40
|
+
"optional": true
|
|
41
|
+
},
|
|
42
|
+
"@tsed/schema": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
32
45
|
},
|
|
33
46
|
"repository": "https://github.com/tsedio/tsed",
|
|
34
47
|
"bugs": {
|
|
35
48
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
36
49
|
},
|
|
37
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
50
|
+
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/platform/platform-middlewares",
|
|
38
51
|
"author": "Romain Lenzotti",
|
|
39
52
|
"license": "MIT"
|
|
40
53
|
}
|
package/readme.md
CHANGED
|
@@ -36,18 +36,17 @@ npm install --save @tsed/platform-middlewares
|
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## Contributors
|
|
39
|
+
|
|
39
40
|
Please read [contributing guidelines here](https://tsed.io/CONTRIBUTING.html).
|
|
40
41
|
|
|
41
42
|
<a href="https://github.com/tsedio/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
|
|
42
43
|
|
|
43
|
-
|
|
44
44
|
## Backers
|
|
45
45
|
|
|
46
46
|
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
|
|
47
47
|
|
|
48
48
|
<a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
## Sponsors
|
|
52
51
|
|
|
53
52
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
|
|
@@ -8,16 +8,5 @@
|
|
|
8
8
|
"declaration": true,
|
|
9
9
|
"declarationDir": "./lib/types"
|
|
10
10
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"test",
|
|
14
|
-
"lib",
|
|
15
|
-
"benchmark",
|
|
16
|
-
"coverage",
|
|
17
|
-
"spec",
|
|
18
|
-
"**/*.benchmark.ts",
|
|
19
|
-
"**/*.spec.ts",
|
|
20
|
-
"keys",
|
|
21
|
-
"jest.config.js"
|
|
22
|
-
]
|
|
11
|
+
"exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
|
|
23
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,KAAK;IACL,UAAU;IACV,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,QAAQ;IACR,YAAY;CACb,CAAC","sourcesContent":["export const HTTP_METHODS = [\n \"all\",\n \"checkout\",\n \"connect\",\n \"copy\",\n \"delete\",\n \"get\",\n \"head\",\n \"lock\",\n \"merge\",\n \"mkactivity\",\n \"mkcol\",\n \"move\",\n \"m-search\",\n \"notify\",\n \"options\",\n \"param\",\n \"patch\",\n \"post\",\n \"propfind\",\n \"propatch\",\n \"purge\",\n \"put\",\n \"report\",\n \"search\",\n \"subscribe\",\n \"trace\",\n \"unlock\",\n \"unsuscribe\"\n];\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapUseOptions = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
function mapUseOptions(args) {
|
|
6
|
-
let method = undefined;
|
|
7
|
-
let path = undefined;
|
|
8
|
-
const middlewares = args.filter((arg) => {
|
|
9
|
-
if (typeof arg === "string" && constants_1.HTTP_METHODS.includes(arg)) {
|
|
10
|
-
method = arg;
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
if (typeof arg === "string" || arg instanceof RegExp) {
|
|
14
|
-
path = arg ? arg : "/";
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return !!arg;
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
path,
|
|
21
|
-
method,
|
|
22
|
-
middlewares
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
exports.mapUseOptions = mapUseOptions;
|
|
26
|
-
//# sourceMappingURL=mapUseOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapUseOptions.js","sourceRoot":"","sources":["../../../src/utils/mapUseOptions.ts"],"names":[],"mappings":";;;AAAA,4CAA0C;AAE1C,SAAgB,aAAa,CAAC,IAAW;IACvC,IAAI,MAAM,GAAuB,SAAS,CAAC;IAC3C,IAAI,IAAI,GAAgC,SAAS,CAAC;IAElD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE;QAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,wBAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACzD,MAAM,GAAG,GAAG,CAAC;YAEb,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,MAAM,EAAE;YACpD,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAEvB,OAAO,KAAK,CAAC;SACd;QAED,OAAO,CAAC,CAAC,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,MAAM;QACN,WAAW;KACZ,CAAC;AACJ,CAAC;AAzBD,sCAyBC","sourcesContent":["import {HTTP_METHODS} from \"../constants\";\n\nexport function mapUseOptions(args: any[]) {\n let method: string | undefined = undefined;\n let path: string | RegExp | undefined = undefined;\n\n const middlewares = args.filter((arg: any) => {\n if (typeof arg === \"string\" && HTTP_METHODS.includes(arg)) {\n method = arg;\n\n return false;\n }\n\n if (typeof arg === \"string\" || arg instanceof RegExp) {\n path = arg ? arg : \"/\";\n\n return false;\n }\n\n return !!arg;\n });\n\n return {\n path,\n method,\n middlewares\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK;IACL,UAAU;IACV,SAAS;IACT,MAAM;IACN,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;IACP,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,QAAQ;IACR,YAAY;CACb,CAAC","sourcesContent":["export const HTTP_METHODS = [\n \"all\",\n \"checkout\",\n \"connect\",\n \"copy\",\n \"delete\",\n \"get\",\n \"head\",\n \"lock\",\n \"merge\",\n \"mkactivity\",\n \"mkcol\",\n \"move\",\n \"m-search\",\n \"notify\",\n \"options\",\n \"param\",\n \"patch\",\n \"post\",\n \"propfind\",\n \"propatch\",\n \"purge\",\n \"put\",\n \"report\",\n \"search\",\n \"subscribe\",\n \"trace\",\n \"unlock\",\n \"unsuscribe\"\n];\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HTTP_METHODS } from "../constants";
|
|
2
|
-
export function mapUseOptions(args) {
|
|
3
|
-
let method = undefined;
|
|
4
|
-
let path = undefined;
|
|
5
|
-
const middlewares = args.filter((arg) => {
|
|
6
|
-
if (typeof arg === "string" && HTTP_METHODS.includes(arg)) {
|
|
7
|
-
method = arg;
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
if (typeof arg === "string" || arg instanceof RegExp) {
|
|
11
|
-
path = arg ? arg : "/";
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return !!arg;
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
path,
|
|
18
|
-
method,
|
|
19
|
-
middlewares
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=mapUseOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapUseOptions.js","sourceRoot":"","sources":["../../../src/utils/mapUseOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,aAAa,CAAC,IAAW;IACvC,IAAI,MAAM,GAAuB,SAAS,CAAC;IAC3C,IAAI,IAAI,GAAgC,SAAS,CAAC;IAElD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,EAAE;QAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACzD,MAAM,GAAG,GAAG,CAAC;YAEb,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,MAAM,EAAE;YACpD,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAEvB,OAAO,KAAK,CAAC;SACd;QAED,OAAO,CAAC,CAAC,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,IAAI;QACJ,MAAM;QACN,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["import {HTTP_METHODS} from \"../constants\";\n\nexport function mapUseOptions(args: any[]) {\n let method: string | undefined = undefined;\n let path: string | RegExp | undefined = undefined;\n\n const middlewares = args.filter((arg: any) => {\n if (typeof arg === \"string\" && HTTP_METHODS.includes(arg)) {\n method = arg;\n\n return false;\n }\n\n if (typeof arg === \"string\" || arg instanceof RegExp) {\n path = arg ? arg : \"/\";\n\n return false;\n }\n\n return !!arg;\n });\n\n return {\n path,\n method,\n middlewares\n };\n}\n"]}
|