@tsed/schema 6.102.6 → 6.102.8-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/lib/cjs/decorators/common/description.js.map +1 -1
  2. package/lib/cjs/decorators/common/ignore.js.map +1 -1
  3. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -1
  4. package/lib/cjs/decorators/operations/in.js +6 -4
  5. package/lib/cjs/decorators/operations/in.js.map +1 -1
  6. package/lib/cjs/domain/JsonMap.js.map +1 -1
  7. package/lib/cjs/domain/JsonOperation.js.map +1 -1
  8. package/lib/cjs/domain/JsonParameter.js.map +1 -1
  9. package/lib/cjs/domain/JsonResponse.js.map +1 -1
  10. package/lib/cjs/domain/JsonSchema.js.map +1 -1
  11. package/lib/cjs/index.js +135 -13
  12. package/lib/cjs/index.js.map +1 -1
  13. package/lib/cjs/package.json +3 -0
  14. package/lib/cjs/utils/from.js +9 -8
  15. package/lib/cjs/utils/from.js.map +1 -1
  16. package/lib/cjs/utils/generics.js.map +1 -1
  17. package/lib/cjs/utils/getJsonSchema.js +1 -1
  18. package/lib/cjs/utils/getJsonSchema.js.map +1 -1
  19. package/lib/cjs/utils/getSpec.js.map +1 -1
  20. package/lib/esm/components/anyMapper.js +4 -4
  21. package/lib/esm/components/classMapper.js +4 -4
  22. package/lib/esm/components/genericsMapper.js +4 -4
  23. package/lib/esm/components/inheritedClassMapper.js +2 -2
  24. package/lib/esm/components/itemMapper.js +1 -1
  25. package/lib/esm/components/lazyRefMapper.js +3 -3
  26. package/lib/esm/components/mapMapper.js +2 -2
  27. package/lib/esm/components/objectMapper.js +3 -3
  28. package/lib/esm/components/ofMapper.js +1 -1
  29. package/lib/esm/components/propertiesMapper.js +1 -1
  30. package/lib/esm/components/schemaMapper.js +6 -6
  31. package/lib/esm/decorators/class/children.js +1 -1
  32. package/lib/esm/decorators/collections/collectionContains.js +1 -1
  33. package/lib/esm/decorators/collections/collectionOf.js +1 -1
  34. package/lib/esm/decorators/collections/maxItems.js +1 -1
  35. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  36. package/lib/esm/decorators/collections/minItems.js +1 -1
  37. package/lib/esm/decorators/collections/minProperties.js +1 -1
  38. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  39. package/lib/esm/decorators/common/additionalProperties.js +1 -1
  40. package/lib/esm/decorators/common/allOf.js +1 -1
  41. package/lib/esm/decorators/common/allow.js +2 -2
  42. package/lib/esm/decorators/common/any.js +1 -1
  43. package/lib/esm/decorators/common/anyOf.js +1 -1
  44. package/lib/esm/decorators/common/const.js +1 -1
  45. package/lib/esm/decorators/common/customKey.js +1 -1
  46. package/lib/esm/decorators/common/default.js +1 -1
  47. package/lib/esm/decorators/common/description.js +1 -1
  48. package/lib/esm/decorators/common/description.js.map +1 -1
  49. package/lib/esm/decorators/common/enum.js +1 -1
  50. package/lib/esm/decorators/common/example.js +1 -1
  51. package/lib/esm/decorators/common/examples.js +1 -1
  52. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  53. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  54. package/lib/esm/decorators/common/format.js +2 -2
  55. package/lib/esm/decorators/common/forwardGroups.js +1 -1
  56. package/lib/esm/decorators/common/groups.js +2 -2
  57. package/lib/esm/decorators/common/ignore.js +1 -1
  58. package/lib/esm/decorators/common/ignore.js.map +1 -1
  59. package/lib/esm/decorators/common/integer.js +1 -1
  60. package/lib/esm/decorators/common/jsonEntityFn.js +1 -1
  61. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -1
  62. package/lib/esm/decorators/common/maxLength.js +1 -1
  63. package/lib/esm/decorators/common/maximum.js +1 -1
  64. package/lib/esm/decorators/common/minLength.js +1 -1
  65. package/lib/esm/decorators/common/minimum.js +1 -1
  66. package/lib/esm/decorators/common/multipleOf.js +1 -1
  67. package/lib/esm/decorators/common/name.js +1 -1
  68. package/lib/esm/decorators/common/nullable.js +2 -2
  69. package/lib/esm/decorators/common/oneOf.js +1 -1
  70. package/lib/esm/decorators/common/optional.js +1 -1
  71. package/lib/esm/decorators/common/pattern.js +1 -1
  72. package/lib/esm/decorators/common/property.js +1 -1
  73. package/lib/esm/decorators/common/readOnly.js +1 -1
  74. package/lib/esm/decorators/common/required.js +2 -2
  75. package/lib/esm/decorators/common/requiredGroups.js +2 -2
  76. package/lib/esm/decorators/common/schema.js +1 -1
  77. package/lib/esm/decorators/common/title.js +1 -1
  78. package/lib/esm/decorators/common/writeOnly.js +1 -1
  79. package/lib/esm/decorators/config/jsonEntityComponent.js +1 -1
  80. package/lib/esm/decorators/generics/genericOf.js +2 -2
  81. package/lib/esm/decorators/generics/generics.js +1 -1
  82. package/lib/esm/decorators/operations/acceptMime.js +1 -1
  83. package/lib/esm/decorators/operations/consumes.js +1 -1
  84. package/lib/esm/decorators/operations/contentType.js +1 -1
  85. package/lib/esm/decorators/operations/deprecated.js +1 -1
  86. package/lib/esm/decorators/operations/header.js +1 -1
  87. package/lib/esm/decorators/operations/in.js +3 -1
  88. package/lib/esm/decorators/operations/in.js.map +1 -1
  89. package/lib/esm/decorators/operations/inFile.js +5 -5
  90. package/lib/esm/decorators/operations/location.js +1 -1
  91. package/lib/esm/decorators/operations/operationId.js +1 -1
  92. package/lib/esm/decorators/operations/operationPath.js +1 -1
  93. package/lib/esm/decorators/operations/partial.js +1 -1
  94. package/lib/esm/decorators/operations/path.js +1 -1
  95. package/lib/esm/decorators/operations/produces.js +1 -1
  96. package/lib/esm/decorators/operations/redirect.js +2 -2
  97. package/lib/esm/decorators/operations/returns.js +8 -8
  98. package/lib/esm/decorators/operations/route.js +3 -3
  99. package/lib/esm/decorators/operations/security.js +1 -1
  100. package/lib/esm/decorators/operations/status.js +1 -1
  101. package/lib/esm/decorators/operations/summary.js +1 -1
  102. package/lib/esm/decorators/operations/tags.js +1 -1
  103. package/lib/esm/domain/DecoratorContext.js +1 -1
  104. package/lib/esm/domain/JsonClassStore.js +3 -3
  105. package/lib/esm/domain/JsonLazyRef.js +2 -2
  106. package/lib/esm/domain/JsonMap.js +1 -1
  107. package/lib/esm/domain/JsonMap.js.map +1 -1
  108. package/lib/esm/domain/JsonMethodStore.js +4 -4
  109. package/lib/esm/domain/JsonOperation.js +8 -8
  110. package/lib/esm/domain/JsonOperation.js.map +1 -1
  111. package/lib/esm/domain/JsonOperationPathsMap.js +1 -1
  112. package/lib/esm/domain/JsonOperationRoute.js +1 -1
  113. package/lib/esm/domain/JsonParameter.js +6 -6
  114. package/lib/esm/domain/JsonParameter.js.map +1 -1
  115. package/lib/esm/domain/JsonParameterStore.js +4 -4
  116. package/lib/esm/domain/JsonPropertyStore.js +3 -3
  117. package/lib/esm/domain/JsonRequestBody.js +2 -2
  118. package/lib/esm/domain/JsonResponse.js +4 -4
  119. package/lib/esm/domain/JsonResponse.js.map +1 -1
  120. package/lib/esm/domain/JsonSchema.js +6 -6
  121. package/lib/esm/domain/JsonSchema.js.map +1 -1
  122. package/lib/esm/index.js +142 -20
  123. package/lib/esm/index.js.map +1 -1
  124. package/lib/esm/package.json +3 -0
  125. package/lib/esm/utils/from.js +5 -4
  126. package/lib/esm/utils/from.js.map +1 -1
  127. package/lib/esm/utils/generics.js.map +1 -1
  128. package/lib/esm/utils/getInheritedStores.js +1 -1
  129. package/lib/esm/utils/getJsonEntityStore.js +5 -5
  130. package/lib/esm/utils/getJsonSchema.js +4 -4
  131. package/lib/esm/utils/getJsonSchema.js.map +1 -1
  132. package/lib/esm/utils/getOperationsRoutes.js +3 -3
  133. package/lib/esm/utils/getOperationsStores.js +4 -4
  134. package/lib/esm/utils/getPropertiesStores.js +3 -3
  135. package/lib/esm/utils/getRequiredProperties.js +1 -1
  136. package/lib/esm/utils/getSpec.js +6 -6
  137. package/lib/esm/utils/getSpec.js.map +1 -1
  138. package/lib/esm/utils/mapNullableType.js +1 -1
  139. package/lib/esm/utils/mapRouteOptions.js +1 -1
  140. package/lib/esm/utils/mergeOperation.js +3 -3
  141. package/lib/esm/utils/ref.js +1 -1
  142. package/lib/esm/utils/toJsonMapCollection.js +1 -1
  143. package/lib/types/decorators/common/ignore.d.ts +1 -1
  144. package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
  145. package/lib/types/decorators/operations/in.d.ts +1 -1
  146. package/lib/types/domain/JsonMap.d.ts +1 -1
  147. package/lib/types/domain/JsonOperation.d.ts +2 -1
  148. package/lib/types/domain/JsonParameter.d.ts +1 -1
  149. package/lib/types/domain/JsonResponse.d.ts +2 -1
  150. package/lib/types/domain/JsonSchema.d.ts +1 -1
  151. package/lib/types/index.d.ts +135 -13
  152. package/lib/types/utils/generics.d.ts +1 -1
  153. package/lib/types/utils/getJsonSchema.d.ts +2 -2
  154. package/lib/types/utils/getSpec.d.ts +1 -1
  155. package/package.json +19 -8
  156. package/tsconfig.compile.esm.json +1 -0
  157. package/lib/cjs/components/index.js +0 -15
  158. package/lib/cjs/components/index.js.map +0 -1
  159. package/lib/cjs/decorators/index.js +0 -79
  160. package/lib/cjs/decorators/index.js.map +0 -1
  161. package/lib/cjs/domain/index.js +0 -20
  162. package/lib/cjs/domain/index.js.map +0 -1
  163. package/lib/cjs/interfaces/index.js +0 -8
  164. package/lib/cjs/interfaces/index.js.map +0 -1
  165. package/lib/esm/components/index.js +0 -12
  166. package/lib/esm/components/index.js.map +0 -1
  167. package/lib/esm/decorators/index.js +0 -76
  168. package/lib/esm/decorators/index.js.map +0 -1
  169. package/lib/esm/domain/index.js +0 -17
  170. package/lib/esm/domain/index.js.map +0 -1
  171. package/lib/esm/interfaces/index.js +0 -5
  172. package/lib/esm/interfaces/index.js.map +0 -1
  173. package/lib/types/components/index.d.ts +0 -11
  174. package/lib/types/decorators/index.d.ts +0 -70
  175. package/lib/types/domain/index.d.ts +0 -16
  176. package/lib/types/interfaces/index.d.ts +0 -4
