@kivacore/tanstack-db-generator 0.0.0 → 0.9.7
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/README.md +138 -1
- package/dist/cli.js +1292 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +1216 -0
- package/package.json +41 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
interface OpenAPISpec {
|
|
2
|
+
openapi: string;
|
|
3
|
+
paths: Record<string, PathItem>;
|
|
4
|
+
components?: {
|
|
5
|
+
schemas?: Record<string, SchemaObject>;
|
|
6
|
+
parameters?: Record<string, ParameterObject>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface PathItem {
|
|
10
|
+
get?: OperationObject;
|
|
11
|
+
post?: OperationObject;
|
|
12
|
+
patch?: OperationObject;
|
|
13
|
+
delete?: OperationObject;
|
|
14
|
+
put?: OperationObject;
|
|
15
|
+
}
|
|
16
|
+
interface OperationObject {
|
|
17
|
+
operationId: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
parameters?: Array<ParameterObject | {
|
|
21
|
+
$ref: string;
|
|
22
|
+
}>;
|
|
23
|
+
requestBody?: {
|
|
24
|
+
required?: boolean;
|
|
25
|
+
content?: {
|
|
26
|
+
'application/json'?: {
|
|
27
|
+
schema?: SchemaObject | {
|
|
28
|
+
$ref: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
responses?: Record<string, ResponseObject>;
|
|
34
|
+
tags?: string[];
|
|
35
|
+
security?: Array<Record<string, string[]>>;
|
|
36
|
+
}
|
|
37
|
+
interface ParameterObject {
|
|
38
|
+
name: string;
|
|
39
|
+
in: 'query' | 'path' | 'header';
|
|
40
|
+
required?: boolean;
|
|
41
|
+
description?: string;
|
|
42
|
+
schema?: SchemaObject;
|
|
43
|
+
}
|
|
44
|
+
interface ResponseObject {
|
|
45
|
+
description?: string;
|
|
46
|
+
content?: {
|
|
47
|
+
'application/json'?: {
|
|
48
|
+
schema?: SchemaObject | {
|
|
49
|
+
$ref: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
interface SchemaObject {
|
|
55
|
+
type?: string;
|
|
56
|
+
properties?: Record<string, SchemaObject | {
|
|
57
|
+
$ref: string;
|
|
58
|
+
}>;
|
|
59
|
+
items?: SchemaObject | {
|
|
60
|
+
$ref: string;
|
|
61
|
+
};
|
|
62
|
+
allOf?: Array<SchemaObject | {
|
|
63
|
+
$ref: string;
|
|
64
|
+
}>;
|
|
65
|
+
oneOf?: Array<SchemaObject | {
|
|
66
|
+
$ref: string;
|
|
67
|
+
}>;
|
|
68
|
+
required?: string[];
|
|
69
|
+
format?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
readOnly?: boolean;
|
|
72
|
+
writeOnly?: boolean;
|
|
73
|
+
enum?: any[];
|
|
74
|
+
}
|
|
75
|
+
interface DataSourceInfo {
|
|
76
|
+
appName: string;
|
|
77
|
+
dataSourceName: string;
|
|
78
|
+
entityName: string;
|
|
79
|
+
endpoints: {
|
|
80
|
+
list?: OperationInfo;
|
|
81
|
+
get?: OperationInfo;
|
|
82
|
+
create?: OperationInfo;
|
|
83
|
+
update?: OperationInfo;
|
|
84
|
+
delete?: OperationInfo;
|
|
85
|
+
deleteMany?: OperationInfo;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
interface OperationInfo {
|
|
89
|
+
path: string;
|
|
90
|
+
operationId: string;
|
|
91
|
+
method: string;
|
|
92
|
+
parameters?: ParameterObject[];
|
|
93
|
+
requestBody?: any;
|
|
94
|
+
responseSchema?: SchemaObject;
|
|
95
|
+
summary?: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
}
|
|
98
|
+
interface EntitySchema {
|
|
99
|
+
name: string;
|
|
100
|
+
properties: Record<string, SchemaObject>;
|
|
101
|
+
required?: string[];
|
|
102
|
+
}
|
|
103
|
+
interface GenerateFromOpenAPIOptions {
|
|
104
|
+
apps?: string[];
|
|
105
|
+
dataSources?: string[];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare function generateFromOpenAPI(spec: OpenAPISpec, outputDir: string, options?: GenerateFromOpenAPIOptions): Promise<void>;
|
|
109
|
+
|
|
110
|
+
export { generateFromOpenAPI };
|
|
111
|
+
export type { DataSourceInfo, EntitySchema, GenerateFromOpenAPIOptions, OpenAPISpec, OperationInfo, OperationObject, ParameterObject, PathItem, ResponseObject, SchemaObject };
|