@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
package/lib/cjs/index.js CHANGED
@@ -1,24 +1,146 @@
1
1
  "use strict";
2
+ /**
3
+ * @file Automatically generated by barrelsby.
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./constants/httpStatusMessages"), exports);
7
+ (0, tslib_1.__exportStar)(require("./components/anyMapper"), exports);
8
+ (0, tslib_1.__exportStar)(require("./components/classMapper"), exports);
9
+ (0, tslib_1.__exportStar)(require("./components/genericsMapper"), exports);
10
+ (0, tslib_1.__exportStar)(require("./components/inheritedClassMapper"), exports);
11
+ (0, tslib_1.__exportStar)(require("./components/itemMapper"), exports);
12
+ (0, tslib_1.__exportStar)(require("./components/lazyRefMapper"), exports);
13
+ (0, tslib_1.__exportStar)(require("./components/mapMapper"), exports);
14
+ (0, tslib_1.__exportStar)(require("./components/objectMapper"), exports);
15
+ (0, tslib_1.__exportStar)(require("./components/ofMapper"), exports);
16
+ (0, tslib_1.__exportStar)(require("./components/propertiesMapper"), exports);
17
+ (0, tslib_1.__exportStar)(require("./components/schemaMapper"), exports);
5
18
  (0, tslib_1.__exportStar)(require("./constants/httpMethods"), exports);
19
+ (0, tslib_1.__exportStar)(require("./constants/httpStatusMessages"), exports);
20
+ (0, tslib_1.__exportStar)(require("./decorators/class/children"), exports);
21
+ (0, tslib_1.__exportStar)(require("./decorators/collections/collectionContains"), exports);
22
+ (0, tslib_1.__exportStar)(require("./decorators/collections/collectionOf"), exports);
23
+ (0, tslib_1.__exportStar)(require("./decorators/collections/maxItems"), exports);
24
+ (0, tslib_1.__exportStar)(require("./decorators/collections/maxProperties"), exports);
25
+ (0, tslib_1.__exportStar)(require("./decorators/collections/minItems"), exports);
26
+ (0, tslib_1.__exportStar)(require("./decorators/collections/minProperties"), exports);
27
+ (0, tslib_1.__exportStar)(require("./decorators/collections/uniqueItems"), exports);
28
+ (0, tslib_1.__exportStar)(require("./decorators/common/additionalProperties"), exports);
29
+ (0, tslib_1.__exportStar)(require("./decorators/common/allOf"), exports);
30
+ (0, tslib_1.__exportStar)(require("./decorators/common/allow"), exports);
31
+ (0, tslib_1.__exportStar)(require("./decorators/common/any"), exports);
32
+ (0, tslib_1.__exportStar)(require("./decorators/common/anyOf"), exports);
33
+ (0, tslib_1.__exportStar)(require("./decorators/common/const"), exports);
34
+ (0, tslib_1.__exportStar)(require("./decorators/common/customKey"), exports);
35
+ (0, tslib_1.__exportStar)(require("./decorators/common/default"), exports);
36
+ (0, tslib_1.__exportStar)(require("./decorators/common/description"), exports);
37
+ (0, tslib_1.__exportStar)(require("./decorators/common/enum"), exports);
38
+ (0, tslib_1.__exportStar)(require("./decorators/common/example"), exports);
39
+ (0, tslib_1.__exportStar)(require("./decorators/common/examples"), exports);
40
+ (0, tslib_1.__exportStar)(require("./decorators/common/exclusiveMaximum"), exports);
41
+ (0, tslib_1.__exportStar)(require("./decorators/common/exclusiveMinimum"), exports);
42
+ (0, tslib_1.__exportStar)(require("./decorators/common/format"), exports);
43
+ (0, tslib_1.__exportStar)(require("./decorators/common/forwardGroups"), exports);
44
+ (0, tslib_1.__exportStar)(require("./decorators/common/groups"), exports);
45
+ (0, tslib_1.__exportStar)(require("./decorators/common/hidden"), exports);
46
+ (0, tslib_1.__exportStar)(require("./decorators/common/ignore"), exports);
47
+ (0, tslib_1.__exportStar)(require("./decorators/common/integer"), exports);
48
+ (0, tslib_1.__exportStar)(require("./decorators/common/jsonEntityFn"), exports);
49
+ (0, tslib_1.__exportStar)(require("./decorators/common/maxLength"), exports);
50
+ (0, tslib_1.__exportStar)(require("./decorators/common/maximum"), exports);
51
+ (0, tslib_1.__exportStar)(require("./decorators/common/minLength"), exports);
52
+ (0, tslib_1.__exportStar)(require("./decorators/common/minimum"), exports);
53
+ (0, tslib_1.__exportStar)(require("./decorators/common/multipleOf"), exports);
54
+ (0, tslib_1.__exportStar)(require("./decorators/common/name"), exports);
55
+ (0, tslib_1.__exportStar)(require("./decorators/common/nullable"), exports);
56
+ (0, tslib_1.__exportStar)(require("./decorators/common/oneOf"), exports);
57
+ (0, tslib_1.__exportStar)(require("./decorators/common/optional"), exports);
58
+ (0, tslib_1.__exportStar)(require("./decorators/common/pattern"), exports);
59
+ (0, tslib_1.__exportStar)(require("./decorators/common/property"), exports);
60
+ (0, tslib_1.__exportStar)(require("./decorators/common/readOnly"), exports);
61
+ (0, tslib_1.__exportStar)(require("./decorators/common/required"), exports);
62
+ (0, tslib_1.__exportStar)(require("./decorators/common/requiredGroups"), exports);
63
+ (0, tslib_1.__exportStar)(require("./decorators/common/schema"), exports);
64
+ (0, tslib_1.__exportStar)(require("./decorators/common/title"), exports);
65
+ (0, tslib_1.__exportStar)(require("./decorators/common/writeOnly"), exports);
66
+ (0, tslib_1.__exportStar)(require("./decorators/config/jsonEntityComponent"), exports);
67
+ (0, tslib_1.__exportStar)(require("./decorators/generics/genericOf"), exports);
68
+ (0, tslib_1.__exportStar)(require("./decorators/generics/generics"), exports);
69
+ (0, tslib_1.__exportStar)(require("./decorators/operations/acceptMime"), exports);
70
+ (0, tslib_1.__exportStar)(require("./decorators/operations/consumes"), exports);
71
+ (0, tslib_1.__exportStar)(require("./decorators/operations/contentType"), exports);
72
+ (0, tslib_1.__exportStar)(require("./decorators/operations/deprecated"), exports);
73
+ (0, tslib_1.__exportStar)(require("./decorators/operations/header"), exports);
74
+ (0, tslib_1.__exportStar)(require("./decorators/operations/in"), exports);
75
+ (0, tslib_1.__exportStar)(require("./decorators/operations/inFile"), exports);
76
+ (0, tslib_1.__exportStar)(require("./decorators/operations/location"), exports);
77
+ (0, tslib_1.__exportStar)(require("./decorators/operations/operationId"), exports);
78
+ (0, tslib_1.__exportStar)(require("./decorators/operations/operationPath"), exports);
79
+ (0, tslib_1.__exportStar)(require("./decorators/operations/partial"), exports);
80
+ (0, tslib_1.__exportStar)(require("./decorators/operations/path"), exports);
81
+ (0, tslib_1.__exportStar)(require("./decorators/operations/produces"), exports);
82
+ (0, tslib_1.__exportStar)(require("./decorators/operations/redirect"), exports);
83
+ (0, tslib_1.__exportStar)(require("./decorators/operations/returns"), exports);
84
+ (0, tslib_1.__exportStar)(require("./decorators/operations/route"), exports);
85
+ (0, tslib_1.__exportStar)(require("./decorators/operations/security"), exports);
86
+ (0, tslib_1.__exportStar)(require("./decorators/operations/status"), exports);
87
+ (0, tslib_1.__exportStar)(require("./decorators/operations/summary"), exports);
88
+ (0, tslib_1.__exportStar)(require("./decorators/operations/tags"), exports);
89
+ (0, tslib_1.__exportStar)(require("./decorators/operations/view"), exports);
90
+ (0, tslib_1.__exportStar)(require("./domain/DecoratorContext"), exports);
91
+ (0, tslib_1.__exportStar)(require("./domain/JsonAliasMap"), exports);
92
+ (0, tslib_1.__exportStar)(require("./domain/JsonClassStore"), exports);
93
+ (0, tslib_1.__exportStar)(require("./domain/JsonEntityStore"), exports);
94
+ (0, tslib_1.__exportStar)(require("./domain/JsonFormatTypes"), exports);
95
+ (0, tslib_1.__exportStar)(require("./domain/JsonLazyRef"), exports);
96
+ (0, tslib_1.__exportStar)(require("./domain/JsonMap"), exports);
97
+ (0, tslib_1.__exportStar)(require("./domain/JsonMethodStore"), exports);
98
+ (0, tslib_1.__exportStar)(require("./domain/JsonOperation"), exports);
99
+ (0, tslib_1.__exportStar)(require("./domain/JsonOperationPathsMap"), exports);
100
+ (0, tslib_1.__exportStar)(require("./domain/JsonOperationRoute"), exports);
101
+ (0, tslib_1.__exportStar)(require("./domain/JsonParameter"), exports);
102
+ (0, tslib_1.__exportStar)(require("./domain/JsonParameterStore"), exports);
103
+ (0, tslib_1.__exportStar)(require("./domain/JsonParameterTypes"), exports);
104
+ (0, tslib_1.__exportStar)(require("./domain/JsonPropertyStore"), exports);
105
+ (0, tslib_1.__exportStar)(require("./domain/JsonRequestBody"), exports);
106
+ (0, tslib_1.__exportStar)(require("./domain/JsonResponse"), exports);
107
+ (0, tslib_1.__exportStar)(require("./domain/JsonSchema"), exports);
108
+ (0, tslib_1.__exportStar)(require("./domain/SpecTypes"), exports);
109
+ (0, tslib_1.__exportStar)(require("./hooks/alterIgnore"), exports);
110
+ (0, tslib_1.__exportStar)(require("./hooks/alterOneOf"), exports);
111
+ (0, tslib_1.__exportStar)(require("./hooks/alterRequiredGroups"), exports);
112
+ (0, tslib_1.__exportStar)(require("./interfaces/IgnoreCallback"), exports);
113
+ (0, tslib_1.__exportStar)(require("./interfaces/JsonHookContext"), exports);
114
+ (0, tslib_1.__exportStar)(require("./interfaces/JsonOpenSpec"), exports);
115
+ (0, tslib_1.__exportStar)(require("./interfaces/JsonSchemaOptions"), exports);
116
+ (0, tslib_1.__exportStar)(require("./registries/JsonSchemaMapperContainer"), exports);
117
+ (0, tslib_1.__exportStar)(require("./utils/buildPath"), exports);
118
+ (0, tslib_1.__exportStar)(require("./utils/concatParameters"), exports);
119
+ (0, tslib_1.__exportStar)(require("./utils/concatPath"), exports);
120
+ (0, tslib_1.__exportStar)(require("./utils/defineStatusModel"), exports);
121
+ (0, tslib_1.__exportStar)(require("./utils/from"), exports);
122
+ (0, tslib_1.__exportStar)(require("./utils/generics"), exports);
123
+ (0, tslib_1.__exportStar)(require("./utils/getComputedType"), exports);
124
+ (0, tslib_1.__exportStar)(require("./utils/getInheritedStores"), exports);
125
+ (0, tslib_1.__exportStar)(require("./utils/getJsonEntityStore"), exports);
126
+ (0, tslib_1.__exportStar)(require("./utils/getJsonPathParameters"), exports);
6
127
  (0, tslib_1.__exportStar)(require("./utils/getJsonSchema"), exports);
7
128
  (0, tslib_1.__exportStar)(require("./utils/getJsonType"), exports);
8
- (0, tslib_1.__exportStar)(require("./utils/getPropertiesStores"), exports);
9
- (0, tslib_1.__exportStar)(require("./utils/getOperationsStores"), exports);
10
129
  (0, tslib_1.__exportStar)(require("./utils/getOperationsRoutes"), exports);
130
+ (0, tslib_1.__exportStar)(require("./utils/getOperationsStores"), exports);
131
+ (0, tslib_1.__exportStar)(require("./utils/getPropertiesStores"), exports);
132
+ (0, tslib_1.__exportStar)(require("./utils/getRequiredProperties"), exports);
11
133
  (0, tslib_1.__exportStar)(require("./utils/getSpec"), exports);
12
- (0, tslib_1.__exportStar)(require("./utils/mergeSpec"), exports);
13
- (0, tslib_1.__exportStar)(require("./utils/generics"), exports);
134
+ (0, tslib_1.__exportStar)(require("./utils/isSuccessStatus"), exports);
14
135
  (0, tslib_1.__exportStar)(require("./utils/mapHeaders"), exports);
136
+ (0, tslib_1.__exportStar)(require("./utils/mapNullableType"), exports);
137
+ (0, tslib_1.__exportStar)(require("./utils/mapRouteOptions"), exports);
15
138
  (0, tslib_1.__exportStar)(require("./utils/matchGroups"), exports);
16
- (0, tslib_1.__exportStar)(require("./utils/isSuccessStatus"), exports);
17
- (0, tslib_1.__exportStar)(require("./utils/from"), exports);
18
- (0, tslib_1.__exportStar)(require("./utils/concatPath"), exports);
19
- (0, tslib_1.__exportStar)(require("./utils/defineStatusModel"), exports);
20
- (0, tslib_1.__exportStar)(require("./domain"), exports);
21
- (0, tslib_1.__exportStar)(require("./hooks/alterIgnore"), exports);
22
- (0, tslib_1.__exportStar)(require("./interfaces"), exports);
23
- (0, tslib_1.__exportStar)(require("./decorators"), exports);
139
+ (0, tslib_1.__exportStar)(require("./utils/mergeOperation"), exports);
140
+ (0, tslib_1.__exportStar)(require("./utils/mergeSpec"), exports);
141
+ (0, tslib_1.__exportStar)(require("./utils/operationIdFormatter"), exports);
142
+ (0, tslib_1.__exportStar)(require("./utils/ref"), exports);
143
+ (0, tslib_1.__exportStar)(require("./utils/serializeEnumValues"), exports);
144
+ (0, tslib_1.__exportStar)(require("./utils/toJsonMapCollection"), exports);
145
+ (0, tslib_1.__exportStar)(require("./utils/toJsonRegex"), exports);
24
146
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,8EAA+C;AAC/C,uEAAwC;AACxC,qEAAsC;AACtC,mEAAoC;AACpC,2EAA4C;AAC5C,2EAA4C;AAC5C,2EAA4C;AAC5C,+DAAgC;AAChC,iEAAkC;AAClC,gEAAiC;AACjC,kEAAmC;AACnC,mEAAoC;AACpC,uEAAwC;AACxC,4DAA6B;AAC7B,kEAAmC;AACnC,yEAA0C;AAC1C,wDAAyB;AACzB,mEAAoC;AACpC,4DAA6B;AAC7B,4DAA6B","sourcesContent":["export * from \"./constants/httpStatusMessages\";\nexport * from \"./constants/httpMethods\";\nexport * from \"./utils/getJsonSchema\";\nexport * from \"./utils/getJsonType\";\nexport * from \"./utils/getPropertiesStores\";\nexport * from \"./utils/getOperationsStores\";\nexport * from \"./utils/getOperationsRoutes\";\nexport * from \"./utils/getSpec\";\nexport * from \"./utils/mergeSpec\";\nexport * from \"./utils/generics\";\nexport * from \"./utils/mapHeaders\";\nexport * from \"./utils/matchGroups\";\nexport * from \"./utils/isSuccessStatus\";\nexport * from \"./utils/from\";\nexport * from \"./utils/concatPath\";\nexport * from \"./utils/defineStatusModel\";\nexport * from \"./domain\";\nexport * from \"./hooks/alterIgnore\";\nexport * from \"./interfaces\";\nexport * from \"./decorators\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sEAAuC;AACvC,wEAAyC;AACzC,2EAA4C;AAC5C,iFAAkD;AAClD,uEAAwC;AACxC,0EAA2C;AAC3C,sEAAuC;AACvC,yEAA0C;AAC1C,qEAAsC;AACtC,6EAA8C;AAC9C,yEAA0C;AAC1C,uEAAwC;AACxC,8EAA+C;AAC/C,2EAA4C;AAC5C,2FAA4D;AAC5D,qFAAsD;AACtD,iFAAkD;AAClD,sFAAuD;AACvD,iFAAkD;AAClD,sFAAuD;AACvD,oFAAqD;AACrD,wFAAyD;AACzD,yEAA0C;AAC1C,yEAA0C;AAC1C,uEAAwC;AACxC,yEAA0C;AAC1C,yEAA0C;AAC1C,6EAA8C;AAC9C,2EAA4C;AAC5C,+EAAgD;AAChD,wEAAyC;AACzC,2EAA4C;AAC5C,4EAA6C;AAC7C,oFAAqD;AACrD,oFAAqD;AACrD,0EAA2C;AAC3C,iFAAkD;AAClD,0EAA2C;AAC3C,0EAA2C;AAC3C,0EAA2C;AAC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ACpC,2EAA4C;AAC5C,2EAA4C;AAC5C,2EAA4C;AAC5C,6EAA8C;AAC9C,+DAAgC;AAChC,uEAAwC;AACxC,kEAAmC;AACnC,uEAAwC;AACxC,uEAAwC;AACxC,mEAAoC;AACpC,sEAAuC;AACvC,iEAAkC;AAClC,4EAA6C;AAC7C,2DAA4B;AAC5B,2EAA4C;AAC5C,2EAA4C;AAC5C,mEAAoC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/anyMapper\";\nexport * from \"./components/classMapper\";\nexport * from \"./components/genericsMapper\";\nexport * from \"./components/inheritedClassMapper\";\nexport * from \"./components/itemMapper\";\nexport * from \"./components/lazyRefMapper\";\nexport * from \"./components/mapMapper\";\nexport * from \"./components/objectMapper\";\nexport * from \"./components/ofMapper\";\nexport * from \"./components/propertiesMapper\";\nexport * from \"./components/schemaMapper\";\nexport * from \"./constants/httpMethods\";\nexport * from \"./constants/httpStatusMessages\";\nexport * from \"./decorators/class/children\";\nexport * from \"./decorators/collections/collectionContains\";\nexport * from \"./decorators/collections/collectionOf\";\nexport * from \"./decorators/collections/maxItems\";\nexport * from \"./decorators/collections/maxProperties\";\nexport * from \"./decorators/collections/minItems\";\nexport * from \"./decorators/collections/minProperties\";\nexport * from \"./decorators/collections/uniqueItems\";\nexport * from \"./decorators/common/additionalProperties\";\nexport * from \"./decorators/common/allOf\";\nexport * from \"./decorators/common/allow\";\nexport * from \"./decorators/common/any\";\nexport * from \"./decorators/common/anyOf\";\nexport * from \"./decorators/common/const\";\nexport * from \"./decorators/common/customKey\";\nexport * from \"./decorators/common/default\";\nexport * from \"./decorators/common/description\";\nexport * from \"./decorators/common/enum\";\nexport * from \"./decorators/common/example\";\nexport * from \"./decorators/common/examples\";\nexport * from \"./decorators/common/exclusiveMaximum\";\nexport * from \"./decorators/common/exclusiveMinimum\";\nexport * from \"./decorators/common/format\";\nexport * from \"./decorators/common/forwardGroups\";\nexport * from \"./decorators/common/groups\";\nexport * from \"./decorators/common/hidden\";\nexport * from \"./decorators/common/ignore\";\nexport * from \"./decorators/common/integer\";\nexport * from \"./decorators/common/jsonEntityFn\";\nexport * from \"./decorators/common/maxLength\";\nexport * from \"./decorators/common/maximum\";\nexport * from \"./decorators/common/minLength\";\nexport * from \"./decorators/common/minimum\";\nexport * from \"./decorators/common/multipleOf\";\nexport * from \"./decorators/common/name\";\nexport * from \"./decorators/common/nullable\";\nexport * from \"./decorators/common/oneOf\";\nexport * from \"./decorators/common/optional\";\nexport * from \"./decorators/common/pattern\";\nexport * from \"./decorators/common/property\";\nexport * from \"./decorators/common/readOnly\";\nexport * from \"./decorators/common/required\";\nexport * from \"./decorators/common/requiredGroups\";\nexport * from \"./decorators/common/schema\";\nexport * from \"./decorators/common/title\";\nexport * from \"./decorators/common/writeOnly\";\nexport * from \"./decorators/config/jsonEntityComponent\";\nexport * from \"./decorators/generics/genericOf\";\nexport * from \"./decorators/generics/generics\";\nexport * from \"./decorators/operations/acceptMime\";\nexport * from \"./decorators/operations/consumes\";\nexport * from \"./decorators/operations/contentType\";\nexport * from \"./decorators/operations/deprecated\";\nexport * from \"./decorators/operations/header\";\nexport * from \"./decorators/operations/in\";\nexport * from \"./decorators/operations/inFile\";\nexport * from \"./decorators/operations/location\";\nexport * from \"./decorators/operations/operationId\";\nexport * from \"./decorators/operations/operationPath\";\nexport * from \"./decorators/operations/partial\";\nexport * from \"./decorators/operations/path\";\nexport * from \"./decorators/operations/produces\";\nexport * from \"./decorators/operations/redirect\";\nexport * from \"./decorators/operations/returns\";\nexport * from \"./decorators/operations/route\";\nexport * from \"./decorators/operations/security\";\nexport * from \"./decorators/operations/status\";\nexport * from \"./decorators/operations/summary\";\nexport * from \"./decorators/operations/tags\";\nexport * from \"./decorators/operations/view\";\nexport * from \"./domain/DecoratorContext\";\nexport * from \"./domain/JsonAliasMap\";\nexport * from \"./domain/JsonClassStore\";\nexport * from \"./domain/JsonEntityStore\";\nexport * from \"./domain/JsonFormatTypes\";\nexport * from \"./domain/JsonLazyRef\";\nexport * from \"./domain/JsonMap\";\nexport * from \"./domain/JsonMethodStore\";\nexport * from \"./domain/JsonOperation\";\nexport * from \"./domain/JsonOperationPathsMap\";\nexport * from \"./domain/JsonOperationRoute\";\nexport * from \"./domain/JsonParameter\";\nexport * from \"./domain/JsonParameterStore\";\nexport * from \"./domain/JsonParameterTypes\";\nexport * from \"./domain/JsonPropertyStore\";\nexport * from \"./domain/JsonRequestBody\";\nexport * from \"./domain/JsonResponse\";\nexport * from \"./domain/JsonSchema\";\nexport * from \"./domain/SpecTypes\";\nexport * from \"./hooks/alterIgnore\";\nexport * from \"./hooks/alterOneOf\";\nexport * from \"./hooks/alterRequiredGroups\";\nexport * from \"./interfaces/IgnoreCallback\";\nexport * from \"./interfaces/JsonHookContext\";\nexport * from \"./interfaces/JsonOpenSpec\";\nexport * from \"./interfaces/JsonSchemaOptions\";\nexport * from \"./registries/JsonSchemaMapperContainer\";\nexport * from \"./utils/buildPath\";\nexport * from \"./utils/concatParameters\";\nexport * from \"./utils/concatPath\";\nexport * from \"./utils/defineStatusModel\";\nexport * from \"./utils/from\";\nexport * from \"./utils/generics\";\nexport * from \"./utils/getComputedType\";\nexport * from \"./utils/getInheritedStores\";\nexport * from \"./utils/getJsonEntityStore\";\nexport * from \"./utils/getJsonPathParameters\";\nexport * from \"./utils/getJsonSchema\";\nexport * from \"./utils/getJsonType\";\nexport * from \"./utils/getOperationsRoutes\";\nexport * from \"./utils/getOperationsStores\";\nexport * from \"./utils/getPropertiesStores\";\nexport * from \"./utils/getRequiredProperties\";\nexport * from \"./utils/getSpec\";\nexport * from \"./utils/isSuccessStatus\";\nexport * from \"./utils/mapHeaders\";\nexport * from \"./utils/mapNullableType\";\nexport * from \"./utils/mapRouteOptions\";\nexport * from \"./utils/matchGroups\";\nexport * from \"./utils/mergeOperation\";\nexport * from \"./utils/mergeSpec\";\nexport * from \"./utils/operationIdFormatter\";\nexport * from \"./utils/ref\";\nexport * from \"./utils/serializeEnumValues\";\nexport * from \"./utils/toJsonMapCollection\";\nexport * from \"./utils/toJsonRegex\";\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lazyRef = exports.allOf = exports.oneOf = exports.anyOf = exports.any = exports.object = exports.set = exports.map = exports.array = exports.url = exports.uri = exports.email = exports.time = exports.datetime = exports.date = exports.boolean = exports.string = exports.integer = exports.number = exports.from = void 0;
4
4
  const core_1 = require("@tsed/core");
5
- const domain_1 = require("../domain");
5
+ const JsonEntityStore_1 = require("../domain/JsonEntityStore");
6
+ const JsonFormatTypes_1 = require("../domain/JsonFormatTypes");
6
7
  const JsonLazyRef_1 = require("../domain/JsonLazyRef");
7
8
  const JsonSchema_1 = require("../domain/JsonSchema");
8
9
  const getJsonEntityStore_1 = require("./getJsonEntityStore");
@@ -83,7 +84,7 @@ exports.boolean = boolean;
83
84
  * @schemaFunctional
84
85
  */
