@twin.org/tools-core 0.0.2-next.1 → 0.0.2-next.3
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 +27 -8
- package/dist/esm/index.mjs +27 -9
- package/dist/types/index.d.ts +7 -0
- package/dist/types/models/IOpenApi.d.ts +54 -0
- package/dist/types/models/IOpenApiExample.d.ts +13 -0
- package/dist/types/models/IOpenApiHeader.d.ts +19 -0
- package/dist/types/models/IOpenApiPathMethod.d.ts +65 -0
- package/dist/types/models/IOpenApiResponse.d.ts +32 -0
- package/dist/types/models/IOpenApiSecurityScheme.d.ts +25 -0
- package/dist/types/utils/jsonSchemaHelper.d.ts +2 -2
- package/dist/types/utils/openApiHelper.d.ts +9 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/JsonSchemaHelper.md +3 -3
- package/docs/reference/classes/OpenApiHelper.md +21 -0
- package/docs/reference/index.md +7 -0
- package/docs/reference/interfaces/IOpenApi.md +103 -0
- package/docs/reference/interfaces/IOpenApiExample.md +19 -0
- package/docs/reference/interfaces/IOpenApiHeader.md +31 -0
- package/docs/reference/interfaces/IOpenApiPathMethod.md +119 -0
- package/docs/reference/interfaces/IOpenApiResponse.md +35 -0
- package/docs/reference/interfaces/IOpenApiSecurityScheme.md +43 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -72,18 +72,21 @@ class JsonSchemaHelper {
|
|
|
72
72
|
*/
|
|
73
73
|
static normaliseTypeName(typeName) {
|
|
74
74
|
// Remove the partial markers
|
|
75
|
-
let sTypeName = typeName.replace(/^Partial<(.*?)>/g, "$1");
|
|
75
|
+
let sTypeName = typeName.replace(/^Partial<I(.*?)>/g, "$1");
|
|
76
76
|
sTypeName = sTypeName.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
77
77
|
// Remove the omit markers
|
|
78
|
-
sTypeName = sTypeName.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
78
|
+
sTypeName = sTypeName.replace(/^Omit<I(.*?),.*>/g, "$1");
|
|
79
79
|
sTypeName = sTypeName.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
80
80
|
// Remove the pick markers
|
|
81
|
-
sTypeName = sTypeName.replace(/^Pick<(.*?),.*>/g, "$1");
|
|
81
|
+
sTypeName = sTypeName.replace(/^Pick<I(.*?),.*>/g, "$1");
|
|
82
82
|
sTypeName = sTypeName.replace(/Pick%3CI(.*?)%2C.*%3E/g, "$1");
|
|
83
|
+
// Cleanup the generic markers
|
|
84
|
+
sTypeName = sTypeName.replace(/^(.*?)<I(.*?)>/g, "$1<$2>");
|
|
85
|
+
sTypeName = sTypeName.replace(/(.*?)%3CI(.*?)%3E/g, "$1<$2>");
|
|
83
86
|
// Cleanup the unknown markers
|
|
84
87
|
sTypeName = sTypeName.replace(/<unknown>/g, "");
|
|
85
88
|
sTypeName = sTypeName.replace(/%3Cunknown%3E/g, "");
|
|
86
|
-
// Replace the
|
|
89
|
+
// Replace the other url markers
|
|
87
90
|
sTypeName = sTypeName.replace(/%7C/g, "|").replace(/%3C/g, "<").replace(/%3E/g, ">");
|
|
88
91
|
return sTypeName;
|
|
89
92
|
}
|
|
@@ -147,10 +150,13 @@ class JsonSchemaHelper {
|
|
|
147
150
|
*/
|
|
148
151
|
static extractTypes(allSchemas, requiredTypes, referencedSchemas) {
|
|
149
152
|
for (const typeKey of Object.keys(allSchemas)) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
if (!referencedSchemas[typeKey]) {
|
|
154
|
+
for (const requiredType of requiredTypes) {
|
|
155
|
+
if ((core.Is.regexp(requiredType) && new RegExp(requiredType).test(typeKey)) ||
|
|
156
|
+
(core.Is.stringValue(requiredType) && requiredType === typeKey)) {
|
|
157
|
+
referencedSchemas[typeKey] = allSchemas[typeKey];
|
|
158
|
+
JsonSchemaHelper.extractTypesFromSchema(allSchemas, allSchemas[typeKey], referencedSchemas);
|
|
159
|
+
}
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
}
|
|
@@ -223,4 +229,17 @@ class JsonSchemaHelper {
|
|
|
223
229
|
}
|
|
224
230
|
}
|
|
225
231
|
|
|
232
|
+
// Copyright 2024 IOTA Stiftung.
|
|
233
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
234
|
+
/**
|
|
235
|
+
* Helper class for OpenAPI processing.
|
|
236
|
+
*/
|
|
237
|
+
class OpenApiHelper {
|
|
238
|
+
/**
|
|
239
|
+
* The OpenAPI version used.
|
|
240
|
+
*/
|
|
241
|
+
static API_VERSION = "3.1.1";
|
|
242
|
+
}
|
|
243
|
+
|
|
226
244
|
exports.JsonSchemaHelper = JsonSchemaHelper;
|
|
245
|
+
exports.OpenApiHelper = OpenApiHelper;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -70,18 +70,21 @@ class JsonSchemaHelper {
|
|
|
70
70
|
*/
|
|
71
71
|
static normaliseTypeName(typeName) {
|
|
72
72
|
// Remove the partial markers
|
|
73
|
-
let sTypeName = typeName.replace(/^Partial<(.*?)>/g, "$1");
|
|
73
|
+
let sTypeName = typeName.replace(/^Partial<I(.*?)>/g, "$1");
|
|
74
74
|
sTypeName = sTypeName.replace(/Partial%3CI(.*?)%3E/g, "$1");
|
|
75
75
|
// Remove the omit markers
|
|
76
|
-
sTypeName = sTypeName.replace(/^Omit<(.*?),.*>/g, "$1");
|
|
76
|
+
sTypeName = sTypeName.replace(/^Omit<I(.*?),.*>/g, "$1");
|
|
77
77
|
sTypeName = sTypeName.replace(/Omit%3CI(.*?)%2C.*%3E/g, "$1");
|
|
78
78
|
// Remove the pick markers
|
|
79
|
-
sTypeName = sTypeName.replace(/^Pick<(.*?),.*>/g, "$1");
|
|
79
|
+
sTypeName = sTypeName.replace(/^Pick<I(.*?),.*>/g, "$1");
|
|
80
80
|
sTypeName = sTypeName.replace(/Pick%3CI(.*?)%2C.*%3E/g, "$1");
|
|
81
|
+
// Cleanup the generic markers
|
|
82
|
+
sTypeName = sTypeName.replace(/^(.*?)<I(.*?)>/g, "$1<$2>");
|
|
83
|
+
sTypeName = sTypeName.replace(/(.*?)%3CI(.*?)%3E/g, "$1<$2>");
|
|
81
84
|
// Cleanup the unknown markers
|
|
82
85
|
sTypeName = sTypeName.replace(/<unknown>/g, "");
|
|
83
86
|
sTypeName = sTypeName.replace(/%3Cunknown%3E/g, "");
|
|
84
|
-
// Replace the
|
|
87
|
+
// Replace the other url markers
|
|
85
88
|
sTypeName = sTypeName.replace(/%7C/g, "|").replace(/%3C/g, "<").replace(/%3E/g, ">");
|
|
86
89
|
return sTypeName;
|
|
87
90
|
}
|
|
@@ -145,10 +148,13 @@ class JsonSchemaHelper {
|
|
|
145
148
|
*/
|
|
146
149
|
static extractTypes(allSchemas, requiredTypes, referencedSchemas) {
|
|
147
150
|
for (const typeKey of Object.keys(allSchemas)) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
if (!referencedSchemas[typeKey]) {
|
|
152
|
+
for (const requiredType of requiredTypes) {
|
|
153
|
+
if ((Is.regexp(requiredType) && new RegExp(requiredType).test(typeKey)) ||
|
|
154
|
+
(Is.stringValue(requiredType) && requiredType === typeKey)) {
|
|
155
|
+
referencedSchemas[typeKey] = allSchemas[typeKey];
|
|
156
|
+
JsonSchemaHelper.extractTypesFromSchema(allSchemas, allSchemas[typeKey], referencedSchemas);
|
|
157
|
+
}
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -221,4 +227,16 @@ class JsonSchemaHelper {
|
|
|
221
227
|
}
|
|
222
228
|
}
|
|
223
229
|
|
|
224
|
-
|
|
230
|
+
// Copyright 2024 IOTA Stiftung.
|
|
231
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
232
|
+
/**
|
|
233
|
+
* Helper class for OpenAPI processing.
|
|
234
|
+
*/
|
|
235
|
+
class OpenApiHelper {
|
|
236
|
+
/**
|
|
237
|
+
* The OpenAPI version used.
|
|
238
|
+
*/
|
|
239
|
+
static API_VERSION = "3.1.1";
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export { JsonSchemaHelper, OpenApiHelper };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export * from "./models/IJsonSchema";
|
|
2
|
+
export * from "./models/IOpenApi";
|
|
3
|
+
export * from "./models/IOpenApiExample";
|
|
4
|
+
export * from "./models/IOpenApiHeader";
|
|
5
|
+
export * from "./models/IOpenApiPathMethod";
|
|
6
|
+
export * from "./models/IOpenApiResponse";
|
|
7
|
+
export * from "./models/IOpenApiSecurityScheme";
|
|
2
8
|
export * from "./models/IPackageJson";
|
|
3
9
|
export * from "./models/jsonTypeName";
|
|
4
10
|
export * from "./utils/jsonSchemaHelper";
|
|
11
|
+
export * from "./utils/openApiHelper";
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
@@ -11,7 +11,7 @@ export declare class JsonSchemaHelper {
|
|
|
11
11
|
* Process arrays in the schema object.
|
|
12
12
|
* @param schemaObject The schema object to process.
|
|
13
13
|
*/
|
|
14
|
-
static processArrays(schemaObject
|
|
14
|
+
static processArrays(schemaObject: IJsonSchema): void;
|
|
15
15
|
/**
|
|
16
16
|
* Process arrays in the schema object.
|
|
17
17
|
* @param schemaDictionary The schema object to process.
|
|
@@ -49,7 +49,7 @@ export declare class JsonSchemaHelper {
|
|
|
49
49
|
*/
|
|
50
50
|
static extractTypes(allSchemas: {
|
|
51
51
|
[id: string]: IJsonSchema;
|
|
52
|
-
}, requiredTypes: string[], referencedSchemas: {
|
|
52
|
+
}, requiredTypes: (string | RegExp)[], referencedSchemas: {
|
|
53
53
|
[id: string]: IJsonSchema;
|
|
54
54
|
}): void;
|
|
55
55
|
/**
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* improve type name normalisation ([1fe28e5](https://github.com/twinfoundation/tools/commit/1fe28e567593e46a41a833fbba95fe4cd958f525))
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* improve auto expand types ([6181d1d](https://github.com/twinfoundation/tools/commit/6181d1daded1f91323195cf7efbc2f1881f38b41))
|
|
16
|
+
|
|
3
17
|
## [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)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -24,13 +24,13 @@ The JSON Schema version used.
|
|
|
24
24
|
|
|
25
25
|
### processArrays()
|
|
26
26
|
|
|
27
|
-
> `static` **processArrays**(`schemaObject
|
|
27
|
+
> `static` **processArrays**(`schemaObject`): `void`
|
|
28
28
|
|
|
29
29
|
Process arrays in the schema object.
|
|
30
30
|
|
|
31
31
|
#### Parameters
|
|
32
32
|
|
|
33
|
-
##### schemaObject
|
|
33
|
+
##### schemaObject
|
|
34
34
|
|
|
35
35
|
`AnySchemaObject`
|
|
36
36
|
|
|
@@ -144,7 +144,7 @@ All the known schemas.
|
|
|
144
144
|
|
|
145
145
|
##### requiredTypes
|
|
146
146
|
|
|
147
|
-
`string`[]
|
|
147
|
+
(`string` \| `RegExp`)[]
|
|
148
148
|
|
|
149
149
|
The required types.
|
|
150
150
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Class: OpenApiHelper
|
|
2
|
+
|
|
3
|
+
Helper class for OpenAPI processing.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new OpenApiHelper**(): `OpenApiHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`OpenApiHelper`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### API\_VERSION
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **API\_VERSION**: `"3.1.1"` = `"3.1.1"`
|
|
20
|
+
|
|
21
|
+
The OpenAPI version used.
|
package/docs/reference/index.md
CHANGED
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
## Classes
|
|
4
4
|
|
|
5
5
|
- [JsonSchemaHelper](classes/JsonSchemaHelper.md)
|
|
6
|
+
- [OpenApiHelper](classes/OpenApiHelper.md)
|
|
6
7
|
|
|
7
8
|
## Interfaces
|
|
8
9
|
|
|
10
|
+
- [IOpenApi](interfaces/IOpenApi.md)
|
|
11
|
+
- [IOpenApiExample](interfaces/IOpenApiExample.md)
|
|
12
|
+
- [IOpenApiHeader](interfaces/IOpenApiHeader.md)
|
|
13
|
+
- [IOpenApiPathMethod](interfaces/IOpenApiPathMethod.md)
|
|
14
|
+
- [IOpenApiResponse](interfaces/IOpenApiResponse.md)
|
|
15
|
+
- [IOpenApiSecurityScheme](interfaces/IOpenApiSecurityScheme.md)
|
|
9
16
|
- [IPackageJson](interfaces/IPackageJson.md)
|
|
10
17
|
|
|
11
18
|
## Type Aliases
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Interface: IOpenApi
|
|
2
|
+
|
|
3
|
+
The Open API config definition.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### openapi
|
|
8
|
+
|
|
9
|
+
> **openapi**: `string`
|
|
10
|
+
|
|
11
|
+
The open api version.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### info
|
|
16
|
+
|
|
17
|
+
> **info**: `object`
|
|
18
|
+
|
|
19
|
+
Info.
|
|
20
|
+
|
|
21
|
+
#### title
|
|
22
|
+
|
|
23
|
+
> **title**: `string`
|
|
24
|
+
|
|
25
|
+
#### version
|
|
26
|
+
|
|
27
|
+
> **version**: `string`
|
|
28
|
+
|
|
29
|
+
#### description
|
|
30
|
+
|
|
31
|
+
> **description**: `string`
|
|
32
|
+
|
|
33
|
+
#### license?
|
|
34
|
+
|
|
35
|
+
> `optional` **license**: `object`
|
|
36
|
+
|
|
37
|
+
##### license.name
|
|
38
|
+
|
|
39
|
+
> **name**: `string`
|
|
40
|
+
|
|
41
|
+
##### license.url
|
|
42
|
+
|
|
43
|
+
> **url**: `string`
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### servers?
|
|
48
|
+
|
|
49
|
+
> `optional` **servers**: `object`[]
|
|
50
|
+
|
|
51
|
+
The servers for the endpoints.
|
|
52
|
+
|
|
53
|
+
#### url
|
|
54
|
+
|
|
55
|
+
> **url**: `string`
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### tags?
|
|
60
|
+
|
|
61
|
+
> `optional` **tags**: `object`[]
|
|
62
|
+
|
|
63
|
+
Tags for the endpoints.
|
|
64
|
+
|
|
65
|
+
#### name
|
|
66
|
+
|
|
67
|
+
> **name**: `string`
|
|
68
|
+
|
|
69
|
+
#### description
|
|
70
|
+
|
|
71
|
+
> **description**: `string`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### paths
|
|
76
|
+
|
|
77
|
+
> **paths**: `object`
|
|
78
|
+
|
|
79
|
+
The paths.
|
|
80
|
+
|
|
81
|
+
#### Index Signature
|
|
82
|
+
|
|
83
|
+
\[`path`: `string`\]: `object`
|
|
84
|
+
|
|
85
|
+
***
|
|
86
|
+
|
|
87
|
+
### components?
|
|
88
|
+
|
|
89
|
+
> `optional` **components**: `object`
|
|
90
|
+
|
|
91
|
+
The components.
|
|
92
|
+
|
|
93
|
+
#### schemas?
|
|
94
|
+
|
|
95
|
+
> `optional` **schemas**: `AnySchemaObject`
|
|
96
|
+
|
|
97
|
+
#### securitySchemes?
|
|
98
|
+
|
|
99
|
+
> `optional` **securitySchemes**: `object`
|
|
100
|
+
|
|
101
|
+
##### Index Signature
|
|
102
|
+
|
|
103
|
+
\[`name`: `string`\]: [`IOpenApiSecurityScheme`](IOpenApiSecurityScheme.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Interface: IOpenApiExample
|
|
2
|
+
|
|
3
|
+
The Open API config definition.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### summary?
|
|
8
|
+
|
|
9
|
+
> `optional` **summary**: `string`
|
|
10
|
+
|
|
11
|
+
The summary of the example.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### value
|
|
16
|
+
|
|
17
|
+
> **value**: `unknown`
|
|
18
|
+
|
|
19
|
+
The value of the example.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Interface: IOpenApiHeader
|
|
2
|
+
|
|
3
|
+
The Open API config definition.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### schema?
|
|
8
|
+
|
|
9
|
+
> `optional` **schema**: `object`
|
|
10
|
+
|
|
11
|
+
The schema of the header.
|
|
12
|
+
|
|
13
|
+
#### type
|
|
14
|
+
|
|
15
|
+
> **type**: `string`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### description?
|
|
20
|
+
|
|
21
|
+
> `optional` **description**: `string`
|
|
22
|
+
|
|
23
|
+
The description of the header.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### format?
|
|
28
|
+
|
|
29
|
+
> `optional` **format**: `string`
|
|
30
|
+
|
|
31
|
+
The format of the header.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Interface: IOpenApiPathMethod
|
|
2
|
+
|
|
3
|
+
The Open API config definition.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### operationId
|
|
8
|
+
|
|
9
|
+
> **operationId**: `string`
|
|
10
|
+
|
|
11
|
+
The operation id.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### summary
|
|
16
|
+
|
|
17
|
+
> **summary**: `string`
|
|
18
|
+
|
|
19
|
+
Summary.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### tags?
|
|
24
|
+
|
|
25
|
+
> `optional` **tags**: `string`[]
|
|
26
|
+
|
|
27
|
+
Tags.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### parameters?
|
|
32
|
+
|
|
33
|
+
> `optional` **parameters**: `object`[]
|
|
34
|
+
|
|
35
|
+
Parameters.
|
|
36
|
+
|
|
37
|
+
#### name
|
|
38
|
+
|
|
39
|
+
> **name**: `string`
|
|
40
|
+
|
|
41
|
+
#### in
|
|
42
|
+
|
|
43
|
+
> **in**: `string`
|
|
44
|
+
|
|
45
|
+
#### description?
|
|
46
|
+
|
|
47
|
+
> `optional` **description**: `string`
|
|
48
|
+
|
|
49
|
+
#### required
|
|
50
|
+
|
|
51
|
+
> **required**: `boolean`
|
|
52
|
+
|
|
53
|
+
#### schema
|
|
54
|
+
|
|
55
|
+
> **schema**: `object`
|
|
56
|
+
|
|
57
|
+
##### schema.type?
|
|
58
|
+
|
|
59
|
+
> `optional` **type**: `"string"` \| `"number"` \| `"boolean"` \| `"object"` \| `"integer"` \| `"null"` \| `"array"` \| (`"string"` \| `"number"` \| `"boolean"` \| `"object"` \| `"integer"` \| `"null"` \| `"array"`)[]
|
|
60
|
+
|
|
61
|
+
##### schema.enum?
|
|
62
|
+
|
|
63
|
+
> `optional` **enum**: `AnySchemaObject`[]
|
|
64
|
+
|
|
65
|
+
##### schema.$ref?
|
|
66
|
+
|
|
67
|
+
> `optional` **$ref**: `string`
|
|
68
|
+
|
|
69
|
+
#### style?
|
|
70
|
+
|
|
71
|
+
> `optional` **style**: `string`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### requestBody?
|
|
76
|
+
|
|
77
|
+
> `optional` **requestBody**: `object`
|
|
78
|
+
|
|
79
|
+
Request body.
|
|
80
|
+
|
|
81
|
+
#### required
|
|
82
|
+
|
|
83
|
+
> **required**: `boolean`
|
|
84
|
+
|
|
85
|
+
#### description?
|
|
86
|
+
|
|
87
|
+
> `optional` **description**: `string`
|
|
88
|
+
|
|
89
|
+
#### content?
|
|
90
|
+
|
|
91
|
+
> `optional` **content**: `object`
|
|
92
|
+
|
|
93
|
+
##### Index Signature
|
|
94
|
+
|
|
95
|
+
\[`contentType`: `string`\]: `object`
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### responses?
|
|
100
|
+
|
|
101
|
+
> `optional` **responses**: `object`
|
|
102
|
+
|
|
103
|
+
Response body.
|
|
104
|
+
|
|
105
|
+
#### Index Signature
|
|
106
|
+
|
|
107
|
+
\[`code`: `string`\]: [`IOpenApiResponse`](IOpenApiResponse.md)
|
|
108
|
+
|
|
109
|
+
***
|
|
110
|
+
|
|
111
|
+
### security?
|
|
112
|
+
|
|
113
|
+
> `optional` **security**: `object`[]
|
|
114
|
+
|
|
115
|
+
Security model for the API.
|
|
116
|
+
|
|
117
|
+
#### Index Signature
|
|
118
|
+
|
|
119
|
+
\[`name`: `string`\]: `string`[]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Interface: IOpenApiResponse
|
|
2
|
+
|
|
3
|
+
The Open API config definition.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### description?
|
|
8
|
+
|
|
9
|
+
> `optional` **description**: `string`
|
|
10
|
+
|
|
11
|
+
Descriptions for the response.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### content?
|
|
16
|
+
|
|
17
|
+
> `optional` **content**: `object`
|
|
18
|
+
|
|
19
|
+
Content for the response.
|
|
20
|
+
|
|
21
|
+
#### Index Signature
|
|
22
|
+
|
|
23
|
+
\[`contentType`: `string`\]: `object`
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### headers?
|
|
28
|
+
|
|
29
|
+
> `optional` **headers**: `object`
|
|
30
|
+
|
|
31
|
+
The headers for the response.
|
|
32
|
+
|
|
33
|
+
#### Index Signature
|
|
34
|
+
|
|
35
|
+
\[`id`: `string`\]: [`IOpenApiHeader`](IOpenApiHeader.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Interface: IOpenApiSecurityScheme
|
|
2
|
+
|
|
3
|
+
The Open API config definition for security scheme.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### type?
|
|
8
|
+
|
|
9
|
+
> `optional` **type**: `string`
|
|
10
|
+
|
|
11
|
+
The type of the security schema.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### scheme?
|
|
16
|
+
|
|
17
|
+
> `optional` **scheme**: `string`
|
|
18
|
+
|
|
19
|
+
The scheme method.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### bearerFormat?
|
|
24
|
+
|
|
25
|
+
> `optional` **bearerFormat**: `string`
|
|
26
|
+
|
|
27
|
+
The bearer format.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### in?
|
|
32
|
+
|
|
33
|
+
> `optional` **in**: `string`
|
|
34
|
+
|
|
35
|
+
Where is the token located.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### name?
|
|
40
|
+
|
|
41
|
+
> `optional` **name**: `string`
|
|
42
|
+
|
|
43
|
+
What is the name of the token.
|