@@ -1,6 +1,6 @@
1
1
  import { DecoratorTypes, isClass, useDecorators } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
3
- import { Property } from "./property";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
+ import { Property } from "./property.js";
4
4
  /**
5
5
  * Add allowed values when the property or parameters is required.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set the type of the array items.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The const keyword is used to restrict a value to a fixed value.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set a custom key on JsonSchema that is not a part of the official spec.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * There are no restrictions placed on the value of this keyword.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { decoratorTypeOf, DecoratorTypes } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * Add a description to the class, method or property
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../src/decorators/common/description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB;IAC1C,OAAO,YAAY,CAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;;QACxE,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,cAAc,CAAC,IAAI,CAAC;YACzB,KAAK,cAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACtC,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACjE,MAAM;YAER,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAC,KAAyB,CAAC,SAAS,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;gBAC/D,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonMethodStore, JsonParameterStore} from \"../../domain\";\n\n/**\n * Add a description to the class, method or property\n *\n * ## Examples\n * ### On class\n *\n * ```typescript\n * @Description(\"description\")\n * class Model {\n *\n * }\n * ```\n *\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * @Description(\"description\")\n * async method() {}\n * }\n * ```\n *\n * ### On parameter\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * async method(@Description(\"description\") @PathParam(\"id\") id: string) {}\n * }\n * ```\n *\n * ### On property\n *\n * ```typescript\n * class Model {\n * @Description(\"description\")\n * id: string;\n * }\n * ```\n *\n * @param {string} description\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @methodDecorator\n * @propertyDecorator\n * @parameterDecorator\n */\nexport function Description(description: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PROP:\n case DecoratorTypes.CLASS:\n store.schema.description(description);\n break;\n\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.description(description);\n break;\n\n case DecoratorTypes.METHOD:\n (store as JsonMethodStore).operation?.description(description);\n break;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../src/decorators/common/description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,UAAU,WAAW,CAAC,WAAgB;IAC1C,OAAO,YAAY,CAAC,CAAC,KAAsB,EAAE,IAAyB,EAAE,EAAE;;QACxE,QAAQ,eAAe,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,cAAc,CAAC,IAAI,CAAC;YACzB,KAAK,cAAc,CAAC,KAAK;gBACvB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACtC,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBACjE,MAAM;YAER,KAAK,cAAc,CAAC,MAAM;gBACxB,MAAC,KAAyB,CAAC,SAAS,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAC;gBAC/D,MAAM;SACT;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorParameters, decoratorTypeOf, DecoratorTypes} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\nimport type {JsonMethodStore} from \"../../domain/JsonMethodStore\";\nimport type {JsonParameterStore} from \"../../domain/JsonParameterStore\";\n\n/**\n * Add a description to the class, method or property\n *\n * ## Examples\n * ### On class\n *\n * ```typescript\n * @Description(\"description\")\n * class Model {\n *\n * }\n * ```\n *\n * ### On method\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * @Description(\"description\")\n * async method() {}\n * }\n * ```\n *\n * ### On parameter\n *\n * ```typescript\n * @Controller(\"/\")\n * class ModelCtrl {\n * async method(@Description(\"description\") @PathParam(\"id\") id: string) {}\n * }\n * ```\n *\n * ### On property\n *\n * ```typescript\n * class Model {\n * @Description(\"description\")\n * id: string;\n * }\n * ```\n *\n * @param {string} description\n * @decorator\n * @validation\n * @swagger\n * @schema\n * @input\n * @classDecorator\n * @methodDecorator\n * @propertyDecorator\n * @parameterDecorator\n */\nexport function Description(description: any) {\n return JsonEntityFn((store: JsonEntityStore, args: DecoratorParameters) => {\n switch (decoratorTypeOf(args)) {\n case DecoratorTypes.PROP:\n case DecoratorTypes.CLASS:\n store.schema.description(description);\n break;\n\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.description(description);\n break;\n\n case DecoratorTypes.METHOD:\n (store as JsonMethodStore).operation?.description(description);\n break;\n }\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  export function Enum(enumValue, ...enumValues) {
3
3
  return JsonEntityFn((store) => {
4
4
  store.itemSchema.enum(enumValue, ...enumValues);
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Add a example metadata on the decorated element.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Add a examples metadata on the decorated element.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Maximum } from "./maximum";
1
+ import { Maximum } from "./maximum.js";
2
2
  /**
3
3
  * The value of `exclusiveMaximum` MUST be number, representing an exclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Minimum } from "./minimum";
1
+ import { Minimum } from "./minimum.js";
2
2
  /**
3
3
  * The value of `exclusiveMinimum` MUST be number, representing an exclusive upper limit for a numeric instance.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { JsonFormatTypes } from "../../domain/JsonFormatTypes";
2
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonFormatTypes } from "../../domain/JsonFormatTypes.js";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * The following formats are supported for string validation with `format` keyword:
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Allow to forward group on specific property.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { DecoratorTypes } from "@tsed/core";
2
- import { matchGroups } from "../../utils/matchGroups";
3
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { matchGroups } from "../../utils/matchGroups.js";
3
+ import { JsonEntityFn } from "./jsonEntityFn.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * @ignore
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/decorators/common/ignore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,UAAU,MAAM,CAAC,KAA+B,SAAS;IAC7D,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {IgnoreCallback} from \"../../interfaces\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * @ignore\n */\nconst defaultCB = (value: any, ctx: any) => ctx.mongoose !== true;\n\n/**\n * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.\n *\n * ::: warning\n * Swagger will not generate documentation for the ignored property.\n * :::\n *\n * ```typescript\n * class User {\n * @Ignore()\n * _id: string;\n *\n * @Property()\n * firstName: string;\n *\n * @Property()\n * lastName: string;\n *\n * @Ignore((value, ctx) => !ctx.mongoose) // don't ignore prop only if mongoose\n * password: string;\n * }\n * ```\n *\n * The controller:\n * ```typescript\n * import {Post, Controller, BodyParams} from \"@tsed/common\";\n * import {Person} from \"../models/Person\";\n *\n * @Controller(\"/\")\n * export class UsersCtrl {\n * @Get(\"/\")\n * get(): User {\n * const user = new User();\n * user._id = \"12345\";\n * user.firstName = \"John\";\n * user.lastName = \"Doe\";\n * user.password = \"secretpassword\";\n * return\n * }\n * }\n * ```\n *\n * The expected json object:\n *\n * ```json\n * {\n * \"firstName\": \"John\",\n * \"lastName\": \"Doe\"\n * }\n * ```\n * @param cb Callback to know if the property must be ignored\n * @decorator\n * @validation\n * @swagger\n * @schema\n */\nexport function Ignore(cb: boolean | IgnoreCallback = defaultCB) {\n return JsonEntityFn((store) => {\n store.schema.ignore(cb);\n });\n}\n"]}
1
+ {"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/decorators/common/ignore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,UAAU,MAAM,CAAC,KAA+B,SAAS;IAC7D,OAAO,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {IgnoreCallback} from \"../../interfaces/IgnoreCallback\";\nimport {JsonEntityFn} from \"./jsonEntityFn\";\n\n/**\n * @ignore\n */\nconst defaultCB = (value: any, ctx: any) => ctx.mongoose !== true;\n\n/**\n * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.\n *\n * ::: warning\n * Swagger will not generate documentation for the ignored property.\n * :::\n *\n * ```typescript\n * class User {\n * @Ignore()\n * _id: string;\n *\n * @Property()\n * firstName: string;\n *\n * @Property()\n * lastName: string;\n *\n * @Ignore((value, ctx) => !ctx.mongoose) // don't ignore prop only if mongoose\n * password: string;\n * }\n * ```\n *\n * The controller:\n * ```typescript\n * import {Post, Controller, BodyParams} from \"@tsed/common\";\n * import {Person} from \"../models/Person\";\n *\n * @Controller(\"/\")\n * export class UsersCtrl {\n * @Get(\"/\")\n * get(): User {\n * const user = new User();\n * user._id = \"12345\";\n * user.firstName = \"John\";\n * user.lastName = \"Doe\";\n * user.password = \"secretpassword\";\n * return\n * }\n * }\n * ```\n *\n * The expected json object:\n *\n * ```json\n * {\n * \"firstName\": \"John\",\n * \"lastName\": \"Doe\"\n * }\n * ```\n * @param cb Callback to know if the property must be ignored\n * @decorator\n * @validation\n * @swagger\n * @schema\n */\nexport function Ignore(cb: boolean | IgnoreCallback = defaultCB) {\n return JsonEntityFn((store) => {\n store.schema.ignore(cb);\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set integer type.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { getJsonEntityStore } from "../../utils/getJsonEntityStore";
1
+ import { getJsonEntityStore } from "../../utils/getJsonEntityStore.js";
2
2
  /**
3
3
  * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"jsonEntityFn.js","sourceRoot":"","sources":["../../../../src/decorators/common/jsonEntityFn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAC1B,EAAuD;IAEvD,OAAO,CAAC,GAAG,UAA+B,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAQ,EAAE,CAAC,kBAAkB,CAAI,GAAG,UAAU,CAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport type {JsonEntityStore} from \"../../domain\";\nimport {getJsonEntityStore} from \"../../utils/getJsonEntityStore\";\n\n/**\n * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.\n *\n * ## Usage\n *\n * ```typescript\n * export function Description(description: any) {\n * return JsonEntityFn((entity: JsonEntityStore, args: DecoratorParameters) => {\n * entity.itemSchema.description(description)\n * });\n * }\n * ```\n *\n * @param fn\n * @decorator\n * @utils\n * @model\n */\nexport function JsonEntityFn<T extends JsonEntityStore = JsonEntityStore>(\n fn: (entity: T, parameters: DecoratorParameters) => any\n): (...args: any[]) => any {\n return (...parameters: DecoratorParameters) => {\n const result: any = fn(getJsonEntityStore<T>(...parameters) as T, parameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"jsonEntityFn.js","sourceRoot":"","sources":["../../../../src/decorators/common/jsonEntityFn.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAC1B,EAAuD;IAEvD,OAAO,CAAC,GAAG,UAA+B,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAQ,EAAE,CAAC,kBAAkB,CAAI,GAAG,UAAU,CAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport type {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {getJsonEntityStore} from \"../../utils/getJsonEntityStore\";\n\n/**\n * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.\n *\n * ## Usage\n *\n * ```typescript\n * export function Description(description: any) {\n * return JsonEntityFn((entity: JsonEntityStore, args: DecoratorParameters) => {\n * entity.itemSchema.description(description)\n * });\n * }\n * ```\n *\n * @param fn\n * @decorator\n * @utils\n * @model\n */\nexport function JsonEntityFn<T extends JsonEntityStore = JsonEntityStore>(\n fn: (entity: T, parameters: DecoratorParameters) => any\n): (...args: any[]) => any {\n return (...parameters: DecoratorParameters) => {\n const result: any = fn(getJsonEntityStore<T>(...parameters) as T, parameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The value of `maximum` MUST be a number, representing an inclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  *
4
4
  * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * A numeric instance is valid only if division by this keyword's value results in an integer.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { decoratorTypeOf, DecoratorTypes } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add a name metadata on the decorated element.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { useDecorators } from "@tsed/core";
2
- import { Any } from "./any";
3
- import { Property } from "./property";
2
+ import { Any } from "./any.js";
3
+ import { Property } from "./property.js";
4
4
  /**
5
5
  * Set field as nullable.
6
6
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorTypes } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * Add optional annotation on Property or Parameter.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * The pattern and Pattern Properties keywords use regular expressions to express constraints.
4
4
  * The regular expression syntax used is from JavaScript (ECMA 262, specifically). However, that complete syntax is not widely supported, therefore it is recommended that you stick to the subset of that syntax described below.
@@ -1,5 +1,5 @@
1
1
  import { isClass } from "@tsed/core";
2
- import { JsonEntityFn } from "./jsonEntityFn";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * Declare a new property on a model.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set the property as readOnly.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { Allow } from "./allow";
2
- import { Optional } from "./optional";
1
+ import { Allow } from "./allow.js";
2
+ import { Optional } from "./optional.js";
3
3
  /**
4
4
  * Add required annotation on Property or Parameter.
5
5
  *
@@ -1,5 +1,5 @@
1
- import { matchGroups } from "../../utils/matchGroups";
2
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { matchGroups } from "../../utils/matchGroups.js";
2
+ import { JsonEntityFn } from "./jsonEntityFn.js";
3
3
  /**
4
4
  * Apply groups validation strategy for required property.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Write data formatted to JsonSchema.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Add title metadata on the decorated element.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Set the property as WriteOnly.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntitiesContainer } from "../../domain/JsonEntityStore";
1
+ import { JsonEntitiesContainer } from "../../domain/JsonEntityStore.js";
2
2
  /**
3
3
  * Declare a new JsonEntityStore class for a specific decorator type.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { isObject } from "@tsed/core";
2
- import { JsonEntityStore } from "../../domain/JsonEntityStore";
3
- import { string } from "../../utils/from";
2
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
3
+ import { string } from "../../utils/from.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,4 +1,4 @@
1
- import { JsonEntityStore } from "../../domain/JsonEntityStore";
1
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
2
  /**
3
3
  * Define generics list. This list is used by @@GenericOf@@ and the @@getJsonSchema@@ function to build the correct JsonSchema.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { StoreSet, useDecorators } from "@tsed/core";
2
- import { Produces } from "./produces";
2
+ import { Produces } from "./produces.js";
3
3
  /**
4
4
  * Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add consumes metadata on the decorated element.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Returns } from "./returns";
1
+ import { Returns } from "./returns.js";
2
2
  /**
3
3
  * Sets the Content-Type HTTP header to the MIME type as determined by mime.lookup() for the specified type.
4
4
  * If type contains the “/” character, then it sets the `Content-Type` to type.
@@ -1,5 +1,5 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add deprecated metadata on the decorated element.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Returns } from "./returns";
1
+ import { Returns } from "./returns.js";
2
2
  /**
3
3
  * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter.
4
4
  *
@@ -1,5 +1,7 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityStore, JsonParameter, JsonSchema } from "../../domain";
2
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
3
+ import { JsonParameter } from "../../domain/JsonParameter.js";
4
+ import { JsonSchema } from "../../domain/JsonSchema.js";
3
5
  /**
4
6
  * Add a input parameter.
5
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../src/decorators/operations/in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAQ,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAC,eAAe,EAAmB,aAAa,EAAsB,UAAU,EAAmB,MAAM,cAAc,CAAC;AA+C/H;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,EAAE,CAAC,MAAmC;IACpD,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,MAAM,SAAS,GAAG,CAAC,MAAW,EAAE,WAA6B,EAAE,KAAmC,EAAE,EAAE;QACpG,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAE/D,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,cAAc,CAAC,MAAM;gBACxB,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACxB,KAAyB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;gBAErE,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC9C,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;SACxE;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAe,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QAEnB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE;QAChC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE;QAC9C,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEvC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,QAAQ,GAAG,CAAC,WAAoB,IAAI,EAAE,EAAE;QAChD,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEjC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,OAAO,GAAG,CAAC,OAAwB,EAAE,EAAE;QAC/C,OAAO,SAAS,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF,SAAS,CAAC,MAAM,GAAG,CAAC,OAAY,EAAE,EAAE;QAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE/B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, Type, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityStore, JsonMethodStore, JsonParameter, JsonParameterStore, JsonSchema, JsonSchemaObject} from \"../../domain\";\nimport {JsonParameterTypes} from \"../../domain/JsonParameterTypes\";\n\nexport interface InChainedDecorators {\n <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;\n\n (target: Object, propertyKey: string | symbol, parameterIndex: number): void;\n\n (target: Function): void;\n\n /**\n * Type of this in parameter\n * @param type\n */\n Type(type: Type<any>): this;\n\n /**\n *\n * @param name\n */\n Name(name: string): this;\n\n /**\n *\n * @param description\n */\n Description(description: string): this;\n\n /**\n *\n * @param required\n */\n Required(required?: boolean): this;\n\n /**\n * Add pattern constraint. Only available for OPENAPI.\n * @param pattern\n */\n Pattern(pattern: string | RegExp): this;\n\n /**\n * Add custom schema.\n * @param schema\n */\n Schema(schema: Partial<JsonSchemaObject>): this;\n}\n\n/**\n * Add a input parameter.\n *\n * ::: warning\n * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.\n * But you can use this decorator on Method, to add extra in parameters like Authorization header.\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Get(\"/\")\n * @In(\"header\").Type(String).Name(\"Authorization\").Required()\n * method() {\n * }\n * }\n * ```\n * :::\n *\n * @param inType\n * @decorator\n * @swagger\n * @schema\n * @input\n * @operation\n */\nexport function In(inType: JsonParameterTypes | string): InChainedDecorators {\n const jsonParameter = new JsonParameter();\n const schema: any = {};\n\n const decorator = (target: any, propertyKey?: string | symbol, index?: PropertyDescriptor | number) => {\n const store = JsonEntityStore.from(target, propertyKey, index);\n\n switch (store.decoratorType) {\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.in(inType);\n break;\n case DecoratorTypes.METHOD:\n jsonParameter.in(inType);\n (store as JsonMethodStore).operation.addParameter(-1, jsonParameter);\n\n jsonParameter.schema(JsonSchema.from(schema));\n break;\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(target, decorator);\n break;\n\n default:\n throw new UnsupportedDecoratorType(In, [target, propertyKey, index]);\n }\n };\n\n decorator.Type = (type: Type<any>) => {\n schema.type = type;\n\n return decorator;\n };\n\n decorator.Name = (name: string) => {\n jsonParameter.name(name);\n\n return decorator;\n };\n\n decorator.Description = (description: string) => {\n jsonParameter.description(description);\n\n return decorator;\n };\n\n decorator.Required = (required: boolean = true) => {\n jsonParameter.required(required);\n\n return decorator;\n };\n\n decorator.Pattern = (pattern: string | RegExp) => {\n return decorator.Schema({pattern: pattern.toString()});\n };\n\n decorator.Schema = (_schema: any) => {\n Object.assign(schema, _schema);\n\n return decorator;\n };\n\n return decorator;\n}\n"]}
1
+ {"version":3,"file":"in.js","sourceRoot":"","sources":["../../../../src/decorators/operations/in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAQ,wBAAwB,EAAC,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAAC,UAAU,EAAmB,MAAM,yBAAyB,CAAC;AA8CrE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,EAAE,CAAC,MAAmC;IACpD,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,MAAM,SAAS,GAAG,CAAC,MAAW,EAAE,WAA6B,EAAE,KAAmC,EAAE,EAAE;QACpG,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAE/D,QAAQ,KAAK,CAAC,aAAa,EAAE;YAC3B,KAAK,cAAc,CAAC,KAAK;gBACtB,KAA4B,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,cAAc,CAAC,MAAM;gBACxB,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACxB,KAAyB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;gBAErE,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC9C,MAAM;YAER,KAAK,cAAc,CAAC,KAAK;gBACvB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAER;gBACE,MAAM,IAAI,wBAAwB,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;SACxE;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAe,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QAEnB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE;QAChC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzB,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE;QAC9C,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEvC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,QAAQ,GAAG,CAAC,WAAoB,IAAI,EAAE,EAAE;QAChD,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEjC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,SAAS,CAAC,OAAO,GAAG,CAAC,OAAwB,EAAE,EAAE;QAC/C,OAAO,SAAS,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAC,CAAC,CAAC;IACzD,CAAC,CAAC;IAEF,SAAS,CAAC,MAAM,GAAG,CAAC,OAAY,EAAE,EAAE;QAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAE/B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import {decorateMethodsOf, DecoratorTypes, Type, UnsupportedDecoratorType} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../../domain/JsonEntityStore\";\nimport {JsonMethodStore} from \"../../domain/JsonMethodStore\";\nimport {JsonParameter} from \"../../domain/JsonParameter\";\nimport {JsonParameterStore} from \"../../domain/JsonParameterStore\";\nimport {JsonParameterTypes} from \"../../domain/JsonParameterTypes\";\nimport {JsonSchema, JsonSchemaObject} from \"../../domain/JsonSchema\";\n\nexport interface InChainedDecorators {\n <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;\n\n (target: Object, propertyKey: string | symbol, parameterIndex: number): void;\n\n (target: Function): void;\n\n /**\n * Type of this in parameter\n * @param type\n */\n Type(type: Type<any>): this;\n\n /**\n *\n * @param name\n */\n Name(name: string): this;\n\n /**\n *\n * @param description\n */\n Description(description: string): this;\n\n /**\n *\n * @param required\n */\n Required(required?: boolean): this;\n\n /**\n * Add pattern constraint. Only available for OPENAPI.\n * @param pattern\n */\n Pattern(pattern: string | RegExp): this;\n\n /**\n * Add custom schema.\n * @param schema\n */\n Schema(schema: Partial<JsonSchemaObject>): this;\n}\n\n/**\n * Add a input parameter.\n *\n * ::: warning\n * Don't use decorator with Ts.ED application to decorate parameters. Use @@BodyParams@@, @@PathParams@@, etc... instead.\n * But you can use this decorator on Method, to add extra in parameters like Authorization header.\n *\n * ```typescript\n * @Controller(\"/\")\n * class MyController {\n * @Get(\"/\")\n * @In(\"header\").Type(String).Name(\"Authorization\").Required()\n * method() {\n * }\n * }\n * ```\n * :::\n *\n * @param inType\n * @decorator\n * @swagger\n * @schema\n * @input\n * @operation\n */\nexport function In(inType: JsonParameterTypes | string): InChainedDecorators {\n const jsonParameter = new JsonParameter();\n const schema: any = {};\n\n const decorator = (target: any, propertyKey?: string | symbol, index?: PropertyDescriptor | number) => {\n const store = JsonEntityStore.from(target, propertyKey, index);\n\n switch (store.decoratorType) {\n case DecoratorTypes.PARAM:\n (store as JsonParameterStore).parameter.in(inType);\n break;\n case DecoratorTypes.METHOD:\n jsonParameter.in(inType);\n (store as JsonMethodStore).operation.addParameter(-1, jsonParameter);\n\n jsonParameter.schema(JsonSchema.from(schema));\n break;\n\n case DecoratorTypes.CLASS:\n decorateMethodsOf(target, decorator);\n break;\n\n default:\n throw new UnsupportedDecoratorType(In, [target, propertyKey, index]);\n }\n };\n\n decorator.Type = (type: Type<any>) => {\n schema.type = type;\n\n return decorator;\n };\n\n decorator.Name = (name: string) => {\n jsonParameter.name(name);\n\n return decorator;\n };\n\n decorator.Description = (description: string) => {\n jsonParameter.description(description);\n\n return decorator;\n };\n\n decorator.Required = (required: boolean = true) => {\n jsonParameter.required(required);\n\n return decorator;\n };\n\n decorator.Pattern = (pattern: string | RegExp) => {\n return decorator.Schema({pattern: pattern.toString()});\n };\n\n decorator.Schema = (_schema: any) => {\n Object.assign(schema, _schema);\n\n return decorator;\n };\n\n return decorator;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import { Metadata, useDecorators, useMethodDecorators } from "@tsed/core";
2
- import { In } from "./in";
3
- import { JsonParameterTypes } from "../../domain/JsonParameterTypes";
4
- import { Returns } from "./returns";
5
- import { Name } from "../common/name";
6
- import { Consumes } from "./consumes";
2
+ import { In } from "./in.js";
3
+ import { JsonParameterTypes } from "../../domain/JsonParameterTypes.js";
4
+ import { Returns } from "./returns.js";
5
+ import { Name } from "../common/name.js";
6
+ import { Consumes } from "./consumes.js";
7
7
  /**
8
8
  * Add a input file parameter.
9
9
  *
@@ -1,4 +1,4 @@
1
- import { Returns } from "./returns";
1
+ import { Returns } from "./returns.js";
2
2
  /**
3
3
  * Sets the response Location HTTP header to the specified path parameter.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Set a swagger operationId explicitly.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Declare new Operation with his path and http method.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Groups } from "../common/groups";
1
+ import { Groups } from "../common/groups.js";
2
2
  /**
3
3
  * Apply Partial group strategy on the input model
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Set class path to expose all endpoints
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add produces metadata on the decorated element.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { isNumber, isString, useDecorators } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
3
- import { Returns } from "./returns";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
+ import { Returns } from "./returns.js";
4
4
  export function Redirect(...args) {
5
5
  const { status, url, meta } = args.reduce((options, value) => {
6
6
  if (isNumber(value)) {
@@ -1,12 +1,12 @@
1
1
  import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, isArray, isCollection, isObject, isPlainObject, isPrimitiveOrPrimitiveClass, isString } from "@tsed/core";
2
- import { getStatusMessage } from "../../constants/httpStatusMessages";
3
- import { DecoratorContext } from "../../domain/DecoratorContext";
4
- import { JsonEntityStore } from "../../domain/JsonEntityStore";
5
- import { JsonSchema } from "../../domain/JsonSchema";
6
- import { getStatusModel } from "../../utils/defineStatusModel";
7
- import { string } from "../../utils/from";
8
- import { isSuccessStatus } from "../../utils/isSuccessStatus";
9
- import { mapHeaders } from "../../utils/mapHeaders";
2
+ import { getStatusMessage } from "../../constants/httpStatusMessages.js";
3
+ import { DecoratorContext } from "../../domain/DecoratorContext.js";
4
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
5
+ import { JsonSchema } from "../../domain/JsonSchema.js";
6
+ import { getStatusModel } from "../../utils/defineStatusModel.js";
7
+ import { string } from "../../utils/from.js";
8
+ import { isSuccessStatus } from "../../utils/isSuccessStatus.js";
9
+ import { mapHeaders } from "../../utils/mapHeaders.js";
10
10
  /**
11
11
  * @ignore
12
12
  */
@@ -1,6 +1,6 @@
1
- import { DecoratorContext } from "../../domain/DecoratorContext";
2
- import { mapRouteOptions } from "../../utils/mapRouteOptions";
3
- import { OperationMethods } from "../../constants/httpMethods";
1
+ import { DecoratorContext } from "../../domain/DecoratorContext.js";
2
+ import { mapRouteOptions } from "../../utils/mapRouteOptions.js";
3
+ import { OperationMethods } from "../../constants/httpMethods.js";
4
4
  class RouteDecoratorContext extends DecoratorContext {
5
5
  constructor() {
6
6
  super(...arguments);
@@ -1,5 +1,5 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add security metadata on the decorated method.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Returns } from "./returns";
1
+ import { Returns } from "./returns.js";
2
2
  /**
3
3
  * Add responses documentation for a specific status code.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add summary metadata on the decorated element.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { decorateMethodsOf, DecoratorTypes, UnsupportedDecoratorType } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  function mapTags(tags) {
4
4
  return tags.map((tag) => {
5
5
  if (typeof tag === "string") {
@@ -1,6 +1,6 @@
1
1
  import { DecoratorTypes } from "@tsed/core";
2
2
  import { pascalCase } from "pascal-case";
3
- import { JsonEntityStore } from "./JsonEntityStore";
3
+ import { JsonEntityStore } from "./JsonEntityStore.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,8 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { DecoratorTypes } from "@tsed/core";
3
- import { JsonEntityStore } from "./JsonEntityStore";
4
- import { JsonSchema } from "./JsonSchema";
5
- import { JsonEntityComponent } from "../decorators/config/jsonEntityComponent";
3
+ import { JsonEntityStore } from "./JsonEntityStore.js";
4
+ import { JsonSchema } from "./JsonSchema.js";
5
+ import { JsonEntityComponent } from "../decorators/config/jsonEntityComponent.js";
6
6
  let JsonClassStore = class JsonClassStore extends JsonEntityStore {
7
7
  constructor() {
8
8
  super(...arguments);
@@ -1,6 +1,6 @@
1
1
  import { nameOf } from "@tsed/core";
2
- import { execMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { getJsonEntityStore } from "../utils/getJsonEntityStore";
2
+ import { execMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { getJsonEntityStore } from "../utils/getJsonEntityStore.js";
4
4
  export class JsonLazyRef {
5
5
  constructor(getType) {
6
6
  this.getType = getType;
@@ -1,5 +1,5 @@
1
1
  import { isFunction } from "@tsed/core";
2
- import { execMapper } from "../registries/JsonSchemaMapperContainer";
2
+ import { execMapper } from "../registries/JsonSchemaMapperContainer.js";
3
3
  export class JsonMap extends Map {
4
4
  constructor(obj = {}) {
5
5
  super();