@tsed/platform-params 7.18.3-rc.1 → 7.18.4

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 (69) hide show
  1. package/.eslintignore +13 -0
  2. package/.eslintrc.js +1 -0
  3. package/jest.config.js +5 -5
  4. package/lib/cjs/builder/PlatformParams.js.map +1 -1
  5. package/lib/cjs/decorators/bodyParams.js.map +1 -1
  6. package/lib/cjs/decorators/context.js.map +1 -1
  7. package/lib/cjs/decorators/cookies.js.map +1 -1
  8. package/lib/cjs/decorators/headerParams.js.map +1 -1
  9. package/lib/cjs/decorators/locals.js.map +1 -1
  10. package/lib/cjs/decorators/paramFn.js.map +1 -1
  11. package/lib/cjs/decorators/pathParams.js.map +1 -1
  12. package/lib/cjs/decorators/queryParams.js.map +1 -1
  13. package/lib/cjs/decorators/session.js.map +1 -1
  14. package/lib/cjs/decorators/useDeserialization.js.map +1 -1
  15. package/lib/cjs/decorators/useParam.js.map +1 -1
  16. package/lib/cjs/decorators/useParamExpression.js.map +1 -1
  17. package/lib/cjs/decorators/useParamType.js.map +1 -1
  18. package/lib/cjs/decorators/usePipe.js.map +1 -1
  19. package/lib/cjs/decorators/useType.js.map +1 -1
  20. package/lib/cjs/decorators/useValidation.js.map +1 -1
  21. package/lib/cjs/domain/ParamMetadata.js.map +1 -1
  22. package/lib/cjs/domain/ParamOptions.js.map +1 -1
  23. package/lib/cjs/domain/ParamTypes.js.map +1 -1
  24. package/lib/cjs/errors/ParamValidationError.js.map +1 -1
  25. package/lib/cjs/errors/RequiredValidationError.js.map +1 -1
  26. package/lib/cjs/errors/ValidationError.js.map +1 -1
  27. package/lib/cjs/exports.js.map +1 -1
  28. package/lib/cjs/index.js.map +1 -1
  29. package/lib/cjs/pipes/DeserializerPipe.js.map +1 -1
  30. package/lib/cjs/pipes/ParseExpressionPipe.js.map +1 -1
  31. package/lib/cjs/pipes/ValidationPipe.js.map +1 -1
  32. package/lib/cjs/utils/mapParamsOptions.js.map +1 -1
  33. package/lib/esm/builder/PlatformParams.js.map +1 -1
  34. package/lib/esm/decorators/bodyParams.js.map +1 -1
  35. package/lib/esm/decorators/context.js.map +1 -1
  36. package/lib/esm/decorators/cookies.js.map +1 -1
  37. package/lib/esm/decorators/headerParams.js.map +1 -1
  38. package/lib/esm/decorators/locals.js.map +1 -1
  39. package/lib/esm/decorators/paramFn.js.map +1 -1
  40. package/lib/esm/decorators/pathParams.js.map +1 -1
  41. package/lib/esm/decorators/queryParams.js.map +1 -1
  42. package/lib/esm/decorators/session.js.map +1 -1
  43. package/lib/esm/decorators/useDeserialization.js.map +1 -1
  44. package/lib/esm/decorators/useParam.js.map +1 -1
  45. package/lib/esm/decorators/useParamExpression.js.map +1 -1
  46. package/lib/esm/decorators/useParamType.js.map +1 -1
  47. package/lib/esm/decorators/usePipe.js.map +1 -1
  48. package/lib/esm/decorators/useType.js.map +1 -1
  49. package/lib/esm/decorators/useValidation.js.map +1 -1
  50. package/lib/esm/domain/ParamMetadata.js.map +1 -1
  51. package/lib/esm/domain/ParamOptions.js.map +1 -1
  52. package/lib/esm/domain/ParamTypes.js.map +1 -1
  53. package/lib/esm/errors/ParamValidationError.js.map +1 -1
  54. package/lib/esm/errors/RequiredValidationError.js.map +1 -1
  55. package/lib/esm/errors/ValidationError.js.map +1 -1
  56. package/lib/esm/exports.js.map +1 -1
  57. package/lib/esm/index.js.map +1 -1
  58. package/lib/esm/pipes/DeserializerPipe.js.map +1 -1
  59. package/lib/esm/pipes/ParseExpressionPipe.js.map +1 -1
  60. package/lib/esm/pipes/ValidationPipe.js.map +1 -1
  61. package/lib/esm/utils/mapParamsOptions.js.map +1 -1
  62. package/lib/tsconfig.esm.tsbuildinfo +1 -0
  63. package/lib/tsconfig.tsbuildinfo +1 -0
  64. package/lib/types/builder/PlatformParams.d.ts +2 -2
  65. package/lib/types/decorators/context.d.ts +1 -1
  66. package/lib/types/pipes/ValidationPipe.d.ts +1 -1
  67. package/package.json +21 -20
  68. package/tsconfig.esm.json +45 -0
  69. 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,13 +2,13 @@
2
2
  // https://jestjs.io/docs/en/configuration.html
3
3
 
