@tsed/platform-params 8.34.0 → 8.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { injectable, injector, ProviderScope } from "@tsed/di";
1
+ import { ProviderScope, injectable, injector } from "@tsed/di";
2
2
  import { JsonMethodStore, JsonParameterStore } from "@tsed/schema";
3
3
  import { ParamValidationError } from "../errors/ParamValidationError.js";
4
4
  import { ParseExpressionPipe } from "../pipes/ParseExpressionPipe.js";
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function BodyParams(...args) {
5
5
  const { expression, useType, useMapper = true, useValidation = true } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function Context(...args) {
5
5
  const { expression, useType, useMapper = false, useValidation = false } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function CookiesParams(...args) {
5
5
  const { expression, useType, useMapper = false, useValidation = false } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function HeaderParams(...args) {
5
5
  const { expression, useType, useMapper = false, useValidation = false } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function Locals(...args) {
5
5
  const { expression, useType, useMapper = false, useValidation = false } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function PathParams(...args) {
5
5
  const { expression, useType, useMapper = true, useValidation = true } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function QueryParams(...args) {
5
5
  const { expression, useType, useMapper = true, useValidation = true } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,6 +1,6 @@
1
1
  import { ParamTypes } from "../domain/ParamTypes.js";
2
- import { mapParamsOptions } from "../utils/mapParamsOptions.js";
3
2
  import { UseParam } from "./useParam.js";
3
+ import { mapParamsOptions } from "../utils/mapParamsOptions.js";
4
4
  export function Session(...args) {
5
5
  const { expression, useType, useMapper = false, useValidation = false } = mapParamsOptions(args);
6
6
  return UseParam({
@@ -1,9 +1,9 @@
1
- import { useDecorators } from "@tsed/core";
2
1
  import { ParamTypes } from "../domain/ParamTypes.js";
3
2
  import { UseDeserialization } from "./useDeserialization.js";
4
3
  import { UseParamType } from "./useParamType.js";
5
4
  import { UseType } from "./useType.js";
6
5
  import { UseValidation } from "./useValidation.js";
6
+ import { useDecorators } from "@tsed/core";
7
7
  /**
8
8
  * @ignore
9
9
  * @param options
@@ -1,6 +1,6 @@
1
- import { isBuffer, useDecorators } from "@tsed/core";
2
- import { isParameterType, Name } from "@tsed/schema";
1
+ import { Name, isParameterType } from "@tsed/schema";
3
2
  import { PARAM_TYPES_DATA_PATH, ParamTypes } from "../domain/ParamTypes.js";
3
+ import { isBuffer, useDecorators } from "@tsed/core";
4
4
  import { ParamFn } from "./paramFn.js";
5
5
  import { UseParamExpression } from "./useParamExpression.js";
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { ValidationPipe } from "../pipes/ValidationPipe.js";
2
1
  import { ParamFn } from "./paramFn.js";
2
+ import { ValidationPipe } from "../pipes/ValidationPipe.js";
3
3
  /**
4
4
  * Enable validation on the decoratored parameter.
5
5
  *
@@ -1,6 +1,6 @@
1
- import { nameOf } from "@tsed/core";
2
1
  import { BadRequest } from "@tsed/exceptions";
3
2
  import { ValidationError } from "./ValidationError.js";
3
+ import { nameOf } from "@tsed/core";
4
4
  export class ParamValidationError extends BadRequest {
5
5
  constructor() {
6
6
  super(...arguments);
@@ -1,5 +1,5 @@
1
- import { nameOf } from "@tsed/core";
2
1
  import { ValidationError } from "./ValidationError.js";
2
+ import { nameOf } from "@tsed/core";
3
3
  export class RequiredValidationError extends ValidationError {
4
4
  constructor() {
5
5
  super(...arguments);
@@ -1,5 +1,5 @@
1
- import { injectable } from "@tsed/di";
2
1
  import { deserialize } from "@tsed/json-mapper";
2
+ import { injectable } from "@tsed/di";
3
3
  export class DeserializerPipe {
4
4
  transform(value, param) {
5
5
  return deserialize(value, {
@@ -1,6 +1,6 @@
1
- import { getValue } from "@tsed/core";
2
1
  import { injectable } from "@tsed/di";
3
2
  import { ParamTypes } from "../domain/ParamTypes.js";
3
+ import { getValue } from "@tsed/core";
4
4
  export class ParseExpressionPipe {
5
5
  transform(scope, param) {
6
6
  const { paramType, type } = param;
@@ -1,8 +1,8 @@
1
- import { constant, injectable, injectMany } from "@tsed/di";
2
- import { deserialize } from "@tsed/json-mapper";
3
1
  import { compile } from "@tsed/schema";
2
+ import { constant, injectMany, injectable } from "@tsed/di";
4
3
  import { ParamTypes } from "../domain/ParamTypes.js";
5
4
  import { RequiredValidationError } from "../errors/RequiredValidationError.js";
5
+ import { deserialize } from "@tsed/json-mapper";
6
6
  function cast(value, metadata) {
7
7
  try {
8
8
  return deserialize(value, {
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ParamOptions } from "../domain/ParamOptions.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * BodyParams return the value from [request.body](http://expressjs.com/en/4x/api.html#req.body) object.
5
5
  *
@@ -6,7 +6,7 @@ import { BaseContext } from "@tsed/di";
6
6
  *
7
7
  * - The request id,
8
8
  * - The request container used by the Ts.ED DI. It contain all services annotated with `@Scope(ProviderScope.REQUEST)`,
9
- * - The current @@EndpointMetadata@@ resolved by Ts.ED during the request,
9
+ * - The current @@JsonMethodStore@@ resolved by Ts.ED during the request,
10
10
  * - The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.
11
11
  *
12
12
  * ::: tip
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ParamOptions } from "../domain/ParamOptions.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Cookies or CookiesParams return the value from [request.cookies](http://expressjs.com/en/4x/api.html#req.cookies) object.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ParamOptions } from "../domain/ParamOptions.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * HeaderParams return the value from [`request.get()`](http://expressjs.com/en/4x/api.html#req.get) method.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { DecoratorParameters } from "@tsed/core";
2
1
  import { JsonParameterStore } from "@tsed/schema";
2
+ import { DecoratorParameters } from "@tsed/core";
3
3
  /**
4
4
  * Get the Param metadata. Use this decorator to compose your own decorator.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ParamOptions } from "../domain/ParamOptions.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * PathParams return the value from [request.params](http://expressjs.com/en/4x/api.html#req.params) object.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ParamOptions } from "../domain/ParamOptions.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * QueryParams returns the value from [request.query](http://expressjs.com/en/4x/api.html#req.query) object.
5
5
  * N.B.: If the query parameter is an array, the type of the array elements needs to be specified.
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { PipeMethods } from "@tsed/schema";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Register a Pipe to be used with the current decorated param.
5
5
  *
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@tsed/platform-params",
3
+ "version": "8.35.0",
3
4
  "description": "Params module for Ts.ED Framework",
4
- "type": "module",
5
- "version": "8.34.0",
6
5
  "source": "./src/index.ts",
6
+ "type": "module",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
@@ -26,14 +26,13 @@
26
26
  "tslib": ">=2.7.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@tsed/barrels": "8.34.0",
30
- "@tsed/core": "8.34.0",
31
- "@tsed/di": "8.34.0",
32
- "@tsed/exceptions": "8.34.0",
33
- "@tsed/json-mapper": "8.34.0",
34
- "@tsed/schema": "8.34.0",
35
- "@tsed/typescript": "8.34.0",
36
- "eslint": "9.12.0",
29
+ "@tsed/barrels": "8.35.0",
30
+ "@tsed/core": "8.35.0",
31
+ "@tsed/di": "8.35.0",
32
+ "@tsed/exceptions": "8.35.0",
33
+ "@tsed/json-mapper": "8.35.0",
34
+ "@tsed/schema": "8.35.0",
35
+ "@tsed/typescript": "8.35.0",
37
36
  "typescript": "6.0.2",
38
37
  "vitest": "4.1.4"
39
38
  },