85
86
  function date() {
86
- return from(Date).format(domain_1.JsonFormatTypes.DATE);
87
+ return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.DATE);
87
88
  }
88
89
  exports.date = date;
89
90
  /**
@@ -94,7 +95,7 @@ exports.date = date;
94
95
  * @schemaFunctional
95
96
  */
96
97
  function datetime() {
97
- return from(Date).format(domain_1.JsonFormatTypes.DATE_TIME);
98
+ return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.DATE_TIME);
98
99
  }
99
100
  exports.datetime = datetime;
100
101
  /**
@@ -105,7 +106,7 @@ exports.datetime = datetime;
105
106
  * @schemaFunctional
106
107
  */
107
108
  function time() {
108
- return from(Date).format(domain_1.JsonFormatTypes.TIME);
109
+ return from(Date).format(JsonFormatTypes_1.JsonFormatTypes.TIME);
109
110
  }
110
111
  exports.time = time;
111
112
  /**
@@ -116,7 +117,7 @@ exports.time = time;
116
117
  * @schemaFunctional
117
118
  */
118
119
  function email() {
119
- return from(String).format(domain_1.JsonFormatTypes.EMAIL);
120
+ return from(String).format(JsonFormatTypes_1.JsonFormatTypes.EMAIL);
120
121
  }
