@tsed/platform-middlewares 6.88.1 → 6.92.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.
Files changed (84) hide show
  1. package/lib/{constants → cjs/constants}/index.d.ts +0 -0
  2. package/lib/cjs/constants/index.js +34 -0
  3. package/lib/cjs/constants/index.js.map +1 -0
  4. package/lib/{decorators → cjs/decorators}/authOptions.d.ts +0 -0
  5. package/lib/cjs/decorators/authOptions.js +58 -0
  6. package/lib/cjs/decorators/authOptions.js.map +1 -0
  7. package/lib/{decorators → cjs/decorators}/middleware.d.ts +0 -0
  8. package/lib/cjs/decorators/middleware.js +17 -0
  9. package/lib/cjs/decorators/middleware.js.map +1 -0
  10. package/lib/{decorators → cjs/decorators}/use.d.ts +0 -0
  11. package/lib/cjs/decorators/use.js +43 -0
  12. package/lib/cjs/decorators/use.js.map +1 -0
  13. package/lib/{decorators → cjs/decorators}/useAfter.d.ts +0 -0
  14. package/lib/cjs/decorators/useAfter.js +46 -0
  15. package/lib/cjs/decorators/useAfter.js.map +1 -0
  16. package/lib/{decorators → cjs/decorators}/useAuth.d.ts +0 -0
  17. package/lib/cjs/decorators/useAuth.js +45 -0
  18. package/lib/cjs/decorators/useAuth.js.map +1 -0
  19. package/lib/{decorators → cjs/decorators}/useBefore.d.ts +0 -0
  20. package/lib/cjs/decorators/useBefore.js +45 -0
  21. package/lib/cjs/decorators/useBefore.js.map +1 -0
  22. package/lib/{decorators → cjs/decorators}/useBeforeEach.d.ts +0 -0
  23. package/lib/cjs/decorators/useBeforeEach.js +40 -0
  24. package/lib/cjs/decorators/useBeforeEach.js.map +1 -0
  25. package/lib/{domain → cjs/domain}/MiddlewareMethods.d.ts +0 -0
  26. package/lib/cjs/domain/MiddlewareMethods.js +3 -0
  27. package/lib/cjs/domain/MiddlewareMethods.js.map +1 -0
  28. package/lib/{domain → cjs/domain}/PlatformMiddlewareSettings.d.ts +0 -0
  29. package/lib/cjs/domain/PlatformMiddlewareSettings.js +3 -0
  30. package/lib/cjs/domain/PlatformMiddlewareSettings.js.map +1 -0
  31. package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  32. package/lib/cjs/index.js +17 -0
  33. package/lib/cjs/index.js.map +1 -0
  34. package/lib/{utils → cjs/utils}/getMiddlewaresForHook.d.ts +0 -0
  35. package/lib/cjs/utils/getMiddlewaresForHook.js +26 -0
  36. package/lib/cjs/utils/getMiddlewaresForHook.js.map +1 -0
  37. package/lib/{utils → cjs/utils}/mapUseOptions.d.ts +0 -0
  38. package/lib/cjs/utils/mapUseOptions.js +26 -0
  39. package/lib/cjs/utils/mapUseOptions.js.map +1 -0
  40. package/lib/esm/constants/index.js +31 -0
  41. package/lib/esm/constants/index.js.map +1 -0
  42. package/lib/esm/decorators/authOptions.js +54 -0
  43. package/lib/esm/decorators/authOptions.js.map +1 -0
  44. package/lib/esm/decorators/middleware.js +13 -0
  45. package/lib/esm/decorators/middleware.js.map +1 -0
  46. package/lib/esm/decorators/use.js +39 -0
  47. package/lib/esm/decorators/use.js.map +1 -0
  48. package/lib/esm/decorators/useAfter.js +42 -0
  49. package/lib/esm/decorators/useAfter.js.map +1 -0
  50. package/lib/esm/decorators/useAuth.js +41 -0
  51. package/lib/esm/decorators/useAuth.js.map +1 -0
  52. package/lib/esm/decorators/useBefore.js +41 -0
  53. package/lib/esm/decorators/useBefore.js.map +1 -0
  54. package/lib/esm/decorators/useBeforeEach.js +36 -0
  55. package/lib/esm/decorators/useBeforeEach.js.map +1 -0
  56. package/lib/esm/domain/MiddlewareMethods.js +2 -0
  57. package/lib/esm/domain/MiddlewareMethods.js.map +1 -0
  58. package/lib/esm/domain/PlatformMiddlewareSettings.js +2 -0
  59. package/lib/esm/domain/PlatformMiddlewareSettings.js.map +1 -0
  60. package/lib/esm/index.js +14 -0
  61. package/lib/esm/index.js.map +1 -0
  62. package/lib/esm/utils/getMiddlewaresForHook.js +22 -0
  63. package/lib/esm/utils/getMiddlewaresForHook.js.map +1 -0
  64. package/lib/esm/utils/mapUseOptions.js +22 -0
  65. package/lib/esm/utils/mapUseOptions.js.map +1 -0
  66. package/lib/types/constants/index.d.ts +1 -0
  67. package/lib/types/decorators/authOptions.d.ts +42 -0
  68. package/lib/types/decorators/middleware.d.ts +7 -0
  69. package/lib/types/decorators/use.d.ts +22 -0
  70. package/lib/types/decorators/useAfter.d.ts +21 -0
  71. package/lib/types/decorators/useAuth.d.ts +23 -0
  72. package/lib/types/decorators/useBefore.d.ts +21 -0
  73. package/lib/types/decorators/useBeforeEach.d.ts +21 -0
  74. package/lib/types/domain/MiddlewareMethods.d.ts +8 -0
  75. package/lib/types/domain/PlatformMiddlewareSettings.d.ts +17 -0
  76. package/lib/types/index.d.ts +10 -0
  77. package/lib/types/utils/getMiddlewaresForHook.d.ts +2 -0
  78. package/lib/types/utils/mapUseOptions.d.ts +5 -0
  79. package/package.json +16 -12
  80. package/tsconfig.compile.esm.json +23 -0
  81. package/lib/index.js +0 -326
  82. package/lib/index.js.map +0 -1
  83. package/lib/index.modern.js +0 -319
  84. package/lib/index.modern.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/decorators/middleware.ts","../src/decorators/authOptions.ts","../src/decorators/use.ts","../src/decorators/useAfter.ts","../src/decorators/useBefore.ts","../src/decorators/useAuth.ts","../src/decorators/useBeforeEach.ts","../src/utils/getMiddlewaresForHook.ts"],"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","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\nexport interface IAuthOptions {\n /**\n * @deprecated Since v6. Use @Returns from @tsed/schema\n */\n responses?: {\n [statusCode: string]: {\n description: string;\n };\n };\n /**\n * @deprecated Since v6. Use @Security from @tsed/schema\n */\n security?:\n | {\n [securityName: string]: string[];\n }[]\n | {\n [securityName: string]: string[];\n };\n\n [key: string]: any;\n}\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: IAuthOptions = {}): 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 if (options.responses) {\n const {responses} = options;\n store.merge(\"responses\", responses, true);\n delete options.responses;\n }\n\n if (options.security) {\n const {security} = options;\n [].concat(security as any).forEach((security) => {\n Object.entries(security).forEach(([name, scopes]: [string, string[]]) => {\n entity.operation!.addSecurityScopes(name, scopes);\n });\n });\n\n delete options.security;\n }\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","import {DecoratorTypes, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityFn, OperationMethods, OperationPath, Route} from \"@tsed/schema\";\nimport {mapUseOptions} from \"../utils/mapUseOptions\";\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","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","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","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, IAuthOptions} 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: IAuthOptions = {}): 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","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","import {isFunction} from \"@tsed/core\";\nimport {PlatformMiddlewareLoadingOptions} from \"../domain/PlatformMiddlewareSettings\";\n\nexport function getMiddlewaresForHook(hook: string, settings: TsED.Configuration, defaultHook = \"\") {\n const {env, middlewares = []} = settings;\n\n return middlewares\n .map<PlatformMiddlewareLoadingOptions>((middleware) => {\n return isFunction(middleware)\n ? {\n env,\n hook: defaultHook,\n use: middleware\n }\n : {\n env,\n hook: defaultHook,\n ...middleware\n };\n })\n .filter((options) => {\n return options.use && options.env === env && options.hook === hook;\n });\n}\n"],"names":["Middleware","Injectable","type","ProviderType","MIDDLEWARE","AuthOptions","guardAuth","options","args","decoratorTypeOf","DecoratorTypes","METHOD","JsonEntityFn","entity","store","responses","merge","security","concat","forEach","Object","entries","name","scopes","operation","addSecurityScopes","CLASS","decorateMethodsOf","UnsupportedDecoratorType","Use","parameters","decoratorType","Route","use","UseAfter","endpoint","afterMiddlewares","middlewares","get","set","useAfter","UseBefore","beforeMiddlewares","useBefore","UseAuth","useDecorators","StoreFn","has","UseBeforeEach","decoratorArgs","getMiddlewaresForHook","hook","settings","defaultHook","env","map","middleware","isFunction","filter"],"mappings":";;;;AAEA;;;;;;;SAMgBA;AACd,SAAOC,UAAU,C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