@tsed/schema 7.0.0-beta.3 → 7.0.0-beta.6

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 (304) hide show
  1. package/jest.config.js +4 -4
  2. package/lib/cjs/components/schemaMapper.js +1 -1
  3. package/lib/cjs/components/schemaMapper.js.map +1 -1
  4. package/lib/cjs/constants/httpStatusMessages.js +12 -96
  5. package/lib/cjs/constants/httpStatusMessages.js.map +1 -1
  6. package/lib/cjs/decorators/common/anyOf.js +4 -0
  7. package/lib/cjs/decorators/common/anyOf.js.map +1 -1
  8. package/lib/cjs/decorators/common/description.js.map +1 -1
  9. package/lib/cjs/decorators/common/enum.js +1 -20
  10. package/lib/cjs/decorators/common/enum.js.map +1 -1
  11. package/lib/cjs/decorators/common/ignore.js.map +1 -1
  12. package/lib/cjs/decorators/common/jsonEntityFn.js.map +1 -1
  13. package/lib/cjs/decorators/common/oneOf.js +4 -0
  14. package/lib/cjs/decorators/common/oneOf.js.map +1 -1
  15. package/lib/cjs/decorators/common/recordOf.js +63 -0
  16. package/lib/cjs/decorators/common/recordOf.js.map +1 -0
  17. package/lib/cjs/decorators/operations/acceptMime.js +28 -0
  18. package/lib/cjs/decorators/operations/acceptMime.js.map +1 -0
  19. package/lib/cjs/decorators/operations/in.js +6 -4
  20. package/lib/cjs/decorators/operations/in.js.map +1 -1
  21. package/lib/cjs/decorators/operations/view.js +31 -0
  22. package/lib/cjs/decorators/operations/view.js.map +1 -0
  23. package/lib/cjs/domain/DecoratorContext.js.map +1 -1
  24. package/lib/cjs/domain/JsonClassStore.js +1 -1
  25. package/lib/cjs/domain/JsonMap.js.map +1 -1
  26. package/lib/cjs/domain/JsonMethodStore.js +66 -24
  27. package/lib/cjs/domain/JsonMethodStore.js.map +1 -1
  28. package/lib/cjs/domain/JsonOperation.js +11 -26
  29. package/lib/cjs/domain/JsonOperation.js.map +1 -1
  30. package/lib/cjs/domain/JsonOperationRoute.js +4 -0
  31. package/lib/cjs/domain/JsonOperationRoute.js.map +1 -1
  32. package/lib/cjs/domain/JsonParameter.js +38 -44
  33. package/lib/cjs/domain/JsonParameter.js.map +1 -1
  34. package/lib/cjs/domain/JsonParameterStore.js +14 -5
  35. package/lib/cjs/domain/JsonParameterStore.js.map +1 -1
  36. package/lib/cjs/domain/JsonPropertyStore.js +6 -2
  37. package/lib/cjs/domain/JsonPropertyStore.js.map +1 -1
  38. package/lib/cjs/domain/JsonResponse.js +1 -11
  39. package/lib/cjs/domain/JsonResponse.js.map +1 -1
  40. package/lib/cjs/domain/JsonSchema.js +47 -54
  41. package/lib/cjs/domain/JsonSchema.js.map +1 -1
  42. package/lib/cjs/domain/SpecTypes.js +1 -0
  43. package/lib/cjs/domain/SpecTypes.js.map +1 -1
  44. package/lib/cjs/index.js +150 -20
  45. package/lib/cjs/index.js.map +1 -1
  46. package/lib/cjs/interfaces/JsonSchemaOptions.js.map +1 -1
  47. package/lib/cjs/package.json +3 -0
  48. package/lib/cjs/utils/from.js +9 -8
  49. package/lib/cjs/utils/from.js.map +1 -1
  50. package/lib/cjs/utils/generateSpec.js +46 -0
  51. package/lib/cjs/utils/generateSpec.js.map +1 -0
  52. package/lib/cjs/utils/generics.js.map +1 -1
  53. package/lib/cjs/utils/getJsonSchema.js +11 -1
  54. package/lib/cjs/utils/getJsonSchema.js.map +1 -1
  55. package/lib/cjs/utils/getJsonType.js +1 -1
  56. package/lib/cjs/utils/getJsonType.js.map +1 -1
  57. package/lib/cjs/utils/getOperationsRoutes.js +2 -1
  58. package/lib/cjs/utils/getOperationsRoutes.js.map +1 -1
  59. package/lib/cjs/utils/getSpec.js +58 -43
  60. package/lib/cjs/utils/getSpec.js.map +1 -1
  61. package/lib/cjs/utils/getSpecType.js +21 -0
  62. package/lib/cjs/utils/getSpecType.js.map +1 -0
  63. package/lib/cjs/utils/mapNullableType.js +1 -1
  64. package/lib/cjs/utils/mapNullableType.js.map +1 -1
  65. package/lib/cjs/utils/mapOpenSpec.js +41 -0
  66. package/lib/cjs/utils/mapOpenSpec.js.map +1 -0
  67. package/lib/cjs/utils/mapOpenSpec2.js +34 -0
  68. package/lib/cjs/utils/mapOpenSpec2.js.map +1 -0
  69. package/lib/cjs/utils/mapOpenSpec3.js +26 -0
  70. package/lib/cjs/utils/mapOpenSpec3.js.map +1 -0
  71. package/lib/cjs/utils/mapOpenSpecInfo.js +21 -0
  72. package/lib/cjs/utils/mapOpenSpecInfo.js.map +1 -0
  73. package/lib/cjs/utils/matchGroups.js +1 -1
  74. package/lib/cjs/utils/matchGroups.js.map +1 -1
  75. package/lib/cjs/utils/mergeOperation.js +1 -0
  76. package/lib/cjs/utils/mergeOperation.js.map +1 -1
  77. package/lib/cjs/utils/mergeSpec.js.map +1 -1
  78. package/lib/cjs/utils/serializeEnumValues.js +26 -0
  79. package/lib/cjs/utils/serializeEnumValues.js.map +1 -0
  80. package/lib/cjs/utils/transformToOS2.js +510 -0
  81. package/lib/cjs/utils/transformToOS2.js.map +1 -0
  82. package/lib/esm/components/anyMapper.js +4 -4
  83. package/lib/esm/components/classMapper.js +4 -4
  84. package/lib/esm/components/genericsMapper.js +4 -4
  85. package/lib/esm/components/inheritedClassMapper.js +2 -2
  86. package/lib/esm/components/itemMapper.js +1 -1
  87. package/lib/esm/components/lazyRefMapper.js +3 -3
  88. package/lib/esm/components/mapMapper.js +2 -2
  89. package/lib/esm/components/objectMapper.js +3 -3
  90. package/lib/esm/components/ofMapper.js +1 -1
  91. package/lib/esm/components/propertiesMapper.js +1 -1
  92. package/lib/esm/components/schemaMapper.js +7 -7
  93. package/lib/esm/components/schemaMapper.js.map +1 -1
  94. package/lib/esm/constants/httpStatusMessages.js +11 -96
  95. package/lib/esm/constants/httpStatusMessages.js.map +1 -1
  96. package/lib/esm/decorators/class/children.js +1 -1
  97. package/lib/esm/decorators/collections/collectionContains.js +1 -1
  98. package/lib/esm/decorators/collections/collectionOf.js +1 -1
  99. package/lib/esm/decorators/collections/maxItems.js +1 -1
  100. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  101. package/lib/esm/decorators/collections/minItems.js +1 -1
  102. package/lib/esm/decorators/collections/minProperties.js +1 -1
  103. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  104. package/lib/esm/decorators/common/additionalProperties.js +1 -1
  105. package/lib/esm/decorators/common/allOf.js +1 -1
  106. package/lib/esm/decorators/common/allow.js +2 -2
  107. package/lib/esm/decorators/common/any.js +1 -1
  108. package/lib/esm/decorators/common/anyOf.js +5 -1
  109. package/lib/esm/decorators/common/anyOf.js.map +1 -1
  110. package/lib/esm/decorators/common/const.js +1 -1
  111. package/lib/esm/decorators/common/customKey.js +1 -1
  112. package/lib/esm/decorators/common/default.js +1 -1
  113. package/lib/esm/decorators/common/description.js +1 -1
  114. package/lib/esm/decorators/common/description.js.map +1 -1
  115. package/lib/esm/decorators/common/enum.js +2 -21
  116. package/lib/esm/decorators/common/enum.js.map +1 -1
  117. package/lib/esm/decorators/common/example.js +1 -1
  118. package/lib/esm/decorators/common/examples.js +1 -1
  119. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  120. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  121. package/lib/esm/decorators/common/format.js +2 -2
  122. package/lib/esm/decorators/common/forwardGroups.js +1 -1
  123. package/lib/esm/decorators/common/groups.js +2 -2
  124. package/lib/esm/decorators/common/ignore.js +1 -1
  125. package/lib/esm/decorators/common/ignore.js.map +1 -1
  126. package/lib/esm/decorators/common/integer.js +1 -1
  127. package/lib/esm/decorators/common/jsonEntityFn.js +1 -1
  128. package/lib/esm/decorators/common/jsonEntityFn.js.map +1 -1
  129. package/lib/esm/decorators/common/maxLength.js +1 -1
  130. package/lib/esm/decorators/common/maximum.js +1 -1
  131. package/lib/esm/decorators/common/minLength.js +1 -1
  132. package/lib/esm/decorators/common/minimum.js +1 -1
  133. package/lib/esm/decorators/common/multipleOf.js +1 -1
  134. package/lib/esm/decorators/common/name.js +1 -1
  135. package/lib/esm/decorators/common/nullable.js +2 -2
  136. package/lib/esm/decorators/common/oneOf.js +5 -1
  137. package/lib/esm/decorators/common/oneOf.js.map +1 -1
  138. package/lib/esm/decorators/common/optional.js +1 -1
  139. package/lib/esm/decorators/common/pattern.js +1 -1
  140. package/lib/esm/decorators/common/property.js +1 -1
  141. package/lib/esm/decorators/common/readOnly.js +1 -1
  142. package/lib/esm/decorators/common/recordOf.js +59 -0
  143. package/lib/esm/decorators/common/recordOf.js.map +1 -0
  144. package/lib/esm/decorators/common/required.js +2 -2
  145. package/lib/esm/decorators/common/requiredGroups.js +2 -2
  146. package/lib/esm/decorators/common/schema.js +1 -1
  147. package/lib/esm/decorators/common/title.js +1 -1
  148. package/lib/esm/decorators/common/writeOnly.js +1 -1
  149. package/lib/esm/decorators/config/jsonEntityComponent.js +1 -1
  150. package/lib/esm/decorators/generics/genericOf.js +2 -2
  151. package/lib/esm/decorators/generics/generics.js +1 -1
  152. package/lib/esm/decorators/operations/acceptMime.js +24 -0
  153. package/lib/esm/decorators/operations/acceptMime.js.map +1 -0
  154. package/lib/esm/decorators/operations/consumes.js +1 -1
  155. package/lib/esm/decorators/operations/contentType.js +1 -1
  156. package/lib/esm/decorators/operations/deprecated.js +1 -1
  157. package/lib/esm/decorators/operations/header.js +1 -1
  158. package/lib/esm/decorators/operations/in.js +3 -1
  159. package/lib/esm/decorators/operations/in.js.map +1 -1
  160. package/lib/esm/decorators/operations/inFile.js +5 -5
  161. package/lib/esm/decorators/operations/location.js +1 -1
  162. package/lib/esm/decorators/operations/operationId.js +1 -1
  163. package/lib/esm/decorators/operations/operationPath.js +1 -1
  164. package/lib/esm/decorators/operations/partial.js +1 -1
  165. package/lib/esm/decorators/operations/path.js +1 -1
  166. package/lib/esm/decorators/operations/produces.js +1 -1
  167. package/lib/esm/decorators/operations/redirect.js +2 -2
  168. package/lib/esm/decorators/operations/returns.js +8 -8
  169. package/lib/esm/decorators/operations/route.js +3 -3
  170. package/lib/esm/decorators/operations/security.js +1 -1
  171. package/lib/esm/decorators/operations/status.js +1 -1
  172. package/lib/esm/decorators/operations/summary.js +1 -1
  173. package/lib/esm/decorators/operations/tags.js +1 -1
  174. package/lib/esm/decorators/operations/view.js +27 -0
  175. package/lib/esm/decorators/operations/view.js.map +1 -0
  176. package/lib/esm/domain/DecoratorContext.js +1 -1
  177. package/lib/esm/domain/DecoratorContext.js.map +1 -1
  178. package/lib/esm/domain/JsonClassStore.js +3 -3
  179. package/lib/esm/domain/JsonLazyRef.js +2 -2
  180. package/lib/esm/domain/JsonMap.js +1 -1
  181. package/lib/esm/domain/JsonMap.js.map +1 -1
  182. package/lib/esm/domain/JsonMethodStore.js +68 -26
  183. package/lib/esm/domain/JsonMethodStore.js.map +1 -1
  184. package/lib/esm/domain/JsonOperation.js +10 -25
  185. package/lib/esm/domain/JsonOperation.js.map +1 -1
  186. package/lib/esm/domain/JsonOperationPathsMap.js +1 -1
  187. package/lib/esm/domain/JsonOperationRoute.js +5 -1
  188. package/lib/esm/domain/JsonOperationRoute.js.map +1 -1
  189. package/lib/esm/domain/JsonParameter.js +42 -48
  190. package/lib/esm/domain/JsonParameter.js.map +1 -1
  191. package/lib/esm/domain/JsonParameterStore.js +17 -8
  192. package/lib/esm/domain/JsonParameterStore.js.map +1 -1
  193. package/lib/esm/domain/JsonPropertyStore.js +7 -3
  194. package/lib/esm/domain/JsonPropertyStore.js.map +1 -1
  195. package/lib/esm/domain/JsonRequestBody.js +2 -2
  196. package/lib/esm/domain/JsonResponse.js +4 -14
  197. package/lib/esm/domain/JsonResponse.js.map +1 -1
  198. package/lib/esm/domain/JsonSchema.js +9 -16
  199. package/lib/esm/domain/JsonSchema.js.map +1 -1
  200. package/lib/esm/domain/SpecTypes.js +1 -0
  201. package/lib/esm/domain/SpecTypes.js.map +1 -1
  202. package/lib/esm/index.js +150 -20
  203. package/lib/esm/index.js.map +1 -1
  204. package/lib/esm/interfaces/JsonSchemaOptions.js.map +1 -1
  205. package/lib/esm/package.json +3 -0
  206. package/lib/esm/utils/from.js +5 -4
  207. package/lib/esm/utils/from.js.map +1 -1
  208. package/lib/esm/utils/generateSpec.js +41 -0
  209. package/lib/esm/utils/generateSpec.js.map +1 -0
  210. package/lib/esm/utils/generics.js.map +1 -1
  211. package/lib/esm/utils/getInheritedStores.js +1 -1
  212. package/lib/esm/utils/getJsonEntityStore.js +5 -5
  213. package/lib/esm/utils/getJsonSchema.js +14 -4
  214. package/lib/esm/utils/getJsonSchema.js.map +1 -1
  215. package/lib/esm/utils/getJsonType.js +2 -2
  216. package/lib/esm/utils/getJsonType.js.map +1 -1
  217. package/lib/esm/utils/getOperationsRoutes.js +5 -4
  218. package/lib/esm/utils/getOperationsRoutes.js.map +1 -1
  219. package/lib/esm/utils/getOperationsStores.js +4 -4
  220. package/lib/esm/utils/getPropertiesStores.js +3 -3
  221. package/lib/esm/utils/getRequiredProperties.js +1 -1
  222. package/lib/esm/utils/getSpec.js +65 -50
  223. package/lib/esm/utils/getSpec.js.map +1 -1
  224. package/lib/esm/utils/getSpecType.js +16 -0
  225. package/lib/esm/utils/getSpecType.js.map +1 -0
  226. package/lib/esm/utils/mapNullableType.js +2 -2
  227. package/lib/esm/utils/mapNullableType.js.map +1 -1
  228. package/lib/esm/utils/mapOpenSpec.js +37 -0
  229. package/lib/esm/utils/mapOpenSpec.js.map +1 -0
  230. package/lib/esm/utils/mapOpenSpec2.js +30 -0
  231. package/lib/esm/utils/mapOpenSpec2.js.map +1 -0
  232. package/lib/esm/utils/mapOpenSpec3.js +22 -0
  233. package/lib/esm/utils/mapOpenSpec3.js.map +1 -0
  234. package/lib/esm/utils/mapOpenSpecInfo.js +17 -0
  235. package/lib/esm/utils/mapOpenSpecInfo.js.map +1 -0
  236. package/lib/esm/utils/mapRouteOptions.js +1 -1
  237. package/lib/esm/utils/mergeOperation.js +4 -3
  238. package/lib/esm/utils/mergeOperation.js.map +1 -1
  239. package/lib/esm/utils/mergeSpec.js.map +1 -1
  240. package/lib/esm/utils/ref.js +1 -1
  241. package/lib/esm/utils/serializeEnumValues.js +21 -0
  242. package/lib/esm/utils/serializeEnumValues.js.map +1 -0
  243. package/lib/esm/utils/toJsonMapCollection.js +1 -1
  244. package/lib/esm/utils/transformToOS2.js +504 -0
  245. package/lib/esm/utils/transformToOS2.js.map +1 -0
  246. package/lib/types/constants/httpStatusMessages.d.ts +2 -263
  247. package/lib/types/decorators/common/anyOf.d.ts +4 -0
  248. package/lib/types/decorators/common/ignore.d.ts +1 -1
  249. package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
  250. package/lib/types/decorators/common/oneOf.d.ts +4 -0
  251. package/lib/types/decorators/common/recordOf.d.ts +46 -0
  252. package/lib/types/decorators/operations/acceptMime.d.ts +19 -0
  253. package/lib/types/decorators/operations/in.d.ts +1 -1
  254. package/lib/types/decorators/operations/view.d.ts +23 -0
  255. package/lib/types/domain/JsonMap.d.ts +1 -1
  256. package/lib/types/domain/JsonMethodStore.d.ts +51 -2
  257. package/lib/types/domain/JsonOperation.d.ts +2 -1
  258. package/lib/types/domain/JsonOperationRoute.d.ts +5 -3
  259. package/lib/types/domain/JsonParameter.d.ts +2 -1
  260. package/lib/types/domain/JsonParameterStore.d.ts +23 -1
  261. package/lib/types/domain/JsonPropertyStore.d.ts +7 -0
  262. package/lib/types/domain/JsonResponse.d.ts +2 -1
  263. package/lib/types/domain/JsonSchema.d.ts +2 -2
  264. package/lib/types/domain/SpecTypes.d.ts +1 -0
  265. package/lib/types/index.d.ts +143 -13
  266. package/lib/types/interfaces/JsonSchemaOptions.d.ts +2 -2
  267. package/lib/types/utils/generateSpec.d.ts +16 -0
  268. package/lib/types/utils/generics.d.ts +1 -1
  269. package/lib/types/utils/getJsonSchema.d.ts +12 -2
  270. package/lib/types/utils/getOperationsRoutes.d.ts +2 -2
  271. package/lib/types/utils/getSpec.d.ts +5 -4
  272. package/lib/types/utils/getSpecType.d.ts +12 -0
  273. package/lib/types/utils/mapNullableType.d.ts +1 -1
  274. package/lib/types/utils/mapOpenSpec.d.ts +10 -0
  275. package/lib/types/utils/mapOpenSpec2.d.ts +9 -0
  276. package/lib/types/utils/mapOpenSpec3.d.ts +8 -0
  277. package/lib/types/utils/mapOpenSpecInfo.d.ts +6 -0
  278. package/lib/types/utils/mergeSpec.d.ts +2 -2
  279. package/lib/types/utils/serializeEnumValues.d.ts +5 -0
  280. package/lib/types/utils/transformToOS2.d.ts +25 -0
  281. package/package.json +30 -15
  282. package/readme.md +1 -0
  283. package/tsconfig.compile.esm.json +2 -12
  284. package/benchmark/cold-start.js +0 -17
  285. package/lib/cjs/components/index.js +0 -15
  286. package/lib/cjs/components/index.js.map +0 -1
  287. package/lib/cjs/decorators/index.js +0 -77
  288. package/lib/cjs/decorators/index.js.map +0 -1
  289. package/lib/cjs/domain/index.js +0 -20
  290. package/lib/cjs/domain/index.js.map +0 -1
  291. package/lib/cjs/interfaces/index.js +0 -8
  292. package/lib/cjs/interfaces/index.js.map +0 -1
  293. package/lib/esm/components/index.js +0 -12
  294. package/lib/esm/components/index.js.map +0 -1
  295. package/lib/esm/decorators/index.js +0 -74
  296. package/lib/esm/decorators/index.js.map +0 -1
  297. package/lib/esm/domain/index.js +0 -17
  298. package/lib/esm/domain/index.js.map +0 -1
  299. package/lib/esm/interfaces/index.js +0 -5
  300. package/lib/esm/interfaces/index.js.map +0 -1
  301. package/lib/types/components/index.d.ts +0 -11
  302. package/lib/types/decorators/index.d.ts +0 -68
  303. package/lib/types/domain/index.d.ts +0 -16
  304. package/lib/types/interfaces/index.d.ts +0 -4