121
122
  exports.email = email;
122
123
  /**
@@ -127,7 +128,7 @@ exports.email = email;
127
128
  * @schemaFunctional
128
129
  */
129
130
  function uri() {
130
- return from(String).format(domain_1.JsonFormatTypes.URI);
131
+ return from(String).format(JsonFormatTypes_1.JsonFormatTypes.URI);
131
132
  }
132
133
  exports.uri = uri;
133
134
  /**
@@ -138,7 +139,7 @@ exports.uri = uri;
138
139
  * @schemaFunctional
139
140
  */
140
141
  function url() {
141
- return from(String).format(domain_1.JsonFormatTypes.URL);
142
+ return from(String).format(JsonFormatTypes_1.JsonFormatTypes.URL);
142
143
  }
143
144
  exports.url = url;
144
145
  /**
@@ -262,7 +263,7 @@ function lazyRef(cb) {
262
263
  // solve issue with a self referenced model
263
264
  if (cb()) {
264
265
  // type is already accessible
265
- return domain_1.JsonEntityStore.from(cb()).schema;
266
+ return JsonEntityStore_1.JsonEntityStore.from(cb()).schema;
266
267
  }
267
268
  }
268
269
  catch (er) { }
@@ -1 +1 @@
1
- {"version":3,"file":"from.js","sourceRoot":"","sources":["../../../src/utils/from.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,sCAA2D;AAC3D,uDAAkD;AAClD,qDAAgD;AAChD,6DAAwD;AAExD;;;;;;;;;;GAUG;AACH,SAAgB,IAAI,CAAC,OAAkB,MAAM;IAC3C,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QACjB,MAAM,EAAC,MAAM,EAAC,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,GAAgC;YACtE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE;gBACxD,IAAA,uCAAkB,EAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,C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KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,EAAmB;IACzC,IAAI;QACF,2CAA2C;QAC3C,IAAI,EAAE,EAAE,EAAE;YACR,6BAA6B;YAC7B,OAAO,wBAAe,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,MAAa,CAAC;SACjD;KACF;IAAC,OAAO,EAAE,EAAE,GAAE;IAEf,OAAO,IAAI,yBAAW,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAVD,0BAUC","sourcesContent":["import {isClass, Type} from \"@tsed/core\";\nimport {JsonEntityStore, JsonFormatTypes} from \"../domain\";\nimport {JsonLazyRef} from \"../domain/JsonLazyRef\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * Create a new model from the given type.\n *\n * ```typescript\n * from(String)\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function from(type: Type<any> = Object) {\n if (isClass(type)) {\n const {schema} = getJsonEntityStore(type);\n\n schema.properties = function properties(obj: {[key: string]: JsonSchema}) {\n Object.entries(obj).forEach(([propertyKey, propSchema]) => {\n getJsonEntityStore(type.prototype, propertyKey).schema.assign(propSchema);\n });\n\n return this;\n };\n\n return schema;\n }\n\n return JsonSchema.from({type});\n}\n\n/**\n * Declare a new number model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function number() {\n return from(Number);\n}\n\n/**\n * Declare a new integer model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function integer() {\n return from(Number).integer();\n}\n\n/**\n * Declare a new string model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function string() {\n return from(String);\n}\n\n/**\n * Declare a new boolean model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function boolean() {\n return from(Boolean);\n}\n\n/**\n * Declare a new string model with `format: date`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function date() {\n return from(Date).format(JsonFormatTypes.DATE);\n}\n\n/**\n * Declare a new string model with `format: datetime`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function datetime() {\n return from(Date).format(JsonFormatTypes.DATE_TIME);\n}\n\n/**\n * Declare a new string model with `format: time`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function time() {\n return from(Date).format(JsonFormatTypes.TIME);\n}\n\n/**\n * Declare a new string model with `format: email`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function email() {\n return from(String).format(JsonFormatTypes.EMAIL);\n}\n\n/**\n * Declare a new string model with `format: uri`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function uri() {\n return from(String).format(JsonFormatTypes.URI);\n}\n\n/**\n * Declare a new string model with `format: url`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function url() {\n return from(String).format(JsonFormatTypes.URL);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"array\"\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function array() {\n return from(Array);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"additionalProperties\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function map() {\n return from(Map).unknown(true);\n}\n\n/**\n * Declare a new array model with `uniqueItems: true`.\n *\n * ```json\n * {\n * \"type\": \"array\",\n * \"uniqueItems\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function set() {\n return from(Array).uniqueItems(true);\n}\n\n/**\n * Declare a new object model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function object(properties: {[key: string]: JsonSchema} = {}) {\n return from(Object).properties(properties);\n}\n\n/**\n * Declare a model with any type (By default: `integer`, `number`, `string`, `boolean`, `array`, `object`, `null`)\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function any(...types: any[]) {\n return from().any(...types);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n * @schemaFunctional\n */\nexport function anyOf(...anyOf: any[]) {\n return from().anyOf(anyOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n */\nexport function oneOf(...oneOf: any[]) {\n return from().oneOf(oneOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n * @schemaFunctional\n */\nexport function allOf(...allOf: any[]) {\n return from().allOf(allOf);\n}\n\n/**\n * Declare a sub schema which will be resolved later. Use this function when you have a circular reference between two schemes.\n *\n * @schemaFunctional\n */\nexport function lazyRef(cb: () => Type<any>) {\n try {\n // solve issue with a self referenced model\n if (cb()) {\n // type is already accessible\n return JsonEntityStore.from(cb()).schema as any;\n }\n } catch (er) {}\n\n return new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,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAFD,kBAEC;AAED;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,aAA0C,EAAE;IACjE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;AACH,SAAgB,GAAG,CAAC,GAAG,KAAY;IACjC,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;AAC9B,CAAC;AAFD,kBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,GAAG,KAAY;IACnC,OAAO,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,EAAmB;IACzC,IAAI;QACF,2CAA2C;QAC3C,IAAI,EAAE,EAAE,EAAE;YACR,6BAA6B;YAC7B,OAAO,iCAAe,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,MAAa,CAAC;SACjD;KACF;IAAC,OAAO,EAAE,EAAE,GAAE;IAEf,OAAO,IAAI,yBAAW,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAVD,0BAUC","sourcesContent":["import {isClass, Type} from \"@tsed/core\";\nimport {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {JsonFormatTypes} from \"../domain/JsonFormatTypes\";\nimport {JsonLazyRef} from \"../domain/JsonLazyRef\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * Create a new model from the given type.\n *\n * ```typescript\n * from(String)\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function from(type: Type<any> = Object) {\n if (isClass(type)) {\n const {schema} = getJsonEntityStore(type);\n\n schema.properties = function properties(obj: {[key: string]: JsonSchema}) {\n Object.entries(obj).forEach(([propertyKey, propSchema]) => {\n getJsonEntityStore(type.prototype, propertyKey).schema.assign(propSchema);\n });\n\n return this;\n };\n\n return schema;\n }\n\n return JsonSchema.from({type});\n}\n\n/**\n * Declare a new number model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function number() {\n return from(Number);\n}\n\n/**\n * Declare a new integer model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function integer() {\n return from(Number).integer();\n}\n\n/**\n * Declare a new string model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function string() {\n return from(String);\n}\n\n/**\n * Declare a new boolean model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function boolean() {\n return from(Boolean);\n}\n\n/**\n * Declare a new string model with `format: date`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function date() {\n return from(Date).format(JsonFormatTypes.DATE);\n}\n\n/**\n * Declare a new string model with `format: datetime`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function datetime() {\n return from(Date).format(JsonFormatTypes.DATE_TIME);\n}\n\n/**\n * Declare a new string model with `format: time`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function time() {\n return from(Date).format(JsonFormatTypes.TIME);\n}\n\n/**\n * Declare a new string model with `format: email`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function email() {\n return from(String).format(JsonFormatTypes.EMAIL);\n}\n\n/**\n * Declare a new string model with `format: uri`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function uri() {\n return from(String).format(JsonFormatTypes.URI);\n}\n\n/**\n * Declare a new string model with `format: url`.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function url() {\n return from(String).format(JsonFormatTypes.URL);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"array\"\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function array() {\n return from(Array);\n}\n\n/**\n * Declare a new object model with `additionalProperties: true`.\n *\n * ```json\n * {\n * \"type\": \"object\",\n * \"additionalProperties\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function map() {\n return from(Map).unknown(true);\n}\n\n/**\n * Declare a new array model with `uniqueItems: true`.\n *\n * ```json\n * {\n * \"type\": \"array\",\n * \"uniqueItems\": true\n * }\n * ```\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function set() {\n return from(Array).uniqueItems(true);\n}\n\n/**\n * Declare a new object model.\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function object(properties: {[key: string]: JsonSchema} = {}) {\n return from(Object).properties(properties);\n}\n\n/**\n * Declare a model with any type (By default: `integer`, `number`, `string`, `boolean`, `array`, `object`, `null`)\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n */\nexport function any(...types: any[]) {\n return from().any(...types);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27\n * @schemaFunctional\n */\nexport function anyOf(...anyOf: any[]) {\n return from().anyOf(anyOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @schemaFunctional\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28\n */\nexport function oneOf(...oneOf: any[]) {\n return from().oneOf(oneOf);\n}\n\n/**\n * See https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n *\n * * See @@JsonSchema@@ to discover available methods.\n *\n * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26\n * @schemaFunctional\n */\nexport function allOf(...allOf: any[]) {\n return from().allOf(allOf);\n}\n\n/**\n * Declare a sub schema which will be resolved later. Use this function when you have a circular reference between two schemes.\n *\n * @schemaFunctional\n */\nexport function lazyRef(cb: () => Type<any>) {\n try {\n // solve issue with a self referenced model\n if (cb()) {\n // type is already accessible\n return JsonEntityStore.from(cb()).schema as any;\n }\n } catch (er) {}\n\n return new JsonLazyRef(cb);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../src/utils/generics.ts"],"names":[],"mappings":";;;AA4CA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,aAAuB,EAAE,YAA4B;IAClF,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAqB,EAAE,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACrI,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAA8C;IAC/E,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;QACjD,MAAM,EAAC,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;QAEtD,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC;SACtD,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,gDAWC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAqB;IAC/C,MAAM,CAAC,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;IAEpD,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,GAAG;KACpB,CAAC;AACJ,CAAC;AAPD,kCAOC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain\";\n\nexport type GenericValue = Type<any> | JsonSchema | any;\n\n/**\n * @ignore\n */\nexport type GenericsMap = Map<string, GenericValue>;\n\n/**\n * @ignore\n */\nexport interface GenericTypes {\n genericTypes: Type<any>[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericLabels {\n genericLabels: string[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface NestedGenerics {\n nestedGenerics: GenericValue[][];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {\n generics: GenericsMap;\n}\n\n/**\n * @ignore\n * @param genericLabels\n * @param genericTypes\n */\nexport function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap {\n return genericLabels.reduce((map: Map<string, any>, item: string, index: number) => map.set(item, genericTypes[index]), new Map());\n}\n\n/**\n * @ignore\n * @param options\n */\nexport function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>) {\n if (options.genericLabels && options.genericTypes) {\n const {genericLabels, genericTypes, ...ops} = options;\n\n return {\n ...ops,\n generics: getGenericsMap(genericLabels, genericTypes)\n };\n }\n\n return options;\n}\n\n/**\n * @ignore\n * @param value\n */\nexport function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes {\n const [genericTypes, ...out] = value.nestedGenerics;\n\n return {\n genericTypes,\n nestedGenerics: out\n };\n}\n"]}
1
+ {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../../src/utils/generics.ts"],"names":[],"mappings":";;;AA4CA;;;;GAIG;AACH,SAAgB,cAAc,CAAC,aAAuB,EAAE,YAA4B;IAClF,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,GAAqB,EAAE,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACrI,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,OAA8C;IAC/E,IAAI,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE;QACjD,MAAM,EAAC,aAAa,EAAE,YAAY,EAAE,GAAG,GAAG,EAAC,GAAG,OAAO,CAAC;QAEtD,OAAO;YACL,GAAG,GAAG;YACN,QAAQ,EAAE,cAAc,CAAC,aAAa,EAAE,YAAY,CAAC;SACtD,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,gDAWC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAqB;IAC/C,MAAM,CAAC,YAAY,EAAE,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;IAEpD,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,GAAG;KACpB,CAAC;AACJ,CAAC;AAPD,kCAOC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {JsonSchema} from \"../domain/JsonSchema\";\n\nexport type GenericValue = Type<any> | JsonSchema | any;\n\n/**\n * @ignore\n */\nexport type GenericsMap = Map<string, GenericValue>;\n\n/**\n * @ignore\n */\nexport interface GenericTypes {\n genericTypes: Type<any>[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericLabels {\n genericLabels: string[];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface NestedGenerics {\n nestedGenerics: GenericValue[][];\n\n [key: string]: any;\n}\n\n/**\n * @ignore\n */\nexport interface GenericsContext extends GenericTypes, GenericLabels, NestedGenerics {\n generics: GenericsMap;\n}\n\n/**\n * @ignore\n * @param genericLabels\n * @param genericTypes\n */\nexport function getGenericsMap(genericLabels: string[], genericTypes: GenericValue[]): GenericsMap {\n return genericLabels.reduce((map: Map<string, any>, item: string, index: number) => map.set(item, genericTypes[index]), new Map());\n}\n\n/**\n * @ignore\n * @param options\n */\nexport function mapGenericsOptions(options: Partial<GenericTypes & GenericLabels>) {\n if (options.genericLabels && options.genericTypes) {\n const {genericLabels, genericTypes, ...ops} = options;\n\n return {\n ...ops,\n generics: getGenericsMap(genericLabels, genericTypes)\n };\n }\n\n return options;\n}\n\n/**\n * @ignore\n * @param value\n */\nexport function popGenerics(value: NestedGenerics): NestedGenerics & GenericTypes {\n const [genericTypes, ...out] = value.nestedGenerics;\n\n return {\n genericTypes,\n nestedGenerics: out\n };\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getJsonSchema = void 0;
4
- require("../components");
4
+ require("@tsed/schema");
5
5
  const SpecTypes_1 = require("../domain/SpecTypes");
6
6
  const JsonSchemaMapperContainer_1 = require("../registries/JsonSchemaMapperContainer");
7
7
  const getJsonEntityStore_1 = require("./getJsonEntityStore");
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/utils/getJsonSchema.ts"],"names":[],"mappings":";;;AACA,yBAAuB;AAEvB,mDAA8C;AAE9C,uFAAmE;AACnE,6DAAwD;AAExD;;GAEG;AACH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC;;GAEG;AACH,SAAS,MAAM,CAAC,OAAY;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,GAAG,CAAC,M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AAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AArBD,sCAqBC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport \"../components\";\nimport type {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * @ignore\n */\nconst CACHE_KEY = \"$cache:schemes\";\n\n/**\n * @ignore\n */\nfunction getKey(options: any) {\n return JSON.stringify(options);\n}\n\n/**\n * @ignore\n */\nfunction get(entity: JsonEntityStore, options: any) {\n const cache: Map<string, any> = entity.store.get(CACHE_KEY) || new Map();\n const key = getKey(options);\n\n if (!cache.has(key)) {\n const schema = execMapper(\"schema\", entity.schema, options);\n\n if (Object.keys(options.schemas).length) {\n schema.definitions = options.schemas;\n }\n\n cache.set(key, schema);\n }\n\n entity.store.set(CACHE_KEY, cache);\n\n return cache.get(key);\n}\n\nexport function getJsonSchema(model: Type<any> | any, options: JsonSchemaOptions = {}) {\n const entity = getJsonEntityStore(model);\n\n options = {\n endpoint: true,\n groups: [],\n ...options,\n specType: options.specType || SpecTypes.JSON,\n schemas: {}\n };\n\n if (entity.decoratorType === \"parameter\") {\n options = {\n ...options,\n genericTypes: entity.nestedGenerics[0],\n nestedGenerics: entity.nestedGenerics,\n groups: entity.parameter?.groups\n };\n }\n\n return get(entity, options);\n}\n"]}
1
+ {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/utils/getJsonSchema.ts"],"names":[],"mappings":";;;AACA,wBAAsB;AAEtB,mDAA8C;AAE9C,uFAAmE;AACnE,6DAAwD;AAExD;;GAEG;AACH,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEnC;;GAEG;AACH,SAAS,MAAM,CAAC,OAAY;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CA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AC,SAAS,0CAAE,MAAM;SACjC,CAAC;KACH;IAED,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC;AArBD,sCAqBC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport \"@tsed/schema\";\nimport type {JsonEntityStore} from \"../domain/JsonEntityStore\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {execMapper} from \"../registries/JsonSchemaMapperContainer\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\n\n/**\n * @ignore\n */\nconst CACHE_KEY = \"$cache:schemes\";\n\n/**\n * @ignore\n */\nfunction getKey(options: any) {\n return JSON.stringify(options);\n}\n\n/**\n * @ignore\n */\nfunction get(entity: JsonEntityStore, options: any) {\n const cache: Map<string, any> = entity.store.get(CACHE_KEY) || new Map();\n const key = getKey(options);\n\n if (!cache.has(key)) {\n const schema = execMapper(\"schema\", entity.schema, options);\n\n if (Object.keys(options.schemas).length) {\n schema.definitions = options.schemas;\n }\n\n cache.set(key, schema);\n }\n\n entity.store.set(CACHE_KEY, cache);\n\n return cache.get(key);\n}\n\nexport function getJsonSchema(model: Type<any> | any, options: JsonSchemaOptions = {}) {\n const entity = getJsonEntityStore(model);\n\n options = {\n endpoint: true,\n groups: [],\n ...options,\n specType: options.specType || SpecTypes.JSON,\n schemas: {}\n };\n\n if (entity.decoratorType === \"parameter\") {\n options = {\n ...options,\n genericTypes: entity.nestedGenerics[0],\n nestedGenerics: entity.nestedGenerics,\n groups: entity.parameter?.groups\n };\n }\n\n return get(entity, options);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getSpec.js","sourceRoot":"","sources":["../../../src/utils/getSpec.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAErD,mDAA8C;AAE9C,2CAAsC;AACtC,6DAAwD;AACxD,+DAA0D;AAC1D,qDAAgD;AAChD,iEAA4D;AAoC5D;;GAEG;AACH,MAA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M,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YAC/B,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,UAAU,GAAG;oBACpB,OAAO;iBACR,CAAC;aACH;iBAAM;gBACL,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;aAChC;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAhED,0BAgEC","sourcesContent":["import {cleanObject, Type, uniqBy} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces\";\nimport {buildPath} from \"./buildPath\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {mergeOperation} from \"./mergeOperation\";\nimport {operationIdFormatter} from \"./operationIdFormatter\";\n\nexport interface SpecSerializerOptions extends JsonSchemaOptions {\n specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;\n /**\n * Paths\n */\n paths?: any;\n /**\n * Root path. This paths will be added to all generated paths Object.\n */\n rootPath?: string;\n /**\n * A function to generate the operationId.\n */\n operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;\n /**\n * A pattern to generate the operationId.\n */\n operationIdPattern?: string;\n}\n\nexport interface OS3SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.OPENAPI;\n}\n\nexport interface OS2SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.SWAGGER;\n}\n\n/**\n * @ignore\n */\nconst caches: Map<Type<any>, Map<string, any>> = new Map();\n\n/**\n * @ignore\n */\nfunction get(model: Type<any>, options: any, cb: any) {\n if (!caches.has(model)) {\n caches.set(model, new Map());\n }\n\n const cache = caches.get(model)!;\n const key = JSON.stringify(options);\n\n if (!cache.has(key)) {\n cache.set(key, cb());\n }\n\n return cache.get(key);\n}\n\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS3SpecSerializerOptions): Partial<OpenSpec3>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions = {}): Partial<OpenSpec2 | OpenSpec3> {\n if (!options.specType) {\n options.specType = SpecTypes.OPENAPI;\n }\n\n options = {\n ...options,\n operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),\n root: false,\n specType: options.specType\n };\n\n return get(model, options, () => {\n const store = getJsonEntityStore(model);\n const {specType = SpecTypes.OPENAPI, schemas = {}, paths = {}, rootPath = \"/\", tags = []} = options;\n const ctrlPath = store.path;\n const defaultTags = cleanObject({\n name: store.schema.getName(),\n description: store.schema.get(\"description\")\n });\n\n const specJson: any = {paths};\n\n getOperationsStores(model).forEach((operationStore) => {\n if (operationStore.store.get(\"hidden\")) {\n return;\n }\n\n const operation = operationStore.operation!.toJSON({...options, specType, schemas});\n\n operationStore.operation!.operationPaths.forEach(({path, method}: {path: string; method: string}) => {\n if (method) {\n mergeOperation(specJson, operation, {\n rootPath: buildPath(rootPath + ctrlPath),\n path,\n method,\n defaultTags,\n tags,\n specType,\n operationId: (path: string) =>\n options.operationIdFormatter!(\n operationStore.parent.schema.get(\"name\") || operationStore.parent.targetName,\n operationStore.propertyName,\n path\n )\n });\n }\n });\n });\n\n specJson.tags = uniqBy(tags, \"name\");\n\n if (Object.keys(schemas).length) {\n if (specType === SpecTypes.OPENAPI) {\n specJson.components = {\n schemas\n };\n } else {\n specJson.definitions = schemas;\n }\n }\n\n return specJson;\n });\n}\n"]}
1
+ {"version":3,"file":"getSpec.js","sourceRoot":"","sources":["../../../src/utils/getSpec.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAErD,mDAA8C;AAE9C,2CAAsC;AACtC,6DAAwD;AACxD,+DAA0D;AAC1D,qDAAgD;AAChD,iEAA4D;AAoC5D;;GAEG;AACH,MAAM,MAAM,GAAqC,IAAI,GAAG,EAAE,CAAC;AAE3D;;GAEG;AACH,SAAS,GAAG,CAAC,KAAgB,EAAE,OAAY,EAAE,EAAO;IAClD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;KAC9B;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAEpC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACnB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KACtB;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAgBD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,KAAgB,EAAE,UAAiC,EAAE;IAC3E,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACrB,OAAO,CAAC,QAAQ,GAAG,qBAAS,CAAC,OAAO,CAAC;KACtC;IAED,OAAO,GAAG;QACR,GAAG,OAAO;QACV,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,IAAA,2CAAoB,EAAC,OAAO,CAAC,kBAAkB,CAAC;QACtG,IAAI,EAAE,KAAK;QACX,QAAQ,EAAE,OAAO,CAAC,QAA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E,EAAE,CAC5B,OAAO,CAAC,oBAAqB,CAC3B,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,EAC5E,cAAc,CAAC,YAAY,EAC3B,IAAI,CACL;qBACJ,CAAC,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,GAAG,IAAA,aAAM,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAErC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE;YAC/B,IAAI,QAAQ,KAAK,qBAAS,CAAC,OAAO,EAAE;gBAClC,QAAQ,CAAC,UAAU,GAAG;oBACpB,OAAO;iBACR,CAAC;aACH;iBAAM;gBACL,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;aAChC;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAhED,0BAgEC","sourcesContent":["import {cleanObject, Type, uniqBy} from \"@tsed/core\";\nimport {OpenSpec2, OpenSpec3} from \"@tsed/openspec\";\nimport {SpecTypes} from \"../domain/SpecTypes\";\nimport {JsonSchemaOptions} from \"../interfaces/JsonSchemaOptions\";\nimport {buildPath} from \"./buildPath\";\nimport {getJsonEntityStore} from \"./getJsonEntityStore\";\nimport {getOperationsStores} from \"./getOperationsStores\";\nimport {mergeOperation} from \"./mergeOperation\";\nimport {operationIdFormatter} from \"./operationIdFormatter\";\n\nexport interface SpecSerializerOptions extends JsonSchemaOptions {\n specType?: SpecTypes.SWAGGER | SpecTypes.OPENAPI;\n /**\n * Paths\n */\n paths?: any;\n /**\n * Root path. This paths will be added to all generated paths Object.\n */\n rootPath?: string;\n /**\n * A function to generate the operationId.\n */\n operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;\n /**\n * A pattern to generate the operationId.\n */\n operationIdPattern?: string;\n}\n\nexport interface OS3SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.OPENAPI;\n}\n\nexport interface OS2SpecSerializerOptions extends SpecSerializerOptions {\n /**\n * Define Spec types level\n */\n specType: SpecTypes.SWAGGER;\n}\n\n/**\n * @ignore\n */\nconst caches: Map<Type<any>, Map<string, any>> = new Map();\n\n/**\n * @ignore\n */\nfunction get(model: Type<any>, options: any, cb: any) {\n if (!caches.has(model)) {\n caches.set(model, new Map());\n }\n\n const cache = caches.get(model)!;\n const key = JSON.stringify(options);\n\n if (!cache.has(key)) {\n cache.set(key, cb());\n }\n\n return cache.get(key);\n}\n\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS2SpecSerializerOptions): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>): Partial<OpenSpec2>;\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions): Partial<OpenSpec2>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: OS3SpecSerializerOptions): Partial<OpenSpec3>;\n/**\n * Return the swagger or open spec for the given class.\n * @param model\n * @param options\n */\nexport function getSpec(model: Type<any>, options: SpecSerializerOptions = {}): Partial<OpenSpec2 | OpenSpec3> {\n if (!options.specType) {\n options.specType = SpecTypes.OPENAPI;\n }\n\n options = {\n ...options,\n operationIdFormatter: options.operationIdFormatter || operationIdFormatter(options.operationIdPattern),\n root: false,\n specType: options.specType\n };\n\n return get(model, options, () => {\n const store = getJsonEntityStore(model);\n const {specType = SpecTypes.OPENAPI, schemas = {}, paths = {}, rootPath = \"/\", tags = []} = options;\n const ctrlPath = store.path;\n const defaultTags = cleanObject({\n name: store.schema.getName(),\n description: store.schema.get(\"description\")\n });\n\n const specJson: any = {paths};\n\n getOperationsStores(model).forEach((operationStore) => {\n if (operationStore.store.get(\"hidden\")) {\n return;\n }\n\n const operation = operationStore.operation!.toJSON({...options, specType, schemas});\n\n operationStore.operation!.operationPaths.forEach(({path, method}: {path: string; method: string}) => {\n if (method) {\n mergeOperation(specJson, operation, {\n rootPath: buildPath(rootPath + ctrlPath),\n path,\n method,\n defaultTags,\n tags,\n specType,\n operationId: (path: string) =>\n options.operationIdFormatter!(\n operationStore.parent.schema.get(\"name\") || operationStore.parent.targetName,\n operationStore.propertyName,\n path\n )\n });\n }\n });\n });\n\n specJson.tags = uniqBy(tags, \"name\");\n\n if (Object.keys(schemas).length) {\n if (specType === SpecTypes.OPENAPI) {\n specJson.components = {\n schemas\n };\n } else {\n specJson.definitions = schemas;\n }\n }\n\n return specJson;\n });\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { JsonLazyRef } from "../domain/JsonLazyRef";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { mapGenericsOptions } from "../utils/generics";
4
- import { toRef } from "../utils/ref";
1
+ import { JsonLazyRef } from "../domain/JsonLazyRef.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { mapGenericsOptions } from "../utils/generics.js";
4
+ import { toRef } from "../utils/ref.js";
5
5
  export function anyMapper(input, options = {}) {
6
6
  if (typeof input !== "object" || input === null) {
7
7
  return input;
@@ -1,7 +1,7 @@
1
- import { JsonEntityStore } from "../domain/JsonEntityStore";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { mapGenericsOptions, popGenerics } from "../utils/generics";
4
- import { createRef, createRefName } from "../utils/ref";
1
+ import { JsonEntityStore } from "../domain/JsonEntityStore.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { mapGenericsOptions, popGenerics } from "../utils/generics.js";
4
+ import { createRef, createRefName } from "../utils/ref.js";
5
5
  export function classMapper(value, options) {
6
6
  const store = JsonEntityStore.from(value.class);
7
7
  const name = createRefName(store.schema.getName() || value.getName(), options);
@@ -1,8 +1,8 @@
1
1
  import { isClass, isPrimitiveClass } from "@tsed/core";
2
- import { JsonEntityStore } from "../domain/JsonEntityStore";
3
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
- import { popGenerics } from "../utils/generics";
5
- import { getJsonType } from "../utils/getJsonType";
2
+ import { JsonEntityStore } from "../domain/JsonEntityStore.js";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
4
+ import { popGenerics } from "../utils/generics.js";
5
+ import { getJsonType } from "../utils/getJsonType.js";
6
6
  /**
7
7
  * @ignore
8
8
  */
@@ -1,6 +1,6 @@
1
1
  import { classOf, deepMerge } from "@tsed/core";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
3
- import { getInheritedStores } from "../utils/getInheritedStores";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
+ import { getInheritedStores } from "../utils/getInheritedStores.js";
4
4
  /**
5
5
  * @ignore
6
6
  */
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function itemMapper(value, options) {
3
3
  return value && value.isClass ? execMapper("class", value, options) : execMapper("any", value, options);
4
4
  }
@@ -1,6 +1,6 @@
1
- import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
2
- import { mapGenericsOptions } from "../utils/generics";
3
- import { createRef, toRef } from "../utils/ref";
1
+ import { registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
+ import { mapGenericsOptions } from "../utils/generics.js";
3
+ import { createRef, toRef } from "../utils/ref.js";
4
4
  export function lazyRefMapper(input, options) {
5
5
  var _a;
6
6
  const name = input.name;
@@ -1,5 +1,5 @@
1
- import { mapGenericsOptions } from "../utils/generics";
2
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { mapGenericsOptions } from "../utils/generics.js";
2
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
3
3
  /**
4
4
  * Serialize class which inherit from Map like JsonMap, JsonOperation, JsonParameter.
5
5
  * @param input
@@ -1,7 +1,7 @@
1
1
  import { isArray } from "@tsed/core";
2
- import { alterIgnore } from "../hooks/alterIgnore";
3
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
4
- import { mapNullableType } from "../utils/mapNullableType";
2
+ import { alterIgnore } from "../hooks/alterIgnore.js";
3
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
4
+ import { mapNullableType } from "../utils/mapNullableType.js";
5
5
  /**
6
6
  * Serialize Any object to a json schema
7
7
  * @param input
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function ofMapper(input, options, parent) {
3
3
  return input.map((value) => {
4
4
  return execMapper("item", value, {
@@ -1,4 +1,4 @@
1
- import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
1
+ import { execMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
2
2
  export function propertiesMapper(input, options, parent) {
3
3
  if (input.isClass) {
4
4
  return execMapper("class", input, options);
@@ -1,10 +1,10 @@
1
1
  import { isObject } from "@tsed/core";
2
- import { mapAliasedProperties } from "../domain/JsonAliasMap";
3
- import { SpecTypes } from "../domain/SpecTypes";
4
- import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer";
5
- import { getRequiredProperties } from "../utils/getRequiredProperties";
6
- import { alterOneOf } from "../hooks/alterOneOf";
7
- import { mapNullableType } from "../utils/mapNullableType";
2
+ import { mapAliasedProperties } from "../domain/JsonAliasMap.js";
3
+ import { SpecTypes } from "../domain/SpecTypes.js";
4
+ import { execMapper, hasMapper, registerJsonSchemaMapper } from "../registries/JsonSchemaMapperContainer.js";
5
+ import { getRequiredProperties } from "../utils/getRequiredProperties.js";
6
+ import { alterOneOf } from "../hooks/alterOneOf.js";
7
+ import { mapNullableType } from "../utils/mapNullableType.js";
8
8
  /**
9
9
  * @ignore
10
10
  */
@@ -1,5 +1,5 @@
1
1
  import { Store } from "@tsed/core";
2
- import { JsonEntityFn } from "../common/jsonEntityFn";
2
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
3
3
  /**
4
4
  * Add Children class to compose routes
5
5
  *
@@ -1,4 +1,4 @@
1
- import { CollectionOf } from "./collectionOf";
1
+ import { CollectionOf } from "./collectionOf.js";
2
2
  /**
3
3
  * Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityStore } from "../../domain/JsonEntityStore";
1
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
2
  /**
3
3
  * Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * The value `maxItems` MUST be a non-negative integer.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An object instance is valid against `maxProperties` if its number of properties is less than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An array instance is valid against `minItems` if its size is greater than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * An object instance is valid against `minProperties` if its number of properties is less than, or equal to, the value of this keyword.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "../common/jsonEntityFn";
1
+ import { JsonEntityFn } from "../common/jsonEntityFn.js";
2
2
  /**
3
3
  * If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonEntityFn } from "./jsonEntityFn";
1
+ import { JsonEntityFn } from "./jsonEntityFn.js";
2
2
  /**
3
3
  * Accept unknown properties on the deserialized model.
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.26
4
4
  *