@tsed/schema 7.79.4 → 7.80.1

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 (206) hide show
  1. package/lib/browser/schema.umd.min.js.map +1 -1
  2. package/lib/cjs/components/default/inlineEnumsMapper.js +2 -2
  3. package/lib/cjs/components/default/inlineEnumsMapper.js.map +1 -1
  4. package/lib/cjs/components/default/nullableMapper.js +4 -4
  5. package/lib/cjs/components/default/nullableMapper.js.map +1 -1
  6. package/lib/cjs/components/default/requiredMapper.js +4 -4
  7. package/lib/cjs/components/default/requiredMapper.js.map +1 -1
  8. package/lib/cjs/components/open-spec/nullableMapper.js +4 -4
  9. package/lib/cjs/components/open-spec/nullableMapper.js.map +1 -1
  10. package/lib/cjs/utils/generateSpec.js +1 -24
  11. package/lib/cjs/utils/generateSpec.js.map +1 -1
  12. package/lib/esm/components/default/inlineEnumsMapper.js.map +1 -1
  13. package/lib/esm/components/default/nullableMapper.js.map +1 -1
  14. package/lib/esm/components/default/requiredMapper.js.map +1 -1
  15. package/lib/esm/components/open-spec/nullableMapper.js.map +1 -1
  16. package/lib/esm/utils/getJsonSchema.js +1 -1
  17. package/lib/types/components/default/inlineEnumsMapper.d.ts +2 -2
  18. package/lib/types/components/default/nullableMapper.d.ts +1 -1
  19. package/lib/types/components/default/requiredMapper.d.ts +2 -2
  20. package/lib/types/components/open-spec/nullableMapper.d.ts +1 -1
  21. package/lib/types-esm/components/async-api/channelsMapper.d.ts +2 -0
  22. package/lib/types-esm/components/async-api/generate.d.ts +1 -0
  23. package/lib/types-esm/components/async-api/messageMapper.d.ts +6 -0
  24. package/lib/types-esm/components/async-api/payloadMapper.d.ts +4 -0
  25. package/lib/types-esm/components/async-api/responseMapper.d.ts +6 -0
  26. package/lib/types-esm/components/default/anyMapper.d.ts +2 -0
  27. package/lib/types-esm/components/default/classMapper.d.ts +3 -0
  28. package/lib/types-esm/components/default/genericsMapper.d.ts +5 -0
  29. package/lib/types-esm/components/default/inheritedClassMapper.d.ts +5 -0
  30. package/lib/types-esm/components/default/inlineEnumsMapper.d.ts +3 -0
  31. package/lib/types-esm/components/default/itemMapper.d.ts +2 -0
  32. package/lib/types-esm/components/default/lazyRefMapper.d.ts +3 -0
  33. package/lib/types-esm/components/default/mapMapper.d.ts +9 -0
  34. package/lib/types-esm/components/default/nullableMapper.d.ts +2 -0
  35. package/lib/types-esm/components/default/objectMapper.d.ts +8 -0
  36. package/lib/types-esm/components/default/ofMapper.d.ts +3 -0
  37. package/lib/types-esm/components/default/propertiesMapper.d.ts +3 -0
  38. package/lib/types-esm/components/default/requiredMapper.d.ts +3 -0
  39. package/lib/types-esm/components/default/schemaMapper.d.ts +3 -0
  40. package/lib/types-esm/components/index.d.ts +33 -0
  41. package/lib/types-esm/components/open-spec/generate.d.ts +1 -0
  42. package/lib/types-esm/components/open-spec/nullableMapper.d.ts +2 -0
  43. package/lib/types-esm/components/open-spec/operationInFilesMapper.d.ts +2 -0
  44. package/lib/types-esm/components/open-spec/operationInParameterMapper.d.ts +10 -0
  45. package/lib/types-esm/components/open-spec/operationInParametersMapper.d.ts +3 -0
  46. package/lib/types-esm/components/open-spec/operationInQueryMapper.d.ts +2 -0
  47. package/lib/types-esm/components/open-spec/operationMapper.d.ts +3 -0
  48. package/lib/types-esm/components/open-spec/operationMediaMapper.d.ts +3 -0
  49. package/lib/types-esm/components/open-spec/operationRequestBodyMapper.d.ts +3 -0
  50. package/lib/types-esm/components/open-spec/operationResponseMapper.d.ts +3 -0
  51. package/lib/types-esm/components/open-spec/pathsMapper.d.ts +2 -0
  52. package/lib/types-esm/constants/OperationVerbs.d.ts +20 -0
  53. package/lib/types-esm/constants/httpStatusMessages.d.ts +11 -0
  54. package/lib/types-esm/constants/jsonSchemaProperties.d.ts +7 -0
  55. package/lib/types-esm/decorators/class/children.d.ts +11 -0
  56. package/lib/types-esm/decorators/class/discriminatorValue.d.ts +42 -0
  57. package/lib/types-esm/decorators/collections/collectionContains.d.ts +21 -0
  58. package/lib/types-esm/decorators/collections/collectionOf.d.ts +101 -0
  59. package/lib/types-esm/decorators/collections/maxItems.d.ts +48 -0
  60. package/lib/types-esm/decorators/collections/maxProperties.d.ts +71 -0
  61. package/lib/types-esm/decorators/collections/minItems.d.ts +52 -0
  62. package/lib/types-esm/decorators/collections/minProperties.d.ts +70 -0
  63. package/lib/types-esm/decorators/collections/uniqueItems.d.ts +51 -0
  64. package/lib/types-esm/decorators/common/additionalProperties.d.ts +11 -0
  65. package/lib/types-esm/decorators/common/allOf.d.ts +13 -0
  66. package/lib/types-esm/decorators/common/allow.d.ts +28 -0
  67. package/lib/types-esm/decorators/common/any.d.ts +38 -0
  68. package/lib/types-esm/decorators/common/anyOf.d.ts +17 -0
  69. package/lib/types-esm/decorators/common/const.d.ts +61 -0
  70. package/lib/types-esm/decorators/common/customKey.d.ts +26 -0
  71. package/lib/types-esm/decorators/common/default.d.ts +41 -0
  72. package/lib/types-esm/decorators/common/defaultMsg.d.ts +32 -0
  73. package/lib/types-esm/decorators/common/description.d.ts +53 -0
  74. package/lib/types-esm/decorators/common/discriminatorKey.d.ts +1 -0
  75. package/lib/types-esm/decorators/common/enum.d.ts +101 -0
  76. package/lib/types-esm/decorators/common/errorMsg.d.ts +6 -0
  77. package/lib/types-esm/decorators/common/example.d.ts +11 -0
  78. package/lib/types-esm/decorators/common/examples.d.ts +12 -0
  79. package/lib/types-esm/decorators/common/exclusiveMaximum.d.ts +70 -0
  80. package/lib/types-esm/decorators/common/exclusiveMinimum.d.ts +70 -0
  81. package/lib/types-esm/decorators/common/format.d.ts +466 -0
  82. package/lib/types-esm/decorators/common/forwardGroups.d.ts +10 -0
  83. package/lib/types-esm/decorators/common/groups.d.ts +12 -0
  84. package/lib/types-esm/decorators/common/hidden.d.ts +32 -0
  85. package/lib/types-esm/decorators/common/ignore.d.ts +59 -0
  86. package/lib/types-esm/decorators/common/integer.d.ts +61 -0
  87. package/lib/types-esm/decorators/common/jsonEntityFn.d.ts +21 -0
  88. package/lib/types-esm/decorators/common/maxLength.d.ts +77 -0
  89. package/lib/types-esm/decorators/common/maximum.d.ts +139 -0
  90. package/lib/types-esm/decorators/common/minLength.d.ts +78 -0
  91. package/lib/types-esm/decorators/common/minimum.d.ts +137 -0
  92. package/lib/types-esm/decorators/common/multipleOf.d.ts +69 -0
  93. package/lib/types-esm/decorators/common/name.d.ts +32 -0
  94. package/lib/types-esm/decorators/common/nullable.d.ts +25 -0
  95. package/lib/types-esm/decorators/common/oneOf.d.ts +17 -0
  96. package/lib/types-esm/decorators/common/optional.d.ts +10 -0
  97. package/lib/types-esm/decorators/common/pattern.d.ts +94 -0
  98. package/lib/types-esm/decorators/common/property.d.ts +11 -0
  99. package/lib/types-esm/decorators/common/readOnly.d.ts +11 -0
  100. package/lib/types-esm/decorators/common/recordOf.d.ts +46 -0
  101. package/lib/types-esm/decorators/common/required.d.ts +44 -0
  102. package/lib/types-esm/decorators/common/requiredGroups.d.ts +10 -0
  103. package/lib/types-esm/decorators/common/schema.d.ts +53 -0
  104. package/lib/types-esm/decorators/common/title.d.ts +39 -0
  105. package/lib/types-esm/decorators/common/typeError.d.ts +8 -0
  106. package/lib/types-esm/decorators/common/writeOnly.d.ts +11 -0
  107. package/lib/types-esm/decorators/config/jsonEntityComponent.d.ts +10 -0
  108. package/lib/types-esm/decorators/generics/genericOf.d.ts +76 -0
  109. package/lib/types-esm/decorators/generics/generics.d.ts +14 -0
  110. package/lib/types-esm/decorators/operations/acceptMime.d.ts +19 -0
  111. package/lib/types-esm/decorators/operations/consumes.d.ts +19 -0
  112. package/lib/types-esm/decorators/operations/contentType.d.ts +20 -0
  113. package/lib/types-esm/decorators/operations/deprecated.d.ts +23 -0
  114. package/lib/types-esm/decorators/operations/header.d.ts +49 -0
  115. package/lib/types-esm/decorators/operations/in.d.ts +64 -0
  116. package/lib/types-esm/decorators/operations/inFile.d.ts +25 -0
  117. package/lib/types-esm/decorators/operations/location.d.ts +22 -0
  118. package/lib/types-esm/decorators/operations/operation.d.ts +60 -0
  119. package/lib/types-esm/decorators/operations/operationId.d.ts +10 -0
  120. package/lib/types-esm/decorators/operations/operationPath.d.ts +21 -0
  121. package/lib/types-esm/decorators/operations/partial.d.ts +10 -0
  122. package/lib/types-esm/decorators/operations/path.d.ts +15 -0
  123. package/lib/types-esm/decorators/operations/produces.d.ts +26 -0
  124. package/lib/types-esm/decorators/operations/publish.d.ts +1 -0
  125. package/lib/types-esm/decorators/operations/redirect.d.ts +52 -0
  126. package/lib/types-esm/decorators/operations/returns.d.ts +267 -0
  127. package/lib/types-esm/decorators/operations/route.d.ts +133 -0
  128. package/lib/types-esm/decorators/operations/security.d.ts +23 -0
  129. package/lib/types-esm/decorators/operations/status.d.ts +127 -0
  130. package/lib/types-esm/decorators/operations/subscribe.d.ts +1 -0
  131. package/lib/types-esm/decorators/operations/summary.d.ts +20 -0
  132. package/lib/types-esm/decorators/operations/tags.d.ts +23 -0
  133. package/lib/types-esm/decorators/operations/view.d.ts +23 -0
  134. package/lib/types-esm/domain/DecoratorContext.d.ts +28 -0
  135. package/lib/types-esm/domain/JsonAliasMap.d.ts +12 -0
  136. package/lib/types-esm/domain/JsonClassStore.d.ts +12 -0
  137. package/lib/types-esm/domain/JsonDiscriminator.d.ts +18 -0
  138. package/lib/types-esm/domain/JsonEntityStore.d.ts +110 -0
  139. package/lib/types-esm/domain/JsonFormatTypes.d.ts +17 -0
  140. package/lib/types-esm/domain/JsonLazyRef.d.ts +9 -0
  141. package/lib/types-esm/domain/JsonMap.d.ts +9 -0
  142. package/lib/types-esm/domain/JsonMedia.d.ts +11 -0
  143. package/lib/types-esm/domain/JsonMethodStore.d.ts +92 -0
  144. package/lib/types-esm/domain/JsonOperation.d.ts +51 -0
  145. package/lib/types-esm/domain/JsonOperationPathsMap.d.ts +7 -0
  146. package/lib/types-esm/domain/JsonOperationRoute.d.ts +25 -0
  147. package/lib/types-esm/domain/JsonParameter.d.ts +22 -0
  148. package/lib/types-esm/domain/JsonParameterStore.d.ts +52 -0
  149. package/lib/types-esm/domain/JsonParameterTypes.d.ts +16 -0
  150. package/lib/types-esm/domain/JsonPropertyStore.d.ts +32 -0
  151. package/lib/types-esm/domain/JsonRequestBody.d.ts +12 -0
  152. package/lib/types-esm/domain/JsonResponse.d.ts +18 -0
  153. package/lib/types-esm/domain/JsonSchema.d.ts +340 -0
  154. package/lib/types-esm/domain/SpecTypes.d.ts +6 -0
  155. package/lib/types-esm/hooks/alterIgnore.d.ts +10 -0
  156. package/lib/types-esm/hooks/alterOneOf.d.ts +3 -0
  157. package/lib/types-esm/hooks/alterRequiredGroups.d.ts +6 -0
  158. package/lib/types-esm/index.d.ts +182 -0
  159. package/lib/types-esm/interfaces/IgnoreCallback.d.ts +4 -0
  160. package/lib/types-esm/interfaces/JsonHookContext.d.ts +17 -0
  161. package/lib/types-esm/interfaces/JsonOpenSpec.d.ts +9 -0
  162. package/lib/types-esm/interfaces/JsonSchemaOptions.d.ts +30 -0
  163. package/lib/types-esm/registries/JsonSchemaMapperContainer.d.ts +21 -0
  164. package/lib/types-esm/registries/enumRegistries.d.ts +2 -0
  165. package/lib/types-esm/utils/buildPath.d.ts +6 -0
  166. package/lib/types-esm/utils/concatParameters.d.ts +4 -0
  167. package/lib/types-esm/utils/concatPath.d.ts +1 -0
  168. package/lib/types-esm/utils/defineStatusModel.d.ts +3 -0
  169. package/lib/types-esm/utils/from.d.ts +190 -0
  170. package/lib/types-esm/utils/generateSpec.d.ts +16 -0
  171. package/lib/types-esm/utils/generics.d.ts +50 -0
  172. package/lib/types-esm/utils/getComputedType.d.ts +5 -0
  173. package/lib/types-esm/utils/getInheritedStores.d.ts +8 -0
  174. package/lib/types-esm/utils/getJsonEntityStore.d.ts +15 -0
  175. package/lib/types-esm/utils/getJsonPathParameters.d.ts +7 -0
  176. package/lib/types-esm/utils/getJsonSchema.d.ts +4 -0
  177. package/lib/types-esm/utils/getJsonType.d.ts +5 -0
  178. package/lib/types-esm/utils/getOperationsRoutes.d.ts +10 -0
  179. package/lib/types-esm/utils/getOperationsStores.d.ts +6 -0
  180. package/lib/types-esm/utils/getPropertiesStores.d.ts +20 -0
  181. package/lib/types-esm/utils/getSpec.d.ts +34 -0
  182. package/lib/types-esm/utils/getSpecType.d.ts +12 -0
  183. package/lib/types-esm/utils/isSuccessStatus.d.ts +2 -0
  184. package/lib/types-esm/utils/mapHeaders.d.ts +9 -0
  185. package/lib/types-esm/utils/mapOpenSpec.d.ts +10 -0
  186. package/lib/types-esm/utils/mapOpenSpec2.d.ts +9 -0
  187. package/lib/types-esm/utils/mapOpenSpec3.d.ts +8 -0
  188. package/lib/types-esm/utils/mapOpenSpecInfo.d.ts +6 -0
  189. package/lib/types-esm/utils/mapOperationOptions.d.ts +5 -0
  190. package/lib/types-esm/utils/matchGroups.d.ts +4 -0
  191. package/lib/types-esm/utils/mergeSpec.d.ts +23 -0
  192. package/lib/types-esm/utils/operationIdFormatter.d.ts +6 -0
  193. package/lib/types-esm/utils/ref.d.ts +14 -0
  194. package/lib/types-esm/utils/removeHiddenOperation.d.ts +2 -0
  195. package/lib/types-esm/utils/serializeEnumValues.d.ts +5 -0
  196. package/lib/types-esm/utils/somethingOf.d.ts +1 -0
  197. package/lib/types-esm/utils/toJsonMapCollection.d.ts +7 -0
  198. package/lib/types-esm/utils/toJsonRegex.d.ts +5 -0
  199. package/lib/types-esm/utils/transformToOS2.d.ts +25 -0
  200. package/lib/types-esm/utils/withErrorMsg.d.ts +6 -0
  201. package/package.json +21 -17
  202. package/vitest.config.mts +21 -0
  203. package/jest.config.js +0 -21
  204. package/lib/cjs/package.json +0 -3
  205. package/lib/esm/package.json +0 -3
  206. package/tsconfig.esm.json +0 -36