@@ -1,269 +1,8 @@
1
1
  export declare const HTTP_STATUS_MESSAGES: {
2
- "100": {
2
+ [x: string]: {
3
3
  label: string;
4
4
  code: string;
5
- };
6
- "101": {
7
- label: string;
8
- code: string;
9
- };
10
- "102": {
11
- label: string;
12
- code: string;
13
- };
14
- "103": {
15
- label: string;
16
- code: string;
17
- };
18
- "200": {
19
- label: string;
20
- code: string;
21
- };
22
- "201": {
23
- label: string;
24
- code: string;
25
- };
26
- "202": {
27
- label: string;
28
- code: string;
29
- };
30
- "203": {
31
- label: string;
32
- code: string;
33
- };
34
- "204": {
35
- label: string;
36
- code: string;
37
- };
38
- "205": {
39
- label: string;
40
- code: string;
41
- };
42
- "206": {
43
- label: string;
44
- code: string;
45
- };
46
- "207": {
47
- label: string;
48
- code: string;
49
- };
50
- "208": {
51
- label: string;
52
- code: string;
53
- };
54
- "226": {
55
- label: string;
56
- code: string;
57
- };
58
- "300": {
59
- label: string;
60
- code: string;
61
- };
62
- "301": {
63
- label: string;
64
- code: string;
65
- };
66
- "302": {
67
- label: string;
68
- code: string;
69
- };
70
- "303": {
71
- label: string;
72
- code: string;
73
- };
74
- "304": {
75
- label: string;
76
- code: string;
77
- };
78
- "305": {
79
- label: string;
80
- code: string;
81
- };
82
- "306": {
83
- label: string;
84
- code: string;
85
- };
86
- "307": {
87
- label: string;
88
- code: string;
89
- };
90
- "308": {
91
- label: string;
92
- code: string;
93
- };
94
- "310": {
95
- label: string;
96
- code: string;
97
- };
98
- "400": {
99
- label: string;
100
- code: string;
101
- };
102
- "401": {
103
- label: string;
104
- code: string;
105
- };
106
- "402": {
107
- label: string;
108
- code: string;
109
- };
110
- "403": {
111
- label: string;
112
- code: string;
113
- };
114
- "404": {
115
- label: string;
116
- code: string;
117
- };
118
- "405": {
119
- label: string;
120
- code: string;
121
- };
122
- "406": {
123
- label: string;
124
- code: string;
125
- };
126
- "407": {
127
- label: string;
128
- code: string;
129
- };
130
- "408": {
131
- label: string;
132
- code: string;
133
- };
134
- "409": {
135
- label: string;
136
- code: string;
137
- };
138
- "410": {
139
- label: string;
140
- code: string;
141
- };
142
- "411": {
143
- label: string;
144
- code: string;
145
- };
146
- "412": {
147
- label: string;
148
- code: string;
149
- };
150
- "413": {
151
- label: string;
152
- code: string;
153
- };
154
- "414": {
155
- label: string;
156
- code: string;
157
- };
158
- "415": {
159
- label: string;
160
- code: string;
161
- };
162
- "416": {
163
- label: string;
164
- code: string;
165
- };
166
- "417": {
167
- label: string;
168
- code: string;
169
- };
170
- "418": {
171
- label: string;
172
- code: string;
173
- };
174
- "421": {
175
- label: string;
176
- code: string;
177
- };
178
- "422": {
179
- label: string;
180
- code: string;
181
- };
182
- "423": {
183
- label: string;
184
- code: string;
185
- };
186
- "424": {
187
- label: string;
188
- code: string;
189
- };
190
- "425": {
191
- label: string;
192
- code: string;
193
- };
194
- "426": {
195
- label: string;
196
- code: string;
197
- };
198
- "427": {
199
- label: string;
200
- code: string;
201
- };
202
- "428": {
203
- label: string;
204
- code: string;
205
- };
206
- "429": {
207
- label: string;
208
- code: string;
209
- };
210
- "430": {
211
- label: string;
212
- code: string;
213
- };
214
- "431": {
215
- label: string;
216
- code: string;
217
- };
218
- "451": {
219
- label: string;
220
- code: string;
221
- };
222
- "500": {
223
- label: string;
224
- code: string;
225
- };
226
- "501": {
227
- label: string;
228
- code: string;
229
- };
230
- "502": {
231
- label: string;
232
- code: string;
233
- };
234
- "503": {
235
- label: string;
236
- code: string;
237
- };
238
- "504": {
239
- label: string;
240
- code: string;
241
- };
242
- "505": {
243
- label: string;
244
- code: string;
245
- };
246
- "506": {
247
- label: string;
248
- code: string;
249
- };
250
- "507": {
251
- label: string;
252
- code: string;
253
- };
254
- "508": {
255
- label: string;
256
- code: string;
257
- };
258
- "509": {
259
- label: string;
260
- code: string;
261
- };
262
- "510": {
263
- label: string;
264
- code: string;
265
- };
266
- "511": {
5
+ } | {
267
6
  label: string;
268
7
  code: string;
269
8
  };
@@ -2,6 +2,10 @@ import { AnyJsonSchema } from "../../domain/JsonSchema";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
4
4
  *
5
+ * ::: warning
6
+ * AnyOf isn't supported by OS2
7
+ * :::
8
+ *
5
9
  * @decorator
6
10
  * @validation
7
11
  * @swagger
@@ -1,4 +1,4 @@
1
- import { IgnoreCallback } from "../../interfaces";
1
+ import { IgnoreCallback } from "../../interfaces/IgnoreCallback";
2
2
  /**
3
3
  * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorParameters } from "@tsed/core";
2
- import type { JsonEntityStore } from "../../domain";
2
+ import type { JsonEntityStore } from "../../domain/JsonEntityStore";
3
3
  /**
4
4
  * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
5
5
  *
@@ -2,6 +2,10 @@ import { AnyJsonSchema } from "../../domain/JsonSchema";
2
2
  /**
3
3
  * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
4
4
  *
5
+ * ::: warning
6
+ * OneOf isn't supported by OS2
7
+ * :::
8
+ *
5
9
  * @decorator
6
10
  * @validation
7
11
  * @swagger
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Constructs a json schema object type whose property keys are keys and whose property values are type.
3
+ *
4
+ * ## Example
5
+ *
6
+ * ```typescript
7
+ * type keys = 'one' | 'two';
8
+ *
9
+ * class Part {
10
+ * prop: string;
11
+ * }
12
+ *
13
+ * type Parts = Record<keys, Part>;
14
+ *
15
+ * class Test {
16
+ * @RecordOf(Part, 'one', 'two')
17
+ * parts: Parts;
18
+ * }
19
+ * ```
20
+ *
21
+ * Will produce:
22
+ *
23
+ * ```json
24
+ * {
25
+ * "type": "object",
26
+ * "properties": {
27
+ * "one": {
28
+ * "$ref": "#/components/schemas/Part"
29
+ * },
30
+ * "two": {
31
+ * "$ref": "#/components/schemas/Part"
32
+ * },
33
+ * },
34
+ * }
35
+ * ```
36
+ *
37
+ * @param model
38
+ * @param keys
39
+ * @decorator
40
+ * @validation
41
+ * @swagger
42
+ * @schema
43
+ * @classDecorator
44
+ * @input
45
+ */
46
+ export declare function RecordOf(model: any, ...keys: string[]): (...args: any[]) => any;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 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.
3
+ *
4
+ * ```typescript
5
+ * @Controller('/mypath')
6
+ * export class MyCtrl {
7
+ *
8
+ * @Get('/')
9
+ * @AcceptMime('application/json')
10
+ * public getResource(){}
11
+ * }
12
+ * ```
13
+ *
14
+ * @param mimes
15
+ * @decorator
16
+ * @operation
17
+ * @response
18
+ */
19
+ export declare function AcceptMime(...mimes: string[]): Function;
@@ -1,6 +1,6 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonSchemaObject } from "../../domain";
3
2
  import { JsonParameterTypes } from "../../domain/JsonParameterTypes";
3
+ import { JsonSchemaObject } from "../../domain/JsonSchema";
4
4
  export interface InChainedDecorators {
5
5
  <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
6
6
  (target: Object, propertyKey: string | symbol, parameterIndex: number): void;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Use a view and sends the rendered HTML string to the client. Optional parameter:
3
+ *
4
+ * * viewOptions, an object whose properties define local variables for the view.
5
+ *
6
+ * The view argument is a string that is the file path of the view file to render.
7
+ * This can be an absolute path, or a path relative to the views setting.
8
+ * If the path does not contain a file extension, then the view engine setting determines the file extension.
9
+ * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
10
+ * and render it using the loaded module’s __express function.
11
+ *
12
+ * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
13
+ *
14
+ * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
15
+ * and as so for security reasons should not contain input from the end-user.
16
+ *
17
+ * @param path Relative path to the view file.
18
+ * @param options Additional options
19
+ * @decorator
20
+ * @operation
21
+ * @response
22
+ */
23
+ export declare function View(path: string, options?: Object): MethodDecorator;
@@ -1,4 +1,4 @@
1
- import { JsonSchemaOptions } from "../interfaces";
1
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
2
2
  export declare class JsonMap<T> extends Map<string, any> {
3
3
  [key: string]: any;
4
4
  constructor(obj?: Partial<T>);
@@ -1,13 +1,21 @@
1
+ import { Type } from "@tsed/core";
1
2
  import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore";
2
3
  import { JsonOperation } from "./JsonOperation";
3
4
  import type { JsonParameterStore } from "./JsonParameterStore";
4
5
  import type { JsonClassStore } from "./JsonClassStore";
6
+ export interface JsonViewOptions {
7
+ path: string;
8
+ options: any;
9
+ }
10
+ export interface JsonRedirectOptions {
11
+ status: number | undefined;
12
+ url: string;
13
+ }
5
14
  export declare class JsonMethodStore extends JsonEntityStore {
6
15
  readonly parent: JsonClassStore;
7
16
  middlewares: any[];
8
17
  beforeMiddlewares: any[];
9
18
  afterMiddlewares: any[];
10
- constructor(options: JsonEntityStoreOptions);
11
19
  /**
12
20
  * Ref to JsonOperation when the decorated object is a method.
13
21
  */
@@ -16,10 +24,22 @@ export declare class JsonMethodStore extends JsonEntityStore {
16
24
  * List of children JsonEntityStore (properties or methods or params)
17
25
  */
18
26
  readonly children: Map<string | number, JsonParameterStore>;
27
+ constructor(options: JsonEntityStoreOptions);
28
+ get params(): JsonParameterStore[];
29
+ get view(): JsonViewOptions;
30
+ set view(view: JsonViewOptions);
31
+ get acceptMimes(): string[];
32
+ set acceptMimes(mimes: string[]);
19
33
  get parameters(): JsonParameterStore[];
20
34
  get operationPaths(): Map<string, import("./JsonOperation").JsonMethodPath>;
35
+ /**
36
+ * Get an endpoint.
37
+ * @param target
38
+ * @param propertyKey
39
+ * @param descriptor
40
+ */
41
+ static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
21
42
  getResponseOptions(status: number, contentType?: string): undefined | any;
22
- protected build(): void;
23
43
  /**
24
44
  * Append middlewares to the beforeMiddlewares list.
25
45
  * @param args
@@ -37,4 +57,33 @@ export declare class JsonMethodStore extends JsonEntityStore {
37
57
  * @param args
38
58
  */
39
59
  use(args: Function[]): this;
60
+ /**
61
+ * Find the value at the controller level. Let this value be extended or overridden by the endpoint itself.
62
+ *
63
+ * @param key
64
+ * @returns {any}
65
+ */
66
+ get<T = any>(key: any): T;
67
+ getParamTypes(): Record<string, boolean>;
68
+ protected build(): void;
40
69
  }
70
+ /**
71
+ * EndpointMetadata contains metadata about a controller and his method.
72
+ * Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
73
+ * EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.
74
+ *
75
+ * Example :
76
+ *```typescript
77
+ * @Controller("/my-path")
78
+ * provide MyClass {
79
+ *
80
+ * @Get("/")
81
+ * @Authenticated()
82
+ * public myMethod(){}
83
+ * }
84
+ *```
85
+ *
86
+ * @alias JsonMethodStore
87
+ */
88
+ export declare type EndpointMetadata = JsonMethodStore;
89
+ export declare const EndpointMetadata: typeof JsonMethodStore;
@@ -1,5 +1,6 @@
1
1
  import { OpenSpecSecurity, OpenSpecTag, OS3Operation } from "@tsed/openspec";
2
- import { JsonHeader, JsonSchemaOptions } from "../interfaces";
2
+ import { JsonHeader } from "../interfaces/JsonOpenSpec";
3
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
3
4
  import { JsonMap } from "./JsonMap";
4
5
  import { JsonParameter } from "./JsonParameter";
5
6
  import { JsonResponse } from "./JsonResponse";
@@ -1,11 +1,12 @@
1
1
  import { Type } from "@tsed/core";
2
+ import { JsonMethodStore } from "./JsonMethodStore";
2
3
  import { JsonMethodPath, JsonOperation } from "./JsonOperation";
3
- import { JsonEntityStore } from "./JsonEntityStore";
4
- export declare class JsonOperationRoute<Entity extends JsonEntityStore = JsonEntityStore> {
4
+ export declare class JsonOperationRoute<Entity extends JsonMethodStore = JsonMethodStore> {
5
5
  readonly token: Type<any>;
6
6
  readonly endpoint: Entity;
7
7
  readonly operationPath?: JsonMethodPath;
8
8
  readonly basePath?: string;
9
+ readonly paramsTypes: Record<string, boolean>;
9
10
  constructor(options: Partial<JsonOperationRoute>);
10
11
  get url(): string;
11
12
  get path(): string | RegExp | undefined;
@@ -15,10 +16,11 @@ export declare class JsonOperationRoute<Entity extends JsonEntityStore = JsonEnt
15
16
  get name(): string;
16
17
  get className(): string;
17
18
  get methodClassName(): string;
18
- get parameters(): any;
19
+ get parameters(): import("./JsonParameterStore").JsonParameterStore[];
19
20
  get propertyKey(): string;
20
21
  get propertyName(): string;
21
22
  get store(): import("@tsed/core").Store;
22
23
  get operation(): JsonOperation;
23
24
  get operationId(): any;
25
+ has(key: string): boolean;
24
26
  }
@@ -1,6 +1,6 @@
1
1
  import { Type } from "@tsed/core";
2
2
  import { OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter } from "@tsed/openspec";
3
- import { JsonSchemaOptions } from "../interfaces";
3
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
4
4
  import { NestedGenerics } from "../utils/generics";
5
5
  import { JsonMap } from "./JsonMap";
6
6
  import { JsonSchema } from "./JsonSchema";
@@ -18,5 +18,6 @@ export declare class JsonParameter extends JsonMap<OS3Parameter<JsonSchema>> imp
18
18
  schema(schema: JsonSchema): this;
19
19
  toJSON(options?: JsonSchemaOptions): any;
20
20
  private build;
21
+ private getFileSchema;
21
22
  private refToParameters;
22
23
  }
@@ -1,14 +1,30 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonEntityStore } from "./JsonEntityStore";
2
+ import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore";
3
3
  import type { JsonMethodStore } from "./JsonMethodStore";
4
4
  import { JsonParameter } from "./JsonParameter";
5
5
  import { JsonSchema } from "./JsonSchema";
6
+ export interface JsonParameterStoreOptions extends JsonEntityStoreOptions {
7
+ dataPath?: string;
8
+ paramType?: string;
9
+ expression?: string;
10
+ }
11
+ export interface PipeMethods<T = any, R = any> {
12
+ transform(value: T, metadata: JsonParameterStore): R;
13
+ }
6
14
  export declare class JsonParameterStore extends JsonEntityStore {
15
+ paramType: string;
16
+ expression: string;
17
+ dataPath: string;
18
+ /**
19
+ * Define pipes can be called by the framework to transform input parameter
20
+ */
21
+ pipes: Type<PipeMethods>[];
7
22
  /**
8
23
  * Ref to JsonParameter when the decorated object is a parameter.
9
24
  */
10
25
  readonly parameter: JsonParameter;
11
26
  readonly parent: JsonMethodStore;
27
+ constructor(options: JsonParameterStoreOptions);
12
28
  get nestedGenerics(): Type<any>[][];
13
29
  set nestedGenerics(nestedGenerics: Type<any>[][]);
14
30
  /**
@@ -19,6 +35,7 @@ export declare class JsonParameterStore extends JsonEntityStore {
19
35
  set required(value: boolean);
20
36
  get allowedRequiredValues(): any[];
21
37
  static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
38
+ static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
22
39
  /**
23
40
  * Check precondition between value, required and allowedRequiredValues to know if the entity is required.
24
41
  * @param value
@@ -28,3 +45,8 @@ export declare class JsonParameterStore extends JsonEntityStore {
28
45
  protected getSchema(type: any): JsonSchema;
29
46
  protected build(): void;
30
47
  }
48
+ /**
49
+ * @alias JsonParameterStore
50
+ */
51
+ export declare type ParamMetadata = JsonParameterStore;
52
+ export declare const ParamMetadata: typeof JsonParameterStore;
@@ -1,3 +1,4 @@
1
+ import { Type } from "@tsed/core";
1
2
  import { JsonEntityStore } from "./JsonEntityStore";
2
3
  import type { JsonClassStore } from "./JsonClassStore";
3
4
  export declare class JsonPropertyStore extends JsonEntityStore {
@@ -20,4 +21,10 @@ export declare class JsonPropertyStore extends JsonEntityStore {
20
21
  */
21
22
  isRequired(value: any): boolean;
22
23
  protected build(): void;
24
+ static get(target: Type<any>, propertyKey: string | symbol): JsonPropertyStore;
23
25
  }
26
+ /**
27
+ * @alias JsonPropertyStore
28
+ */
29
+ export declare type PropertyMetadata = JsonPropertyStore;
30
+ export declare const PropertyMetadata: typeof JsonPropertyStore;
@@ -1,5 +1,6 @@
1
1
  import { OS3MediaType, OS3Response } from "@tsed/openspec";
2
- import { JsonHeader, JsonSchemaOptions } from "../interfaces";
2
+ import { JsonHeader } from "../interfaces/JsonOpenSpec";
3
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
3
4
  import { JsonMap } from "./JsonMap";
4
5
  import { JsonSchema } from "./JsonSchema";
5
6
  export declare type JsonResponseOptions = OS3Response<JsonSchema, string | JsonHeader>;
@@ -1,6 +1,6 @@
1
1
  import { Hooks, Type, ValueOf } from "@tsed/core";
2
2
  import type { JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version } from "json-schema";
3
- import { JsonSchemaOptions } from "../interfaces";
3
+ import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions";
4
4
  import { IgnoreCallback } from "../interfaces/IgnoreCallback";
5
5
  import { NestedGenerics } from "../utils/generics";
6
6
  import { AliasMap, AliasType } from "./JsonAliasMap";
@@ -218,7 +218,7 @@ export declare class JsonSchema extends Map<string, any> implements NestedGeneri
218
218
  *
219
219
  * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
220
220
  */
221
- enum(enumValues: JSONSchema6Type[]): this;
221
+ enum(...enumValues: any[]): this;
222
222
  /**
223
223
  * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
224
224
  */
@@ -1,4 +1,5 @@
1
1
  export declare enum SpecTypes {
2
2
  JSON = "jsonschema",
3
+ SWAGGER = "swagger2",
3
4
  OPENAPI = "openapi3"
4
5
  }