@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/docs/examples.md CHANGED
@@ -254,7 +254,7 @@ The generated `output.json` should be:
254
254
  }
255
255
  },
256
256
  {
257
- "name": "pageSize",
257
+ "name": "limit",
258
258
  "description": "The maximum number of entities in a page.",
259
259
  "in": "query",
260
260
  "required": false,
@@ -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.1",
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": "^0.0.1-next.1",
18
- "@twin.org/cli-core": "^0.0.1",
19
- "@twin.org/core": "^0.0.1",
20
- "@twin.org/nameof": "^0.0.1",
21
- "@twin.org/web": "^0.0.1",
22
- "ajv": "8.17.1",
23
- "commander": "14.0.0",
24
- "glob": "11.0.2",
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,5 +0,0 @@
1
- import type { AnySchemaObject } from "ajv/dist/2020.js";
2
- /**
3
- * Default schema type.
4
- */
5
- export type IJsonSchema = AnySchemaObject;
@@ -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,13 +0,0 @@
1
- /**
2
- * The Open API config definition.
3
- */
4
- export interface IOpenApiExample {
5
- /**
6
- * The summary of the example.
7
- */
8
- summary?: string;
9
- /**
10
- * The value of the example.
11
- */
12
- value: unknown;
13
- }
@@ -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
- }
@@ -1,5 +0,0 @@
1
- import type { JSONType } from "ajv/dist/2020.js";
2
- /**
3
- * Default schema type.
4
- */
5
- export type JsonTypeName = JSONType;