@@ -0,0 +1,77 @@
1
+ /**
2
+ * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
3
+ *
4
+ * The length of a string instance is defined as the number of its characters as defined by [RFC 7159](http://json-schema.org/latest/json-schema-validation.html#RFC7159).
5
+ *
6
+ * ::: warning
7
+ * The value of maxLength MUST be a non-negative integer.
8
+ * :::
9
+ *
10
+ * ::: tip
11
+ * Omitting this keyword has the same behavior as a value of 0.
12
+ * :::
13
+ *
14
+ * ::: warning
15
+ * For v6 user, use @@MaxLength@@ from @tsed/schema instead of @tsed/common.
16
+ * :::
17
+ *
18
+ * ## Example
19
+ * ### With primitive type
20
+ *
21
+ * ```typescript
22
+ * class Model {
23
+ * @MaxLength(10)
24
+ * property: number;
25
+ * }
26
+ * ```
27
+ *
28
+ * Will produce:
29
+ *
30
+ * ```json
31
+ * {
32
+ * "type": "object",
33
+ * "properties": {
34
+ * "property": {
35
+ * "type": "string",
36
+ * "maxLength": 10
37
+ * }
38
+ * }
39
+ * }
40
+ * ```
41
+ *
42
+ * ### With array type
43
+ *
44
+ * ```typescript
45
+ * class Model {
46
+ * @MaxLength(10)
47
+ * @CollectionOf(String)
48
+ * property: string[];
49
+ * }
50
+ * ```
51
+ *
52
+ * Will produce:
53
+ *
54
+ * ```json
55
+ * {
56
+ * "type": "object",
57
+ * "properties": {
58
+ * "property": {
59
+ * "type": "array",
60
+ * "items": {
61
+ * "type": "string",
62
+ * "maxLength": 10
63
+ * }
64
+ * }
65
+ * }
66
+ * }
67
+ * ```
68
+ *
69
+ * @param {number} maxLength The maximum length allowed
70
+ * @decorator
71
+ * @validation
72
+ * @swagger
73
+ * @schema
74
+ * @input
75
+ * @ajv-errors
76
+ */
77
+ export declare const MaxLength: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(maxLength: number) => (...args: any[]) => any>;
@@ -0,0 +1,139 @@
1
+ /**
2
+ * The value of `maximum` MUST be a number, representing an inclusive upper limit for a numeric instance.
3
+ *
4
+ * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
5
+ *
6
+ * ::: warning
7
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
8
+ * :::
9
+ *
10
+ * ## Example
11
+ * ### With primitive type
12
+ *
13
+ * ```typescript
14
+ * class Model {
15
+ * @Maximum(10)
16
+ * property: number;
17
+ * }
18
+ * ```
19
+ *
20
+ * Will produce:
21
+ *
22
+ * ```json
23
+ * {
24
+ * "type": "object",
25
+ * "properties": {
26
+ * "property": {
27
+ * "type": "number",
28
+ * "maximum": 10
29
+ * }
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * ### With array type
35
+ *
36
+ * ```typescript
37
+ * class Model {
38
+ * @Maximum(10)
39
+ * @CollectionOf(Number)
40
+ * property: number[];
41
+ * }
42
+ * ```
43
+ *
44
+ * Will produce:
45
+ *
46
+ * ```json
47
+ * {
48
+ * "type": "object",
49
+ * "properties": {
50
+ * "property": {
51
+ * "type": "array",
52
+ * "items": {
53
+ * "type": "number",
54
+ * "maximum": 10
55
+ * }
56
+ * }
57
+ * }
58
+ * }
59
+ * ```
60
+ *
61
+ * @param {number} maximum The maximum value allowed
62
+ * @param {boolean} exclusive Same effect as ExclusiveMaximum decorator.
63
+ * @decorator
64
+ * @validation
65
+ * @swagger
66
+ * @schema
67
+ * @input
68
+ * @ajv-errors
69
+ */
70
+ export declare const Maximum: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(maximum: number, exclusive?: boolean) => (...args: any[]) => any>;
71
+ /**
72
+ * The value of `maximum` MUST be a number, representing an inclusive upper limit for a numeric instance.
73
+ *
74
+ * If the instance is a number, then this keyword validates only if the instance is less than or exactly equal to `maximum`.
75
+ *
76
+ * ::: warning
77
+ * For v6 user, use @@Maximum@@ from @tsed/schema instead of @tsed/common.
78
+ * :::
79
+ *
80
+ * ## Example
81
+ * ### With primitive type
82
+ *
83
+ * ```typescript
84
+ * class Model {
85
+ * @Max(10)
86
+ * property: number;
87
+ * }
88
+ * ```
89
+ *
90
+ * Will produce:
91
+ *
92
+ * ```json
93
+ * {
94
+ * "type": "object",
95
+ * "properties": {
96
+ * "property": {
97
+ * "type": "number",
98
+ * "maximum": 10
99
+ * }
100
+ * }
101
+ * }
102
+ * ```
103
+ *
104
+ * ### With array type
105
+ *
106
+ * ```typescript
107
+ * class Model {
108
+ * @Max(10)
109
+ * @CollectionOf(Number)
110
+ * property: number[];
111
+ * }
112
+ * ```
113
+ *
114
+ * Will produce:
115
+ *
116
+ * ```json
117
+ * {
118
+ * "type": "object",
119
+ * "properties": {
120
+ * "property": {
121
+ * "type": "array",
122
+ * "items": {
123
+ * "type": "number",
124
+ * "maximum": 10
125
+ * }
126
+ * }
127
+ * }
128
+ * }
129
+ * ```
130
+ *
131
+ * @param {number} maximum The maximum value allowed
132
+ * @param {boolean} exclusive Same effect as ExclusiveMaximum decorator.
133
+ * @decorator
134
+ * @validation
135
+ * @swagger
136
+ * @schema
137
+ * @input
138
+ */
139
+ export declare const Max: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(maximum: number, exclusive?: boolean) => (...args: any[]) => any>;
@@ -0,0 +1,78 @@
1
+ /**
2
+ *
3
+ * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
4
+ *
5
+ * The length of a string instance is defined as the number of its characters as defined by [RFC 7159](http://json-schema.org/latest/json-schema-validation.html#RFC7159).
6
+ *
7
+ * ::: warning
8
+ * The value of minLength MUST be a non-negative integer.
9
+ * :::
10
+ *
11
+ * ::: tip
12
+ * Omitting this keyword has the same behavior as a value of 0.
13
+ * :::
14
+ *
15
+ * ::: warning
16
+ * For v6 user, use @@MinLength@@ from @tsed/schema instead of @tsed/common.
17
+ * :::
18
+ *
19
+ * ## Example
20
+ * ### With primitive type
21
+ *
22
+ * ```typescript
23
+ * class Model {
24
+ * @MinLength(10)
25
+ * property: number;
26
+ * }
27
+ * ```
28
+ *
29
+ * Will produce:
30
+ *
31
+ * ```json
32
+ * {
33
+ * "type": "object",
34
+ * "properties": {
35
+ * "property": {
36
+ * "type": "string",
37
+ * "maxLength": 10
38
+ * }
39
+ * }
40
+ * }
41
+ * ```
42
+ *
43
+ * ### With array type
44
+ *
45
+ * ```typescript
46
+ * class Model {
47
+ * @MinLength(10)
48
+ * @CollectionOf(String)
49
+ * property: string[];
50
+ * }
51
+ * ```
52
+ *
53
+ * Will produce:
54
+ *
55
+ * ```json
56
+ * {
57
+ * "type": "object",
58
+ * "properties": {
59
+ * "property": {
60
+ * "type": "array",
61
+ * "items": {
62
+ * "type": "string",
63
+ * "minLength": 10
64
+ * }
65
+ * }
66
+ * }
67
+ * }
68
+ * ```
69
+ *
70
+ * @param {number} minLength
71
+ * @decorator
72
+ * @validation
73
+ * @swagger
74
+ * @schema
75
+ * @input
76
+ * @ajv-errors
77
+ */
78
+ export declare const MinLength: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(minLength: number) => (...args: any[]) => any>;
@@ -0,0 +1,137 @@
1
+ /**
2
+ * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
3
+ *
4
+ * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.
5
+ *
6
+ * ::: warning
7
+ * This decorator will be removed in v7.
8
+ * For v6 user, use @@Minimum@@ from @tsed/schema instead of @tsed/common.
9
+ * :::
10
+ *
11
+ * ## Example
12
+ * ### With primitive type
13
+ *
14
+ * ```typescript
15
+ * class Model {
16
+ * @Minimum(10)
17
+ * property: number;
18
+ * }
19
+ * ```
20
+ *
21
+ * Will produce:
22
+ *
23
+ * ```json
24
+ * {
25
+ * "type": "object",
26
+ * "properties": {
27
+ * "property": {
28
+ * "type": "number",
29
+ * "minimum": 10
30
+ * }
31
+ * }
32
+ * }
33
+ * ```
34
+ *
35
+ * ### With array type
36
+ *
37
+ * ```typescript
38
+ * class Model {
39
+ * @Minimum(10)
40
+ * @CollectionOf(Number)
41
+ * property: number[];
42
+ * }
43
+ * ```
44
+ *
45
+ * Will produce:
46
+ *
47
+ * ```json
48
+ * {
49
+ * "type": "object",
50
+ * "properties": {
51
+ * "property": {
52
+ * "type": "array",
53
+ * "items": {
54
+ * "type": "number",
55
+ * "minimum": 10
56
+ * }
57
+ * }
58
+ * }
59
+ * }
60
+ * ```
61
+ *
62
+ * @param {number} minimum The minimum value allowed
63
+ * @param {boolean} exclusive
64
+ * @decorator
65
+ * @validation
66
+ * @swagger
67
+ * @schema
68
+ * @input
69
+ * @ajv-errors
70
+ */
71
+ export declare const Minimum: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(minimum: number, exclusive?: boolean) => (...args: any[]) => any>;
72
+ /**
73
+ * The value of `minimum` MUST be a number, representing an inclusive upper limit for a numeric instance.
74
+ *
75
+ * If the instance is a number, then this keyword validates only if the instance is greater than or exactly equal to `minimum`.
76
+ *
77
+ * ## Example
78
+ * ### With primitive type
79
+ *
80
+ * ```typescript
81
+ * class Model {
82
+ * @Min(10)
83
+ * property: number;
84
+ * }
85
+ * ```
86
+ *
87
+ * Will produce:
88
+ *
89
+ * ```json
90
+ * {
91
+ * "type": "object",
92
+ * "properties": {
93
+ * "property": {
94
+ * "type": "number",
95
+ * "minimum": 10
96
+ * }
97
+ * }
98
+ * }
99
+ * ```
100
+ *
101
+ * ### With array type
102
+ *
103
+ * ```typescript
104
+ * class Model {
105
+ * @Min(10)
106
+ * @CollectionOf(Number)
107
+ * property: number[];
108
+ * }
109
+ * ```
110
+ *
111
+ * Will produce:
112
+ *
113
+ * ```json
114
+ * {
115
+ * "type": "object",
116
+ * "properties": {
117
+ * "property": {
118
+ * "type": "array",
119
+ * "items": {
120
+ * "type": "number",
121
+ * "minimum": 10
122
+ * }
123
+ * }
124
+ * }
125
+ * }
126
+ * ```
127
+ *
128
+ * @alias Minimum
129
+ * @param minimum The minimum value allowed
130
+ * @param exclusive
131
+ * @decorator
132
+ * @validation
133
+ * @swagger
134
+ * @schema
135
+ * @input
136
+ */
137
+ export declare const Min: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(minimum: number, exclusive?: boolean) => (...args: any[]) => any>;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * A numeric instance is valid only if division by this keyword's value results in an integer.
3
+ *
4
+ * ::: warning
5
+ * The value of `multipleOf` MUST be a number, strictly greater than 0.
6
+ * :::
7
+ *
8
+ * ::: warning
9
+ * For v6 user, use @@MultipleOf@@ from @tsed/schema instead of @tsed/common.
10
+ * :::
11
+ *
12
+ * ## Example
13
+ * ### With primitive type
14
+ *
15
+ * ```typescript
16
+ * class Model {
17
+ * @MultipleOf(2)
18
+ * property: Number;
19
+ * }
20
+ * ```
21
+ *
22
+ * ```json
23
+ * {
24
+ * "type": "object",
25
+ * "properties": {
26
+ * "property": {
27
+ * "type": "number",
28
+ * "multipleOf": 2
29
+ * }
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * ### With array type
35
+ *
36
+ * ```typescript
37
+ * class Model {
38
+ * @CollectionOf(number)
39
+ * @MultipleOf(2)
40
+ * property: number[];
41
+ * }
42
+ * ```
43
+ *
44
+ * Will produce:
45
+ *
46
+ * ```json
47
+ * {
48
+ * "type": "object",
49
+ * "properties": {
50
+ * "property": {
51
+ * "type": "array",
52
+ * "items": {
53
+ * "type": "number",
54
+ * "multipleOf": 2
55
+ * }
56
+ * }
57
+ * }
58
+ * }
59
+ * ```
60
+ *
61
+ * @param {number} multipleOf The multiple value allowed
62
+ * @decorator
63
+ * @validation
64
+ * @swagger
65
+ * @schema
66
+ * @input
67
+ * @ajv-errors
68
+ */
69
+ export declare const MultipleOf: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(multipleOf: number) => (...args: any[]) => any>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Add a name metadata on the decorated element.
3
+ *
4
+ * ## Examples
5
+ * ### On parameters
6
+ *
7
+ * ```typescript
8
+ * async myMethod(@Name("nameOf") @PathParams("id") id: string): Promise<Model> {
9
+ *
10
+ * }
11
+ * ```
12
+ *
13
+ * ### On parameters
14
+ *
15
+ * ```typescript
16
+ * @Name("AliasName")
17
+ * @Controller("/")
18
+ * class ModelCtrl {
19
+ *
20
+ * }
21
+ * ```
22
+ *
23
+ * @param name
24
+ * @decorator
25
+ * @validation
26
+ * @swagger
27
+ * @schema
28
+ * @input
29
+ * @classDecorator
30
+ * @operation
31
+ */
32
+ export declare function Name(name: any): (...args: any[]) => any;
@@ -0,0 +1,25 @@
1
+ import { Type } from "@tsed/core";
2
+ import type { JSONSchema6TypeName } from "json-schema";
3
+ /**
4
+ * Set field as nullable.
5
+ *
6
+ * ## Example
7
+ *
8
+ * ```typescript
9
+ * class Model {
10
+ * @Nullable(Date)
11
+ * property: Date | null;
12
+ *
13
+ * @Nullable(String, Number, Boolean)
14
+ * property: string | number | boolean | null;
15
+ * }
16
+ * ```
17
+ *
18
+ * @returns {Function}
19
+ * @decorator
20
+ * @validation
21
+ * @swagger
22
+ * @schema
23
+ * @input
24
+ */
25
+ export declare function Nullable(type: JSONSchema6TypeName | Type<any> | any, ...types: (JSONSchema6TypeName | Type<any> | any)[]): any;
@@ -0,0 +1,17 @@
1
+ import { AnyJsonSchema } from "../../domain/JsonSchema.js";
2
+ /**
3
+ * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
4
+ *
5
+ * ::: warning
6
+ * OneOf isn't supported by OS2
7
+ * :::
8
+ *
9
+ * @decorator
10
+ * @validation
11
+ * @swagger
12
+ * @schema
13
+ * @classDecorator
14
+ * @input
15
+ * @param oneOf
16
+ */
17
+ export declare function OneOf(...oneOf: AnyJsonSchema[]): (...args: any[]) => any;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Add optional annotation on Property or Parameter.
3
+ *
4
+ * @decorator
5
+ * @validation
6
+ * @swagger
7
+ * @schema
8
+ * @input
9
+ */
10
+ export declare function Optional(): (...args: any[]) => any;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The pattern and Pattern Properties keywords use regular expressions to express constraints.
3
+ * 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.
4
+ *
5
+ * ::: warning
6
+ * For v6 user, use @@Pattern@@ from @tsed/schema instead of @tsed/common.
7
+ * :::
8
+ *
9
+ * A single unicode character (other than the special characters below) matches itself.
10
+ *
11
+ * * `^`: Matches only at the beginning of the string.
12
+ * * `$`: Matches only at the end of the string.
13
+ * * `(...)`: Group a series of regular expressions into a single regular expression.
14
+ * * `|`: Matches either the regular expression preceding or following the | symbol.
15
+ * * `[abc]`: Matches any of the characters inside the square brackets.
16
+ * * `[a-z]`: Matches the range of characters.
17
+ * * `[^abc]`: Matches any character not listed.
18
+ * * `[^a-z]`: Matches any character outside of the range.
19
+ * * `+`: Matches one or more repetitions of the preceding regular expression.
20
+ * * `*`: Matches zero or more repetitions of the preceding regular expression.
21
+ * * `?`: Matches zero or one repetitions of the preceding regular expression.
22
+ * * `+?`, *?`, ??`: The `*`, `+`, and `?` qualifiers are all greedy; they match as much text as possible. Sometimes this behavior isn’t desired and you want to match as few characters as possible.
23
+ * * `{x}`: Match exactly x occurrences of the preceding regular expression.
24
+ * * `{x,y}`: Match at least x and at most y occurrences of the preceding regular expression.
25
+ * * `{x,}`: Match x occurrences or more of the preceding regular expression.
26
+ * * `{x}?`, {x,y}?, {x,}?`: Lazy versions of the above expressions.
27
+ *
28
+ * ## Example
29
+ *
30
+ * ```typescript
31
+ * class Model {
32
+ * @Pattern("^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$")
33
+ * @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
34
+ * property: string;
35
+ * }
36
+ * ```
37
+ *
38
+ * ### With primitive type
39
+ *
40
+ * ```typescript
41
+ * class Model {
42
+ * @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
43
+ * property: string;
44
+ * }
45
+ * ```
46
+ *
47
+ * ```json
48
+ * {
49
+ * "type": "object",
50
+ * "properties": {
51
+ * "property": {
52
+ * "type": "string",
53
+ * "pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
54
+ * }
55
+ * }
56
+ * }
57
+ * ```
58
+ *
59
+ * ### With array type
60
+ *
61
+ * ```typescript
62
+ * class Model {
63
+ * @CollectionOf(string)
64
+ * @Pattern(/^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$/)
65
+ * property: string[];
66
+ * }
67
+ * ```
68
+ *
69
+ * Will produce:
70
+ *
71
+ * ```json
72
+ * {
73
+ * "type": "object",
74
+ * "properties": {
75
+ * "property": {
76
+ * "type": "array",
77
+ * "items": {
78
+ * "type": "string",
79
+ * "pattern": "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
80
+ * }
81
+ * }
82
+ * }
83
+ * }
84
+ * ```
85
+ *
86
+ * @param {string} pattern
87
+ * @decorator
88
+ * @validation
89
+ * @swagger
90
+ * @schema
91
+ * @input
92
+ * @ajv-errors
93
+ */
94
+ export declare const Pattern: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(pattern: string | RegExp) => (...args: any[]) => any>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Declare a new property on a model.
3
+ *
4
+ * @param type
5
+ * @decorator
6
+ * @validation
7
+ * @swagger
8
+ * @schema
9
+ * @input
10
+ */
11
+ export declare function Property(type?: any): (...args: any[]) => any;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Set the property as readOnly.
3
+ *
4
+ * @returns {Function}
5
+ * @decorator
6
+ * @validation
7
+ * @property
8
+ * @parameter
9
+ * @schema
10
+ */
11
+ export declare function ReadOnly(readOnly?: boolean): (...args: any[]) => any;