@twin.org/tools-core 0.0.3-next.3 → 0.0.3-next.31

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 +365 -34
  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 +6 -5
  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,103 +1,434 @@
1
1
  # Changelog
2
2
 
3
- ## [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)
3
+ ## [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)
4
+
5
+
6
+ ### Features
7
+
8
+ * update dependencies ([5bdd8be](https://github.com/iotaledger/twin-tools/commit/5bdd8becf9f08b35342ea8f298f74578951f4bac))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/tools-models bumped from 0.0.3-next.30 to 0.0.3-next.31
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * 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))
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * dependencies
29
+ * @twin.org/tools-models bumped from 0.0.3-next.29 to 0.0.3-next.30
30
+
31
+ ## [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)
32
+
33
+
34
+ ### Features
35
+
36
+ * add examples to json schema ([#109](https://github.com/iotaledger/twin-tools/issues/109)) ([def5b13](https://github.com/iotaledger/twin-tools/commit/def5b1312e7a0ffefe662fb14575cb655d1c0774))
37
+
38
+
39
+ ### Dependencies
40
+
41
+ * The following workspace dependencies were updated
42
+ * dependencies
43
+ * @twin.org/tools-models bumped from 0.0.3-next.28 to 0.0.3-next.29
44
+
45
+ ## [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)
46
+
47
+
48
+ ### Features
49
+
50
+ * typescript 6 update ([02d2e47](https://github.com/iotaledger/twin-tools/commit/02d2e47859a1d64c81e840626cc2d443816af45b))
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * The following workspace dependencies were updated
56
+ * dependencies
57
+ * @twin.org/tools-models bumped from 0.0.3-next.27 to 0.0.3-next.28
58
+
59
+ ## [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)
60
+
61
+
62
+ ### Miscellaneous Chores
63
+
64
+ * **tools-core:** Synchronize repo versions
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * The following workspace dependencies were updated
70
+ * dependencies
71
+ * @twin.org/tools-models bumped from 0.0.3-next.26 to 0.0.3-next.27
72
+
73
+ ## [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)
74
+
75
+
76
+ ### Features
77
+
78
+ * add json-schema embedded mode ([#102](https://github.com/iotaledger/twin-tools/issues/102)) ([f070967](https://github.com/iotaledger/twin-tools/commit/f070967f8f3308e0b5320eab278a319c9d229e3e))
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * The following workspace dependencies were updated
84
+ * dependencies
85
+ * @twin.org/tools-models bumped from 0.0.3-next.25 to 0.0.3-next.26
86
+
87
+ ## [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)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * module resolution ([f3aa10c](https://github.com/iotaledger/twin-tools/commit/f3aa10c9c9af073de392a2ef6b8411e947e991c2))
93
+
94
+
95
+ ### Dependencies
96
+
97
+ * The following workspace dependencies were updated
98
+ * dependencies
99
+ * @twin.org/tools-models bumped from 0.0.3-next.24 to 0.0.3-next.25
100
+
101
+ ## [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)
102
+
103
+
104
+ ### Features
105
+
106
+ * use correct json-ld context schema ([c831486](https://github.com/iotaledger/twin-tools/commit/c8314864a63635556cd5f2912162a2989056e974))
107
+
108
+
109
+ ### Dependencies
110
+
111
+ * The following workspace dependencies were updated
112
+ * dependencies
113
+ * @twin.org/tools-models bumped from 0.0.3-next.23 to 0.0.3-next.24
114
+
115
+ ## [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)
116
+
117
+
118
+ ### Features
119
+
120
+ * improve inheritance redefinition optionality ([e7024f6](https://github.com/iotaledger/twin-tools/commit/e7024f699988c0b3de8315a0dbe455a13268e75d))
121
+
122
+
123
+ ### Dependencies
124
+
125
+ * The following workspace dependencies were updated
126
+ * dependencies
127
+ * @twin.org/tools-models bumped from 0.0.3-next.22 to 0.0.3-next.23
128
+
129
+ ## [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)
130
+
131
+
132
+ ### Features
133
+
134
+ * add context id features ([#54](https://github.com/iotaledger/twin-tools/issues/54)) ([41ad65d](https://github.com/iotaledger/twin-tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
135
+ * add jsdoc default value to schema ([7886a84](https://github.com/iotaledger/twin-tools/commit/7886a84961e692d2054f223e2e99205a654b76a6))
136
+ * add jsdoc tag validation ([971b8d3](https://github.com/iotaledger/twin-tools/commit/971b8d3817d40467bfd7549c99af602f0c590299))
137
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
138
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
139
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
140
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
141
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
142
+ * improve discriminated unions ([9c36ea7](https://github.com/iotaledger/twin-tools/commit/9c36ea7283230089ff19085ddc4b4c30a4e3f8a2))
143
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
144
+ * remove additionalProperties ([f9b5d81](https://github.com/iotaledger/twin-tools/commit/f9b5d81e952468f9579593cb979f2b84db6f0dfa))
145
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
146
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
147
+ * ts to schema ([#86](https://github.com/iotaledger/twin-tools/issues/86)) ([ffebda5](https://github.com/iotaledger/twin-tools/commit/ffebda5f14ab5ec734bf37c9fb70a7ec3d4012c3))
148
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
149
+ * use jsdoc tags for json-ld markup ([1ea872e](https://github.com/iotaledger/twin-tools/commit/1ea872e07a1cc0e94178158a57383d64008e02e3))
150
+
151
+
152
+ ### Bug Fixes
153
+
154
+ * additionalItems object check ([ca81668](https://github.com/iotaledger/twin-tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
155
+ * improve schema output ([9e53cbe](https://github.com/iotaledger/twin-tools/commit/9e53cbe26e6272323d72c65e277b7d24521fdbba))
156
+ * missing type definitions when importing relative from dynamic node_modules ([52d9fc5](https://github.com/iotaledger/twin-tools/commit/52d9fc5f2618a09c02b9f5dbe585b37cf60c9f20))
157
+ * work for schema generator spread defect ([1a705ff](https://github.com/iotaledger/twin-tools/commit/1a705ffc74b353f652e74ea43454164a2f6740bf))
158
+
159
+
160
+ ### Dependencies
161
+
162
+ * The following workspace dependencies were updated
163
+ * dependencies
164
+ * @twin.org/tools-models bumped from 0.0.3-next.21 to 0.0.3-next.22
165
+
166
+ ## [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)
167
+
168
+
169
+ ### Features
170
+
171
+ * add jsdoc tag validation ([971b8d3](https://github.com/iotaledger/twin-tools/commit/971b8d3817d40467bfd7549c99af602f0c590299))
172
+
173
+
174
+ ### Dependencies
175
+
176
+ * The following workspace dependencies were updated
177
+ * dependencies
178
+ * @twin.org/tools-models bumped from 0.0.3-next.20 to 0.0.3-next.21
179
+
180
+ ## [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)
181
+
182
+
183
+ ### Miscellaneous Chores
184
+
185
+ * **tools-core:** Synchronize repo versions
186
+
187
+
188
+ ### Dependencies
189
+
190
+ * The following workspace dependencies were updated
191
+ * dependencies
192
+ * @twin.org/tools-models bumped from 0.0.3-next.19 to 0.0.3-next.20
193
+
194
+ ## [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)
195
+
196
+
197
+ ### Miscellaneous Chores
198
+
199
+ * **tools-core:** Synchronize repo versions
200
+
201
+
202
+ ### Dependencies
203
+
204
+ * The following workspace dependencies were updated
205
+ * dependencies
206
+ * @twin.org/tools-models bumped from 0.0.3-next.18 to 0.0.3-next.19
207
+
208
+ ## [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)
209
+
210
+
211
+ ### Features
212
+
213
+ * add jsdoc default value to schema ([7886a84](https://github.com/iotaledger/twin-tools/commit/7886a84961e692d2054f223e2e99205a654b76a6))
214
+
215
+
216
+ ### Dependencies
217
+
218
+ * The following workspace dependencies were updated
219
+ * dependencies
220
+ * @twin.org/tools-models bumped from 0.0.3-next.17 to 0.0.3-next.18
221
+
222
+ ## [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)
223
+
224
+
225
+ ### Features
226
+
227
+ * improve discriminated unions ([9c36ea7](https://github.com/iotaledger/twin-tools/commit/9c36ea7283230089ff19085ddc4b4c30a4e3f8a2))
228
+
229
+
230
+ ### Dependencies
231
+
232
+ * The following workspace dependencies were updated
233
+ * dependencies
234
+ * @twin.org/tools-models bumped from 0.0.3-next.16 to 0.0.3-next.17
235
+
236
+ ## [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)
237
+
238
+
239
+ ### Features
240
+
241
+ * ts to schema ([#86](https://github.com/iotaledger/twin-tools/issues/86)) ([ffebda5](https://github.com/iotaledger/twin-tools/commit/ffebda5f14ab5ec734bf37c9fb70a7ec3d4012c3))
242
+
243
+
244
+ ### Dependencies
245
+
246
+ * The following workspace dependencies were updated
247
+ * dependencies
248
+ * @twin.org/tools-models bumped from 0.0.3-next.15 to 0.0.3-next.16
249
+
250
+ ## [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)
251
+
252
+
253
+ ### Features
254
+
255
+ * use jsdoc tags for json-ld markup ([1ea872e](https://github.com/iotaledger/twin-tools/commit/1ea872e07a1cc0e94178158a57383d64008e02e3))
256
+
257
+ ## [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)
258
+
259
+
260
+ ### Bug Fixes
261
+
262
+ * improve schema output ([9e53cbe](https://github.com/iotaledger/twin-tools/commit/9e53cbe26e6272323d72c65e277b7d24521fdbba))
263
+
264
+ ## [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)
265
+
266
+
267
+ ### Bug Fixes
268
+
269
+ * work for schema generator spread defect ([1a705ff](https://github.com/iotaledger/twin-tools/commit/1a705ffc74b353f652e74ea43454164a2f6740bf))
270
+
271
+ ## [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)
272
+
273
+
274
+ ### Miscellaneous Chores
275
+
276
+ * **tools-core:** Synchronize repo versions
277
+
278
+ ## [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)
279
+
280
+
281
+ ### Miscellaneous Chores
282
+
283
+ * **tools-core:** Synchronize repo versions
284
+
285
+ ## [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)
286
+
287
+
288
+ ### Features
289
+
290
+ * remove additionalProperties ([f9b5d81](https://github.com/iotaledger/twin-tools/commit/f9b5d81e952468f9579593cb979f2b84db6f0dfa))
291
+
292
+ ## [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)
293
+
294
+
295
+ ### Miscellaneous Chores
296
+
297
+ * **tools-core:** Synchronize repo versions
298
+
299
+ ## [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)
300
+
301
+
302
+ ### Miscellaneous Chores
303
+
304
+ * **tools-core:** Synchronize repo versions
305
+
306
+ ## [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)
307
+
308
+
309
+ ### Miscellaneous Chores
310
+
311
+ * **tools-core:** Synchronize repo versions
312
+
313
+ ## [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)
314
+
315
+
316
+ ### Miscellaneous Chores
317
+
318
+ * **tools-core:** Synchronize repo versions
319
+
320
+ ## [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)
321
+
322
+
323
+ ### Miscellaneous Chores
324
+
325
+ * **tools-core:** Synchronize repo versions
326
+
327
+ ## [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)
328
+
329
+
330
+ ### Miscellaneous Chores
331
+
332
+ * **tools-core:** Synchronize repo versions
333
+
334
+ ## [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)
4
335
 
5
336
 
6
337
  ### Miscellaneous Chores
7
338
 
8
339
  * **tools-core:** Synchronize repo versions
9
340
 
10
- ## [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)
341
+ ## [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)
11
342
 
12
343
 
13
344
  ### Bug Fixes
14
345
 
15
- * additionalItems object check ([ca81668](https://github.com/twinfoundation/tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
346
+ * additionalItems object check ([ca81668](https://github.com/iotaledger/twin-tools/commit/ca81668e1ee0d2b1a479215265e651932d7b76de))
16
347
 
17
- ## [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)
348
+ ## [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)
18
349
 
19
350
 
20
351
  ### Features
21
352
 
22
- * add context id features ([#54](https://github.com/twinfoundation/tools/issues/54)) ([41ad65d](https://github.com/twinfoundation/tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
23
- * add support for auto expand types ([dd1e10a](https://github.com/twinfoundation/tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
24
- * add validate-locales ([97bb11f](https://github.com/twinfoundation/tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
25
- * correctly handle auto expand types ([57fce0f](https://github.com/twinfoundation/tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
26
- * eslint migration to flat config ([25acfcf](https://github.com/twinfoundation/tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
27
- * improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
28
- * improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
29
- * remove auto expanded types from final output ([18e05dc](https://github.com/twinfoundation/tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
30
- * tighten the types included with the regex matching ([e54909b](https://github.com/twinfoundation/tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
31
- * update framework core ([559cb98](https://github.com/twinfoundation/tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
353
+ * add context id features ([#54](https://github.com/iotaledger/twin-tools/issues/54)) ([41ad65d](https://github.com/iotaledger/twin-tools/commit/41ad65d5ae33d0533d32a2864cd94e5c35e56c76))
354
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
355
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
356
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
357
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
358
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
359
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
360
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
361
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
362
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
32
363
 
33
- ## [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)
364
+ ## [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)
34
365
 
35
366
 
36
367
  ### Features
37
368
 
38
- * add validate-locales ([97bb11f](https://github.com/twinfoundation/tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
369
+ * add validate-locales ([97bb11f](https://github.com/iotaledger/twin-tools/commit/97bb11fd9e6ed400e7fa69671075ba78f36ca6e6))
39
370
 
40
- ## [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)
371
+ ## [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)
41
372
 
42
373
 
43
374
  ### Miscellaneous Chores
44
375
 
45
376
  * **tools-core:** Synchronize repo versions
46
377
 
47
- ## [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)
378
+ ## [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)
48
379
 
49
380
 
50
381
  ### Features
51
382
 
52
- * tighten the types included with the regex matching ([e54909b](https://github.com/twinfoundation/tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
383
+ * tighten the types included with the regex matching ([e54909b](https://github.com/iotaledger/twin-tools/commit/e54909bded4a19d00560dd3ec783e9146580bda3))
53
384
 
54
- ## [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)
385
+ ## [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)
55
386
 
56
387
 
57
388
  ### Features
58
389
 
59
- * eslint migration to flat config ([25acfcf](https://github.com/twinfoundation/tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
390
+ * eslint migration to flat config ([25acfcf](https://github.com/iotaledger/twin-tools/commit/25acfcf4c4e0c496fffeaf67659fe171bc15199a))
60
391
 
61
- ## [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)
392
+ ## [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)
62
393
 
63
394
 
64
395
  ### Features
65
396
 
66
- * remove auto expanded types from final output ([18e05dc](https://github.com/twinfoundation/tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
397
+ * remove auto expanded types from final output ([18e05dc](https://github.com/iotaledger/twin-tools/commit/18e05dc88f71a0a27b79d1d076b1261b42d2c4c2))
67
398
 
68
- ## [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)
399
+ ## [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)
69
400
 
70
401
 
71
402
  ### Features
72
403
 
73
- * correctly handle auto expand types ([57fce0f](https://github.com/twinfoundation/tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
404
+ * correctly handle auto expand types ([57fce0f](https://github.com/iotaledger/twin-tools/commit/57fce0f9ec4a0876665d70adc6e885f6feb3caf7))
74
405
 
75
- ## [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)
406
+ ## [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)
76
407
 
77
408
 
78
409
  ### Features
79
410
 
80
- * update framework core ([559cb98](https://github.com/twinfoundation/tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
411
+ * update framework core ([559cb98](https://github.com/iotaledger/twin-tools/commit/559cb98612c05a05458b37462cda806b9591b18a))
81
412
 
82
- ## [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)
413
+ ## [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)
83
414
 
84
415
 
85
416
  ### Features
86
417
 
87
- * improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
418
+ * improve type name normalisation ([1fe28e5](https://github.com/iotaledger/twin-tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
88
419
 
89
- ## [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)
420
+ ## [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)
90
421
 
91
422
 
92
423
  ### Features
93
424
 
94
- * improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
425
+ * improve auto expand types ([6181d1d](https://github.com/iotaledger/twin-tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
95
426
 
96
- ## [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)
427
+ ## [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)
97
428
 
98
429
 
99
430
  ### Features
100
431
 
101
- * add support for auto expand types ([dd1e10a](https://github.com/twinfoundation/tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
432
+ * add support for auto expand types ([dd1e10a](https://github.com/iotaledger/twin-tools/commit/dd1e10a5b2fea6f80890ff6f3971f48e239cb4c1))
102
433
 
103
- ## @twin.org/tools-core - Changelog
434
+ ## 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`
@@ -0,0 +1,35 @@
1
+ # Class: DisallowedTypeGuard
2
+
3
+ Validates whether a type node is allowed for schema generation.
4
+
5
+ ## Constructors
6
+
7
+ ### Constructor
8
+
9
+ > **new DisallowedTypeGuard**(): `DisallowedTypeGuard`
10
+
11
+ #### Returns
12
+
13
+ `DisallowedTypeGuard`
14
+
15
+ ## Methods
16
+
17
+ ### getDisallowedTypeName() {#getdisallowedtypename}
18
+
19
+ > `static` **getDisallowedTypeName**(`typeNode`): `string` \| `undefined`
20
+
21
+ Resolve a disallowed type name from a type node.
22
+
23
+ #### Parameters
24
+
25
+ ##### typeNode
26
+
27
+ `TypeNode`
28
+
29
+ The type node to inspect.
30
+
31
+ #### Returns
32
+
33
+ `string` \| `undefined`
34
+
35
+ The disallowed type name, if found.