@tsed/platform-middlewares 7.18.2 → 7.18.3

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.
Files changed (33) hide show
  1. package/.eslintignore +13 -0
  2. package/.eslintrc.js +1 -0
  3. package/jest.config.js +1 -1
  4. package/lib/cjs/constants/constants.js.map +1 -1
  5. package/lib/cjs/decorators/authOptions.js.map +1 -1
  6. package/lib/cjs/decorators/middleware.js.map +1 -1
  7. package/lib/cjs/decorators/use.js.map +1 -1
  8. package/lib/cjs/decorators/useAfter.js.map +1 -1
  9. package/lib/cjs/decorators/useAuth.js.map +1 -1
  10. package/lib/cjs/decorators/useBefore.js.map +1 -1
  11. package/lib/cjs/decorators/useBeforeEach.js.map +1 -1
  12. package/lib/cjs/domain/MiddlewareMethods.js.map +1 -1
  13. package/lib/cjs/domain/PlatformMiddlewareSettings.js.map +1 -1
  14. package/lib/cjs/index.js.map +1 -1
  15. package/lib/cjs/utils/getMiddlewaresForHook.js.map +1 -1
  16. package/lib/esm/constants/constants.js.map +1 -1
  17. package/lib/esm/decorators/authOptions.js.map +1 -1
  18. package/lib/esm/decorators/middleware.js.map +1 -1
  19. package/lib/esm/decorators/use.js.map +1 -1
  20. package/lib/esm/decorators/useAfter.js.map +1 -1
  21. package/lib/esm/decorators/useAuth.js.map +1 -1
  22. package/lib/esm/decorators/useBefore.js.map +1 -1
  23. package/lib/esm/decorators/useBeforeEach.js.map +1 -1
  24. package/lib/esm/domain/MiddlewareMethods.js.map +1 -1
  25. package/lib/esm/domain/PlatformMiddlewareSettings.js.map +1 -1
  26. package/lib/esm/index.js.map +1 -1
  27. package/lib/esm/utils/getMiddlewaresForHook.js.map +1 -1
  28. package/lib/tsconfig.esm.tsbuildinfo +1 -0
  29. package/lib/tsconfig.tsbuildinfo +1 -0
  30. package/lib/types/domain/PlatformMiddlewareSettings.d.ts +2 -2
  31. package/package.json +16 -12
  32. package/tsconfig.esm.json +39 -0
  33. package/tsconfig.compile.esm.json +0 -12