4
4
  module.exports = {
5
- ...require("@tsed/jest-config")(__dirname, "platform-params"),
5
+ ...require("@tsed/jest-config"),
6
6
  coverageThreshold: {
7
7
  global: {
8
- statements: 89.89,
9
- branches: 73.19,
10
- functions: 73.83,
11
- lines: 89.43
8
+ statements: 94.97,
9
+ branches: 88.77,
10
+ functions: 94.33,
11
+ lines: 94.97
12
12
  }
13
13
  }
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformParams.js","sourceRoot":"","sources":["../../../src/builder/PlatformParams.ts"],"names":[],"mappings":";;;;AAAA,iCAAsG;AACtG,yCAA8E;AAC9E,yEAAoE;AACpE,sEAAiE;AAKjE;;;GAGG;AAKH,IAAa,cAAc,GAA3B,MAAa,cAAc;IAEf,QAAQ,CAAkB;IAEpC,QAAQ,CAAC,KAAyB;QAChC,MAAM,GAAG,GAAG,CAAC,IAAmB,EAAE,EAAE;YAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAE,CAAC,QAAQ,IAAI,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,MAAM,IAAI,GAAG,CAAC,EAAiB,EAAE,EAAiB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG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IAAA,eAAU,EAAC;QACV,KAAK,EAAE,kBAAa,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAC,yCAAmB,CAAC;KAC/B,CAAC;GACW,cAAc,CAsE1B;AAtEY,wCAAc","sourcesContent":["import {DIContext, Inject, Injectable, InjectorService, ProviderScope, TokenProvider} from \"@tsed/di\";\nimport {JsonMethodStore, JsonParameterStore, PipeMethods} from \"@tsed/schema\";\nimport {ParamValidationError} from \"../errors/ParamValidationError\";\nimport {ParseExpressionPipe} from \"../pipes/ParseExpressionPipe\";\n\nexport type PlatformParamsScope<Context extends DIContext = DIContext> = {$ctx: Context} & Record<string, any>;\nexport type PlatformParamsCallback<Context extends DIContext = DIContext> = (scope: PlatformParamsScope) => Promise<any>;\n\n/**\n * Platform Params abstraction layer.\n * @platform\n */\n@Injectable({\n scope: ProviderScope.SINGLETON,\n imports: [ParseExpressionPipe]\n})\nexport class PlatformParams {\n @Inject()\n protected injector: InjectorService;\n\n getPipes(param: JsonParameterStore) {\n const get = (pipe: TokenProvider) => {\n return this.injector.getProvider(pipe)!.priority || 0;\n };\n\n const sort = (p1: TokenProvider, p2: TokenProvider) => (get(p1) < get(p2) ? -1 : get(p1) > get(p2) ? 1 : 0);\n const map = (token: TokenProvider) => this.injector.get<PipeMethods>(token)!;\n\n return [ParseExpressionPipe, ...param.pipes.sort(sort)].map(map).filter(Boolean);\n }\n\n /**\n * Return a handler with injectable parameters\n * @param handlerMetadata\n */\n compileHandler<Context extends DIContext = DIContext>({\n propertyKey,\n token,\n handler\n }: {\n propertyKey?: string | symbol;\n token?: any;\n handler?: any;\n }): PlatformParamsCallback<Context> {\n if (!token || !propertyKey) {\n return (scope: PlatformParamsScope) => handler(scope.$ctx);\n }\n\n const store = JsonMethodStore.fromMethod(token, propertyKey);\n const getArguments = this.compile<Context>(store);\n const provider = this.injector.getProvider(token)!;\n\n return async (scope: PlatformParamsScope) => {\n const container = provider.scope === ProviderScope.REQUEST ? scope.$ctx.container : undefined;\n const [instance, args] = await Promise.all([this.injector.invoke<any>(token, container), getArguments(scope)]);\n\n return instance[propertyKey].call(instance, ...args, scope.$ctx);\n };\n }\n\n compile<Context extends DIContext = DIContext>(entity: JsonMethodStore): PlatformParamsCallback<Context> {\n const params = JsonParameterStore.getParams(entity.target, entity.propertyKey);\n const argsPipes = params.map((param) => {\n return {\n param,\n pipes: this.getPipes(param)\n };\n });\n\n return (scope) => {\n const promises = argsPipes.map(({param, pipes}) => this.getArg(scope, pipes, param));\n return Promise.all(promises);\n };\n }\n\n async getArg<Context extends DIContext = DIContext>(scope: PlatformParamsScope, pipes: PipeMethods[], param: JsonParameterStore) {\n return pipes.reduce(async (value: any | Promise<any>, pipe) => {\n value = await value;\n\n try {\n return await pipe.transform(value, param);\n } catch (er) {\n throw ParamValidationError.from(param, er);\n }\n }, scope);\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformParams.js","sourceRoot":"","sources":["../../../src/builder/PlatformParams.ts"],"names":[],"mappings":";;;;AAAA,iCAAsG;AACtG,yCAA8E;AAC9E,yEAAoE;AACpE,sEAAiE;AAKjE;;;GAGG;AAKI,IAAM,cAAc,GAApB,MAAM,cAAc;IAEf,QAAQ,CAAkB;IAEpC,QAAQ,CAAC,KAAyB;QAChC,MAAM,GAAG,GAAG,CAAC,IAAmB,EAAE,EAAE;YAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAE,CAAC,QAAQ,IAAI,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,MAAM,IAAI,GAAG,CAAC,EAAiB,EAAE,EAAiB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5G,MAAM,GAAG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AAC;GACW,cAAc,CAsE1B;AAtEY,wCAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"bodyParams.js","sourceRoot":"","sources":["../../../src/decorators/bodyParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,yCAAoC;AACpC,gEAA2D;AA4C3D,SAAgB,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,gCAUC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,QAAQ;QAC9B,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAND,sCAMC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseParam} from \"./useParam\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\n\n/**\n * BodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@BodyParams() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Post('/')\n * create(@BodyParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@BodyParams('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Post('/')\n * create(@BodyParams('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function BodyParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function BodyParams(expression: string): ParameterDecorator;\nexport function BodyParams(useType: Type<any>): ParameterDecorator;\nexport function BodyParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function BodyParams(): ParameterDecorator;\nexport function BodyParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.BODY,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawBodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) as a Buffer.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@RawBodyParams() body: Buffer) {\n * console.log('Entire body', body.toString(\"utf8\"));\n * }\n * }\n * ```\n *\n * @decorator\n * @operation\n * @input\n * @alias BodyParams Example: @BodyParams() payload: Buffer\n */\nexport function RawBodyParams(): ParameterDecorator {\n return UseParam({\n paramType: ParamTypes.RAW_BODY,\n useMapper: false,\n useValidation: false\n });\n}\n"]}
1
+ {"version":3,"file":"bodyParams.js","sourceRoot":"","sources":["../../../src/decorators/bodyParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,yCAAoC;AACpC,gEAA2D;AA4C3D,SAAgB,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,gCAUC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,QAAQ;QAC9B,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAND,sCAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/decorators/context.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAqDpC,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC","sourcesContent":["import {BaseContext} from \"@tsed/di\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Context decorator return the @@PlatformContext@@ created by Ts.ED when request is handled by the server.\n *\n * It contains some information as following:\n *\n * - The request id,\n * - The request container used by the Ts.ED DI. It contain all services annotated with `@Scope(ProviderScope.REQUEST)`,\n * - The current @@EndpointMetadata@@ resolved by Ts.ED during the request,\n * - The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.\n *\n * ::: tip\n * The @@PlatformContext@@ inherit from Map class. So you can store any information with.\n * :::\n *\n * #### Example\n *\n * ```typescript\n * @Middleware()\n * class AuthTokenMiddleware {\n * use(@Req() request: Req, @Context() context: PlatformContext) {\n * if (!context.has(\"auth\")){\n * context.set('auth', new AuthToken(request))\n * }\n *\n * try {\n * context.get(\"auth\").claims() // check token\n * } catch(er){\n * throw new Forbidden(\"Access forbidden - Bad token\")\n * }\n * }\n * }\n *\n * @Controller('/')\n * @UseBefore(AuthTokenMiddleware) // protect all routes for this controller\n * class MyCtrl {\n * @Get('/')\n * get(@Context('auth') auth: AuthToken) {\n * console.log('auth', auth);\n * console.log('auth.accessToken', auth.accessToken);\n * console.log('auth.idToken', auth.idToken);\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function Context(expression: string): ParameterDecorator;\nexport function Context(): ParameterDecorator;\nexport function Context(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.$CTX,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\nexport type Context = BaseContext;\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/decorators/context.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAqDpC,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../src/decorators/cookies.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAsCpC,SAAgB,aAAa,CAAC,GAAG,IAAW;IAC1C,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,sCAUC;AA6CD,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAChC,CAAC;AAHD,0BAGC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Cookies or CookiesParams return the value from [request.cookies](http://expressjs.com/en/4x/api.html#req.cookies) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Cookies() cookies: any) {\n * console.log('Entire cookies', cookies);\n * }\n *\n * @Post('/')\n * create(@Cookies('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@Cookies('user') user: IUser) {\n * console.log('user', user);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function CookiesParams(expression: string | any, useType: any): ParameterDecorator;\nexport function CookiesParams(): ParameterDecorator;\nexport function CookiesParams(expression: string | any): ParameterDecorator;\nexport function CookiesParams(options: ParamOptions<any>): ParameterDecorator;\nexport function CookiesParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.COOKIES,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * Cookies or CookiesParams return the value from [request.cookies](http://expressjs.com/en/4x/api.html#req.cookies) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Cookies() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Post('/')\n * create(@Cookies('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@Cookies('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Post('/')\n * create(@Cookies('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @aliasof CookiesParams\n * @operation\n * @input\n */\nexport function Cookies(expression: string, useType: Type<any>): ParameterDecorator;\nexport function Cookies(expression: string): ParameterDecorator;\nexport function Cookies(useType: Type<any>): ParameterDecorator;\nexport function Cookies(options: Partial<ParamOptions>): ParameterDecorator;\nexport function Cookies(): ParameterDecorator;\nexport function Cookies(...args: any[]): ParameterDecorator {\n // @ts-ignore\n return CookiesParams(...args);\n}\n"]}
1
+ {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../src/decorators/cookies.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAsCpC,SAAgB,aAAa,CAAC,GAAG,IAAW;IAC1C,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,sCAUC;AA6CD,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAChC,CAAC;AAHD,0BAGC"}
@@ -1 +1 @@
1
- {"version":3,"file":"headerParams.js","sourceRoot":"","sources":["../../../src/decorators/headerParams.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,yCAAoC;AACpC,gEAA2D;AAkC3D,SAAgB,YAAY,CAAC,GAAG,IAAW;IACzC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,oCAUC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseParam} from \"./useParam\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\n\n/**\n * HeaderParams return the value from [`request.get()`](http://expressjs.com/en/4x/api.html#req.get) method.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@HeaderParams() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Get('/')\n * get(@HeaderParams('x-token') token: string) {\n * console.log('token', id);\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @param useType\n * @decorator\n * @operation\n * @input\n */\nexport function HeaderParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function HeaderParams(expression: string): ParameterDecorator;\nexport function HeaderParams(useType: Type<any>): ParameterDecorator;\nexport function HeaderParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function HeaderParams(): ParameterDecorator;\nexport function HeaderParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.HEADER,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"headerParams.js","sourceRoot":"","sources":["../../../src/decorators/headerParams.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,yCAAoC;AACpC,gEAA2D;AAkC3D,SAAgB,YAAY,CAAC,GAAG,IAAW;IACzC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,oCAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"locals.js","sourceRoot":"","sources":["../../../src/decorators/locals.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AA4CpC,SAAgB,MAAM,CAAC,GAAG,IAAW;IACnC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,wBAUC","sourcesContent":["import {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Locals return the value from [response.locals](http://expressjs.com/en/4x/api.html#res.locals) object.\n *\n * ::: tip\n * Locals are generally used by express and third-party like templating engine to render a page/template.\n * See [Templating](http://tsed.io/tutorials/templating.html) section for more details.\n * :::\n *\n * #### Example\n *\n * ```typescript\n * * @Middleware()\n * class LocalsMiddleware {\n * use(@Locals() locals: any) {\n * // set some on locals\n * locals.user = \"user\"\n * }\n * }\n *\n * @Controller('/')\n * @UseBefore(LocalsMiddleware)\n * class MyCtrl {\n * @Get('/')\n * @View('home.ejs') // will use locals and returned data to render the page\n * get(@Locals('user') user: any) {\n * console.log('user', user);\n *\n * return {\n * description: 'Hello world'\n * }\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport function Locals(expression: string): ParameterDecorator;\nexport function Locals(): ParameterDecorator;\nexport function Locals(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.LOCALS,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"locals.js","sourceRoot":"","sources":["../../../src/decorators/locals.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AA4CpC,SAAgB,MAAM,CAAC,GAAG,IAAW;IACnC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,wBAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"paramFn.js","sourceRoot":"","sources":["../../../src/decorators/paramFn.ts"],"names":[],"mappings":";;;AACA,yCAA8D;AAE9D;;;;;;;GAOG;AACH,SAAgB,OAAO,CAAC,EAAwE;IAC9F,OAAO,IAAA,qBAAY,EAAqB,EAAE,CAAC,CAAC;AAC9C,CAAC;AAFD,0BAEC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport {JsonEntityFn, JsonParameterStore} from \"@tsed/schema\";\n\n/**\n * Get the Param metadata. Use this decorator to compose your own decorator.\n *\n * @param fn\n * @decorator\n * @operation\n * @input\n */\nexport function ParamFn(fn: (param: JsonParameterStore, parameters: DecoratorParameters) => void): ParameterDecorator {\n return JsonEntityFn<JsonParameterStore>(fn);\n}\n"]}
1
+ {"version":3,"file":"paramFn.js","sourceRoot":"","sources":["../../../src/decorators/paramFn.ts"],"names":[],"mappings":";;;AACA,yCAA8D;AAE9D;;;;;;;GAOG;AACH,SAAgB,OAAO,CAAC,EAAwE;IAC9F,OAAO,IAAA,qBAAY,EAAqB,EAAE,CAAC,CAAC;AAC9C,CAAC;AAFD,0BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pathParams.js","sourceRoot":"","sources":["../../../src/decorators/pathParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAuCpC,SAAgB,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,gCAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,aAAa,CAAC,UAAkB;IAC9C,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,qBAAqB;QAC/B,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAND,sCAMC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * PathParams return the value from [request.params](http://expressjs.com/en/4x/api.html#req.params) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@PathParams() params: any) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@PathParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Get('/')\n * get(@PathParams({expression: 'id', useType: () => new MyCustomModel() }) id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function PathParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function PathParams(expression: string): ParameterDecorator;\nexport function PathParams(useType: Type<any>): ParameterDecorator;\nexport function PathParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function PathParams(): ParameterDecorator;\nexport function PathParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.PATH,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawPathParams return the raw value from [request.params](http://expressjs.com/en/4x/api.html#req.params) object.\n *\n * Any validation and transformation are performed on the value. Use [pipes](/docs/pipes.html) to validate and/or transform the value.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@RawPathParams() params: string) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@RawPathParams('id') id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function RawPathParams(expression: string) {\n return UseParam({\n paramType: ParamTypes.PATH,\n dataPath: \"$ctx.request.params\",\n expression\n });\n}\n"]}
1
+ {"version":3,"file":"pathParams.js","sourceRoot":"","sources":["../../../src/decorators/pathParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAuCpC,SAAgB,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,gCAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,aAAa,CAAC,UAAkB;IAC9C,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,qBAAqB;QAC/B,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAND,sCAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../../src/decorators/queryParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AA4CpC,SAAgB,WAAW,CAAC,GAAG,IAAW;IACxC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,KAAK;QAC3B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,kCAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,cAAc,CAAC,UAAkB;IAC/C,OAAO,WAAW,CAAC;QACjB,UAAU;QACV,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAND,wCAMC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * QueryParams return the value from [request.query](http://expressjs.com/en/4x/api.html#req.query) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@QueryParams() query: any) {\n * console.log('Entire query', query);\n * }\n *\n * @Get('/')\n * get(@QueryParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Get('/')\n * get(@QueryParams('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Get('/')\n * get(@QueryParams('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function QueryParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function QueryParams(expression: string): ParameterDecorator;\nexport function QueryParams(useType: Type<any>): ParameterDecorator;\nexport function QueryParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function QueryParams(): ParameterDecorator;\nexport function QueryParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.QUERY,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawQueryParams return the value from [request.query](http://expressjs.com/en/4x/api.html#req.query) object.\n *\n * Any validation and transformation are performed on the value. Use [pipes](/docs/pipes.html) to validate and/or transform the value.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@RawPathParams() params: any) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@RawPathParams('id') id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function RawQueryParams(expression: string) {\n return QueryParams({\n expression,\n useConverters: false,\n useValidation: false\n });\n}\n"]}
1
+ {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../../src/decorators/queryParams.ts"],"names":[],"mappings":";;;AAEA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AA4CpC,SAAgB,WAAW,CAAC,GAAG,IAAW;IACxC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,KAAK;QAC3B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,kCAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,cAAc,CAAC,UAAkB;IAC/C,OAAO,WAAW,CAAC;QACjB,UAAU;QACV,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAND,wCAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/decorators/session.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAqCpC,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC","sourcesContent":["import {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Session return the value from [request.session](http://expressjs.com/en/4x/api.html#req.session) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Session() session: Express.Session) {\n * console.log('Entire session', session);\n * }\n *\n * @Post('/')\n * create(@Session('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/') // Example to deserialize use from session\n * create(@Session({expression: 'user', useConverter: true}) user: User) {\n * console.log('user', user);\n * console.log('instanceOf user', user instanceof User);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function Session(expression: string): ParameterDecorator;\nexport function Session(options: Partial<ParamOptions>): ParameterDecorator;\nexport function Session(): ParameterDecorator;\nexport function Session(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.SESSION,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/decorators/session.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAChD,gEAA2D;AAC3D,yCAAoC;AAqCpC,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,IAAA,mBAAQ,EAAC;QACd,SAAS,EAAE,uBAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDeserialization.js","sourceRoot":"","sources":["../../../src/decorators/useDeserialization.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAC3D,uCAAkC;AAElC;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,UAAe,EAAE;IAClD,OAAO,IAAA,iBAAO,EAAC,mCAAgB,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAFD,gDAEC","sourcesContent":["import {DeserializerPipe} from \"../pipes/DeserializerPipe\";\nimport {UsePipe} from \"./usePipe\";\n\n/**\n * Use JsonMapper to deserialize the data.\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseDeserialization(options: any = {}) {\n return UsePipe(DeserializerPipe, options);\n}\n"]}
1
+ {"version":3,"file":"useDeserialization.js","sourceRoot":"","sources":["../../../src/decorators/useDeserialization.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAC3D,uCAAkC;AAElC;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,UAAe,EAAE;IAClD,OAAO,IAAA,iBAAO,EAAC,mCAAgB,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAFD,gDAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParam.js","sourceRoot":"","sources":["../../../src/decorators/useParam.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAEzC,qDAAgD;AAChD,6DAAwD;AACxD,iDAA4C;AAC5C,uCAAkC;AAClC,mDAA8C;AAE9C;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAA8B;IAC9C,MAAM,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;IAErF,OAAO,CAAC,SAAS,KAAK,uBAAU,CAAC,KAAK,IAAI,IAAA,iBAAO,EAAC,OAAO,CAAC,EAAE,aAAa,IAAI,IAAA,6BAAa,GAAE,EAAE,SAAS,IAAI,IAAA,uCAAkB,EAAC,KAAK,CAAC,CAAC,CAAC;AACxI,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,QAAQ,CAAC,OAA8B;IACrD,OAAO,IAAA,oBAAa,EAAC,IAAA,2BAAY,EAAC,OAAc,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAuB,CAAC;AACjG,CAAC;AAFD,4BAEC","sourcesContent":["import {useDecorators} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseDeserialization} from \"./useDeserialization\";\nimport {UseParamType} from \"./useParamType\";\nimport {UseType} from \"./useType\";\nimport {UseValidation} from \"./useValidation\";\n\n/**\n * @ignore\n * @param options\n */\nfunction mapPipes(options: Partial<ParamOptions>) {\n const {paramType, useType, expression, useValidation, useMapper, ...props} = options;\n\n return [paramType !== ParamTypes.FILES && UseType(useType), useValidation && UseValidation(), useMapper && UseDeserialization(props)];\n}\n\n/**\n * Register a new param. It use the paramType to extract value and give it to the next pipe.\n *\n * Given options allow to enable or disable following pipes:\n *\n * - useType: Add extra type for the json mapper,\n * - expression: Get property from the returned value by the previous pipe.\n * - useValidation: Apply validation from the returned value by the previous pipe.\n * - useConverter: Apply json mapper from the returned value by the previous pipe.\n *\n * @param options\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParam(options: Partial<ParamOptions>): ParameterDecorator {\n return useDecorators(UseParamType(options as any), ...mapPipes(options)) as ParameterDecorator;\n}\n"]}
1
+ {"version":3,"file":"useParam.js","sourceRoot":"","sources":["../../../src/decorators/useParam.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAEzC,qDAAgD;AAChD,6DAAwD;AACxD,iDAA4C;AAC5C,uCAAkC;AAClC,mDAA8C;AAE9C;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAA8B;IAC9C,MAAM,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;IAErF,OAAO,CAAC,SAAS,KAAK,uBAAU,CAAC,KAAK,IAAI,IAAA,iBAAO,EAAC,OAAO,CAAC,EAAE,aAAa,IAAI,IAAA,6BAAa,GAAE,EAAE,SAAS,IAAI,IAAA,uCAAkB,EAAC,KAAK,CAAC,CAAC,CAAC;AACxI,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,QAAQ,CAAC,OAA8B;IACrD,OAAO,IAAA,oBAAa,EAAC,IAAA,2BAAY,EAAC,OAAc,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAuB,CAAC;AACjG,CAAC;AAFD,4BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParamExpression.js","sourceRoot":"","sources":["../../../src/decorators/useParamExpression.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,UAAmB;IACpD,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,gDAIC","sourcesContent":["import {ParamFn} from \"./paramFn\";\n\n/**\n * Get data from a path inside the given object\n *\n * @param expression\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParamExpression(expression?: string) {\n return ParamFn((param) => {\n param.expression = expression || \"\";\n });\n}\n"]}
1
+ {"version":3,"file":"useParamExpression.js","sourceRoot":"","sources":["../../../src/decorators/useParamExpression.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;GAQG;AACH,SAAg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AAO,CAAC,UAAU,CAAC,CAC/C,CAAC;AACJ,CAAC;AAnBD,oCAmBC","sourcesContent":["import {isBuffer, useDecorators} from \"@tsed/core\";\nimport {isParameterType, Name} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {UseParamExpression} from \"./useParamExpression\";\nimport {PARAM_TYPES_DATA_PATH, ParamTypes} from \"../domain/ParamTypes\";\n\n/**\n * Get the object from request (like body, params, query, etc...).\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParamType(options: ParamOptions) {\n return useDecorators(\n ParamFn((param) => {\n if (isParameterType(options.paramType)) {\n param.parameter!.in(options.paramType);\n }\n\n param.paramType = options.paramType;\n\n if (isBuffer(param.type) || isBuffer(options.useType) || options.paramType === ParamTypes.RAW_BODY) {\n param.paramType = ParamTypes.RAW_BODY;\n param.parent.operation?.consumes([\"*/*\"]);\n }\n\n param.dataPath = options.dataPath || PARAM_TYPES_DATA_PATH[param.paramType] || \"$ctx\";\n }),\n options.expression && UseParamExpression(options.expression),\n options.expression && Name(options.expression)\n );\n}\n"]}
1
+ {"version":3,"file":"useParamType.js","sourceRoot":"","sources":["../../../src/decorators/useParamType.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAmD;AACnD,uCAAkC;AAElC,6DAAwD;AACxD,qDAAuE;AAEvE;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,OAAqB;IAChD,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,IAAA,wBAAe,EAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACtC,KAAK,CAAC,SAAU,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEpC,IAAI,IAAA,eAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAA,eAAQ,EAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,KAAK,uBAAU,CAAC,QAAQ,EAAE;YAClG,KAAK,CAAC,SAAS,GAAG,uBAAU,CAAC,QAAQ,CAAC;YACtC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C;QAED,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,kCAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;IACxF,CAAC,CAAC,EACF,OAAO,CAAC,UAAU,IAAI,IAAA,uCAAkB,EAAC,OAAO,CAAC,UAAU,CAAC,EAC5D,OAAO,CAAC,UAAU,IAAI,IAAA,aAAI,EAAC,OAAO,CAAC,UAAU,CAAC,CAC/C,CAAC;AACJ,CAAC;AAnBD,oCAmBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePipe.js","sourceRoot":"","sources":["../../../src/decorators/usePipe.ts"],"names":[],"mappings":";;;AAEA,uCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAgB,OAAO,CAAC,KAAwB,EAAE,UAAe,EAAE;IACjE,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AALD,0BAKC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {PipeMethods} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Register a Pipe to be used with the current decorated param.\n *\n * @param token\n * @param options\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UsePipe(token: Type<PipeMethods>, options: any = {}) {\n return ParamFn((param) => {\n param.store.set(token, options);\n param.pipes.push(token);\n });\n}\n"]}
1
+ {"version":3,"file":"usePipe.js","sourceRoot":"","sources":["../../../src/decorators/usePipe.ts"],"names":[],"mappings":";;;AAEA,uCAAkC;AAElC;;;;;;;;;GASG;AACH,SAAgB,OAAO,CAAC,KAAwB,EAAE,UAAe,EAAE;IACjE,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AALD,0BAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useType.js","sourceRoot":"","sources":["../../../src/decorators/useType.ts"],"names":[],"mappings":";;;AACA,yCAA+C;AAC/C,uCAAkC;AAElC;;;;;;;;;;GAUG;AACH,SAAgB,OAAO,CAAC,OAAoC;IAC1D,OAAO,IAAA,iBAAO,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,OAAO,EAAE;YACX,OAAO,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC;SAC9B;QAED,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;YAClH,IAAA,YAAG,GAAE,CAAC,GAAG,UAAU,CAAC,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Any, CollectionOf} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Set the type of the item collection.\n *\n * Prefer @@CollectionOf@@ usage.\n *\n * @param useType\n * @decorator\n * @operation\n * @input\n * @alias CollectionOf\n */\nexport function UseType(useType: undefined | any | Type<any>) {\n return ParamFn((entity, parameters) => {\n if (useType) {\n return CollectionOf(useType);\n }\n\n if (entity.isCollection && entity.type === Object && [undefined, \"object\"].includes(entity.itemSchema.get(\"type\"))) {\n Any()(...parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useType.js","sourceRoot":"","sources":["../../../src/decorators/useType.ts"],"names":[],"mappings":";;;AACA,yCAA+C;AAC/C,uCAAkC;AAElC;;;;;;;;;;GAUG;AACH,SAAgB,OAAO,CAAC,OAAoC;IAC1D,OAAO,IAAA,iBAAO,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,OAAO,EAAE;YACX,OAAO,IAAA,qBAAY,EAAC,OAAO,CAAC,CAAC;SAC9B;QAED,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;YAClH,IAAA,YAAG,GAAE,CAAC,GAAG,UAAU,CAAC,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAVD,0BAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidation.js","sourceRoot":"","sources":["../../../src/decorators/useValidation.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AACvD,uCAAkC;AAElC;;;;;;;GAOG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,cAAc,EAAE;YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,+BAAc,CAAC,CAAC;SAClC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAND,sCAMC","sourcesContent":["import {ValidationPipe} from \"../pipes/ValidationPipe\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Enable validation on the decoratored parameter.\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseValidation() {\n return ParamFn((param) => {\n if (param.type || param.collectionType) {\n param.pipes.push(ValidationPipe);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useValidation.js","sourceRoot":"","sources":["../../../src/decorators/useValidation.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AACvD,uCAAkC;AAElC;;;;;;;GAOG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,cAAc,EAAE;YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,+BAAc,CAAC,CAAC;SAClC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAND,sCAMC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamMetadata.js","sourceRoot":"","sources":["../../../src/domain/ParamMetadata.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAAnC,uGAAA,aAAa,OAAA","sourcesContent":["export {ParamMetadata} from \"@tsed/schema\";\n"]}
1
+ {"version":3,"file":"ParamMetadata.js","sourceRoot":"","sources":["../../../src/domain/ParamMetadata.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAAnC,uGAAA,aAAa,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamOptions.js","sourceRoot":"","sources":["../../../src/domain/ParamOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\n\nexport interface ParamOptions<T = any> {\n dataPath: string;\n paramType: string;\n expression?: string;\n useType?: Type<T>;\n useMapper?: boolean;\n /**\n * @deprecated Since 10-2022. Use ParamOptions.useMapper.\n */\n useConverter?: boolean;\n useValidation?: boolean;\n\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"file":"ParamOptions.js","sourceRoot":"","sources":["../../../src/domain/ParamOptions.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamTypes.js","sourceRoot":"","sources":["../../../src/domain/ParamTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IAEf,WAAW;IACX,iCAAmB,CAAA;IACnB,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,mDAAqC,CAAA;IACrC,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,qDAAuC,CAAA;IACvC,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,yBAAW,CAAA;IACX,yBAAW,CAAA;AACb,CAAC,EAzBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAyBrB;AAEY,QAAA,qBAAqB,GAA2B;IAC3D,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAC3C,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,sBAAsB;IAC7C,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,mBAAmB;IACtC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,oBAAoB;IACxC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,qBAAqB;IACxC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;CAC5C,CAAC","sourcesContent":["export enum ParamTypes {\n $CTX = \"$CTX\",\n BODY = \"BODY\",\n PATH = \"PATH\",\n QUERY = \"QUERY\",\n HEADER = \"HEADER\",\n RAW_BODY = \"RAW_BODY\",\n COOKIES = \"COOKIES\",\n LOCALS = \"LOCALS\",\n SESSION = \"SESSION\",\n FILES = \"FILES\",\n\n /// NOT STD\n NEXT_FN = \"NEXT_FN\",\n ERR = \"ERR\",\n REQUEST = \"REQUEST\",\n PLATFORM_REQUEST = \"PLATFORM_REQUEST\",\n NODE_REQUEST = \"NODE_REQUEST\",\n RESPONSE = \"RESPONSE\",\n PLATFORM_RESPONSE = \"PLATFORM_RESPONSE\",\n NODE_RESPONSE = \"NODE_RESPONSE\",\n RESPONSE_DATA = \"RESPONSE_DATA\",\n ENDPOINT_INFO = \"ENDPOINT_INFO\",\n RES = \"RES\",\n REQ = \"REQ\"\n}\n\nexport const PARAM_TYPES_DATA_PATH: Record<string, string> = {\n [ParamTypes.HEADER]: \"$ctx.request.headers\",\n [ParamTypes.RAW_BODY]: \"$ctx.request.rawBody\",\n [ParamTypes.BODY]: \"$ctx.request.body\",\n [ParamTypes.QUERY]: \"$ctx.request.query\",\n [ParamTypes.PATH]: \"$ctx.request.params\",\n [ParamTypes.COOKIES]: \"$ctx.request.cookies\",\n [ParamTypes.SESSION]: \"$ctx.request.session\",\n [ParamTypes.LOCALS]: \"$ctx.response.locals\"\n};\n"]}
1
+ {"version":3,"file":"ParamTypes.js","sourceRoot":"","sources":["../../../src/domain/ParamTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IAEf,WAAW;IACX,iCAAmB,CAAA;IACnB,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,mDAAqC,CAAA;IACrC,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,qDAAuC,CAAA;IACvC,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,6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AO,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;YAE7H,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAChD,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YACnD,KAAK,CAAC,WAAW,GAAG,IAAA,aAAM,EAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC/C,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC;YAEvC,OAAO,KAAK,CAAC;SACd;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAvBD,oDAuBC","sourcesContent":["import {nameOf} from \"@tsed/core\";\nimport {BadRequest} from \"@tsed/exceptions\";\nimport {JsonParameterStore} from \"@tsed/schema\";\nimport {ValidationError} from \"./ValidationError\";\n\nexport class ParamValidationError extends BadRequest {\n public name: string = \"PARAM_VALIDATION_ERROR\";\n public dataPath: string;\n public requestType: string;\n\n static from(metadata: JsonParameterStore, origin: any = {}) {\n if (origin instanceof ValidationError || origin instanceof BadRequest) {\n const name = nameOf(metadata.paramType)\n .toLowerCase()\n .replace(/parse|params|filter/gi, \"\");\n const expression = metadata.expression;\n const message = `Bad request on parameter \"request.${name}${expression ? \".\" + expression : \"\"}\".\\n${origin.message}`.trim();\n\n const error = new ParamValidationError(message);\n error.dataPath = String(metadata.expression) || \"\";\n error.requestType = nameOf(metadata.paramType);\n error.origin = origin.origin || origin;\n\n return error;\n }\n\n return origin;\n }\n}\n"]}
1
+ {"version":3,"file":"ParamValidationError.js","sourceRoot":"","sources":["../../../src/errors/ParamValidationError.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,iDAA4C;AAE5C,uDAAkD;AAElD,MAAa,oBAAqB,SAAQ,uBAAU;IAC3C,IAAI,GAAW,wBAAwB,CAAC;IACxC,QAAQ,CAAS;IACjB,WAAW,CAAS;IAE3B,MAAM,CAAC,I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W,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,sCAAsC,UAAU,GAAG,CAAC;QAEpE,MAAM,MAAM,GAAG;YACb;gBACE,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,UAAU;gBACnB,OAAO;gBACP,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE;oBACN,eAAe,EAAE,UAAU;iBAC5B;gBACD,UAAU,EAAE,YAAY;aACzB;SACF,CAAC;QAEF,OAAO,IAAI,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;CACF;AAxBD,0DAwBC","sourcesContent":["import {nameOf} from \"@tsed/core\";\nimport {ValidationError} from \"./ValidationError\";\nimport {JsonParameterStore} from \"@tsed/schema\";\n\nexport class RequiredValidationError extends ValidationError {\n public name: string = \"REQUIRED_VALIDATION_ERROR\";\n\n static from(metadata: JsonParameterStore) {\n const name = nameOf(metadata.paramType);\n const expression = metadata.expression;\n const type = name.toLowerCase().replace(/parse|params|filter/gi, \"\");\n const message = `It should have required parameter '${expression}'`;\n\n const errors = [\n {\n dataPath: \"\",\n keyword: \"required\",\n message,\n modelName: type,\n params: {\n missingProperty: expression\n },\n schemaPath: \"#/required\"\n }\n ];\n\n return new RequiredValidationError(message, errors);\n }\n}\n"]}
1
+ {"version":3,"file":"RequiredValidationError.js","sourceRoot":"","sources":["../../../src/errors/RequiredValidationError.ts"],"names":[],"mappings":";;;AAAA,qCAAkC;AAClC,uDAAkD;AAGlD,MAAa,uBAAwB,SAAQ,iCAAe;IACnD,IAAI,GAAW,2BAA2B,CAAC;IAElD,MAAM,CAAC,IAAI,CAAC,QAA4B;QACtC,MAAM,IAAI,GAAG,IAAA,aAAM,EAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,sCAAsC,UAAU,GAAG,CAAC;QAEpE,MAAM,MAAM,GAAG;YACb;gBACE,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,UAAU;gBACnB,OAAO;gBACP,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE;oBACN,eAAe,EAAE,UAAU;iBAC5B;gBACD,UAAU,EAAE,YAAY;aACzB;SACF,CAAC;QAEF,OAAO,IAAI,uBAAuB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;CACF;AAxBD,0DAwBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationError.js","sourceRoot":"","sources":["../../../src/errors/ValidationError.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,eAAgB,SAAQ,uBAAU;IACtC,IAAI,GAAW,kBAAkB,CAAC;IAClC,MAAM,CAAQ;IAErB,YAAY,OAAe,EAAE,SAAgB,EAAE;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AARD,0CAQC","sourcesContent":["import {BadRequest} from \"@tsed/exceptions\";\n\nexport class ValidationError extends BadRequest {\n public name: string = \"VALIDATION_ERROR\";\n public errors: any[];\n\n constructor(message: string, errors: any[] = []) {\n super(message);\n this.errors = errors;\n }\n}\n"]}
1
+ {"version":3,"file":"ValidationError.js","sourceRoot":"","sources":["../../../src/errors/ValidationError.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAE5C,MAAa,eAAgB,SAAQ,uBAAU;IACtC,IAAI,GAAW,kBAAkB,CAAC;IAClC,MAAM,CAAQ;IAErB,YAAY,OAAe,EAAE,SAAgB,EAAE;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AARD,0CAQC"}
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"","sourcesContent":["export {PipeMethods} from \"@tsed/schema\";\n"]}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAA0B;AAC1B,mEAAyC;AACzC,kEAAwC;AACxC,+DAAqC;AACrC,+DAAqC;AACrC,oEAA0C;AAC1C,8DAAoC;AACpC,+DAAqC;AACrC,kEAAwC;AACxC,mEAAyC;AACzC,+DAAqC;AACrC,0EAAgD;AAChD,gEAAsC;AACtC,0EAAgD;AAChD,oEAA0C;AAC1C,+DAAqC;AACrC,+DAAqC;AACrC,qEAA2C;AAC3C,iEAAuC;AACvC,gEAAsC;AACtC,8DAAoC;AACpC,wEAA8C;AAC9C,2EAAiD;AACjD,mEAAyC;AACzC,mEAAyC;AACzC,sEAA4C;AAC5C,iEAAuC;AACvC,mEAAyC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./builder/PlatformParams\";\nexport * from \"./decorators/bodyParams\";\nexport * from \"./decorators/context\";\nexport * from \"./decorators/cookies\";\nexport * from \"./decorators/headerParams\";\nexport * from \"./decorators/locals\";\nexport * from \"./decorators/paramFn\";\nexport * from \"./decorators/pathParams\";\nexport * from \"./decorators/queryParams\";\nexport * from \"./decorators/session\";\nexport * from \"./decorators/useDeserialization\";\nexport * from \"./decorators/useParam\";\nexport * from \"./decorators/useParamExpression\";\nexport * from \"./decorators/useParamType\";\nexport * from \"./decorators/usePipe\";\nexport * from \"./decorators/useType\";\nexport * from \"./decorators/useValidation\";\nexport * from \"./domain/ParamMetadata\";\nexport * from \"./domain/ParamOptions\";\nexport * from \"./domain/ParamTypes\";\nexport * from \"./errors/ParamValidationError\";\nexport * from \"./errors/RequiredValidationError\";\nexport * from \"./errors/ValidationError\";\nexport * from \"./pipes/DeserializerPipe\";\nexport * from \"./pipes/ParseExpressionPipe\";\nexport * from \"./pipes/ValidationPipe\";\nexport * from \"./utils/mapParamsOptions\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAA0B;AAC1B,mEAAyC;AACzC,kEAAwC;AACxC,+DAAqC;AACrC,+DAAqC;AACrC,oEAA0C;AAC1C,8DAAoC;AACpC,+DAAqC;AACrC,kEAAwC;AACxC,mEAAyC;AACzC,+DAAqC;AACrC,0EAAgD;AAChD,gEAAsC;AACtC,0EAAgD;AAChD,oEAA0C;AAC1C,+DAAqC;AACrC,+DAAqC;AACrC,qEAA2C;AAC3C,iEAAuC;AACvC,gEAAsC;AACtC,8DAAoC;AACpC,wEAA8C;AAC9C,2EAAiD;AACjD,mEAAyC;AACzC,mEAAyC;AACzC,sEAA4C;AAC5C,iEAAuC;AACvC,mEAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeserializerPipe.js","sourceRoot":"","sources":["../../../src/pipes/DeserializerPipe.ts"],"names":[],"mappings":";;;;;AAAA,iCAA8C;AAC9C,mDAA8C;AAI9C,IAAa,gBAAgB,wBAA7B,MAAa,gBAAgB;IAC3B,SAAS,CAAC,KAAU,EAAE,KAAyB;QAC7C,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE;YACxB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,KAAK;YACZ,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAgB,CAAC,IAAI,EAAE,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AARY,gBAAgB;IAD5B,IAAA,eAAU,GAAE;GACA,gBAAgB,CAQ5B;AARY,4CAAgB","sourcesContent":["import {Constant, Injectable} from \"@tsed/di\";\nimport {deserialize} from \"@tsed/json-mapper\";\nimport {JsonParameterStore, PipeMethods} from \"@tsed/schema\";\n\n@Injectable()\nexport class DeserializerPipe implements PipeMethods {\n transform(value: any, param: JsonParameterStore) {\n return deserialize(value, {\n useAlias: true,\n store: param,\n ...(param.store.get(DeserializerPipe) || {})\n });\n }\n}\n"]}
1
+ {"version":3,"file":"DeserializerPipe.js","sourceRoot":"","sources":["../../../src/pipes/DeserializerPipe.ts"],"names":[],"mappings":";;;;;AAAA,iCAA8C;AAC9C,mDAA8C;AAIvC,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,SAAS,CAAC,KAAU,EAAE,KAAyB;QAC7C,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE;YACxB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,KAAK;YACZ,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAgB,CAAC,IAAI,EAAE,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AARY,gBAAgB;IAD5B,IAAA,eAAU,GAAE;GACA,gBAAgB,CAQ5B;AARY,4CAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParseExpressionPipe.js","sourceRoot":"","sources":["../../../src/pipes/ParseExpressionPipe.ts"],"names":[],"mappings":";;;;AAAA,qCAAoC;AACpC,iCAAoC;AAGpC,qDAAgD;AAKhD,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC9B,SAAS,CAAC,KAA0B,EAAE,KAAyB;QAC7D,MAAM,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;QAEhC,MAAM,KAAK,GAAG,IAAA,eAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,uBAAU,CAAC,KAAK,EAAE,uBAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAuB,CAAC,IAAI,KAAK,KAAK,EAAE,IAAI,IAAI,KAAK,MAAM,EAAE;YAC5G,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAES,MAAM,CAAC,KAAyB;QACxC,IAAI,EAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;QAC9C,SAAS,GAAG,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAEjE,IAAI,UAAU,IAAI,SAAS,KAAK,uBAAU,CAAC,MAAM,EAAE;YACjD,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C;QAED,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;CACF,CAAA;AAvBY,mBAAmB;IAH/B,IAAA,eAAU,EAAC;QACV,QAAQ,EAAE,CAAC,IAAI;KAChB,CAAC;GACW,mBAAmB,CAuB/B;AAvBY,kDAAmB","sourcesContent":["import {getValue} from \"@tsed/core\";\nimport {Injectable} from \"@tsed/di\";\nimport {JsonParameterStore, PipeMethods} from \"@tsed/schema\";\nimport {PlatformParamsScope} from \"../builder/PlatformParams\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\n\n@Injectable({\n priority: -1000\n})\nexport class ParseExpressionPipe implements PipeMethods {\n transform(scope: PlatformParamsScope, param: JsonParameterStore) {\n const {paramType, type} = param;\n\n const value = getValue(scope, this.getKey(param));\n\n if ([ParamTypes.QUERY, ParamTypes.PATH].includes(paramType as ParamTypes) && value === \"\" && type !== String) {\n return undefined;\n }\n\n return value;\n }\n\n protected getKey(param: JsonParameterStore) {\n let {expression, paramType, dataPath} = param;\n paramType = paramType || param.parameter.get(\"in\").toUpperCase();\n\n if (expression && paramType === ParamTypes.HEADER) {\n expression = String(expression).toLowerCase();\n }\n\n return [dataPath, expression].filter(Boolean).join(\".\");\n }\n}\n"]}
1
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QAED,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE;YAC9B,OAAO,KAAK,CAAC;SACd;QAED,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE1C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEtC,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;QAED,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,QAAQ,EAAE;YACrC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE;YACnC,MAAM;YACN,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAClD,cAAc,EAAE,QAAQ,CAAC,cAAc;SACxC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IAES,eAAe,CAAC,KAAU,EAAE,QAA4B;QAChE,IAAI,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YAC9B,MAAM,iDAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC9C;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AArEY,cAAc;IAH1B,IAAA,eAAU,EAAC;QACV,IAAI,EAAE,WAAW;KAClB,CAAC;IAIa,mBAAA,IAAA,WAAM,EAAC,mBAAmB,CAAC,CAAA;;GAH7B,cAAc,CAqE1B;AArEY,wCAAc","sourcesContent":["import {Inject, Injectable} from \"@tsed/di\";\nimport {deserialize} from \"@tsed/json-mapper\";\nimport {getJsonSchema, JsonParameterStore, PipeMethods} from \"@tsed/schema\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {RequiredValidationError} from \"../errors/RequiredValidationError\";\n\nfunction cast(value: any, metadata: JsonParameterStore) {\n try {\n return deserialize(value, {\n type: metadata.type\n });\n } catch (er) {\n return value;\n }\n}\n\nexport type ValidatorServiceMethods = {validate(value: any, options: any): Promise<any>};\n\n@Injectable({\n type: \"validator\"\n})\nexport class ValidationPipe implements PipeMethods {\n private validator: ValidatorServiceMethods;\n\n constructor(@Inject(\"validator:service\") validators: ValidatorServiceMethods[]) {\n this.validator = validators[0];\n }\n\n coerceTypes(value: any, metadata: JsonParameterStore) {\n if (value === undefined) {\n return value;\n }\n\n if (value === \"null\") {\n return null;\n }\n\n if (metadata.isArray) {\n return [].concat(value);\n }\n\n if (metadata.isPrimitive) {\n return cast(value, metadata);\n }\n\n return value;\n }\n\n skip(value: any, metadata: JsonParameterStore) {\n return metadata.paramType === ParamTypes.PATH && !metadata.isPrimitive;\n }\n\n async transform(value: any, metadata: JsonParameterStore): Promise<any> {\n if (!this.validator) {\n this.checkIsRequired(value, metadata);\n return value;\n }\n\n if (this.skip(value, metadata)) {\n return value;\n }\n\n value = this.coerceTypes(value, metadata);\n\n this.checkIsRequired(value, metadata);\n\n if (value === undefined) {\n return value;\n }\n\n const schema = getJsonSchema(metadata, {\n customKeys: true\n });\n\n await this.validator.validate(value, {\n schema,\n type: metadata.isClass ? metadata.type : undefined,\n collectionType: metadata.collectionType\n });\n\n return value;\n }\n\n protected checkIsRequired(value: any, metadata: JsonParameterStore) {\n if (metadata.isRequired(value)) {\n throw RequiredValidationError.from(metadata);\n }\n\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"ValidationPipe.js","sourceRoot":"","sources":["../../../src/pipes/ValidationPipe.ts"],"names":[],"mappings":";;;;AAAA,iCAA4C;AAC5C,mDAA8C;AAC9C,yCAA4E;AAC5E,qDAAgD;AAChD,+EAA0E;AAE1E,SAAS,IAAI,CAAC,KAAU,EAAE,QAA4B;IACpD,IAAI;QACF,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE;YACxB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC,CAAC;K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,IAAI,CAAC,CAAC,CAAiB,CAAC;QAErC,OAAO;YACL,GAAG,IAAI;YACP,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,YAAY;SAC/C,CAAC;KACH;IAED,OAAO;QACL,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QACnB,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;KACjB,CAAC;AACJ,CAAC;AA1BD,4CA0BC","sourcesContent":["import {isObject} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\n\n/**\n * @ignore\n */\nexport function mapParamsOptions(args: any[]): Partial<ParamOptions<any>> {\n if (args.length === 1) {\n if (typeof args[0] === \"string\") {\n return {\n expression: args[0]\n };\n }\n\n if (!isObject(args[0])) {\n return {\n useType: args[0]\n };\n }\n\n const opts = args[0] as ParamOptions;\n\n return {\n ...opts,\n useMapper: opts.useMapper || opts.useConverter\n };\n }\n\n return {\n expression: args[0],\n useType: args[1]\n };\n}\n"]}
1
+ {"version":3,"file":"mapParamsOptions.js","sourceRoot":"","sources":["../../../src/utils/mapParamsOptions.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAGpC;;GAEG;AACH,SAAgB,gBAAgB,CAAC,IAAW;IAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YAC/B,OAAO;gBACL,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;aACpB,CAAC;SACH;QAED,IAAI,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YACtB,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;aACjB,CAAC;SACH;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAiB,CAAC;QAErC,OAAO;YACL,GAAG,IAAI;YACP,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,YAAY;S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MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACrC,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;aAC5B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;YACrF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAwC,KAA0B,EAAE,KAAoB,EAAE,KAAyB;QAC7H,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAyB,EAAE,IAAI,EAAE,EAAE;YAC5D,KAAK,GAAG,MAAM,KAAK,CAAC;YAEpB,IAAI;gBACF,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC3C;YAAC,OAAO,EAAE,EAAE;gBACX,MAAM,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;aAC5C;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;IACZ,CAAC;CACF,CAAA;AApEC;IADC,MAAM,EAAE;8BACW,eAAe;gDAAC;AAFzB,cAAc;IAJ1B,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAC,mBAAmB,CAAC;KAC/B,CAAC;GACW,cAAc,CAsE1B;SAtEY,cAAc","sourcesContent":["import {DIContext, Inject, Injectable, InjectorService, ProviderScope, TokenProvider} from \"@tsed/di\";\nimport {JsonMethodStore, JsonParameterStore, PipeMethods} from \"@tsed/schema\";\nimport {ParamValidationError} from \"../errors/ParamValidationError\";\nimport {ParseExpressionPipe} from \"../pipes/ParseExpressionPipe\";\n\nexport type PlatformParamsScope<Context extends DIContext = DIContext> = {$ctx: Context} & Record<string, any>;\nexport type PlatformParamsCallback<Context extends DIContext = DIContext> = (scope: PlatformParamsScope) => Promise<any>;\n\n/**\n * Platform Params abstraction layer.\n * @platform\n */\n@Injectable({\n scope: ProviderScope.SINGLETON,\n imports: [ParseExpressionPipe]\n})\nexport class PlatformParams {\n @Inject()\n protected injector: InjectorService;\n\n getPipes(param: JsonParameterStore) {\n const get = (pipe: TokenProvider) => {\n return this.injector.getProvider(pipe)!.priority || 0;\n };\n\n const sort = (p1: TokenProvider, p2: TokenProvider) => (get(p1) < get(p2) ? -1 : get(p1) > get(p2) ? 1 : 0);\n const map = (token: TokenProvider) => this.injector.get<PipeMethods>(token)!;\n\n return [ParseExpressionPipe, ...param.pipes.sort(sort)].map(map).filter(Boolean);\n }\n\n /**\n * Return a handler with injectable parameters\n * @param handlerMetadata\n */\n compileHandler<Context extends DIContext = DIContext>({\n propertyKey,\n token,\n handler\n }: {\n propertyKey?: string | symbol;\n token?: any;\n handler?: any;\n }): PlatformParamsCallback<Context> {\n if (!token || !propertyKey) {\n return (scope: PlatformParamsScope) => handler(scope.$ctx);\n }\n\n const store = JsonMethodStore.fromMethod(token, propertyKey);\n const getArguments = this.compile<Context>(store);\n const provider = this.injector.getProvider(token)!;\n\n return async (scope: PlatformParamsScope) => {\n const container = provider.scope === ProviderScope.REQUEST ? scope.$ctx.container : undefined;\n const [instance, args] = await Promise.all([this.injector.invoke<any>(token, container), getArguments(scope)]);\n\n return instance[propertyKey].call(instance, ...args, scope.$ctx);\n };\n }\n\n compile<Context extends DIContext = DIContext>(entity: JsonMethodStore): PlatformParamsCallback<Context> {\n const params = JsonParameterStore.getParams(entity.target, entity.propertyKey);\n const argsPipes = params.map((param) => {\n return {\n param,\n pipes: this.getPipes(param)\n };\n });\n\n return (scope) => {\n const promises = argsPipes.map(({param, pipes}) => this.getArg(scope, pipes, param));\n return Promise.all(promises);\n };\n }\n\n async getArg<Context extends DIContext = DIContext>(scope: PlatformParamsScope, pipes: PipeMethods[], param: JsonParameterStore) {\n return pipes.reduce(async (value: any | Promise<any>, pipe) => {\n value = await value;\n\n try {\n return await pipe.transform(value, param);\n } catch (er) {\n throw ParamValidationError.from(param, er);\n }\n }, scope);\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformParams.js","sourceRoot":"","sources":["../../../src/builder/PlatformParams.ts"],"names":[],"mappings":";AAAA,OAAO,EAAY,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAgB,MAAM,UAAU,CAAC;AACtG,OAAO,EAAC,eAAe,EAAE,kBAAkB,EAAc,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AAKjE;;;GAGG;AAKI,IAAM,cAAc,GAApB,MAAM,cAAc;IAEf,QAAQ,CAAkB;IAEpC,QAAQ,CAAC,KAAyB;QAChC,MAAM,GAAG,GAAG,CAAC,IAAmB,EAAE,EAAE;YAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAE,CAAC,QAAQ,IAAI,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,MAAM,IAAI,GAAG,CAAC,EAAiB,EAAE,EAAiB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5G,MAAM,GAAG,GAAG,CAAC,KAAoB,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAc,KAAK,CAAE,CA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odyParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AA4C3D,MAAM,UAAU,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,QAAQ;QAC9B,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseParam} from \"./useParam\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\n\n/**\n * BodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@BodyParams() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Post('/')\n * create(@BodyParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@BodyParams('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Post('/')\n * create(@BodyParams('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function BodyParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function BodyParams(expression: string): ParameterDecorator;\nexport function BodyParams(useType: Type<any>): ParameterDecorator;\nexport function BodyParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function BodyParams(): ParameterDecorator;\nexport function BodyParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.BODY,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawBodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) as a Buffer.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@RawBodyParams() body: Buffer) {\n * console.log('Entire body', body.toString(\"utf8\"));\n * }\n * }\n * ```\n *\n * @decorator\n * @operation\n * @input\n * @alias BodyParams Example: @BodyParams() payload: Buffer\n */\nexport function RawBodyParams(): ParameterDecorator {\n return UseParam({\n paramType: ParamTypes.RAW_BODY,\n useMapper: false,\n useValidation: false\n });\n}\n"]}
1
+ {"version":3,"file":"bodyParams.js","sourceRoot":"","sources":["../../../src/decorators/bodyParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AA4C3D,MAAM,UAAU,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,QAAQ;QAC9B,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/decorators/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAqDpC,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {BaseContext} from \"@tsed/di\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Context decorator return the @@PlatformContext@@ created by Ts.ED when request is handled by the server.\n *\n * It contains some information as following:\n *\n * - The request id,\n * - The request container used by the Ts.ED DI. It contain all services annotated with `@Scope(ProviderScope.REQUEST)`,\n * - The current @@EndpointMetadata@@ resolved by Ts.ED during the request,\n * - The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.\n *\n * ::: tip\n * The @@PlatformContext@@ inherit from Map class. So you can store any information with.\n * :::\n *\n * #### Example\n *\n * ```typescript\n * @Middleware()\n * class AuthTokenMiddleware {\n * use(@Req() request: Req, @Context() context: PlatformContext) {\n * if (!context.has(\"auth\")){\n * context.set('auth', new AuthToken(request))\n * }\n *\n * try {\n * context.get(\"auth\").claims() // check token\n * } catch(er){\n * throw new Forbidden(\"Access forbidden - Bad token\")\n * }\n * }\n * }\n *\n * @Controller('/')\n * @UseBefore(AuthTokenMiddleware) // protect all routes for this controller\n * class MyCtrl {\n * @Get('/')\n * get(@Context('auth') auth: AuthToken) {\n * console.log('auth', auth);\n * console.log('auth.accessToken', auth.accessToken);\n * console.log('auth.idToken', auth.idToken);\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function Context(expression: string): ParameterDecorator;\nexport function Context(): ParameterDecorator;\nexport function Context(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.$CTX,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\nexport type Context = BaseContext;\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/decorators/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAqDpC,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../src/decorators/cookies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAsCpC,MAAM,UAAU,aAAa,CAAC,GAAG,IAAW;IAC1C,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AA6CD,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Cookies or CookiesParams return the value from [request.cookies](http://expressjs.com/en/4x/api.html#req.cookies) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Cookies() cookies: any) {\n * console.log('Entire cookies', cookies);\n * }\n *\n * @Post('/')\n * create(@Cookies('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@Cookies('user') user: IUser) {\n * console.log('user', user);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function CookiesParams(expression: string | any, useType: any): ParameterDecorator;\nexport function CookiesParams(): ParameterDecorator;\nexport function CookiesParams(expression: string | any): ParameterDecorator;\nexport function CookiesParams(options: ParamOptions<any>): ParameterDecorator;\nexport function CookiesParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.COOKIES,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * Cookies or CookiesParams return the value from [request.cookies](http://expressjs.com/en/4x/api.html#req.cookies) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Cookies() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Post('/')\n * create(@Cookies('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/')\n * create(@Cookies('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Post('/')\n * create(@Cookies('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @aliasof CookiesParams\n * @operation\n * @input\n */\nexport function Cookies(expression: string, useType: Type<any>): ParameterDecorator;\nexport function Cookies(expression: string): ParameterDecorator;\nexport function Cookies(useType: Type<any>): ParameterDecorator;\nexport function Cookies(options: Partial<ParamOptions>): ParameterDecorator;\nexport function Cookies(): ParameterDecorator;\nexport function Cookies(...args: any[]): ParameterDecorator {\n // @ts-ignore\n return CookiesParams(...args);\n}\n"]}
1
+ {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../src/decorators/cookies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAsCpC,MAAM,UAAU,aAAa,CAAC,GAAG,IAAW;IAC1C,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AA6CD,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC;AAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"headerParams.js","sourceRoot":"","sources":["../../../src/decorators/headerParams.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAkC3D,MAAM,UAAU,YAAY,CAAC,GAAG,IAAW;IACzC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseParam} from \"./useParam\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\n\n/**\n * HeaderParams return the value from [`request.get()`](http://expressjs.com/en/4x/api.html#req.get) method.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@HeaderParams() body: any) {\n * console.log('Entire body', body);\n * }\n *\n * @Get('/')\n * get(@HeaderParams('x-token') token: string) {\n * console.log('token', id);\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @param useType\n * @decorator\n * @operation\n * @input\n */\nexport function HeaderParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function HeaderParams(expression: string): ParameterDecorator;\nexport function HeaderParams(useType: Type<any>): ParameterDecorator;\nexport function HeaderParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function HeaderParams(): ParameterDecorator;\nexport function HeaderParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.HEADER,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"headerParams.js","sourceRoot":"","sources":["../../../src/decorators/headerParams.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAkC3D,MAAM,UAAU,YAAY,CAAC,GAAG,IAAW;IACzC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"locals.js","sourceRoot":"","sources":["../../../src/decorators/locals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4CpC,MAAM,UAAU,MAAM,CAAC,GAAG,IAAW;IACnC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Locals return the value from [response.locals](http://expressjs.com/en/4x/api.html#res.locals) object.\n *\n * ::: tip\n * Locals are generally used by express and third-party like templating engine to render a page/template.\n * See [Templating](http://tsed.io/tutorials/templating.html) section for more details.\n * :::\n *\n * #### Example\n *\n * ```typescript\n * * @Middleware()\n * class LocalsMiddleware {\n * use(@Locals() locals: any) {\n * // set some on locals\n * locals.user = \"user\"\n * }\n * }\n *\n * @Controller('/')\n * @UseBefore(LocalsMiddleware)\n * class MyCtrl {\n * @Get('/')\n * @View('home.ejs') // will use locals and returned data to render the page\n * get(@Locals('user') user: any) {\n * console.log('user', user);\n *\n * return {\n * description: 'Hello world'\n * }\n * }\n * }\n * ```\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n * @response\n */\nexport function Locals(expression: string): ParameterDecorator;\nexport function Locals(): ParameterDecorator;\nexport function Locals(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.LOCALS,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"locals.js","sourceRoot":"","sources":["../../../src/decorators/locals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4CpC,MAAM,UAAU,MAAM,CAAC,GAAG,IAAW;IACnC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,MAAM;QAC5B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"paramFn.js","sourceRoot":"","sources":["../../../src/decorators/paramFn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAqB,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EAAwE;IAC9F,OAAO,YAAY,CAAqB,EAAE,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport {JsonEntityFn, JsonParameterStore} from \"@tsed/schema\";\n\n/**\n * Get the Param metadata. Use this decorator to compose your own decorator.\n *\n * @param fn\n * @decorator\n * @operation\n * @input\n */\nexport function ParamFn(fn: (param: JsonParameterStore, parameters: DecoratorParameters) => void): ParameterDecorator {\n return JsonEntityFn<JsonParameterStore>(fn);\n}\n"]}
1
+ {"version":3,"file":"paramFn.js","sourceRoot":"","sources":["../../../src/decorators/paramFn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAqB,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EAAwE;IAC9F,OAAO,YAAY,CAAqB,EAAE,CAAC,CAAC;AAC9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pathParams.js","sourceRoot":"","sources":["../../../src/decorators/pathParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAuCpC,MAAM,UAAU,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,qBAAqB;QAC/B,UAAU;KACX,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * PathParams return the value from [request.params](http://expressjs.com/en/4x/api.html#req.params) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@PathParams() params: any) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@PathParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Get('/')\n * get(@PathParams({expression: 'id', useType: () => new MyCustomModel() }) id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function PathParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function PathParams(expression: string): ParameterDecorator;\nexport function PathParams(useType: Type<any>): ParameterDecorator;\nexport function PathParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function PathParams(): ParameterDecorator;\nexport function PathParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.PATH,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawPathParams return the raw value from [request.params](http://expressjs.com/en/4x/api.html#req.params) object.\n *\n * Any validation and transformation are performed on the value. Use [pipes](/docs/pipes.html) to validate and/or transform the value.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@RawPathParams() params: string) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@RawPathParams('id') id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function RawPathParams(expression: string) {\n return UseParam({\n paramType: ParamTypes.PATH,\n dataPath: \"$ctx.request.params\",\n expression\n });\n}\n"]}
1
+ {"version":3,"file":"pathParams.js","sourceRoot":"","sources":["../../../src/decorators/pathParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAuCpC,MAAM,UAAU,UAAU,CAAC,GAAG,IAAW;IACvC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,IAAI;QAC1B,QAAQ,EAAE,qBAAqB;QAC/B,UAAU;KACX,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../../src/decorators/queryParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4CpC,MAAM,UAAU,WAAW,CAAC,GAAG,IAAW;IACxC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,KAAK;QAC3B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,OAAO,WAAW,CAAC;QACjB,UAAU;QACV,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * QueryParams return the value from [request.query](http://expressjs.com/en/4x/api.html#req.query) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@QueryParams() query: any) {\n * console.log('Entire query', query);\n * }\n *\n * @Get('/')\n * get(@QueryParams('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Get('/')\n * get(@QueryParams('user') user: User) { // with deserialization\n * console.log('user', user);\n * }\n *\n * @Get('/')\n * get(@QueryParams('users', User) users: User[]) { // with deserialization\n * console.log('users', users);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @param useType The type of the class that to be used to deserialize the data.\n * @decorator\n * @operation\n * @input\n */\nexport function QueryParams(expression: string, useType: Type<any>): ParameterDecorator;\nexport function QueryParams(expression: string): ParameterDecorator;\nexport function QueryParams(useType: Type<any>): ParameterDecorator;\nexport function QueryParams(options: Partial<ParamOptions>): ParameterDecorator;\nexport function QueryParams(): ParameterDecorator;\nexport function QueryParams(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = true, useValidation = true} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.QUERY,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n\n/**\n * RawQueryParams return the value from [request.query](http://expressjs.com/en/4x/api.html#req.query) object.\n *\n * Any validation and transformation are performed on the value. Use [pipes](/docs/pipes.html) to validate and/or transform the value.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Get('/')\n * get(@RawPathParams() params: any) {\n * console.log('Entire params', params);\n * }\n *\n * @Get('/')\n * get(@RawPathParams('id') id: string) {\n * console.log('ID', id);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function RawQueryParams(expression: string) {\n return QueryParams({\n expression,\n useConverters: false,\n useValidation: false\n });\n}\n"]}
1
+ {"version":3,"file":"queryParams.js","sourceRoot":"","sources":["../../../src/decorators/queryParams.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AA4CpC,MAAM,UAAU,WAAW,CAAC,GAAG,IAAW;IACxC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,KAAK;QAC3B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,OAAO,WAAW,CAAC;QACjB,UAAU;QACV,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/decorators/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAqCpC,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {mapParamsOptions} from \"../utils/mapParamsOptions\";\nimport {UseParam} from \"./useParam\";\n\n/**\n * Session return the value from [request.session](http://expressjs.com/en/4x/api.html#req.session) object.\n *\n * #### Example\n *\n * ```typescript\n * @Controller('/')\n * class MyCtrl {\n * @Post('/')\n * create(@Session() session: Express.Session) {\n * console.log('Entire session', session);\n * }\n *\n * @Post('/')\n * create(@Session('id') id: string) {\n * console.log('ID', id);\n * }\n *\n * @Post('/') // Example to deserialize use from session\n * create(@Session({expression: 'user', useConverter: true}) user: User) {\n * console.log('user', user);\n * console.log('instanceOf user', user instanceof User);\n * }\n * }\n * ```\n * > For more information on deserialization see [converters](/docs/json-mapper.md) page.\n *\n * @param expression The path of the property to get.\n * @decorator\n * @operation\n * @input\n */\nexport function Session(expression: string): ParameterDecorator;\nexport function Session(options: Partial<ParamOptions>): ParameterDecorator;\nexport function Session(): ParameterDecorator;\nexport function Session(...args: any[]): ParameterDecorator {\n const {expression, useType, useMapper = false, useValidation = false} = mapParamsOptions(args);\n\n return UseParam({\n paramType: ParamTypes.SESSION,\n expression,\n useType,\n useMapper,\n useValidation\n });\n}\n"]}
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/decorators/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAqCpC,MAAM,UAAU,OAAO,CAAC,GAAG,IAAW;IACpC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,OAAO;QAC7B,UAAU;QACV,OAAO;QACP,SAAS;QACT,aAAa;KACd,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDeserialization.js","sourceRoot":"","sources":["../../../src/decorators/useDeserialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAe,EAAE;IAClD,OAAO,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import {DeserializerPipe} from \"../pipes/DeserializerPipe\";\nimport {UsePipe} from \"./usePipe\";\n\n/**\n * Use JsonMapper to deserialize the data.\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseDeserialization(options: any = {}) {\n return UsePipe(DeserializerPipe, options);\n}\n"]}
1
+ {"version":3,"file":"useDeserialization.js","sourceRoot":"","sources":["../../../src/decorators/useDeserialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAe,EAAE;IAClD,OAAO,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParam.js","sourceRoot":"","sources":["../../../src/decorators/useParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAA8B;IAC9C,MAAM,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;IAErF,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,aAAa,IAAI,aAAa,EAAE,EAAE,SAAS,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AACxI,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,QAAQ,CAAC,OAA8B;IACrD,OAAO,aAAa,CAAC,YAAY,CAAC,OAAc,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAuB,CAAC;AACjG,CAAC","sourcesContent":["import {useDecorators} from \"@tsed/core\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {ParamTypes} from \"../domain/ParamTypes\";\nimport {UseDeserialization} from \"./useDeserialization\";\nimport {UseParamType} from \"./useParamType\";\nimport {UseType} from \"./useType\";\nimport {UseValidation} from \"./useValidation\";\n\n/**\n * @ignore\n * @param options\n */\nfunction mapPipes(options: Partial<ParamOptions>) {\n const {paramType, useType, expression, useValidation, useMapper, ...props} = options;\n\n return [paramType !== ParamTypes.FILES && UseType(useType), useValidation && UseValidation(), useMapper && UseDeserialization(props)];\n}\n\n/**\n * Register a new param. It use the paramType to extract value and give it to the next pipe.\n *\n * Given options allow to enable or disable following pipes:\n *\n * - useType: Add extra type for the json mapper,\n * - expression: Get property from the returned value by the previous pipe.\n * - useValidation: Apply validation from the returned value by the previous pipe.\n * - useConverter: Apply json mapper from the returned value by the previous pipe.\n *\n * @param options\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParam(options: Partial<ParamOptions>): ParameterDecorator {\n return useDecorators(UseParamType(options as any), ...mapPipes(options)) as ParameterDecorator;\n}\n"]}
1
+ {"version":3,"file":"useParam.js","sourceRoot":"","sources":["../../../src/decorators/useParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAA8B;IAC9C,MAAM,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;IAErF,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,aAAa,IAAI,aAAa,EAAE,EAAE,SAAS,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AACxI,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,QAAQ,CAAC,OAA8B;IACrD,OAAO,aAAa,CAAC,YAAY,CAAC,OAAc,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAuB,CAAC;AACjG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParamExpression.js","sourceRoot":"","sources":["../../../src/decorators/useParamExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAmB;IACpD,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamFn} from \"./paramFn\";\n\n/**\n * Get data from a path inside the given object\n *\n * @param expression\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParamExpression(expression?: string) {\n return ParamFn((param) => {\n param.expression = expression || \"\";\n });\n}\n"]}
1
+ {"version":3,"file":"useParamExpression.js","sourceRoot":"","sources":["../../../src/decorators/useParamExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAmB;IACpD,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useParamType.js","sourceRoot":"","sources":["../../../src/decorators/useParamType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,eAAe,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,OAAO,aAAa,CAClB,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACtC,KAAK,CAAC,SAAU,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEpC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,QAAQ,EAAE;YAClG,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;YACtC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C;QAED,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;IACxF,CAAC,CAAC,EACF,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,EAC5D,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAC/C,CAAC;AACJ,CAAC","sourcesContent":["import {isBuffer, useDecorators} from \"@tsed/core\";\nimport {isParameterType, Name} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\nimport {ParamOptions} from \"../domain/ParamOptions\";\nimport {UseParamExpression} from \"./useParamExpression\";\nimport {PARAM_TYPES_DATA_PATH, ParamTypes} from \"../domain/ParamTypes\";\n\n/**\n * Get the object from request (like body, params, query, etc...).\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseParamType(options: ParamOptions) {\n return useDecorators(\n ParamFn((param) => {\n if (isParameterType(options.paramType)) {\n param.parameter!.in(options.paramType);\n }\n\n param.paramType = options.paramType;\n\n if (isBuffer(param.type) || isBuffer(options.useType) || options.paramType === ParamTypes.RAW_BODY) {\n param.paramType = ParamTypes.RAW_BODY;\n param.parent.operation?.consumes([\"*/*\"]);\n }\n\n param.dataPath = options.dataPath || PARAM_TYPES_DATA_PATH[param.paramType] || \"$ctx\";\n }),\n options.expression && UseParamExpression(options.expression),\n options.expression && Name(options.expression)\n );\n}\n"]}
1
+ {"version":3,"file":"useParamType.js","sourceRoot":"","sources":["../../../src/decorators/useParamType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,eAAe,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAE,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB;IAChD,OAAO,aAAa,CAClB,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,IAAI,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACtC,KAAK,CAAC,SAAU,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAEpC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,QAAQ,EAAE;YAClG,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;YACtC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;SAC3C;QAED,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC;IACxF,CAAC,CAAC,EACF,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,EAC5D,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAC/C,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePipe.js","sourceRoot":"","sources":["../../../src/decorators/usePipe.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,KAAwB,EAAE,UAAe,EAAE;IACjE,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {PipeMethods} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Register a Pipe to be used with the current decorated param.\n *\n * @param token\n * @param options\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UsePipe(token: Type<PipeMethods>, options: any = {}) {\n return ParamFn((param) => {\n param.store.set(token, options);\n param.pipes.push(token);\n });\n}\n"]}
1
+ {"version":3,"file":"usePipe.js","sourceRoot":"","sources":["../../../src/decorators/usePipe.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,KAAwB,EAAE,UAAe,EAAE;IACjE,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useType.js","sourceRoot":"","sources":["../../../src/decorators/useType.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,OAAO,CAAC,OAAoC;IAC1D,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,OAAO,EAAE;YACX,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;SAC9B;QAED,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;YAClH,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Any, CollectionOf} from \"@tsed/schema\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Set the type of the item collection.\n *\n * Prefer @@CollectionOf@@ usage.\n *\n * @param useType\n * @decorator\n * @operation\n * @input\n * @alias CollectionOf\n */\nexport function UseType(useType: undefined | any | Type<any>) {\n return ParamFn((entity, parameters) => {\n if (useType) {\n return CollectionOf(useType);\n }\n\n if (entity.isCollection && entity.type === Object && [undefined, \"object\"].includes(entity.itemSchema.get(\"type\"))) {\n Any()(...parameters);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useType.js","sourceRoot":"","sources":["../../../src/decorators/useType.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,OAAO,CAAC,OAAoC;IAC1D,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,IAAI,OAAO,EAAE;YACX,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;SAC9B;QAED,IAAI,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE;YAClH,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useValidation.js","sourceRoot":"","sources":["../../../src/decorators/useValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,cAAc,EAAE;YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAClC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ValidationPipe} from \"../pipes/ValidationPipe\";\nimport {ParamFn} from \"./paramFn\";\n\n/**\n * Enable validation on the decoratored parameter.\n *\n * @decorator\n * @operation\n * @input\n * @pipe\n */\nexport function UseValidation() {\n return ParamFn((param) => {\n if (param.type || param.collectionType) {\n param.pipes.push(ValidationPipe);\n }\n });\n}\n"]}
1
+ {"version":3,"file":"useValidation.js","sourceRoot":"","sources":["../../../src/decorators/useValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,cAAc,EAAE;YACtC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAClC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamMetadata.js","sourceRoot":"","sources":["../../../src/domain/ParamMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC","sourcesContent":["export {ParamMetadata} from \"@tsed/schema\";\n"]}
1
+ {"version":3,"file":"ParamMetadata.js","sourceRoot":"","sources":["../../../src/domain/ParamMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamOptions.js","sourceRoot":"","sources":["../../../src/domain/ParamOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\n\nexport interface ParamOptions<T = any> {\n dataPath: string;\n paramType: string;\n expression?: string;\n useType?: Type<T>;\n useMapper?: boolean;\n /**\n * @deprecated Since 10-2022. Use ParamOptions.useMapper.\n */\n useConverter?: boolean;\n useValidation?: boolean;\n\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"file":"ParamOptions.js","sourceRoot":"","sources":["../../../src/domain/ParamOptions.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ParamTypes.js","sourceRoot":"","sources":["../../../src/domain/ParamTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IAEf,WAAW;IACX,iCAAmB,CAAA;IACnB,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,mDAAqC,CAAA;IACrC,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,qDAAuC,CAAA;IACvC,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,yBAAW,CAAA;IACX,yBAAW,CAAA;AACb,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AAED,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAC3C,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,sBAAsB;IAC7C,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,mBAAmB;IACtC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,oBAAoB;IACxC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,qBAAqB;IACxC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;CAC5C,CAAC","sourcesContent":["export enum ParamTypes {\n $CTX = \"$CTX\",\n BODY = \"BODY\",\n PATH = \"PATH\",\n QUERY = \"QUERY\",\n HEADER = \"HEADER\",\n RAW_BODY = \"RAW_BODY\",\n COOKIES = \"COOKIES\",\n LOCALS = \"LOCALS\",\n SESSION = \"SESSION\",\n FILES = \"FILES\",\n\n /// NOT STD\n NEXT_FN = \"NEXT_FN\",\n ERR = \"ERR\",\n REQUEST = \"REQUEST\",\n PLATFORM_REQUEST = \"PLATFORM_REQUEST\",\n NODE_REQUEST = \"NODE_REQUEST\",\n RESPONSE = \"RESPONSE\",\n PLATFORM_RESPONSE = \"PLATFORM_RESPONSE\",\n NODE_RESPONSE = \"NODE_RESPONSE\",\n RESPONSE_DATA = \"RESPONSE_DATA\",\n ENDPOINT_INFO = \"ENDPOINT_INFO\",\n RES = \"RES\",\n REQ = \"REQ\"\n}\n\nexport const PARAM_TYPES_DATA_PATH: Record<string, string> = {\n [ParamTypes.HEADER]: \"$ctx.request.headers\",\n [ParamTypes.RAW_BODY]: \"$ctx.request.rawBody\",\n [ParamTypes.BODY]: \"$ctx.request.body\",\n [ParamTypes.QUERY]: \"$ctx.request.query\",\n [ParamTypes.PATH]: \"$ctx.request.params\",\n [ParamTypes.COOKIES]: \"$ctx.request.cookies\",\n [ParamTypes.SESSION]: \"$ctx.request.session\",\n [ParamTypes.LOCALS]: \"$ctx.response.locals\"\n};\n"]}
1
+ {"version":3,"file":"ParamTypes.js","sourceRoot":"","sources":["../../../src/domain/ParamTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IAEf,WAAW;IACX,iCAAmB,CAAA;IACnB,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,mDAAqC,CAAA;IACrC,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,qDAAuC,CAAA;IACvC,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,6CAA+B,CAAA;IAC/B,yBAAW,CAAA;IACX,yBAAW,CAAA;AACb,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AAED,MAAM,CAAC,MAAM,qBAAqB,GAA2B;IAC3D,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;IAC3C,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,sBAAsB;IAC7C,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,mBAAmB;IACtC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,oBAAoB;IACxC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,qBAAqB;IACxC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB;IAC5C,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB;CAC5C,CAAC"}