@twin.org/tools-core 0.0.3-next.8 → 0.0.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 (138) hide show
  1. package/README.md +2 -2
  2. package/dist/es/index.js +21 -11
  3. package/dist/es/index.js.map +1 -1
  4. package/dist/es/models/ITypeScriptToSchemaContext.js +2 -0
  5. package/dist/es/models/ITypeScriptToSchemaContext.js.map +1 -0
  6. package/dist/es/models/ITypeScriptToSchemaDiagnostics.js +4 -0
  7. package/dist/es/models/ITypeScriptToSchemaDiagnostics.js.map +1 -0
  8. package/dist/es/models/ITypeScriptToSchemaOptions.js +4 -0
  9. package/dist/es/models/ITypeScriptToSchemaOptions.js.map +1 -0
  10. package/dist/es/models/embeddedSchemaMode.js +17 -0
  11. package/dist/es/models/embeddedSchemaMode.js.map +1 -0
  12. package/dist/es/utils/constants.js +43 -0
  13. package/dist/es/utils/constants.js.map +1 -0
  14. package/dist/es/utils/diagnosticReporter.js +32 -0
  15. package/dist/es/utils/diagnosticReporter.js.map +1 -0
  16. package/dist/es/utils/disallowedTypeGuard.js +151 -0
  17. package/dist/es/utils/disallowedTypeGuard.js.map +1 -0
  18. package/dist/es/utils/enum.js +152 -0
  19. package/dist/es/utils/enum.js.map +1 -0
  20. package/dist/es/utils/fileUtils.js +132 -0
  21. package/dist/es/utils/fileUtils.js.map +1 -0
  22. package/dist/es/utils/importTypeQuerySchemaResolver.js +363 -0
  23. package/dist/es/utils/importTypeQuerySchemaResolver.js.map +1 -0
  24. package/dist/es/utils/indexSignaturePatternResolver.js +94 -0
  25. package/dist/es/utils/indexSignaturePatternResolver.js.map +1 -0
  26. package/dist/es/utils/intersectionSchemaMerger.js +85 -0
  27. package/dist/es/utils/intersectionSchemaMerger.js.map +1 -0
  28. package/dist/es/utils/jsDoc.js +138 -0
  29. package/dist/es/utils/jsDoc.js.map +1 -0
  30. package/dist/es/utils/jsonSchemaBuilder.js +3415 -0
  31. package/dist/es/utils/jsonSchemaBuilder.js.map +1 -0
  32. package/dist/es/utils/mappedTypeSchemaResolver.js +265 -0
  33. package/dist/es/utils/mappedTypeSchemaResolver.js.map +1 -0
  34. package/dist/es/utils/objectTransformer.js +161 -0
  35. package/dist/es/utils/objectTransformer.js.map +1 -0
  36. package/dist/es/utils/regEx.js +128 -0
  37. package/dist/es/utils/regEx.js.map +1 -0
  38. package/dist/es/utils/resolver.js +177 -0
  39. package/dist/es/utils/resolver.js.map +1 -0
  40. package/dist/es/utils/templateLiteralPatternBuilder.js +94 -0
  41. package/dist/es/utils/templateLiteralPatternBuilder.js.map +1 -0
  42. package/dist/es/utils/typeScriptToSchema.js +319 -0
  43. package/dist/es/utils/typeScriptToSchema.js.map +1 -0
  44. package/dist/es/utils/utilityTypeSchemaMapper.js +475 -0
  45. package/dist/es/utils/utilityTypeSchemaMapper.js.map +1 -0
  46. package/dist/types/index.d.ts +21 -11
  47. package/dist/types/models/ITypeScriptToSchemaContext.d.ts +71 -0
  48. package/dist/types/models/ITypeScriptToSchemaDiagnostics.d.ts +31 -0
  49. package/dist/types/models/ITypeScriptToSchemaOptions.d.ts +22 -0
  50. package/dist/types/models/embeddedSchemaMode.d.ts +17 -0
  51. package/dist/types/utils/constants.d.ts +13 -0
  52. package/dist/types/utils/diagnosticReporter.d.ts +17 -0
  53. package/dist/types/utils/disallowedTypeGuard.d.ts +16 -0
  54. package/dist/types/utils/enum.d.ts +42 -0
  55. package/dist/types/utils/fileUtils.d.ts +66 -0
  56. package/dist/types/utils/importTypeQuerySchemaResolver.d.ts +87 -0
  57. package/dist/types/utils/indexSignaturePatternResolver.d.ts +21 -0
  58. package/dist/types/utils/intersectionSchemaMerger.d.ts +16 -0
  59. package/dist/types/utils/jsDoc.d.ts +53 -0
  60. package/dist/types/utils/jsonSchemaBuilder.d.ts +671 -0
  61. package/dist/types/utils/mappedTypeSchemaResolver.d.ts +81 -0
  62. package/dist/types/utils/objectTransformer.d.ts +33 -0
  63. package/dist/types/utils/regEx.d.ts +24 -0
  64. package/dist/types/utils/resolver.d.ts +22 -0
  65. package/dist/types/utils/templateLiteralPatternBuilder.d.ts +12 -0
  66. package/dist/types/utils/typeScriptToSchema.d.ts +92 -0
  67. package/dist/types/utils/utilityTypeSchemaMapper.d.ts +141 -0
  68. package/docs/changelog.md +343 -39
  69. package/docs/examples.md +87 -1
  70. package/docs/reference/classes/Constants.md +29 -0
  71. package/docs/reference/classes/DiagnosticReporter.md +49 -0
  72. package/docs/reference/classes/DisallowedTypeGuard.md +35 -0
  73. package/docs/reference/classes/Enum.md +93 -0
  74. package/docs/reference/classes/FileUtils.md +237 -0
  75. package/docs/reference/classes/ImportTypeQuerySchemaResolver.md +109 -0
  76. package/docs/reference/classes/IndexSignaturePatternResolver.md +69 -0
  77. package/docs/reference/classes/IntersectionSchemaMerger.md +48 -0
  78. package/docs/reference/classes/JsDoc.md +169 -0
  79. package/docs/reference/classes/JsonSchemaBuilder.md +2578 -0
  80. package/docs/reference/classes/MappedTypeSchemaResolver.md +275 -0
  81. package/docs/reference/classes/ObjectTransformer.md +119 -0
  82. package/docs/reference/classes/RegEx.md +99 -0
  83. package/docs/reference/classes/Resolver.md +52 -0
  84. package/docs/reference/classes/TemplateLiteralPatternBuilder.md +35 -0
  85. package/docs/reference/classes/TypeScriptToSchema.md +91 -0
  86. package/docs/reference/classes/UtilityTypeSchemaMapper.md +343 -0
  87. package/docs/reference/index.md +25 -11
  88. package/docs/reference/interfaces/ITypeScriptToSchemaContext.md +125 -0
  89. package/docs/reference/interfaces/ITypeScriptToSchemaDiagnostics.md +55 -0
  90. package/docs/reference/interfaces/ITypeScriptToSchemaOptions.md +44 -0
  91. package/docs/reference/type-aliases/EmbeddedSchemaMode.md +5 -0
  92. package/docs/reference/variables/EmbeddedSchemaMode.md +19 -0
  93. package/locales/en.json +32 -1
  94. package/package.json +8 -7
  95. package/dist/es/models/IJsonSchema.js +0 -2
  96. package/dist/es/models/IJsonSchema.js.map +0 -1
  97. package/dist/es/models/IOpenApi.js +0 -2
  98. package/dist/es/models/IOpenApi.js.map +0 -1
  99. package/dist/es/models/IOpenApiExample.js +0 -4
  100. package/dist/es/models/IOpenApiExample.js.map +0 -1
  101. package/dist/es/models/IOpenApiHeader.js +0 -4
  102. package/dist/es/models/IOpenApiHeader.js.map +0 -1
  103. package/dist/es/models/IOpenApiPathMethod.js +0 -2
  104. package/dist/es/models/IOpenApiPathMethod.js.map +0 -1
  105. package/dist/es/models/IOpenApiResponse.js +0 -2
  106. package/dist/es/models/IOpenApiResponse.js.map +0 -1
  107. package/dist/es/models/IOpenApiSecurityScheme.js +0 -4
  108. package/dist/es/models/IOpenApiSecurityScheme.js.map +0 -1
  109. package/dist/es/models/IPackageJson.js +0 -4
  110. package/dist/es/models/IPackageJson.js.map +0 -1
  111. package/dist/es/models/jsonTypeName.js +0 -2
  112. package/dist/es/models/jsonTypeName.js.map +0 -1
  113. package/dist/es/utils/jsonSchemaHelper.js +0 -258
  114. package/dist/es/utils/jsonSchemaHelper.js.map +0 -1
  115. package/dist/es/utils/openApiHelper.js +0 -12
  116. package/dist/es/utils/openApiHelper.js.map +0 -1
  117. package/dist/types/models/IJsonSchema.d.ts +0 -5
  118. package/dist/types/models/IOpenApi.d.ts +0 -54
  119. package/dist/types/models/IOpenApiExample.d.ts +0 -13
  120. package/dist/types/models/IOpenApiHeader.d.ts +0 -19
  121. package/dist/types/models/IOpenApiPathMethod.d.ts +0 -65
  122. package/dist/types/models/IOpenApiResponse.d.ts +0 -32
  123. package/dist/types/models/IOpenApiSecurityScheme.d.ts +0 -25
  124. package/dist/types/models/IPackageJson.d.ts +0 -15
  125. package/dist/types/models/jsonTypeName.d.ts +0 -5
  126. package/dist/types/utils/jsonSchemaHelper.d.ts +0 -78
  127. package/dist/types/utils/openApiHelper.d.ts +0 -9
  128. package/docs/reference/classes/JsonSchemaHelper.md +0 -233
  129. package/docs/reference/classes/OpenApiHelper.md +0 -21
  130. package/docs/reference/interfaces/IOpenApi.md +0 -103
  131. package/docs/reference/interfaces/IOpenApiExample.md +0 -19
  132. package/docs/reference/interfaces/IOpenApiHeader.md +0 -31
  133. package/docs/reference/interfaces/IOpenApiPathMethod.md +0 -119
  134. package/docs/reference/interfaces/IOpenApiResponse.md +0 -35
  135. package/docs/reference/interfaces/IOpenApiSecurityScheme.md +0 -43
  136. package/docs/reference/interfaces/IPackageJson.md +0 -23
  137. package/docs/reference/type-aliases/IJsonSchema.md +0 -5
  138. package/docs/reference/type-aliases/JsonTypeName.md +0 -5
