@twin.org/ts-to-openapi 0.0.1-next.23 → 0.0.1-next.24
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 +9 -2
- package/dist/esm/index.mjs +9 -2
- package/docs/changelog.md +18 -0
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -698,6 +698,8 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
698
698
|
json = json.replace(/#\/components\/schemas\/(.*)\[\]/g, "#/components/schemas/ListOf$1");
|
|
699
699
|
// Remove the partial markers
|
|
700
700
|
json = json.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
701
|
+
// Remove the omit markers
|
|
702
|
+
json = json.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
701
703
|
// Cleanup the generic markers
|
|
702
704
|
json = json.replace(/%3Cunknown%3E/g, "");
|
|
703
705
|
// Remove external references
|
|
@@ -855,6 +857,8 @@ async function generateSchemas(modelDirWildcards, types, outputWorkingDir) {
|
|
|
855
857
|
for (const def in schema.definitions) {
|
|
856
858
|
// Remove the partial markers
|
|
857
859
|
let defSub = def.replace(/^Partial<(.*?)>/g, "$1");
|
|
860
|
+
// Remove the omit markers
|
|
861
|
+
defSub = defSub.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
858
862
|
// Cleanup the generic markers
|
|
859
863
|
defSub = defSub.replace(/</g, "%3C").replace(/>/g, "%3E");
|
|
860
864
|
allSchemas[defSub] = schema.definitions[def];
|
|
@@ -898,7 +902,10 @@ function extractTypes(allSchemas, requiredTypes, referencedSchemas) {
|
|
|
898
902
|
function extractTypesFromSchema(allTypes, schema, output) {
|
|
899
903
|
const additionalTypes = [];
|
|
900
904
|
if (core.Is.stringValue(schema.$ref)) {
|
|
901
|
-
additionalTypes.push(schema.$ref
|
|
905
|
+
additionalTypes.push(schema.$ref
|
|
906
|
+
.replace("#/definitions/", "")
|
|
907
|
+
.replace(/^Partial%3C(.*?)%3E/g, "$1")
|
|
908
|
+
.replace(/^Omit%3C(.*?)%2C.*%3E/g, "$1"));
|
|
902
909
|
}
|
|
903
910
|
else if (core.Is.object(schema.items)) {
|
|
904
911
|
if (core.Is.arrayValue(schema.items)) {
|
|
@@ -1110,7 +1117,7 @@ class CLI extends cliCore.CLIBase {
|
|
|
1110
1117
|
return this.execute({
|
|
1111
1118
|
title: "TWIN TypeScript To OpenAPI",
|
|
1112
1119
|
appName: "ts-to-openapi",
|
|
1113
|
-
version: "0.0.1-next.
|
|
1120
|
+
version: "0.0.1-next.24", // x-release-please-version
|
|
1114
1121
|
icon: "⚙️ ",
|
|
1115
1122
|
supportsEnvFiles: false,
|
|
1116
1123
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/dist/esm/index.mjs
CHANGED
|
@@ -695,6 +695,8 @@ async function finaliseOutput(usedCommonResponseTypes, schemas, openApi, securit
|
|
|
695
695
|
json = json.replace(/#\/components\/schemas\/(.*)\[\]/g, "#/components/schemas/ListOf$1");
|
|
696
696
|
// Remove the partial markers
|
|
697
697
|
json = json.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
698
|
+
// Remove the omit markers
|
|
699
|
+
json = json.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
698
700
|
// Cleanup the generic markers
|
|
699
701
|
json = json.replace(/%3Cunknown%3E/g, "");
|
|
700
702
|
// Remove external references
|
|
@@ -852,6 +854,8 @@ async function generateSchemas(modelDirWildcards, types, outputWorkingDir) {
|
|
|
852
854
|
for (const def in schema.definitions) {
|
|
853
855
|
// Remove the partial markers
|
|
854
856
|
let defSub = def.replace(/^Partial<(.*?)>/g, "$1");
|
|
857
|
+
// Remove the omit markers
|
|
858
|
+
defSub = defSub.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
855
859
|
// Cleanup the generic markers
|
|
856
860
|
defSub = defSub.replace(/</g, "%3C").replace(/>/g, "%3E");
|
|
857
861
|
allSchemas[defSub] = schema.definitions[def];
|
|
@@ -895,7 +899,10 @@ function extractTypes(allSchemas, requiredTypes, referencedSchemas) {
|
|
|
895
899
|
function extractTypesFromSchema(allTypes, schema, output) {
|
|
896
900
|
const additionalTypes = [];
|
|
897
901
|
if (Is.stringValue(schema.$ref)) {
|
|
898
|
-
additionalTypes.push(schema.$ref
|
|
902
|
+
additionalTypes.push(schema.$ref
|
|
903
|
+
.replace("#/definitions/", "")
|
|
904
|
+
.replace(/^Partial%3C(.*?)%3E/g, "$1")
|
|
905
|
+
.replace(/^Omit%3C(.*?)%2C.*%3E/g, "$1"));
|
|
899
906
|
}
|
|
900
907
|
else if (Is.object(schema.items)) {
|
|
901
908
|
if (Is.arrayValue(schema.items)) {
|
|
@@ -1107,7 +1114,7 @@ class CLI extends CLIBase {
|
|
|
1107
1114
|
return this.execute({
|
|
1108
1115
|
title: "TWIN TypeScript To OpenAPI",
|
|
1109
1116
|
appName: "ts-to-openapi",
|
|
1110
|
-
version: "0.0.1-next.
|
|
1117
|
+
version: "0.0.1-next.24", // x-release-please-version
|
|
1111
1118
|
icon: "⚙️ ",
|
|
1112
1119
|
supportsEnvFiles: false,
|
|
1113
1120
|
overrideOutputWidth: options?.overrideOutputWidth
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @twin.org/ts-to-openapi - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.24](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.1-next.23...ts-to-openapi-v0.0.1-next.24) (2025-06-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* strip Omit types ([3a079f9](https://github.com/twinfoundation/tools/commit/3a079f9abe8127c5b44a2b9382babf2f19629d08))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/nameof bumped from 0.0.1-next.23 to 0.0.1-next.24
|
|
16
|
+
* devDependencies
|
|
17
|
+
* @twin.org/merge-locales bumped from 0.0.1-next.23 to 0.0.1-next.24
|
|
18
|
+
* @twin.org/nameof-transformer bumped from 0.0.1-next.23 to 0.0.1-next.24
|
|
19
|
+
* @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.23 to 0.0.1-next.24
|
|
20
|
+
|
|
3
21
|
## [0.0.1-next.23](https://github.com/twinfoundation/tools/compare/ts-to-openapi-v0.0.1-next.22...ts-to-openapi-v0.0.1-next.23) (2025-06-03)
|
|
4
22
|
|
|
5
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/ts-to-openapi",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.24",
|
|
4
4
|
"description": "Tool to convert TypeScript REST route definitions to OpenAPI Specifications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@twin.org/api-models": "next",
|
|
18
18
|
"@twin.org/cli-core": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
|
-
"@twin.org/nameof": "0.0.1-next.
|
|
20
|
+
"@twin.org/nameof": "0.0.1-next.24",
|
|
21
21
|
"@twin.org/web": "next",
|
|
22
22
|
"commander": "13.1.0",
|
|
23
23
|
"glob": "11.0.1",
|