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

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