@twin.org/ts-to-openapi 0.0.1-next.2 → 0.0.1-next.20
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.
- package/dist/cjs/index.cjs +18 -11
- package/dist/esm/index.mjs +17 -10
- package/dist/locales/en.json +300 -273
- package/dist/types/cli.d.ts +5 -1
- package/docs/changelog.md +37 -1
- package/docs/reference/classes/CLI.md +20 -4
- package/docs/reference/functions/actionCommandTsToOpenApi.md +9 -3
- package/docs/reference/functions/buildCommandTsToOpenApi.md +3 -1
- package/docs/reference/functions/tsToOpenApi.md +9 -3
- package/docs/reference/interfaces/ITsToOpenApiConfig.md +25 -1
- package/package.json +8 -37
package/dist/cjs/index.cjs
CHANGED
|
@@ -607,6 +607,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
609
|
const substituteSchemas = [];
|
|
610
|
+
const finalExternals = {};
|
|
610
611
|
// Remove the I, < and > from names
|
|
611
612
|
const finalSchemas = {};
|
|
612
613
|
for (const schema in schemas) {
|
|
@@ -629,8 +630,10 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
629
630
|
// If the schema is external then remove it from the final schemas
|
|
630
631
|
if (core.Is.object(externalReferences)) {
|
|
631
632
|
for (const external in externalReferences) {
|
|
632
|
-
|
|
633
|
+
const re = new RegExp(`^I?${external}(?<!Request|Response)$`);
|
|
634
|
+
if (re.test(schema)) {
|
|
633
635
|
skipSchema = true;
|
|
636
|
+
finalExternals[core.StringHelper.stripPrefix(schema)] = schema.replace(re, externalReferences[external]);
|
|
634
637
|
break;
|
|
635
638
|
}
|
|
636
639
|
}
|
|
@@ -659,6 +662,9 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
659
662
|
if (finalSchemas.HttpStatusCode) {
|
|
660
663
|
delete finalSchemas.HttpStatusCode;
|
|
661
664
|
}
|
|
665
|
+
if (finalSchemas.Uint8Array) {
|
|
666
|
+
delete finalSchemas.Uint8Array;
|
|
667
|
+
}
|
|
662
668
|
const schemaKeys = Object.keys(finalSchemas);
|
|
663
669
|
schemaKeys.sort();
|
|
664
670
|
const sortedSchemas = {};
|
|
@@ -669,7 +675,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
669
675
|
schemas: sortedSchemas,
|
|
670
676
|
securitySchemes
|
|
671
677
|
};
|
|
672
|
-
let json = JSON.stringify(openApi, undefined, "
|
|
678
|
+
let json = JSON.stringify(openApi, undefined, "\t");
|
|
673
679
|
// Remove the reference only schemas, repeating until no more substitutions
|
|
674
680
|
let performedSubstitution;
|
|
675
681
|
do {
|
|
@@ -695,17 +701,15 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
695
701
|
// Cleanup the generic markers
|
|
696
702
|
json = json.replace(/%3Cunknown%3E/g, "");
|
|
697
703
|
// Remove external references
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
json = json.replace(new RegExp(`#/components/schemas/${core.StringHelper.stripPrefix(external)}`, "g"), externalReferences[external]);
|
|
701
|
-
}
|
|
704
|
+
for (const finalExternal in finalExternals) {
|
|
705
|
+
json = json.replace(new RegExp(`"#/components/schemas/${core.StringHelper.stripPrefix(finalExternal)}"`, "g"), `"${finalExternals[finalExternal]}"`);
|
|
702
706
|
}
|
|
703
707
|
cliCore.CLIDisplay.task(core.I18n.formatMessage("commands.ts-to-openapi.progress.writingOutputFile"), outputFile);
|
|
704
708
|
try {
|
|
705
709
|
await promises.mkdir(path.dirname(outputFile), { recursive: true });
|
|
706
710
|
}
|
|
707
711
|
catch { }
|
|
708
|
-
await promises.writeFile(outputFile, json);
|
|
712
|
+
await promises.writeFile(outputFile, `${json}\n`);
|
|
709
713
|
}
|
|
710
714
|
/**
|
|
711
715
|
* Build the security schemas from the config.
|
|
@@ -1098,16 +1102,19 @@ class CLI extends cliCore.CLIBase {
|
|
|
1098
1102
|
* Run the app.
|
|
1099
1103
|
* @param argv The process arguments.
|
|
1100
1104
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
1105
|
+
* @param options Additional options.
|
|
1106
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
1101
1107
|
* @returns The exit code.
|
|
1102
1108
|
*/
|
|
1103
|
-
async run(argv, localesDirectory) {
|
|
1109
|
+
async run(argv, localesDirectory, options) {
|
|
1104
1110
|
return this.execute({
|
|
1105
1111
|
title: "TWIN TypeScript To OpenAPI",
|
|
1106
1112
|
appName: "ts-to-openapi",
|
|
1107
|
-
version: "0.0.1-next.
|
|
1113
|
+
version: "0.0.1-next.20", // x-release-please-version
|
|
1108
1114
|
icon: "⚙️ ",
|
|
1109
|
-
supportsEnvFiles: false
|
|
1110
|
-
|
|
1115
|
+
supportsEnvFiles: false,
|
|
1116
|
+
overrideOutputWidth: options?.overrideOutputWidth
|
|
1117
|
+
}, localesDirectory ?? path.join(path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "../locales"), argv);
|
|
1111
1118
|
}
|
|
1112
1119
|
/**
|
|
1113
1120
|
* Configure any options or actions at the root program level.
|
package/dist/esm/index.mjs
CHANGED
|
@@ -604,6 +604,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
const substituteSchemas = [];
|
|
607
|
+
const finalExternals = {};
|
|
607
608
|
// Remove the I, < and > from names
|
|
608
609
|
const finalSchemas = {};
|
|
609
610
|
for (const schema in schemas) {
|
|
@@ -626,8 +627,10 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
626
627
|
// If the schema is external then remove it from the final schemas
|
|
627
628
|
if (Is.object(externalReferences)) {
|
|
628
629
|
for (const external in externalReferences) {
|
|
629
|
-
|
|
630
|
+
const re = new RegExp(`^I?${external}(?<!Request|Response)$`);
|
|
631
|
+
if (re.test(schema)) {
|
|
630
632
|
skipSchema = true;
|
|
633
|
+
finalExternals[StringHelper.stripPrefix(schema)] = schema.replace(re, externalReferences[external]);
|
|
631
634
|
break;
|
|
632
635
|
}
|
|
633
636
|
}
|
|
@@ -656,6 +659,9 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
656
659
|
if (finalSchemas.HttpStatusCode) {
|
|
657
660
|
delete finalSchemas.HttpStatusCode;
|
|
658
661
|
}
|
|
662
|
+
if (finalSchemas.Uint8Array) {
|
|
663
|
+
delete finalSchemas.Uint8Array;
|
|
664
|
+
}
|
|
659
665
|
const schemaKeys = Object.keys(finalSchemas);
|
|
660
666
|
schemaKeys.sort();
|
|
661
667
|
const sortedSchemas = {};
|
|
@@ -666,7 +672,7 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
666
672
|
schemas: sortedSchemas,
|
|
667
673
|
securitySchemes
|
|
668
674
|
};
|
|
669
|
-
let json = JSON.stringify(openApi, undefined, "
|
|
675
|
+
let json = JSON.stringify(openApi, undefined, "\t");
|
|
670
676
|
// Remove the reference only schemas, repeating until no more substitutions
|
|
671
677
|
let performedSubstitution;
|
|
672
678
|
do {
|
|
@@ -692,17 +698,15 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
692
698
|
// Cleanup the generic markers
|
|
693
699
|
json = json.replace(/%3Cunknown%3E/g, "");
|
|
694
700
|
// Remove external references
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
json = json.replace(new RegExp(`#/components/schemas/${StringHelper.stripPrefix(external)}`, "g"), externalReferences[external]);
|
|
698
|
-
}
|
|
701
|
+
for (const finalExternal in finalExternals) {
|
|
702
|
+
json = json.replace(new RegExp(`"#/components/schemas/${StringHelper.stripPrefix(finalExternal)}"`, "g"), `"${finalExternals[finalExternal]}"`);
|
|
699
703
|
}
|
|
700
704
|
CLIDisplay.task(I18n.formatMessage("commands.ts-to-openapi.progress.writingOutputFile"), outputFile);
|
|
701
705
|
try {
|
|
702
706
|
await mkdir(path.dirname(outputFile), { recursive: true });
|
|
703
707
|
}
|
|
704
708
|
catch { }
|
|
705
|
-
await writeFile(outputFile, json);
|
|
709
|
+
await writeFile(outputFile, `${json}\n`);
|
|
706
710
|
}
|
|
707
711
|
/**
|
|
708
712
|
* Build the security schemas from the config.
|
|
@@ -1095,15 +1099,18 @@ class CLI extends CLIBase {
|
|
|
1095
1099
|
* Run the app.
|
|
1096
1100
|
* @param argv The process arguments.
|
|
1097
1101
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
1102
|
+
* @param options Additional options.
|
|
1103
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
1098
1104
|
* @returns The exit code.
|
|
1099
1105
|
*/
|
|
1100
|
-
async run(argv, localesDirectory) {
|
|
1106
|
+
async run(argv, localesDirectory, options) {
|
|
1101
1107
|
return this.execute({
|
|
1102
1108
|
title: "TWIN TypeScript To OpenAPI",
|
|
1103
1109
|
appName: "ts-to-openapi",
|
|
1104
|
-
version: "0.0.1-next.
|
|
1110
|
+
version: "0.0.1-next.20", // x-release-please-version
|
|
1105
1111
|
icon: "⚙️ ",
|
|
1106
|
-
supportsEnvFiles: false
|
|
1112
|
+
supportsEnvFiles: false,
|
|
1113
|
+
overrideOutputWidth: options?.overrideOutputWidth
|
|
1107
1114
|
}, localesDirectory ?? path.join(path.dirname(fileURLToPath(import.meta.url)), "../locales"), argv);
|
|
1108
1115
|
}
|
|
1109
1116
|
/**
|
package/dist/locales/en.json
CHANGED
|
@@ -1,274 +1,301 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
2
|
+
"error": {
|
|
3
|
+
"baseRestClient": {
|
|
4
|
+
"missingRouteProp": "Missing route parameter in data \"{routeProp}\" for route \"{route}\"",
|
|
5
|
+
"decodingFailed": "Decoding JSON failed for route \"{route}\"",
|
|
6
|
+
"failureStatusText": "The request to the API failed: \"{statusText}\""
|
|
7
|
+
},
|
|
8
|
+
"validation": {
|
|
9
|
+
"beEmpty": "{fieldName} must be empty",
|
|
10
|
+
"beNotEmpty": "{fieldName} must not be empty",
|
|
11
|
+
"beText": "{fieldName} must be text",
|
|
12
|
+
"beTextValue": "{fieldName} must contain some text",
|
|
13
|
+
"beTextMinMax": "{fieldName} must be longer than {minLength} and shorter than {maxLength} characters",
|
|
14
|
+
"beTextMin": "{fieldName} must be longer than {minLength} characters",
|
|
15
|
+
"beTextMax": "{fieldName} must be shorter than {maxLength} characters",
|
|
16
|
+
"beTextBase58": "{fieldName} must be text formatted using Base58 characters",
|
|
17
|
+
"beTextBase64": "{fieldName} must be text formatted using Base64 characters",
|
|
18
|
+
"beTextHex": "{fieldName} must be text formatted using Hex characters",
|
|
19
|
+
"beTextRegExp": "{fieldName} must be text formatted using the matching pattern {format}",
|
|
20
|
+
"beNumber": "{fieldName} must be a number",
|
|
21
|
+
"beNumberMinMax": "{fieldName} must be >= {minValue} and <= {maxValue}",
|
|
22
|
+
"beNumberMin": "{fieldName} must be >= {minValue}",
|
|
23
|
+
"beNumberMax": "{fieldName} must be <= {maxValue}",
|
|
24
|
+
"beWholeNumber": "{fieldName} must be a whole number",
|
|
25
|
+
"beWholeNumberMinMax": "{fieldName} must be a whole number >= {minValue} and <= {maxValue}",
|
|
26
|
+
"beWholeNumberMin": "{fieldName} must be a whole number >= {minValue}",
|
|
27
|
+
"beWholeNumberMax": "{fieldName} must be a whole number <= {maxValue}",
|
|
28
|
+
"beBigInteger": "{fieldName} must be a bigint",
|
|
29
|
+
"beBigIntegerMinMax": "{fieldName} must be a bigint >= {minValue} and <= {maxValue}",
|
|
30
|
+
"beBigIntegerMin": "{fieldName} must be a bigint >= {minValue}",
|
|
31
|
+
"beBigIntegerMax": "{fieldName} must be a bigint <= {maxValue}",
|
|
32
|
+
"beBoolean": "{fieldName} must be true or false",
|
|
33
|
+
"beDate": "{fieldName} must be a date",
|
|
34
|
+
"beDateTime": "{fieldName} must be a date/time",
|
|
35
|
+
"beTime": "{fieldName} must be a time",
|
|
36
|
+
"beTimestampMilliseconds": "{fieldName} must be a timestamp in milliseconds",
|
|
37
|
+
"beTimestampSeconds": "{fieldName} must be a timestamp in seconds",
|
|
38
|
+
"beObject": "{fieldName} must be an object",
|
|
39
|
+
"beArray": "{fieldName} must be an array",
|
|
40
|
+
"beArrayValue": "{fieldName} must be an array with at least one item",
|
|
41
|
+
"beIncluded": "{fieldName} is unrecognised",
|
|
42
|
+
"beByteArray": "{fieldName} must be a byte array",
|
|
43
|
+
"beUrn": "{fieldName} must be a correctly formatted urn",
|
|
44
|
+
"beUrl": "{fieldName} must be a correctly formatted url",
|
|
45
|
+
"beJSON": "{fieldName} must be correctly formatted JSON",
|
|
46
|
+
"beEmail": "{fieldName} must be a correctly formatted e-mail address",
|
|
47
|
+
"failed": "Validation failed",
|
|
48
|
+
"failedObject": "Validation of \"{objectName}\" failed"
|
|
49
|
+
},
|
|
50
|
+
"guard": {
|
|
51
|
+
"undefined": "Property \"{property}\" must be defined, it is \"{value}\"",
|
|
52
|
+
"string": "Property \"{property}\" must be a string, it is \"{value}\"",
|
|
53
|
+
"stringEmpty": "Property \"{property}\" must have a value, it is empty",
|
|
54
|
+
"stringBase64": "Property \"{property}\" must be a base64 encoded string, it is \"{value}\"",
|
|
55
|
+
"stringBase64Url": "Property \"{property}\" must be a base64 url encoded string, it is \"{value}\"",
|
|
56
|
+
"stringBase58": "Property \"{property}\" must be a base58 encoded string, it is \"{value}\"",
|
|
57
|
+
"stringHex": "Property \"{property}\" must be a hex string, it is \"{value}\"",
|
|
58
|
+
"stringHexLength": "Property \"{property}\" must be a hex string of length \"{options}\", it is \"{value}\"",
|
|
59
|
+
"stringJson": "Property \"{property}\" must be a JSON string",
|
|
60
|
+
"number": "Property \"{property}\" must be a number, it is \"{value}\"",
|
|
61
|
+
"integer": "Property \"{property}\" must be an integer, it is \"{value}\"",
|
|
62
|
+
"bigint": "Property \"{property}\" must be a bigint, it is \"{value}\"",
|
|
63
|
+
"boolean": "Property \"{property}\" must be a boolean, it is \"{value}\"",
|
|
64
|
+
"date": "Property \"{property}\" must be a date, it is \"{value}\"",
|
|
65
|
+
"timestampMilliseconds": "Property \"{property}\" must be a timestamp in milliseconds, it is \"{value}\"",
|
|
66
|
+
"timestampSeconds": "Property \"{property}\" must be a timestamp in seconds, it is \"{value}\"",
|
|
67
|
+
"objectUndefined": "Property \"{property}\" must be an object, it is \"undefined\"",
|
|
68
|
+
"object": "Property \"{property}\" must be an object, it is \"{value}\"",
|
|
69
|
+
"objectValue": "Property \"{property}\" must be an object, with at least one property, it is \"{value}\"",
|
|
70
|
+
"array": "Property \"{property}\" must be an array, it is \"{value}\"",
|
|
71
|
+
"arrayValue": "Property \"{property}\" must be an array with at least one item",
|
|
72
|
+
"arrayOneOf": "Property \"{property}\" must be one of [{options}], it is \"{value}\"",
|
|
73
|
+
"uint8Array": "Property \"{property}\" must be a Uint8Array, it is \"{value}\"",
|
|
74
|
+
"function": "Property \"{property}\" must be a function, it is \"{value}\"",
|
|
75
|
+
"urn": "Property \"{property}\" must be a Urn formatted string, it is \"{value}\"",
|
|
76
|
+
"url": "Property \"{property}\" must be a Url formatted string, it is \"{value}\"",
|
|
77
|
+
"email": "Property \"{property}\" must be string in e-mail format, it is \"{value}\"",
|
|
78
|
+
"length32Multiple": "Property \"{property}\" should be a multiple of 32, it is {value}",
|
|
79
|
+
"lengthEntropy": "Property \"{property}\" should be a multiple of 4, >=16 and <= 32, it is {value}",
|
|
80
|
+
"length3Multiple": "Property \"{property}\" should be a multiple of 3, it is {value}",
|
|
81
|
+
"greaterThan0": "Property \"{property}\" must be greater than zero, it is {value}"
|
|
82
|
+
},
|
|
83
|
+
"objectHelper": {
|
|
84
|
+
"failedBytesToJSON": "Failed converting bytes to JSON",
|
|
85
|
+
"cannotSetArrayIndex": "Cannot set property \"{property}\" using index \"{index}\" as it is not an array",
|
|
86
|
+
"cannotSetProperty": "Cannot set property \"{property}\" when the target is not an object"
|
|
87
|
+
},
|
|
88
|
+
"common": {
|
|
89
|
+
"notImplementedMethod": "The method \"{method}\" has not been implemented",
|
|
90
|
+
"validation": "Validation failed"
|
|
91
|
+
},
|
|
92
|
+
"factory": {
|
|
93
|
+
"noUnregister": "There is no {typeName} registered with the name \"{name}\"",
|
|
94
|
+
"noGet": "The requested {typeName} \"{name}\" does not exist in the factory"
|
|
95
|
+
},
|
|
96
|
+
"bitString": {
|
|
97
|
+
"outOfRange": "The index should be >= 0 and less than the length of the bit string"
|
|
98
|
+
},
|
|
99
|
+
"base32": {
|
|
100
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
101
|
+
},
|
|
102
|
+
"base64": {
|
|
103
|
+
"length4Multiple": "Invalid length should be a multiple of 4, it is \"{value}\""
|
|
104
|
+
},
|
|
105
|
+
"base58": {
|
|
106
|
+
"invalidCharacter": "Data contains a character \"{invalidCharacter}\" which is not in the charset"
|
|
107
|
+
},
|
|
108
|
+
"jsonHelper": {
|
|
109
|
+
"failedPatch": "Failed to patch the JSON object, patch index \"{index}\" failed"
|
|
110
|
+
},
|
|
111
|
+
"fetchHelper": {
|
|
112
|
+
"decodingJSON": "Decoding JSON failed for route \"{route}\"",
|
|
113
|
+
"failureStatusText": "The request to the API failed: \"{statusText}\"",
|
|
114
|
+
"connectivity": "The request failed, the API could be offline, or there are other connectivity issues",
|
|
115
|
+
"timeout": "The request timed out",
|
|
116
|
+
"general": "A general failure occurred during the request"
|
|
117
|
+
},
|
|
118
|
+
"jwt": {
|
|
119
|
+
"noKeyOrSigner": "No key or signer was provided for JWT creation",
|
|
120
|
+
"noKeyOrVerifier": "No key or verifier was provided for JWT creation",
|
|
121
|
+
"verifyFailed": "Failed to verify JWT",
|
|
122
|
+
"invalidTokenParts": "The JSON Web Token could not be parsed, it should contain three parts separated by dots",
|
|
123
|
+
"invalidSigningBytes": "The signing bytes are invalid, it should contain two parts separated by a dot"
|
|
124
|
+
},
|
|
125
|
+
"jwk": {
|
|
126
|
+
"jwkImportFailed": "Failed to import JWK"
|
|
127
|
+
},
|
|
128
|
+
"jws": {
|
|
129
|
+
"createFailed": "Failed to create JWS",
|
|
130
|
+
"verifyFailed": "Failed to verify JWS"
|
|
131
|
+
},
|
|
132
|
+
"bip39": {
|
|
133
|
+
"missingMnemonicWord": "The mnemonic contains a word not in the wordlist, \"{value}\"",
|
|
134
|
+
"checksumMismatch": "The checksum does not match \"{newChecksum}\" != \"{checksumBits}\""
|
|
135
|
+
},
|
|
136
|
+
"ed25519": {
|
|
137
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
138
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
139
|
+
},
|
|
140
|
+
"secp256k1": {
|
|
141
|
+
"privateKeyLength": "The private key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\"",
|
|
142
|
+
"publicKeyLength": "The public key length is incorrect, it should be \"{requiredSize}\" but is \"{actualSize}\""
|
|
143
|
+
},
|
|
144
|
+
"x25519": {
|
|
145
|
+
"invalidPublicKey": "Invalid Ed25519 Public Key"
|
|
146
|
+
},
|
|
147
|
+
"blake2b": {
|
|
148
|
+
"outputLength64": "The output length should be between 1 and 64, it is \"{outputLength}\"",
|
|
149
|
+
"keyLength64": "The key length should be between 1 and 64, it is \"{keyLength}\""
|
|
150
|
+
},
|
|
151
|
+
"sha512": {
|
|
152
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
153
|
+
},
|
|
154
|
+
"sha256": {
|
|
155
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
156
|
+
},
|
|
157
|
+
"sha3": {
|
|
158
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
159
|
+
},
|
|
160
|
+
"hmacSha256": {
|
|
161
|
+
"bitSize": "Only 224 or 256 bits are supported, it is \"{bitSize}\""
|
|
162
|
+
},
|
|
163
|
+
"hmacSha512": {
|
|
164
|
+
"bitSize": "Only 224, 256, 384 or 512 bits are supported, it is \"{bitSize}\""
|
|
165
|
+
},
|
|
166
|
+
"bech32": {
|
|
167
|
+
"decodeFailed": "The address contains decoding failed for address \"{bech32}\"",
|
|
168
|
+
"invalidChecksum": "The address contains an invalid checksum in address, \"{bech32}\"",
|
|
169
|
+
"separatorMisused": "The separator character '1' should only be used between hrp and data, \"{bech32}\"",
|
|
170
|
+
"lowerUpper": "The address my use either lowercase or uppercase, \"{bech32}\"",
|
|
171
|
+
"dataTooShort": "The address does not contain enough data to decode, \"{bech32}\""
|
|
172
|
+
},
|
|
173
|
+
"pbkdf2": {
|
|
174
|
+
"keyTooLong": "The requested key length \"{keyLength}\" is too long, based on the \"{macLength}\""
|
|
175
|
+
},
|
|
176
|
+
"chaCha20Poly1305": {
|
|
177
|
+
"noAadWithData": "You can not set the aad when there is already data",
|
|
178
|
+
"noAuthTag": "Can not finalise when the auth tag is not set",
|
|
179
|
+
"authenticationFailed": "The data could not be authenticated",
|
|
180
|
+
"authTagDecrypting": "Can not get the auth tag when decrypting",
|
|
181
|
+
"authTagEncrypting": "Can not set the auth tag when encrypting",
|
|
182
|
+
"noAuthTagSet": "The auth tag has not been set"
|
|
183
|
+
},
|
|
184
|
+
"bip44": {
|
|
185
|
+
"unsupportedKeyType": "The key type \"{keyType}\" is not supported"
|
|
186
|
+
},
|
|
187
|
+
"slip0010": {
|
|
188
|
+
"invalidSeed": "The seed is invalid \"{seed}\""
|
|
189
|
+
},
|
|
190
|
+
"commands": {
|
|
191
|
+
"common": {
|
|
192
|
+
"missingEnv": "The \"{option}\" option is configured as an environment variable, but there is no environment variable with the name \"{value}\" set.",
|
|
193
|
+
"optionInvalidHex": "The \"{option}\" does not appear to be hex. \"{value}\"",
|
|
194
|
+
"optionInvalidBase64": "The \"{option}\" does not appear to be base64. \"{value}\"",
|
|
195
|
+
"optionInvalidHexBase64": "The \"{option}\" does not appear to be hex or base64. \"{value}\"",
|
|
196
|
+
"optionInvalidBech32": "The \"{option}\" does not appear to be bech32. \"{value}\"",
|
|
197
|
+
"optionMinValue": "The \"{option}\" option must be greater than or equal to {minValue}, it is {value}.",
|
|
198
|
+
"optionMaxValue": "The \"{option}\" option must be less than or equal to {maxValue}, it is {value}."
|
|
199
|
+
},
|
|
200
|
+
"ts-to-openapi": {
|
|
201
|
+
"configFailed": "Configuration failed to load.",
|
|
202
|
+
"missingRestRoutesEntryPoints": "Missing REST routes method \"{method}\" in package \"{package}\".",
|
|
203
|
+
"missingRestRoutesEntryPoint": "Missing REST routes entryPoint \"{entryPoint}\" in package \"{package}\".",
|
|
204
|
+
"unsupportedProperties": "Unsupported properties found in the request object \"{keys}\"."
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"errorNames": {
|
|
209
|
+
"error": "Error",
|
|
210
|
+
"generalError": "General",
|
|
211
|
+
"guardError": "Guard",
|
|
212
|
+
"conflictError": "Conflict",
|
|
213
|
+
"notFoundError": "Not Found",
|
|
214
|
+
"notSupportedError": "Not Supported",
|
|
215
|
+
"alreadyExistsError": "Already Exists",
|
|
216
|
+
"notImplementedError": "Not Implemented",
|
|
217
|
+
"validationError": "Validation",
|
|
218
|
+
"unprocessableError": "Unprocessable"
|
|
219
|
+
},
|
|
220
|
+
"validation": {
|
|
221
|
+
"defaultFieldName": "The field"
|
|
222
|
+
},
|
|
223
|
+
"errorMessages": {
|
|
224
|
+
"fetch": "Fetch"
|
|
225
|
+
},
|
|
226
|
+
"cli": {
|
|
227
|
+
"progress": {
|
|
228
|
+
"done": "Done.",
|
|
229
|
+
"error": "Error",
|
|
230
|
+
"loadingEnvFiles": "Loading env files",
|
|
231
|
+
"pleaseWait": "Please wait...",
|
|
232
|
+
"writingJsonFile": "Writing JSON file",
|
|
233
|
+
"writingEnvFile": "Writing env file",
|
|
234
|
+
"readingJsonFile": "Reading JSON file",
|
|
235
|
+
"readingEnvFile": "Reading env file"
|
|
236
|
+
},
|
|
237
|
+
"options": {
|
|
238
|
+
"lang": {
|
|
239
|
+
"param": "--lang '<'lang'>'",
|
|
240
|
+
"description": "The language to display the output in."
|
|
241
|
+
},
|
|
242
|
+
"load-env": {
|
|
243
|
+
"param": "--load-env [env...]",
|
|
244
|
+
"description": "Load the env files to initialise any environment variables."
|
|
245
|
+
},
|
|
246
|
+
"no-console": {
|
|
247
|
+
"param": "--no-console",
|
|
248
|
+
"description": "Hides the output in the console."
|
|
249
|
+
},
|
|
250
|
+
"json": {
|
|
251
|
+
"param": "--json '<'filename'>'",
|
|
252
|
+
"description": "Creates a JSON file containing the output."
|
|
253
|
+
},
|
|
254
|
+
"env": {
|
|
255
|
+
"param": "--env '<'filename'>'",
|
|
256
|
+
"description": "Creates an env file containing the output."
|
|
257
|
+
},
|
|
258
|
+
"merge-json": {
|
|
259
|
+
"param": "--merge-json",
|
|
260
|
+
"description": "If the JSON file already exists merge the data instead of overwriting."
|
|
261
|
+
},
|
|
262
|
+
"merge-env": {
|
|
263
|
+
"param": "--merge-env",
|
|
264
|
+
"description": "If the env file already exists merge the data instead of overwriting."
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"commands": {
|
|
269
|
+
"ts-to-openapi": {
|
|
270
|
+
"options": {
|
|
271
|
+
"config": {
|
|
272
|
+
"param": "'<'config'>'",
|
|
273
|
+
"description": "Path to the JSON configuration file."
|
|
274
|
+
},
|
|
275
|
+
"output-file": {
|
|
276
|
+
"param": "'<'output-file'>'",
|
|
277
|
+
"description": "The JSON file to write the OpenAPI spec."
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"progress": {
|
|
281
|
+
"loadingConfigJson": "Loading Config JSON",
|
|
282
|
+
"creatingWorkingDir": "Creating Working Directory",
|
|
283
|
+
"creatingSecuritySchemas": "Creating Security Schemas",
|
|
284
|
+
"generatingSchemas": "Generating Schemas",
|
|
285
|
+
"finalisingSchemas": "Finalising Schemas",
|
|
286
|
+
"writingOutputFile": "Writing Output File",
|
|
287
|
+
"models": "Models",
|
|
288
|
+
"installingNpmPackages": "Installing NPM Packages",
|
|
289
|
+
"processingPackage": "Processing Package",
|
|
290
|
+
"importingModule": "Importing Module",
|
|
291
|
+
"processingRoutes": "Processing Routes"
|
|
292
|
+
},
|
|
293
|
+
"labels": {
|
|
294
|
+
"configJson": "Config JSON",
|
|
295
|
+
"outputFile": "Output File",
|
|
296
|
+
"outputWorkingDir": "Output Working Directory",
|
|
297
|
+
"route": "Route"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -8,9 +8,13 @@ export declare class CLI extends CLIBase {
|
|
|
8
8
|
* Run the app.
|
|
9
9
|
* @param argv The process arguments.
|
|
10
10
|
* @param localesDirectory The directory for the locales, default to relative to the script.
|
|
11
|
+
* @param options Additional options.
|
|
12
|
+
* @param options.overrideOutputWidth Override the output width.
|
|
11
13
|
* @returns The exit code.
|
|
12
14
|
*/
|
|
13
|
-
run(argv: string[], localesDirectory?: string
|
|
15
|
+
run(argv: string[], localesDirectory?: string, options?: {
|
|
16
|
+
overrideOutputWidth?: number;
|
|
17
|
+
}): Promise<number>;
|
|
14
18
|
/**
|
|
15
19
|
* Configure any options or actions at the root program level.
|
|
16
20
|
* @param program The root program command.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @twin.org/ts-to-openapi - Changelog
|
|
2
2
|
|
|
3
|
-
## v0.0.
|
|
3
|
+
## [0.0.1-next.20](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.1-next.19...ts-to-openapi-v0.0.1-next.20) (2025-03-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **ts-to-openapi:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/nameof bumped from 0.0.1-next.19 to 0.0.1-next.20
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/merge-locales bumped from 0.0.1-next.19 to 0.0.1-next.20
|
|
18
|
+
* @twin.org/nameof-transformer bumped from 0.0.1-next.19 to 0.0.1-next.20
|
|
19
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.19 to 0.0.1-next.20
|
|
20
|
+
|
|
21
|
+
## [0.0.1-next.19](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.1-next.18...ts-to-openapi-v0.0.1-next.19) (2025-03-26)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Miscellaneous Chores
|
|
25
|
+
|
|
26
|
+
* **ts-to-openapi:** Synchronize repo versions
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Dependencies
|
|
30
|
+
|
|
31
|
+
* The following workspace dependencies were updated
|
|
32
|
+
* dependencies
|
|
33
|
+
* @twin.org/nameof bumped from 0.0.1-next.18 to 0.0.1-next.19
|
|
34
|
+
* devDependencies
|
|
35
|
+
* @twin.org/merge-locales bumped from 0.0.1-next.18 to 0.0.1-next.19
|
|
36
|
+
* @twin.org/nameof-transformer bumped from 0.0.1-next.18 to 0.0.1-next.19
|
|
37
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.18 to 0.0.1-next.19
|
|
38
|
+
|
|
39
|
+
## v0.0.1-next.18
|
|
4
40
|
|
|
5
41
|
- Initial Release
|
|
@@ -24,20 +24,34 @@ The main entry point for the CLI.
|
|
|
24
24
|
|
|
25
25
|
### run()
|
|
26
26
|
|
|
27
|
-
> **run**(`argv`, `localesDirectory`?): `Promise`\<`number`\>
|
|
27
|
+
> **run**(`argv`, `localesDirectory`?, `options`?): `Promise`\<`number`\>
|
|
28
28
|
|
|
29
29
|
Run the app.
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
##### argv
|
|
34
|
+
|
|
35
|
+
`string`[]
|
|
34
36
|
|
|
35
37
|
The process arguments.
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
##### localesDirectory?
|
|
40
|
+
|
|
41
|
+
`string`
|
|
38
42
|
|
|
39
43
|
The directory for the locales, default to relative to the script.
|
|
40
44
|
|
|
45
|
+
##### options?
|
|
46
|
+
|
|
47
|
+
Additional options.
|
|
48
|
+
|
|
49
|
+
###### overrideOutputWidth?
|
|
50
|
+
|
|
51
|
+
`number`
|
|
52
|
+
|
|
53
|
+
Override the output width.
|
|
54
|
+
|
|
41
55
|
#### Returns
|
|
42
56
|
|
|
43
57
|
`Promise`\<`number`\>
|
|
@@ -54,7 +68,9 @@ Configure any options or actions at the root program level.
|
|
|
54
68
|
|
|
55
69
|
#### Parameters
|
|
56
70
|
|
|
57
|
-
|
|
71
|
+
##### program
|
|
72
|
+
|
|
73
|
+
`Command`
|
|
58
74
|
|
|
59
75
|
The root program command.
|
|
60
76
|
|
|
@@ -6,15 +6,21 @@ Action the root command.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### configFile
|
|
10
|
+
|
|
11
|
+
`string`
|
|
10
12
|
|
|
11
13
|
The optional configuration file.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### outputFile
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The output file for the generation OpenApi spec.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### opts
|
|
22
|
+
|
|
23
|
+
`unknown`
|
|
18
24
|
|
|
19
25
|
The options for the command.
|
|
20
26
|
|
|
@@ -6,15 +6,21 @@ Convert the TypeScript definitions to OpenAPI spec.
|
|
|
6
6
|
|
|
7
7
|
## Parameters
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### config
|
|
10
|
+
|
|
11
|
+
[`ITsToOpenApiConfig`](../interfaces/ITsToOpenApiConfig.md)
|
|
10
12
|
|
|
11
13
|
The configuration for the app.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### outputFile
|
|
16
|
+
|
|
17
|
+
`string`
|
|
14
18
|
|
|
15
19
|
The location of the file to output the OpenAPI spec.
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
### workingDirectory
|
|
22
|
+
|
|
23
|
+
`string`
|
|
18
24
|
|
|
19
25
|
The folder the app was run from.
|
|
20
26
|
|
|
@@ -66,6 +66,30 @@ The authentication methods.
|
|
|
66
66
|
|
|
67
67
|
The packages containing routes.
|
|
68
68
|
|
|
69
|
+
#### package?
|
|
70
|
+
|
|
71
|
+
> `optional` **package**: `string`
|
|
72
|
+
|
|
73
|
+
The package containing the routes.
|
|
74
|
+
|
|
75
|
+
#### version?
|
|
76
|
+
|
|
77
|
+
> `optional` **version**: `string`
|
|
78
|
+
|
|
79
|
+
The version of the package to use, defaults to latest.
|
|
80
|
+
|
|
81
|
+
#### packageRoot?
|
|
82
|
+
|
|
83
|
+
> `optional` **packageRoot**: `string`
|
|
84
|
+
|
|
85
|
+
To point to a local instance of a package use this property instead of package/version.
|
|
86
|
+
|
|
87
|
+
#### entryPoints?
|
|
88
|
+
|
|
89
|
+
> `optional` **entryPoints**: [`ITsToOpenApiConfigEntryPoint`](ITsToOpenApiConfigEntryPoint.md)[]
|
|
90
|
+
|
|
91
|
+
The rest entry points to include, defaults to all exported entry points.
|
|
92
|
+
|
|
69
93
|
***
|
|
70
94
|
|
|
71
95
|
### externalReferences?
|
|
@@ -76,4 +100,4 @@ External type references
|
|
|
76
100
|
|
|
77
101
|
#### Index Signature
|
|
78
102
|
|
|
79
|
-
|
|
103
|
+
\[`id`: `string`\]: `string`
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/ts-to-openapi",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.20",
|
|
4
4
|
"description": "Tool to convert TypeScript REST route definitions to OpenAPI Specifications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/tools.git",
|
|
8
|
-
"directory": "
|
|
8
|
+
"directory": "apps/ts-to-openapi"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
11
11
|
"license": "Apache-2.0",
|
|
@@ -13,54 +13,25 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"clean": "rimraf dist coverage",
|
|
18
|
-
"build": "tspc",
|
|
19
|
-
"merge-locales": "merge-locales",
|
|
20
|
-
"test": "vitest --run --config ./vitest.config.ts --no-cache",
|
|
21
|
-
"coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
|
|
22
|
-
"bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
|
|
23
|
-
"bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
|
|
24
|
-
"bundle": "npm run bundle:esm && npm run bundle:cjs",
|
|
25
|
-
"docs:clean": "rimraf docs/reference",
|
|
26
|
-
"docs:generate": "typedoc",
|
|
27
|
-
"docs": "npm run docs:clean && npm run docs:generate",
|
|
28
|
-
"dist": "npm run clean && npm run build && npm run merge-locales && npm run test && npm run bundle && npm run docs"
|
|
29
|
-
},
|
|
30
16
|
"dependencies": {
|
|
31
17
|
"@twin.org/api-models": "next",
|
|
32
18
|
"@twin.org/cli-core": "next",
|
|
33
19
|
"@twin.org/core": "next",
|
|
34
|
-
"@twin.org/nameof": "0.0.1-next.
|
|
20
|
+
"@twin.org/nameof": "0.0.1-next.20",
|
|
35
21
|
"@twin.org/web": "next",
|
|
36
|
-
"commander": "
|
|
37
|
-
"glob": "11.0.
|
|
38
|
-
"jsonschema": "1.
|
|
22
|
+
"commander": "13.1.0",
|
|
23
|
+
"glob": "11.0.1",
|
|
24
|
+
"jsonschema": "1.5.0",
|
|
39
25
|
"ts-json-schema-generator": "2.4.0-next.1"
|
|
40
26
|
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@twin.org/merge-locales": "0.0.1-next.2",
|
|
43
|
-
"@twin.org/nameof-transformer": "0.0.1-next.2",
|
|
44
|
-
"@types/node": "22.5.5",
|
|
45
|
-
"@vitest/coverage-v8": "2.1.1",
|
|
46
|
-
"copyfiles": "2.4.1",
|
|
47
|
-
"rimraf": "6.0.1",
|
|
48
|
-
"rollup": "4.21.3",
|
|
49
|
-
"rollup-plugin-typescript2": "0.36.0",
|
|
50
|
-
"ts-patch": "3.2.1",
|
|
51
|
-
"typedoc": "0.26.7",
|
|
52
|
-
"typedoc-plugin-markdown": "4.2.7",
|
|
53
|
-
"typescript": "5.6.2",
|
|
54
|
-
"vitest": "2.1.1"
|
|
55
|
-
},
|
|
56
27
|
"main": "./dist/cjs/index.cjs",
|
|
57
28
|
"module": "./dist/esm/index.mjs",
|
|
58
29
|
"types": "./dist/types/index.d.ts",
|
|
59
30
|
"exports": {
|
|
60
31
|
".": {
|
|
32
|
+
"types": "./dist/types/index.d.ts",
|
|
61
33
|
"require": "./dist/cjs/index.cjs",
|
|
62
|
-
"import": "./dist/esm/index.mjs"
|
|
63
|
-
"types": "./dist/types/index.d.ts"
|
|
34
|
+
"import": "./dist/esm/index.mjs"
|
|
64
35
|
}
|
|
65
36
|
},
|
|
66
37
|
"files": [
|