@twin.org/ts-to-openapi 0.0.1 → 0.0.2-next.10
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 +44 -160
- package/dist/esm/index.mjs +45 -161
- package/dist/locales/en.json +20 -32
- package/dist/types/models/ITsToOpenApiConfig.d.ts +11 -0
- package/docs/changelog.md +153 -0
- package/docs/examples.md +1 -1
- package/docs/reference/interfaces/ITsToOpenApiConfig.md +20 -0
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +1 -0
- package/package.json +22 -10
- package/dist/types/models/IJsonSchema.d.ts +0 -5
- package/dist/types/models/IOpenApi.d.ts +0 -54
- package/dist/types/models/IOpenApiExample.d.ts +0 -13
- package/dist/types/models/IOpenApiHeader.d.ts +0 -19
- package/dist/types/models/IOpenApiPathMethod.d.ts +0 -65
- package/dist/types/models/IOpenApiResponse.d.ts +0 -32
- package/dist/types/models/IOpenApiSecurityScheme.d.ts +0 -25
- package/dist/types/models/IPackageJson.d.ts +0 -15
- package/dist/types/models/jsonTypeName.d.ts +0 -5
package/docs/examples.md
CHANGED
|
@@ -101,3 +101,23 @@ External type references
|
|
|
101
101
|
#### Index Signature
|
|
102
102
|
|
|
103
103
|
\[`id`: `string`\]: `string`
|
|
104
|
+
|
|
105
|
+
***
|
|
106
|
+
|
|
107
|
+
### overrides?
|
|
108
|
+
|
|
109
|
+
> `optional` **overrides**: `object`
|
|
110
|
+
|
|
111
|
+
Override for specific types, to be used when the type cannot be generated automatically, or is generated incorrectly.
|
|
112
|
+
|
|
113
|
+
#### Index Signature
|
|
114
|
+
|
|
115
|
+
\[`id`: `string`\]: `AnySchemaObject`
|
|
116
|
+
|
|
117
|
+
***
|
|
118
|
+
|
|
119
|
+
### autoExpandTypes?
|
|
120
|
+
|
|
121
|
+
> `optional` **autoExpandTypes**: `string`[]
|
|
122
|
+
|
|
123
|
+
The types to automatically expand inline in type definitions, reg ex string matches.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
^errorMessage$
|
package/locales/en.json
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"creatingWorkingDir": "Creating Working Directory",
|
|
27
27
|
"creatingSecuritySchemas": "Creating Security Schemas",
|
|
28
28
|
"generatingSchemas": "Generating Schemas",
|
|
29
|
+
"overridingSchema": "Overriding Schema",
|
|
29
30
|
"finalisingSchemas": "Finalising Schemas",
|
|
30
31
|
"writingOutputFile": "Writing Output File",
|
|
31
32
|
"models": "Models",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/ts-to-openapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-next.10",
|
|
4
4
|
"description": "Tool to convert TypeScript REST route definitions to OpenAPI Specifications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "
|
|
18
|
-
"@twin.org/cli-core": "
|
|
19
|
-
"@twin.org/core": "
|
|
20
|
-
"@twin.org/nameof": "
|
|
21
|
-
"@twin.org/
|
|
22
|
-
"
|
|
23
|
-
"commander": "14.0.
|
|
24
|
-
"glob": "11.0.
|
|
17
|
+
"@twin.org/api-models": "next",
|
|
18
|
+
"@twin.org/cli-core": "next",
|
|
19
|
+
"@twin.org/core": "next",
|
|
20
|
+
"@twin.org/nameof": "next",
|
|
21
|
+
"@twin.org/tools-core": "0.0.2-next.10",
|
|
22
|
+
"@twin.org/web": "next",
|
|
23
|
+
"commander": "14.0.1",
|
|
24
|
+
"glob": "11.0.3",
|
|
25
25
|
"ts-json-schema-generator": "2.4.0"
|
|
26
26
|
},
|
|
27
27
|
"main": "./dist/cjs/index.cjs",
|
|
@@ -45,5 +45,17 @@
|
|
|
45
45
|
],
|
|
46
46
|
"bin": {
|
|
47
47
|
"ts-to-openapi": "bin/index.js"
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"twin",
|
|
51
|
+
"trade",
|
|
52
|
+
"iota",
|
|
53
|
+
"framework",
|
|
54
|
+
"blockchain",
|
|
55
|
+
"tools"
|
|
56
|
+
],
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "git+https://github.com/twinfoundation/tools/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://twindev.org"
|
|
49
61
|
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { IJsonSchema } from "./IJsonSchema";
|
|
2
|
-
import type { IOpenApiPathMethod } from "./IOpenApiPathMethod";
|
|
3
|
-
import type { IOpenApiSecurityScheme } from "./IOpenApiSecurityScheme";
|
|
4
|
-
/**
|
|
5
|
-
* The Open API config definition.
|
|
6
|
-
*/
|
|
7
|
-
export interface IOpenApi {
|
|
8
|
-
/**
|
|
9
|
-
* The open api version.
|
|
10
|
-
*/
|
|
11
|
-
openapi: string;
|
|
12
|
-
/**
|
|
13
|
-
* Info.
|
|
14
|
-
*/
|
|
15
|
-
info: {
|
|
16
|
-
title: string;
|
|
17
|
-
version: string;
|
|
18
|
-
description: string;
|
|
19
|
-
license?: {
|
|
20
|
-
name: string;
|
|
21
|
-
url: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* The servers for the endpoints.
|
|
26
|
-
*/
|
|
27
|
-
servers?: {
|
|
28
|
-
url: string;
|
|
29
|
-
}[];
|
|
30
|
-
/**
|
|
31
|
-
* Tags for the endpoints.
|
|
32
|
-
*/
|
|
33
|
-
tags?: {
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
}[];
|
|
37
|
-
/**
|
|
38
|
-
* The paths.
|
|
39
|
-
*/
|
|
40
|
-
paths: {
|
|
41
|
-
[path: string]: {
|
|
42
|
-
[method: string]: IOpenApiPathMethod;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The components.
|
|
47
|
-
*/
|
|
48
|
-
components?: {
|
|
49
|
-
schemas?: IJsonSchema;
|
|
50
|
-
securitySchemes?: {
|
|
51
|
-
[name: string]: IOpenApiSecurityScheme;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Open API config definition.
|
|
3
|
-
*/
|
|
4
|
-
export interface IOpenApiHeader {
|
|
5
|
-
/**
|
|
6
|
-
* The schema of the header.
|
|
7
|
-
*/
|
|
8
|
-
schema?: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* The description of the header.
|
|
13
|
-
*/
|
|
14
|
-
description?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The format of the header.
|
|
17
|
-
*/
|
|
18
|
-
format?: string;
|
|
19
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { IJsonSchema } from "./IJsonSchema";
|
|
2
|
-
import type { IOpenApiExample } from "./IOpenApiExample";
|
|
3
|
-
import type { IOpenApiResponse } from "./IOpenApiResponse";
|
|
4
|
-
import type { JsonTypeName } from "./jsonTypeName";
|
|
5
|
-
/**
|
|
6
|
-
* The Open API config definition.
|
|
7
|
-
*/
|
|
8
|
-
export interface IOpenApiPathMethod {
|
|
9
|
-
/**
|
|
10
|
-
* The operation id.
|
|
11
|
-
*/
|
|
12
|
-
operationId: string;
|
|
13
|
-
/**
|
|
14
|
-
* Summary.
|
|
15
|
-
*/
|
|
16
|
-
summary: string;
|
|
17
|
-
/**
|
|
18
|
-
* Tags.
|
|
19
|
-
*/
|
|
20
|
-
tags?: string[];
|
|
21
|
-
/**
|
|
22
|
-
* Parameters.
|
|
23
|
-
*/
|
|
24
|
-
parameters?: {
|
|
25
|
-
name: string;
|
|
26
|
-
in: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
required: boolean;
|
|
29
|
-
schema: {
|
|
30
|
-
type?: JsonTypeName | JsonTypeName[];
|
|
31
|
-
enum?: IJsonSchema[];
|
|
32
|
-
$ref?: string;
|
|
33
|
-
};
|
|
34
|
-
style?: string;
|
|
35
|
-
}[];
|
|
36
|
-
/**
|
|
37
|
-
* Request body.
|
|
38
|
-
*/
|
|
39
|
-
requestBody?: {
|
|
40
|
-
required: boolean;
|
|
41
|
-
description?: string;
|
|
42
|
-
content?: {
|
|
43
|
-
[contentType: string]: {
|
|
44
|
-
schema: {
|
|
45
|
-
$ref: string;
|
|
46
|
-
};
|
|
47
|
-
examples?: {
|
|
48
|
-
[id: string]: IOpenApiExample;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Response body.
|
|
55
|
-
*/
|
|
56
|
-
responses?: {
|
|
57
|
-
[code: string]: IOpenApiResponse;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Security model for the API.
|
|
61
|
-
*/
|
|
62
|
-
security?: {
|
|
63
|
-
[name: string]: string[];
|
|
64
|
-
}[];
|
|
65
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IOpenApiExample } from "./IOpenApiExample";
|
|
2
|
-
import type { IOpenApiHeader } from "./IOpenApiHeader";
|
|
3
|
-
/**
|
|
4
|
-
* The Open API config definition.
|
|
5
|
-
*/
|
|
6
|
-
export interface IOpenApiResponse {
|
|
7
|
-
/**
|
|
8
|
-
* Descriptions for the response.
|
|
9
|
-
*/
|
|
10
|
-
description?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Content for the response.
|
|
13
|
-
*/
|
|
14
|
-
content?: {
|
|
15
|
-
[contentType: string]: {
|
|
16
|
-
schema: {
|
|
17
|
-
type?: string;
|
|
18
|
-
format?: string;
|
|
19
|
-
$ref?: string;
|
|
20
|
-
};
|
|
21
|
-
examples?: {
|
|
22
|
-
[id: string]: IOpenApiExample;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* The headers for the response.
|
|
28
|
-
*/
|
|
29
|
-
headers?: {
|
|
30
|
-
[id: string]: IOpenApiHeader;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Open API config definition for security scheme.
|
|
3
|
-
*/
|
|
4
|
-
export interface IOpenApiSecurityScheme {
|
|
5
|
-
/**
|
|
6
|
-
* The type of the security schema.
|
|
7
|
-
*/
|
|
8
|
-
type?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The scheme method.
|
|
11
|
-
*/
|
|
12
|
-
scheme?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The bearer format.
|
|
15
|
-
*/
|
|
16
|
-
bearerFormat?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Where is the token located.
|
|
19
|
-
*/
|
|
20
|
-
in?: string;
|
|
21
|
-
/**
|
|
22
|
-
* What is the name of the token.
|
|
23
|
-
*/
|
|
24
|
-
name?: string;
|
|
25
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for each individual package.
|
|
3
|
-
*/
|
|
4
|
-
export interface IPackageJson {
|
|
5
|
-
/**
|
|
6
|
-
* The name of the package.
|
|
7
|
-
*/
|
|
8
|
-
name: string;
|
|
9
|
-
/**
|
|
10
|
-
* The dependencies for the package.
|
|
11
|
-
*/
|
|
12
|
-
dependencies?: {
|
|
13
|
-
[id: string]: string;
|
|
14
|
-
};
|
|
15
|
-
}
|