package/docs/changelog.md CHANGED
@@ -1,138 +1,442 @@
1
1
  # Changelog
2
2
 
3
- ## [0.0.3-next.8](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.7...tools-core-v0.0.3-next.8) (2026-02-23)
3
+ ## [0.0.3](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3...tools-core-v0.0.3) (2026-05-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to production ([ad24b7e](https://github.com/iotaledger/twin-tools/commit/ad24b7eb16784165b6c93b5c48788199f0e17526))
9
+ * release to production ([#119](https://github.com/iotaledger/twin-tools/issues/119)) ([cc2828a](https://github.com/iotaledger/twin-tools/commit/cc2828a6c68466bfdeaf75b507bc980dddac2cf0))
10
+
11
+ ## [0.0.3-next.31](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.30...tools-core-v0.0.3-next.31) (2026-05-19)
12
+
13
+
14
+ ### Features
15
+
16
+ * update dependencies ([5bdd8be](https://github.com/iotaledger/twin-tools/commit/5bdd8becf9f08b35342ea8f298f74578951f4bac))
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * The following workspace dependencies were updated
22
+ * dependencies
23
+ * @twin.org/tools-models bumped from 0.0.3-next.30 to 0.0.3-next.31
24
+
25
+ ## [0.0.3-next.30](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.29...tools-core-v0.0.3-next.30) (2026-05-18)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * ajv stack overflow for oneOf on large enums ([#112](https://github.com/iotaledger/twin-tools/issues/112)) ([6be32a3](https://github.com/iotaledger/twin-tools/commit/6be32a3ae5b3cf188c0d1caf1080f497b648705c))
31
+
32
+
33
+ ### Dependencies
34
+
35
+ * The following workspace dependencies were updated
36
+ * dependencies
37
+ * @twin.org/tools-models bumped from 0.0.3-next.29 to 0.0.3-next.30
38
+
39
+ ## [0.0.3-next.29](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.28...tools-core-v0.0.3-next.29) (2026-05-14)
40
+
41
+
42
+ ### Features
43
+
44
+ * add examples to json schema ([#109](https://github.com/iotaledger/twin-tools/issues/109)) ([def5b13](https://github.com/iotaledger/twin-tools/commit/def5b1312e7a0ffefe662fb14575cb655d1c0774))
45
+
46
+
47
+ ### Dependencies
48
+
49
+ * The following workspace dependencies were updated
50
+ * dependencies
51
+ * @twin.org/tools-models bumped from 0.0.3-next.28 to 0.0.3-next.29
52
+
53
+ ## [0.0.3-next.28](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.27...tools-core-v0.0.3-next.28) (2026-05-11)
54
+
55
+
56
+ ### Features
57
+
58
+ * typescript 6 update ([02d2e47](https://github.com/iotaledger/twin-tools/commit/02d2e47859a1d64c81e840626cc2d443816af45b))
59
+
60
+
61
+ ### Dependencies
62
+
63
+ * The following workspace dependencies were updated
64
+ * dependencies
65
+ * @twin.org/tools-models bumped from 0.0.3-next.27 to 0.0.3-next.28
66
+
67
+ ## [0.0.3-next.27](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.26...tools-core-v0.0.3-next.27) (2026-03-27)
68
+
69
+
70
+ ### Miscellaneous Chores
71
+
72
+ * **tools-core:** Synchronize repo versions
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * The following workspace dependencies were updated
78
+ * dependencies
79
+ * @twin.org/tools-models bumped from 0.0.3-next.26 to 0.0.3-next.27
80
+
81
+ ## [0.0.3-next.26](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.25...tools-core-v0.0.3-next.26) (2026-03-27)
82
+
83
+
84
+ ### Features
85
+
86
+ * add json-schema embedded mode ([#102](https://github.com/iotaledger/twin-tools/issues/102)) ([f070967](https://github.com/iotaledger/twin-tools/commit/f070967f8f3308e0b5320eab278a319c9d229e3e))
87
+
88
+
89
+ ### Dependencies
90
+
91
+ * The following workspace dependencies were updated
92
+ * dependencies
93
+ * @twin.org/tools-models bumped from 0.0.3-next.25 to 0.0.3-next.26
94
+
95
+ ## [0.0.3-next.25](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.24...tools-core-v0.0.3-next.25) (2026-03-23)
96
+
97
+
98
+ ### Bug Fixes
99
+
100
+ * module resolution ([f3aa10c](https://github.com/iotaledger/twin-tools/commit/f3aa10c9c9af073de392a2ef6b8411e947e991c2))
101
+
102
+
103
+ ### Dependencies
104
+
105
+ * The following workspace dependencies were updated
106
+ * dependencies
107
+ * @twin.org/tools-models bumped from 0.0.3-next.24 to 0.0.3-next.25
108
+
109
+ ## [0.0.3-next.24](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.23...tools-core-v0.0.3-next.24) (2026-03-20)
110
+
111
+
112
+ ### Features
113
+
114
+ * use correct json-ld context schema ([c831486](https://github.com/iotaledger/twin-tools/commit/c8314864a63635556cd5f2912162a2989056e974))
115
+
116
+
117
+ ### Dependencies
118
+
119
+ * The following workspace dependencies were updated
120
+ * dependencies
121
+ * @twin.org/tools-models bumped from 0.0.3-next.23 to 0.0.3-next.24
122
+
123
+ ## [0.0.3-next.23](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.22...tools-core-v0.0.3-next.23) (2026-03-20)
124
+
125
+
126
+ ### Features
127
+
128
+ * improve inheritance redefinition optionality ([e7024f6](https://github.com/iotaledger/twin-tools/commit/e7024f699988c0b3de8315a0dbe455a13268e75d))
129
+
130
+
131
+ ### Dependencies
132
+
133
+ * The following workspace dependencies were updated
134
+ * dependencies
135
+ * @twin.org/tools-models bumped from 0.0.3-next.22 to 0.0.3-next.23
136
+
137
+ ## [0.0.3-next.22](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.21...tools-core-v0.0.3-next.22) (2026-03-20)
138
+
139
+
140
+ ### Features
141
+
142
+ * add context id features ([#54](https://github.com/iotaledger/twin-tools/issues/54)) ([41ad65d](https://github.com/iotaledger/twin-tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
143
+ * add jsdoc default value to schema ([7886a84](https://github.com/iotaledger/twin-tools/commit/7886a84961e692d2054f223e2e99205a654b76a6))
144
+ * add jsdoc tag validation ([971b8d3](https://github.com/iotaledger/twin-tools/commit/971b8d3817d40467bfd7549c99af602f0c590299))
145
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
146
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
147
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
148
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
149
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
150
+ * improve discriminated unions ([9c36ea7](https://github.com/iotaledger/twin-tools/commit/9c36ea7283230089ff19085ddc4b4c30a4e3f8a2))
151
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
152
+ * remove additionalProperties ([f9b5d81](https://github.com/iotaledger/twin-tools/commit/f9b5d81e952468f9579593cb979f2b84db6f0dfa))
153
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
154
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
155
+ * ts to schema ([#86](https://github.com/iotaledger/twin-tools/issues/86)) ([ffebda5](https://github.com/iotaledger/twin-tools/commit/ffebda5f14ab5ec734bf37c9fb70a7ec3d4012c3))
156
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
157
+ * use jsdoc tags for json-ld markup ([1ea872e](https://github.com/iotaledger/twin-tools/commit/1ea872e07a1cc0e94178158a57383d64008e02e3))
158
+
159
+
160
+ ### Bug Fixes
161
+
162
+ * additionalItems object check ([ca81668](https://github.com/iotaledger/twin-tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
163
+ * improve schema output ([9e53cbe](https://github.com/iotaledger/twin-tools/commit/9e53cbe26e6272323d72c65e277b7d24521fdbba))
164
+ * missing type definitions when importing relative from dynamic node_modules ([52d9fc5](https://github.com/iotaledger/twin-tools/commit/52d9fc5f2618a09c02b9f5dbe585b37cf60c9f20))
165
+ * work for schema generator spread defect ([1a705ff](https://github.com/iotaledger/twin-tools/commit/1a705ffc74b353f652e74ea43454164a2f6740bf))
166
+
167
+
168
+ ### Dependencies
169
+
170
+ * The following workspace dependencies were updated
171
+ * dependencies
172
+ * @twin.org/tools-models bumped from 0.0.3-next.21 to 0.0.3-next.22
173
+
174
+ ## [0.0.3-next.21](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.20...tools-core-v0.0.3-next.21) (2026-03-20)
175
+
176
+
177
+ ### Features
178
+
179
+ * add jsdoc tag validation ([971b8d3](https://github.com/iotaledger/twin-tools/commit/971b8d3817d40467bfd7549c99af602f0c590299))
180
+
181
+
182
+ ### Dependencies
183
+
184
+ * The following workspace dependencies were updated
185
+ * dependencies
186
+ * @twin.org/tools-models bumped from 0.0.3-next.20 to 0.0.3-next.21
187
+
188
+ ## [0.0.3-next.20](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.19...tools-core-v0.0.3-next.20) (2026-03-20)
189
+
190
+
191
+ ### Miscellaneous Chores
192
+
193
+ * **tools-core:** Synchronize repo versions
194
+
195
+
196
+ ### Dependencies
197
+
198
+ * The following workspace dependencies were updated
199
+ * dependencies
200
+ * @twin.org/tools-models bumped from 0.0.3-next.19 to 0.0.3-next.20
201
+
202
+ ## [0.0.3-next.19](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.18...tools-core-v0.0.3-next.19) (2026-03-19)
203
+
204
+
205
+ ### Miscellaneous Chores
206
+
207
+ * **tools-core:** Synchronize repo versions
208
+
209
+
210
+ ### Dependencies
211
+
212
+ * The following workspace dependencies were updated
213
+ * dependencies
214
+ * @twin.org/tools-models bumped from 0.0.3-next.18 to 0.0.3-next.19
215
+
216
+ ## [0.0.3-next.18](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.17...tools-core-v0.0.3-next.18) (2026-03-19)
217
+
218
+
219
+ ### Features
220
+
221
+ * add jsdoc default value to schema ([7886a84](https://github.com/iotaledger/twin-tools/commit/7886a84961e692d2054f223e2e99205a654b76a6))
222
+
223
+
224
+ ### Dependencies
225
+
226
+ * The following workspace dependencies were updated
227
+ * dependencies
228
+ * @twin.org/tools-models bumped from 0.0.3-next.17 to 0.0.3-next.18
229
+
230
+ ## [0.0.3-next.17](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.16...tools-core-v0.0.3-next.17) (2026-03-19)
231
+
232
+
233
+ ### Features
234
+
235
+ * improve discriminated unions ([9c36ea7](https://github.com/iotaledger/twin-tools/commit/9c36ea7283230089ff19085ddc4b4c30a4e3f8a2))
236
+
237
+
238
+ ### Dependencies
239
+
240
+ * The following workspace dependencies were updated
241
+ * dependencies
242
+ * @twin.org/tools-models bumped from 0.0.3-next.16 to 0.0.3-next.17
243
+
244
+ ## [0.0.3-next.16](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.15...tools-core-v0.0.3-next.16) (2026-03-19)
245
+
246
+
247
+ ### Features
248
+
249
+ * ts to schema ([#86](https://github.com/iotaledger/twin-tools/issues/86)) ([ffebda5](https://github.com/iotaledger/twin-tools/commit/ffebda5f14ab5ec734bf37c9fb70a7ec3d4012c3))
250
+
251
+
252
+ ### Dependencies
253
+
254
+ * The following workspace dependencies were updated
255
+ * dependencies
256
+ * @twin.org/tools-models bumped from 0.0.3-next.15 to 0.0.3-next.16
257
+
258
+ ## [0.0.3-next.15](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.14...tools-core-v0.0.3-next.15) (2026-03-10)
259
+
260
+
261
+ ### Features
262
+
263
+ * use jsdoc tags for json-ld markup ([1ea872e](https://github.com/iotaledger/twin-tools/commit/1ea872e07a1cc0e94178158a57383d64008e02e3))
264
+
265
+ ## [0.0.3-next.14](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.13...tools-core-v0.0.3-next.14) (2026-03-06)
266
+
267
+
268
+ ### Bug Fixes
269
+
270
+ * improve schema output ([9e53cbe](https://github.com/iotaledger/twin-tools/commit/9e53cbe26e6272323d72c65e277b7d24521fdbba))
271
+
272
+ ## [0.0.3-next.13](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.12...tools-core-v0.0.3-next.13) (2026-03-05)
273
+
274
+
275
+ ### Bug Fixes
276
+
277
+ * work for schema generator spread defect ([1a705ff](https://github.com/iotaledger/twin-tools/commit/1a705ffc74b353f652e74ea43454164a2f6740bf))
278
+
279
+ ## [0.0.3-next.12](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.11...tools-core-v0.0.3-next.12) (2026-02-27)
280
+
281
+
282
+ ### Miscellaneous Chores
283
+
284
+ * **tools-core:** Synchronize repo versions
285
+
286
+ ## [0.0.3-next.11](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.10...tools-core-v0.0.3-next.11) (2026-02-25)
287
+
288
+
289
+ ### Miscellaneous Chores
290
+
291
+ * **tools-core:** Synchronize repo versions
292
+
293
+ ## [0.0.3-next.10](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.9...tools-core-v0.0.3-next.10) (2026-02-25)
294
+
295
+
296
+ ### Features
297
+
298
+ * remove additionalProperties ([f9b5d81](https://github.com/iotaledger/twin-tools/commit/f9b5d81e952468f9579593cb979f2b84db6f0dfa))
299
+
300
+ ## [0.0.3-next.9](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.8...tools-core-v0.0.3-next.9) (2026-02-24)
301
+
302
+
303
+ ### Miscellaneous Chores
304
+
305
+ * **tools-core:** Synchronize repo versions
306
+
307
+ ## [0.0.3-next.8](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.7...tools-core-v0.0.3-next.8) (2026-02-23)
4
308
 
5
309
 
6
310
  ### Miscellaneous Chores
7
311
 
8
312
  * **tools-core:** Synchronize repo versions
9
313
 
10
- ## [0.0.3-next.7](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.6...tools-core-v0.0.3-next.7) (2026-02-04)
314
+ ## [0.0.3-next.7](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.6...tools-core-v0.0.3-next.7) (2026-02-04)
11
315
 
12
316
 
13
317
  ### Miscellaneous Chores
14
318
 
15
319
  * **tools-core:** Synchronize repo versions
16
320
 
17
- ## [0.0.3-next.6](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.5...tools-core-v0.0.3-next.6) (2026-01-28)
321
+ ## [0.0.3-next.6](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.5...tools-core-v0.0.3-next.6) (2026-01-28)
18
322
 
19
323
 
20
324
  ### Miscellaneous Chores
21
325
 
22
326
  * **tools-core:** Synchronize repo versions
23
327
 
24
- ## [0.0.3-next.5](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.4...tools-core-v0.0.3-next.5) (2026-01-06)
328
+ ## [0.0.3-next.5](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.4...tools-core-v0.0.3-next.5) (2026-01-06)
25
329
 
26
330
 
27
331
  ### Miscellaneous Chores
28
332
 
29
333
  * **tools-core:** Synchronize repo versions
30
334
 
31
- ## [0.0.3-next.4](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.3...tools-core-v0.0.3-next.4) (2026-01-05)
335
+ ## [0.0.3-next.4](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.3...tools-core-v0.0.3-next.4) (2026-01-05)
32
336
 
33
337
 
34
338
  ### Miscellaneous Chores
35
339
 
36
340
  * **tools-core:** Synchronize repo versions
37
341
 
38
- ## [0.0.3-next.3](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.2...tools-core-v0.0.3-next.3) (2025-11-11)
342
+ ## [0.0.3-next.3](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.2...tools-core-v0.0.3-next.3) (2025-11-11)
39
343
 
40
344
 
41
345
  ### Miscellaneous Chores
42
346
 
43
347
  * **tools-core:** Synchronize repo versions
44
348
 
45
- ## [0.0.3-next.2](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.1...tools-core-v0.0.3-next.2) (2025-11-11)
349
+ ## [0.0.3-next.2](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.1...tools-core-v0.0.3-next.2) (2025-11-11)
46
350
 
47
351
 
48
352
  ### Bug Fixes
49
353
 
50
- * additionalItems object check ([ca81668](https://github.com/twinfoundation/tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
354
+ * additionalItems object check ([ca81668](https://github.com/iotaledger/twin-tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
51
355
 
52
- ## [0.0.3-next.1](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.3-next.0...tools-core-v0.0.3-next.1) (2025-11-10)
356
+ ## [0.0.3-next.1](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.3-next.0...tools-core-v0.0.3-next.1) (2025-11-10)
53
357
 
54
358
 
55
359
  ### Features
56
360
 
57
- * add context id features ([#54](https://github.com/twinfoundation/tools/issues/54)) ([41ad65d](https://github.com/twinfoundation/tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
58
- * add support for auto expand types ([dd1e10a](https://github.com/twinfoundation/tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
59
- * add validate-locales ([97bb11f](https://github.com/twinfoundation/tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
60
- * correctly handle auto expand types ([57fce0f](https://github.com/twinfoundation/tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
61
- * eslint migration to flat config ([25acfcf](https://github.com/twinfoundation/tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
62
- * improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
63
- * improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
64
- * remove auto expanded types from final output ([18e05dc](https://github.com/twinfoundation/tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
65
- * tighten the types included with the regex matching ([e54909b](https://github.com/twinfoundation/tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
66
- * update framework core ([559cb98](https://github.com/twinfoundation/tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
361
+ * add context id features ([#54](https://github.com/iotaledger/twin-tools/issues/54)) ([41ad65d](https://github.com/iotaledger/twin-tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
362
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
363
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
364
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
365
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
366
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
367
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
368
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
369
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
370
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
67
371
 
68
- ## [0.0.2-next.10](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.9...tools-core-v0.0.2-next.10) (2025-10-09)
372
+ ## [0.0.2-next.10](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.9...tools-core-v0.0.2-next.10) (2025-10-09)
69
373
 
70
374
 
71
375
  ### Features
72
376
 
73
- * add validate-locales ([97bb11f](https://github.com/twinfoundation/tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
377
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
74
378
 
75
- ## [0.0.2-next.9](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.8...tools-core-v0.0.2-next.9) (2025-09-23)
379
+ ## [0.0.2-next.9](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.8...tools-core-v0.0.2-next.9) (2025-09-23)
76
380
 
77
381
 
78
382
  ### Miscellaneous Chores
79
383
 
80
384
  * **tools-core:** Synchronize repo versions
81
385
 
82
- ## [0.0.2-next.8](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.7...tools-core-v0.0.2-next.8) (2025-09-05)
386
+ ## [0.0.2-next.8](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.7...tools-core-v0.0.2-next.8) (2025-09-05)
83
387
 
84
388
 
85
389
  ### Features
86
390
 
87
- * tighten the types included with the regex matching ([e54909b](https://github.com/twinfoundation/tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
391
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
88
392
 
89
- ## [0.0.2-next.7](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.6...tools-core-v0.0.2-next.7) (2025-08-29)
393
+ ## [0.0.2-next.7](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.6...tools-core-v0.0.2-next.7) (2025-08-29)
90
394
 
91
395
 
92
396
  ### Features
93
397
 
94
- * eslint migration to flat config ([25acfcf](https://github.com/twinfoundation/tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
398
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
95
399
 
96
- ## [0.0.2-next.6](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.5...tools-core-v0.0.2-next.6) (2025-08-21)
400
+ ## [0.0.2-next.6](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.5...tools-core-v0.0.2-next.6) (2025-08-21)
97
401
 
98
402
 
99
403
  ### Features
100
404
 
101
- * remove auto expanded types from final output ([18e05dc](https://github.com/twinfoundation/tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
405
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
102
406
 
103
- ## [0.0.2-next.5](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.4...tools-core-v0.0.2-next.5) (2025-08-19)
407
+ ## [0.0.2-next.5](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.4...tools-core-v0.0.2-next.5) (2025-08-19)
104
408
 
105
409
 
106
410
  ### Features
107
411
 
108
- * correctly handle auto expand types ([57fce0f](https://github.com/twinfoundation/tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
412
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
109
413
 
110
- ## [0.0.2-next.4](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.3...tools-core-v0.0.2-next.4) (2025-08-19)
414
+ ## [0.0.2-next.4](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.3...tools-core-v0.0.2-next.4) (2025-08-19)
111
415
 
112
416
 
113
417
  ### Features
114
418
 
115
- * update framework core ([559cb98](https://github.com/twinfoundation/tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
419
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
116
420
 
117
- ## [0.0.2-next.3](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.2...tools-core-v0.0.2-next.3) (2025-08-05)
421
+ ## [0.0.2-next.3](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.2...tools-core-v0.0.2-next.3) (2025-08-05)
118
422
 
119
423
 
120
424
  ### Features
121
425
 
122
- * improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
426
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
123
427
 
124
- ## [0.0.2-next.2](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.1...tools-core-v0.0.2-next.2) (2025-07-17)
428
+ ## [0.0.2-next.2](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.1...tools-core-v0.0.2-next.2) (2025-07-17)
125
429
 
126
430
 
127
431
  ### Features
128
432
 
129
- * improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
433
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
130
434
 
131
- ## [0.0.2-next.1](https://github.com/twinfoundation/tools/compare/tools-core-v0.0.2-next.0...tools-core-v0.0.2-next.1) (2025-07-14)
435
+ ## [0.0.2-next.1](https://github.com/iotaledger/twin-tools/compare/tools-core-v0.0.2-next.0...tools-core-v0.0.2-next.1) (2025-07-14)
132
436
 
133
437
 
134
438
  ### Features
135
439
 
136
- * add support for auto expand types ([dd1e10a](https://github.com/twinfoundation/tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
440
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
137
441
 
138
- ## @twin.org/tools-core - Changelog
442
+ ## Changelog
package/docs/examples.md CHANGED
@@ -1 +1,87 @@
1
- # @twin.org/tools-core - Examples
1
+ # Tools Core Examples
2
+
3
+ This package provides the lower-level building blocks used by the CLI applications. The most common entry point is `TypeScriptToSchema`, which parses TypeScript declarations and returns JSON Schema documents keyed by title.
4
+
5
+ ## Generate Schemas From TypeScript
6
+
7
+ ```ts
8
+ import type { IJsonSchema } from '@twin.org/tools-models';
9
+ import { TypeScriptToSchema } from '@twin.org/tools-core';
10
+
11
+ const converter = new TypeScriptToSchema();
12
+ const packageSchemas: { [id: string]: { [id: string]: IJsonSchema } } = {};
13
+
14
+ const generatedSchemas = await converter.generateSchema(
15
+ 'https://schema.example.com/demo/',
16
+ '@example/demo-package',
17
+ packageSchemas,
18
+ './dist/types/models.d.ts'
19
+ );
20
+
21
+ console.log(Object.keys(generatedSchemas));
22
+ ```
23
+
24
+ When you already know the exported type you want, pass the type name instead of a file path. The helper resolves the declaration and returns the generated schema for that type together with any dependent schemas.
25
+
26
+ ```ts
27
+ import type { IJsonSchema } from '@twin.org/tools-models';
28
+ import { TypeScriptToSchema } from '@twin.org/tools-core';
29
+
30
+ const converter = new TypeScriptToSchema();
31
+ const packageSchemas: { [id: string]: { [id: string]: IJsonSchema } } = {};
32
+
33
+ const generatedSchemas = await converter.generateSchema(
34
+ 'https://schema.example.com/demo/',
35
+ '@example/demo-package',
36
+ packageSchemas,
37
+ 'DemoRequest'
38
+ );
39
+
40
+ const requestSchema = generatedSchemas.DemoRequest;
41
+ ```
42
+
43
+ ## Transform Generated Object Schemas
44
+
45
+ `TypeScriptSchemaObjectTransformer` helps when you need to adapt object schemas produced by the builder for utility types such as `Pick` and `Omit`, or when you want cleaner description text before serialising the result.
46
+
47
+ ```ts
48
+ import type { IJsonSchema } from '@twin.org/tools-models';
49
+ import { TypeScriptSchemaObjectTransformer } from '@twin.org/tools-core';
50
+
51
+ const transformer = new TypeScriptSchemaObjectTransformer();
52
+
53
+ const personSchema: IJsonSchema = {
54
+ title: 'Person',
55
+ type: 'object',
56
+ properties: {
57
+ id: { type: 'string' },
58
+ name: { type: 'string' },
59
+ email: { type: 'string', format: 'email' }
60
+ },
61
+ required: ['id', 'name', 'email']
62
+ };
63
+
64
+ const publicPersonSchema = transformer.omitKeysFromObjectSchema(personSchema, ['email']);
65
+ const personSummarySchema = transformer.pickKeysFromObjectSchema(personSchema, ['id', 'name']);
66
+ ```
67
+
68
+ If your schema descriptions come from multiline source comments, `normalizeSchemaDescriptions` removes duplicated whitespace while keeping intentional line breaks intact.
69
+
70
+ ```ts
71
+ import type { IJsonSchema } from '@twin.org/tools-models';
72
+ import { TypeScriptSchemaObjectTransformer } from '@twin.org/tools-core';
73
+
74
+ const transformer = new TypeScriptSchemaObjectTransformer();
75
+
76
+ const schemaWithDescription: IJsonSchema = {
77
+ type: 'object',
78
+ properties: {
79
+ status: {
80
+ type: 'string',
81
+ description: 'Current status.\n\n Used in responses.'
82
+ }
83
+ }
84
+ };
85
+
86
+ const normalisedSchema = transformer.normalizeSchemaDescriptions(schemaWithDescription);
87
+ ```
@@ -0,0 +1,29 @@
1
+ # Class: Constants
2
+
3
+ Shared constants for TypeScript to JSON schema generation.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new Constants**(): `Constants`
10
+
11
+ #### Returns
12
+
13
+ `Constants`
14
+
15
+ ## Properties
16
+
17
+ ### UNSUPPORTED\_UTILITY\_TYPE\_NAMES {#unsupported_utility_type_names}
18
+
19
+ > `readonly` `static` **UNSUPPORTED\_UTILITY\_TYPE\_NAMES**: `string`[]
20
+
21
+ Utility type names currently unsupported and mapped to open schemas with diagnostics.
22
+
23
+ ***
24
+
25
+ ### ARRAY\_NUMBER\_TYPE\_NAMES {#array_number_type_names}
26
+
27
+ > `readonly` `static` **ARRAY\_NUMBER\_TYPE\_NAMES**: `string`[]
28
+
29
+ Native typed-array and binary type names mapped to JSON number arrays.
@@ -0,0 +1,49 @@
1
+ # Class: DiagnosticReporter
2
+
3
+ Emits non-fatal diagnostics during schema mapping.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new DiagnosticReporter**(): `DiagnosticReporter`
10
+
11
+ #### Returns
12
+
13
+ `DiagnosticReporter`
14
+
15
+ ## Methods
16
+
17
+ ### report() {#report}
18
+
19
+ > `static` **report**(`context`, `node`, `code`, `properties?`): `void`
20
+
21
+ Emit an optional non-fatal schema generation diagnostic.
22
+
23
+ #### Parameters
24
+
25
+ ##### context
26
+
27
+ [`ITypeScriptToSchemaContext`](../interfaces/ITypeScriptToSchemaContext.md)
28
+
29
+ The generation context.
30
+
31
+ ##### node
32
+
33
+ `Node`
34
+
35
+ The related AST node.
36
+
37
+ ##### code
38
+
39
+ `string`
40
+
41
+ The diagnostic code.
42
+
43
+ ##### properties?
44
+
45
+ The values to substitute into the localised message.
46
+
47
+ #### Returns
48
+
49
+ `void`