package/.eslintignore ADDED
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ docs
3
+ docs-references
4
+ lib
5
+ dist
6
+ coverage
7
+ .nyc_output
8
+ *-lock.json
9
+ *.lock
10
+ benchmarks.*
11
+ **/generated
12
+
13
+ **/*.js
package/.eslintrc.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("@tsed/eslint/node.js");
package/jest.config.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // https://jestjs.io/docs/en/configuration.html
3
3
 
4
4
  module.exports = {
5
- ...require("@tsed/jest-config")(__dirname, "platform-middlewares"),
5
+ ...require("@tsed/jest-config"),
6
6
  coverageThreshold: {
7
7
  global: {
8
8
  statements: 100,
@@ -1 +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
+ {"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":";;;AAAA,qCAQoB;AACpB,yCAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,WAAW,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACrF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,OAAO,IAAA,qBAAY,EAAC,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,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACzD;IACH,CAAC,CAAC;AACJ,CAAC;AAlBD,kCAkBC","sourcesContent":["import {\n decorateMethodsOf,\n DecoratorMethodParameters,\n DecoratorParameters,\n decoratorTypeOf,\n DecoratorTypes,\n Type,\n UnsupportedDecoratorType\n} from \"@tsed/core\";\nimport {JsonEntityFn} from \"@tsed/schema\";\n\n/**\n * Change authentication options.\n *\n * ```typescript\n * @Controller('/mypath')\n * @UseAuth(MyAuthStrategy, {role: ''})\n * class MyCtrl {\n *\n * @Get('/')\n * @AuthOptions(MyAuthStrategy, {role: 'admin'})\n * public getResource(){}\n * }\n * ```\n *\n * @param guardAuth\n * @param options {Object} Object passed to the customer auth strategy\n * @returns {Function}\n * @decorator\n * @decorator\n * @operation\n */\nexport function AuthOptions(guardAuth: Type<any>, options: Record<string, unknown> = {}): Function {\n return <T>(...args: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n return JsonEntityFn((entity) => {\n const store = entity.store;\n\n store.merge(guardAuth, options, true);\n })(...(args as DecoratorMethodParameters));\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], AuthOptions(guardAuth, options));\n break;\n\n default:\n throw new UnsupportedDecoratorType(AuthOptions, args);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":";;;AAAA,qCAQoB;AACpB,yCAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,WAAW,CAAC,SAAoB,EAAE,UAAmC,EAAE;IACrF,OAAO,CAAI,GAAG,IAAyB,EAAqC,EAAE;QAC5E,QAAQ,IAAA,sBAAe,EAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,qBAAc,CAAC,MAAM;gBACxB,OAAO,IAAA,qBAAY,EAAC,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,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACzD;IACH,CAAC,CAAC;AACJ,CAAC;AAlBD,kCAkBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/decorators/middleware.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAElD;;;;;GAKG;AACH,SAAgB,UAAU;IACxB,OAAO,IAAA,eAAU,EAAC;QAChB,IAAI,EAAE,iBAAY,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC","sourcesContent":["import {Injectable, ProviderType} from \"@tsed/di\";\n\n/**\n * Register a new Middleware class.\n *\n * @decorator\n * @classDecorator\n */\nexport function Middleware(): ClassDecorator {\n return Injectable({\n type: ProviderType.MIDDLEWARE\n });\n}\n"]}
1
+ {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/decorators/middleware.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAElD;;;;;GAKG;AACH,SAAgB,UAAU;IACxB,OAAO,IAAA,eAAU,EAAC;QAChB,IAAI,EAAE,iBAAY,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC"}
@@ -1 +1 @@
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"]}
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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C","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} 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 * @UseAfter(Middleware1)\n * export class Ctrl {\n *\n * @Get('/')\n * @UseAfter(Middleware2)\n * get() { }\n * }\n * ```\n *\n * @returns {function(any, any, any): *}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseAfter(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n const endpoint = entity;\n endpoint.afterMiddlewares = args.concat(endpoint.afterMiddlewares);\n\n break;\n\n case DecoratorTypes.CLASS:\n const middlewares = entity.store.get(\"middlewares\") || {};\n\n entity.store.set(\"middlewares\", {\n ...middlewares,\n useAfter: [...args, ...(middlewares.useAfter || [])]\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseAfter, parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useAfter.js","sourceRoot":"","sources":["../../../src/decorators/useAfter.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yCAA0C;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,QAAQ,CAAC,GAAG,IAAW;IACrC,OAAO,IAAA,qBAAY,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,qBAAc,CAAC,MAAM;gBACxB,MAAM,QAAQ,GAAG,MAAM,CAAC;gBACxB,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAEnE,MAAM;YAER,KAAK,qBAAc,CAAC,KAAK;gBACvB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CA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,CAAC;AArBD,0BAqBC","sourcesContent":["import {\n decorateMethodsOf,\n DecoratorParameters,\n decoratorTypeOf,\n DecoratorTypes,\n Store,\n StoreFn,\n Type,\n UnsupportedDecoratorType,\n useDecorators\n} from \"@tsed/core\";\nimport {AuthOptions} from \"./authOptions\";\nimport {UseBefore} from \"./useBefore\";\n\n/**\n * Use custom authentication strategy on your endpoint.\n *\n * ```typescript\n * @Controller('/mypath')\n * @UseAuth(MyAuthStrategy)\n * class MyCtrl {\n *\n * @Get('/')\n * @UseAuth(MyAuthStrategy, {role: 'admin'})\n * public getResource(){}\n * }\n * ```\n *\n * @param guardAuth {Type<any>} A middleware which implement a custom auth strategy\n * @param options {Object} Object passed to the customer auth strategy\n * @returns {Function}\n * @decorator\n * @operation\n */\nexport function UseAuth(guardAuth: Type<any>, options: Record<string, unknown> = {}): Function {\n return <T>(...args: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n return useDecorators(\n StoreFn((store: Store) => {\n if (!store.has(guardAuth)) {\n return UseBefore(guardAuth);\n }\n }),\n AuthOptions(guardAuth, options)\n )(...args);\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], UseAuth(guardAuth, options));\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseAuth, args);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/decorators/useAuth.ts"],"names":[],"mappings":";;;AAAA,qCAUoB;AACpB,+CAA0C;AAC1C,2CAAsC;AAEtC;;;;;;;;;;;;;;;;;;;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,CAA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AC,CAAC;iBACvD,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC7D;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AArBD,8BAqBC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} 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 * @UseBefore(Middleware1) // called only one time before all endpoint\n * export class Ctrl {\n *\n * @Get('/')\n * @UseBefore(Middleware2)\n * get() { }\n * }\n * ```\n *\n * @returns {function(any, any, any): *}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseBefore(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n entity.beforeMiddlewares = args.concat(entity.beforeMiddlewares);\n\n break;\n\n case DecoratorTypes.CLASS:\n const middlewares = entity.store.get(\"middlewares\") || {};\n\n entity.store.set(\"middlewares\", {\n ...middlewares,\n useBefore: [...args, ...(middlewares.useBefore || [])]\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseBefore, parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useBefore.js","sourceRoot":"","sources":["../../../src/decorators/useBefore.ts"],"names":[],"mappings":";;;AAAA,qCAAoE;AACpE,yCAA0C;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,SAAS,CAAC,GAAG,IAAW;IACtC,OAAO,IAAA,qBAAY,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,qBAAc,CAAC,MAAM;gBACxB,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAEjE,MAAM;YAER,KAAK,qBAAc,CAAC,KAAK;gBACvB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;gBAE1D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE;oBAC9B,GAAG,WAAW;oBACd,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;iBACvD,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,+BAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC7D;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AArBD,8BAqBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":";;;AAAA,qCAA6H;AAC7H,2CAAsC;AAEtC;;;;;;;;;;;;;;;;;;;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,qBAAS,EAAC,GAAG,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAE9C,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAA,qBAAS,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","sourcesContent":["import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {UseBefore} from \"./useBefore\";\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 * @UseBeforeEach(Middleware1) // Called before each endpoint\n * export class Ctrl {\n *\n * @Get('/')\n * get() { }\n * }\n *\n * ```\n *\n * @returns {Function}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseBeforeEach(...args: any[]): Function {\n return <T>(...decoratorArgs: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(decoratorArgs)) {\n case DecoratorTypes.METHOD:\n return UseBefore(...args)(...decoratorArgs);\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(decoratorArgs[0], UseBefore(...args));\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseBeforeEach, decoratorArgs);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"useBeforeEach.js","sourceRoot":"","sources":["../../../src/decorators/useBeforeEach.ts"],"names":[],"mappings":";;;AAAA,qCAA6H;AAC7H,2CAAsC;AAEtC;;;;;;;;;;;;;;;;;;;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,qBAAS,EAAC,GAAG,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;YAE9C,KAAK,qBAAc,CAAC,KAAK;gBACvB,IAAA,wBAAiB,EAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAA,qBAAS,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"MiddlewareMethods.js","sourceRoot":"","sources":["../../../src/domain/MiddlewareMethods.ts"],"names":[],"mappings":"","sourcesContent":["export interface MiddlewareMethods {\n use(...args: any[]): void | any | Promise<any>;\n}\n"]}
1
+ {"version":3,"file":"MiddlewareMethods.js","sourceRoot":"","sources":["../../../src/domain/MiddlewareMethods.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformMiddlewareSettings.js","sourceRoot":"","sources":["../../../src/domain/PlatformMiddlewareSettings.ts"],"names":[],"mappings":"","sourcesContent":["import {Env, Type} from \"@tsed/core\";\n\nexport type PlatformMiddlewareLoadingOptions = {env?: Env; use: Function | Type<any> | string; hook?: string; options?: any};\nexport type PlatformMiddlewareSettings = Function | Type<any> | PlatformMiddlewareLoadingOptions | string | any;\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n /**\n * Load middlewares on the $beforeRoutesInit hook (or on the specified hook event name).\n */\n middlewares: PlatformMiddlewareSettings[];\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformMiddlewareSettings.js","sourceRoot":"","sources":["../../../src/domain/PlatformMiddlewareSettings.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
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"]}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMiddlewaresForHook.js","sourceRoot":"","sources":["../../../src/utils/getMiddlewaresForHook.ts"],"names":[],"mappings":";;;AAGA,SAAgB,qBAAqB,CAAC,IAAY,EAAE,QAAyB,EAAE,WAAW,GAAG,EAAE;IAC7F,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;IACzB,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAqC,aAAa,EAAE,EAAE,CAAC,CAAC;IAExF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtG,CAAC;AALD,sDAKC","sourcesContent":["import {DIConfiguration} from \"@tsed/di\";\nimport {PlatformMiddlewareLoadingOptions} from \"../domain/PlatformMiddlewareSettings\";\n\nexport function getMiddlewaresForHook(hook: string, settings: DIConfiguration, defaultHook = \"\") {\n const env = settings.env;\n const middlewares = settings.get<PlatformMiddlewareLoadingOptions[]>(\"middlewares\", []);\n\n return middlewares.filter((options) => options.use && options.env === env && options.hook === hook);\n}\n"]}
1
+ {"version":3,"file":"getMiddlewaresForHook.js","sourceRoot":"","sources":["../../../src/utils/getMiddlewaresForHook.ts"],"names":[],"mappings":";;;AAGA,SAAgB,qBAAqB,CAAC,IAAY,EAAE,QAAyB,EAAE,WAAW,GAAG,EAAE;IAC7F,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;IACzB,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAqC,aAAa,EAAE,EAAE,CAAC,CAAC;IAExF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtG,CAAC;AALD,sDAKC"}
@@ -1 +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
+ {"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,eAAe,EACf,cAAc,EAEd,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;YAC7B,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,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACzD;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n decorateMethodsOf,\n DecoratorMethodParameters,\n DecoratorParameters,\n decoratorTypeOf,\n DecoratorTypes,\n Type,\n UnsupportedDecoratorType\n} from \"@tsed/core\";\nimport {JsonEntityFn} from \"@tsed/schema\";\n\n/**\n * Change authentication options.\n *\n * ```typescript\n * @Controller('/mypath')\n * @UseAuth(MyAuthStrategy, {role: ''})\n * class MyCtrl {\n *\n * @Get('/')\n * @AuthOptions(MyAuthStrategy, {role: 'admin'})\n * public getResource(){}\n * }\n * ```\n *\n * @param guardAuth\n * @param options {Object} Object passed to the customer auth strategy\n * @returns {Function}\n * @decorator\n * @decorator\n * @operation\n */\nexport function AuthOptions(guardAuth: Type<any>, options: Record<string, unknown> = {}): Function {\n return <T>(...args: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n return JsonEntityFn((entity) => {\n const store = entity.store;\n\n store.merge(guardAuth, options, true);\n })(...(args as DecoratorMethodParameters));\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], AuthOptions(guardAuth, options));\n break;\n\n default:\n throw new UnsupportedDecoratorType(AuthOptions, args);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"authOptions.js","sourceRoot":"","sources":["../../../src/decorators/authOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,eAAe,EACf,cAAc,EAEd,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;YAC7B,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,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACzD;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/decorators/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Injectable, ProviderType} from \"@tsed/di\";\n\n/**\n * Register a new Middleware class.\n *\n * @decorator\n * @classDecorator\n */\nexport function Middleware(): ClassDecorator {\n return Injectable({\n type: ProviderType.MIDDLEWARE\n });\n}\n"]}
1
+ {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/decorators/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC,UAAU;KAC9B,CAAC,CAAC;AACL,CAAC"}
@@ -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,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
+ {"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;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C9B,GAAG,WAAW;oBACd,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;iBACrD,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SAC5D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} 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 * @UseAfter(Middleware1)\n * export class Ctrl {\n *\n * @Get('/')\n * @UseAfter(Middleware2)\n * get() { }\n * }\n * ```\n *\n * @returns {function(any, any, any): *}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseAfter(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n const endpoint = entity;\n endpoint.afterMiddlewares = args.concat(endpoint.afterMiddlewares);\n\n break;\n\n case DecoratorTypes.CLASS:\n const middlewares = entity.store.get(\"middlewares\") || {};\n\n entity.store.set(\"middlewares\", {\n ...middlewares,\n useAfter: [...args, ...(middlewares.useAfter || [])]\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseAfter, parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useAfter.js","sourceRoot":"","sources":["../../../src/decorators/useAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAG,IAAW;IACrC,OAAO,YAAY,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QAC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I,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","sourcesContent":["import {\n decorateMethodsOf,\n DecoratorParameters,\n decoratorTypeOf,\n DecoratorTypes,\n Store,\n StoreFn,\n Type,\n UnsupportedDecoratorType,\n useDecorators\n} from \"@tsed/core\";\nimport {AuthOptions} from \"./authOptions\";\nimport {UseBefore} from \"./useBefore\";\n\n/**\n * Use custom authentication strategy on your endpoint.\n *\n * ```typescript\n * @Controller('/mypath')\n * @UseAuth(MyAuthStrategy)\n * class MyCtrl {\n *\n * @Get('/')\n * @UseAuth(MyAuthStrategy, {role: 'admin'})\n * public getResource(){}\n * }\n * ```\n *\n * @param guardAuth {Type<any>} A middleware which implement a custom auth strategy\n * @param options {Object} Object passed to the customer auth strategy\n * @returns {Function}\n * @decorator\n * @operation\n */\nexport function UseAuth(guardAuth: Type<any>, options: Record<string, unknown> = {}): Function {\n return <T>(...args: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.METHOD:\n return useDecorators(\n StoreFn((store: Store) => {\n if (!store.has(guardAuth)) {\n return UseBefore(guardAuth);\n }\n }),\n AuthOptions(guardAuth, options)\n )(...args);\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(args[0], UseAuth(guardAuth, options));\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseAuth, args);\n }\n };\n}\n"]}
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,eAAe,CAAC;AAC1C,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;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":"useBefore.js","sourceRoot":"","sources":["../../../src/decorators/useBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,GAAG,IAAW;IACtC,OAAO,YAAY,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAEjE,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACvB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;gBAE1D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE;oBAC9B,GAAG,WAAW;oBACd,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;iBACvD,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC7D;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn} 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 * @UseBefore(Middleware1) // called only one time before all endpoint\n * export class Ctrl {\n *\n * @Get('/')\n * @UseBefore(Middleware2)\n * get() { }\n * }\n * ```\n *\n * @returns {function(any, any, any): *}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseBefore(...args: any[]): Function {\n return JsonEntityFn((entity, parameters) => {\n switch (entity.decoratorType) {\n case DecoratorTypes.METHOD:\n entity.beforeMiddlewares = args.concat(entity.beforeMiddlewares);\n\n break;\n\n case DecoratorTypes.CLASS:\n const middlewares = entity.store.get(\"middlewares\") || {};\n\n entity.store.set(\"middlewares\", {\n ...middlewares,\n useBefore: [...args, ...(middlewares.useBefore || [])]\n });\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseBefore, parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useBefore.js","sourceRoot":"","sources":["../../../src/decorators/useBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpE,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,GAAG,IAAW;IACtC,OAAO,YAAY,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACzC,QAAQ,MAAM,CAAC,aAAa,EAAE;YAC5B,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAEjE,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACvB,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;gBAE1D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE;oBAC9B,GAAG,WAAW;oBACd,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;iBACvD,CAAC,CAAC;gBACH,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC7D;IACH,CAAC,CAAC,CAAC;AACL,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,aAAa,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;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","sourcesContent":["import {decorateMethodsOf, DecoratorParameters, decoratorTypeOf, DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {UseBefore} from \"./useBefore\";\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 * @UseBeforeEach(Middleware1) // Called before each endpoint\n * export class Ctrl {\n *\n * @Get('/')\n * get() { }\n * }\n *\n * ```\n *\n * @returns {Function}\n * @param args\n * @decorator\n * @operation\n */\nexport function UseBeforeEach(...args: any[]): Function {\n return <T>(...decoratorArgs: DecoratorParameters): TypedPropertyDescriptor<T> | void => {\n switch (decoratorTypeOf(decoratorArgs)) {\n case DecoratorTypes.METHOD:\n return UseBefore(...args)(...decoratorArgs);\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(decoratorArgs[0], UseBefore(...args));\n break;\n\n default:\n throw new UnsupportedDecoratorType(UseBeforeEach, decoratorArgs);\n }\n };\n}\n"]}
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,aAAa,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"MiddlewareMethods.js","sourceRoot":"","sources":["../../../src/domain/MiddlewareMethods.ts"],"names":[],"mappings":"","sourcesContent":["export interface MiddlewareMethods {\n use(...args: any[]): void | any | Promise<any>;\n}\n"]}
1
+ {"version":3,"file":"MiddlewareMethods.js","sourceRoot":"","sources":["../../../src/domain/MiddlewareMethods.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformMiddlewareSettings.js","sourceRoot":"","sources":["../../../src/domain/PlatformMiddlewareSettings.ts"],"names":[],"mappings":"","sourcesContent":["import {Env, Type} from \"@tsed/core\";\n\nexport type PlatformMiddlewareLoadingOptions = {env?: Env; use: Function | Type<any> | string; hook?: string; options?: any};\nexport type PlatformMiddlewareSettings = Function | Type<any> | PlatformMiddlewareLoadingOptions | string | any;\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n /**\n * Load middlewares on the $beforeRoutesInit hook (or on the specified hook event name).\n */\n middlewares: PlatformMiddlewareSettings[];\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformMiddlewareSettings.js","sourceRoot":"","sources":["../../../src/domain/PlatformMiddlewareSettings.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
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"]}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMiddlewaresForHook.js","sourceRoot":"","sources":["../../../src/utils/getMiddlewaresForHook.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,QAAyB,EAAE,WAAW,GAAG,EAAE;IAC7F,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;IACzB,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAqC,aAAa,EAAE,EAAE,CAAC,CAAC;IAExF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtG,CAAC","sourcesContent":["import {DIConfiguration} from \"@tsed/di\";\nimport {PlatformMiddlewareLoadingOptions} from \"../domain/PlatformMiddlewareSettings\";\n\nexport function getMiddlewaresForHook(hook: string, settings: DIConfiguration, defaultHook = \"\") {\n const env = settings.env;\n const middlewares = settings.get<PlatformMiddlewareLoadingOptions[]>(\"middlewares\", []);\n\n return middlewares.filter((options) => options.use && options.env === env && options.hook === hook);\n}\n"]}
1
+ {"version":3,"file":"getMiddlewaresForHook.js","sourceRoot":"","sources":["../../../src/utils/getMiddlewaresForHook.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,QAAyB,EAAE,WAAW,GAAG,EAAE;IAC7F,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;IACzB,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAqC,aAAa,EAAE,EAAE,CAAC,CAAC;IAExF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtG,CAAC"}