swagger-to-playwright-api-clients 1.0.4
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/LICENSE +21 -0
- package/README.md +190 -0
- package/dist/api.d.ts +27 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +127 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +255 -0
- package/dist/cli.js.map +1 -0
- package/dist/clients/BaseAPIClient.d.ts +88 -0
- package/dist/clients/BaseAPIClient.d.ts.map +1 -0
- package/dist/clients/BaseAPIClient.js +199 -0
- package/dist/clients/BaseAPIClient.js.map +1 -0
- package/dist/config/types.d.ts +72 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +19 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/copyBaseClient.d.ts +8 -0
- package/dist/utils/copyBaseClient.d.ts.map +1 -0
- package/dist/utils/copyBaseClient.js +354 -0
- package/dist/utils/copyBaseClient.js.map +1 -0
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/swagger/ClientGenerator.d.ts +49 -0
- package/dist/utils/swagger/ClientGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/ClientGenerator.js +192 -0
- package/dist/utils/swagger/ClientGenerator.js.map +1 -0
- package/dist/utils/swagger/FileWriter.d.ts +66 -0
- package/dist/utils/swagger/FileWriter.d.ts.map +1 -0
- package/dist/utils/swagger/FileWriter.js +185 -0
- package/dist/utils/swagger/FileWriter.js.map +1 -0
- package/dist/utils/swagger/SwaggerGenerator.d.ts +42 -0
- package/dist/utils/swagger/SwaggerGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/SwaggerGenerator.js +211 -0
- package/dist/utils/swagger/SwaggerGenerator.js.map +1 -0
- package/dist/utils/swagger/SwaggerParser.d.ts +69 -0
- package/dist/utils/swagger/SwaggerParser.d.ts.map +1 -0
- package/dist/utils/swagger/SwaggerParser.js +358 -0
- package/dist/utils/swagger/SwaggerParser.js.map +1 -0
- package/dist/utils/swagger/TypeGenerator.d.ts +49 -0
- package/dist/utils/swagger/TypeGenerator.d.ts.map +1 -0
- package/dist/utils/swagger/TypeGenerator.js +166 -0
- package/dist/utils/swagger/TypeGenerator.js.map +1 -0
- package/dist/utils/swagger/index.d.ts +12 -0
- package/dist/utils/swagger/index.d.ts.map +1 -0
- package/dist/utils/swagger/index.js +38 -0
- package/dist/utils/swagger/index.js.map +1 -0
- package/dist/utils/swagger/run-generator.d.ts +23 -0
- package/dist/utils/swagger/run-generator.d.ts.map +1 -0
- package/dist/utils/swagger/run-generator.js +195 -0
- package/dist/utils/swagger/run-generator.js.map +1 -0
- package/dist/utils/swagger/types.d.ts +142 -0
- package/dist/utils/swagger/types.d.ts.map +1 -0
- package/dist/utils/swagger/types.js +7 -0
- package/dist/utils/swagger/types.js.map +1 -0
- package/dist/utils/swagger/utils/naming.d.ts +48 -0
- package/dist/utils/swagger/utils/naming.d.ts.map +1 -0
- package/dist/utils/swagger/utils/naming.js +109 -0
- package/dist/utils/swagger/utils/naming.js.map +1 -0
- package/dist/utils/swagger/utils/pathUtils.d.ts +40 -0
- package/dist/utils/swagger/utils/pathUtils.d.ts.map +1 -0
- package/dist/utils/swagger/utils/pathUtils.js +118 -0
- package/dist/utils/swagger/utils/pathUtils.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SwaggerParser - Parses Swagger 2.0 and OpenAPI 3.x documents
|
|
4
|
+
* Extracts endpoints, schemas, and parameters into a unified format
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SwaggerParser = void 0;
|
|
8
|
+
const naming_1 = require("./utils/naming");
|
|
9
|
+
class SwaggerParser {
|
|
10
|
+
document;
|
|
11
|
+
schemas = new Map();
|
|
12
|
+
generatedTypes = new Map();
|
|
13
|
+
constructor(document) {
|
|
14
|
+
this.document = document;
|
|
15
|
+
this.loadSchemas();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Detect if document is Swagger 2.0 or OpenAPI 3.x
|
|
19
|
+
*/
|
|
20
|
+
isSwagger2() {
|
|
21
|
+
return 'swagger' in this.document && this.document.swagger === '2.0';
|
|
22
|
+
}
|
|
23
|
+
isOpenAPI3() {
|
|
24
|
+
return 'openapi' in this.document && this.document.openapi.startsWith('3.');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get service name from document info
|
|
28
|
+
*/
|
|
29
|
+
getServiceName() {
|
|
30
|
+
const title = this.document.info.title || 'ApiService';
|
|
31
|
+
return (0, naming_1.toPascalCase)(title.replace(/api|service/gi, '').trim()) + 'Service';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load all schemas from the document
|
|
35
|
+
*/
|
|
36
|
+
loadSchemas() {
|
|
37
|
+
if (this.isSwagger2()) {
|
|
38
|
+
const doc = this.document;
|
|
39
|
+
if (doc.definitions) {
|
|
40
|
+
for (const [name, schema] of Object.entries(doc.definitions)) {
|
|
41
|
+
this.schemas.set(`#/definitions/${name}`, schema);
|
|
42
|
+
this.schemas.set(name, schema);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (this.isOpenAPI3()) {
|
|
47
|
+
const doc = this.document;
|
|
48
|
+
if (doc.components?.schemas) {
|
|
49
|
+
for (const [name, schema] of Object.entries(doc.components.schemas)) {
|
|
50
|
+
this.schemas.set(`#/components/schemas/${name}`, schema);
|
|
51
|
+
this.schemas.set(name, schema);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolve a $ref to its schema
|
|
58
|
+
*/
|
|
59
|
+
resolveRef(ref) {
|
|
60
|
+
return this.schemas.get(ref);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Extract ref name from $ref path
|
|
64
|
+
*/
|
|
65
|
+
extractRefName(ref) {
|
|
66
|
+
const parts = ref.split('/');
|
|
67
|
+
return parts[parts.length - 1];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Parse all endpoints from the document
|
|
71
|
+
*/
|
|
72
|
+
parseEndpoints() {
|
|
73
|
+
const endpoints = [];
|
|
74
|
+
const paths = this.document.paths;
|
|
75
|
+
for (const [path, pathItem] of Object.entries(paths)) {
|
|
76
|
+
const methods = [
|
|
77
|
+
'get',
|
|
78
|
+
'post',
|
|
79
|
+
'put',
|
|
80
|
+
'patch',
|
|
81
|
+
'delete',
|
|
82
|
+
];
|
|
83
|
+
// Get path-level parameters
|
|
84
|
+
const pathLevelParams = pathItem.parameters || [];
|
|
85
|
+
for (const method of methods) {
|
|
86
|
+
const operation = pathItem[method];
|
|
87
|
+
if (!operation)
|
|
88
|
+
continue;
|
|
89
|
+
const endpoint = this.parseOperation(path, method.toUpperCase(), operation, pathLevelParams);
|
|
90
|
+
endpoints.push(endpoint);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return endpoints;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a single operation
|
|
97
|
+
*/
|
|
98
|
+
parseOperation(path, method, operation, pathLevelParams) {
|
|
99
|
+
// Combine path-level and operation-level parameters
|
|
100
|
+
const allParams = [...pathLevelParams, ...(operation.parameters || [])];
|
|
101
|
+
const pathParams = this.parseParameters(allParams.filter((p) => p.in === 'path'));
|
|
102
|
+
const queryParams = this.parseParameters(allParams.filter((p) => p.in === 'query'));
|
|
103
|
+
const headerParams = this.parseParameters(allParams.filter((p) => p.in === 'header'));
|
|
104
|
+
// Parse request body (different for Swagger 2.0 vs OpenAPI 3.x)
|
|
105
|
+
let requestBody;
|
|
106
|
+
if (this.isSwagger2()) {
|
|
107
|
+
const bodyParam = allParams.find((p) => p.in === 'body');
|
|
108
|
+
if (bodyParam?.schema) {
|
|
109
|
+
requestBody = this.parseSchema(bodyParam.schema, 'RequestBody');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else if (operation.requestBody) {
|
|
113
|
+
const content = operation.requestBody.content;
|
|
114
|
+
const schema = content['application/json']?.schema || Object.values(content)[0]?.schema;
|
|
115
|
+
if (schema) {
|
|
116
|
+
requestBody = this.parseSchema(schema, 'RequestBody');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Parse responses
|
|
120
|
+
const responses = {};
|
|
121
|
+
if (operation.responses) {
|
|
122
|
+
for (const [statusCode, response] of Object.entries(operation.responses)) {
|
|
123
|
+
let schema;
|
|
124
|
+
if (this.isSwagger2() && response.schema) {
|
|
125
|
+
schema = response.schema;
|
|
126
|
+
}
|
|
127
|
+
else if (response.content) {
|
|
128
|
+
schema =
|
|
129
|
+
response.content['application/json']?.schema ||
|
|
130
|
+
Object.values(response.content)[0]?.schema;
|
|
131
|
+
}
|
|
132
|
+
if (schema) {
|
|
133
|
+
responses[statusCode] = this.parseSchema(schema, `Response${statusCode}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
path,
|
|
139
|
+
method,
|
|
140
|
+
operationId: operation.operationId,
|
|
141
|
+
summary: operation.summary,
|
|
142
|
+
description: operation.description,
|
|
143
|
+
tags: operation.tags,
|
|
144
|
+
pathParams,
|
|
145
|
+
queryParams,
|
|
146
|
+
headerParams,
|
|
147
|
+
requestBody,
|
|
148
|
+
responses,
|
|
149
|
+
deprecated: operation.deprecated,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Parse parameters array
|
|
154
|
+
*/
|
|
155
|
+
parseParameters(params) {
|
|
156
|
+
return params.map((param) => ({
|
|
157
|
+
name: param.name,
|
|
158
|
+
required: param.required || false,
|
|
159
|
+
type: this.parameterToTypeScript(param),
|
|
160
|
+
description: param.description,
|
|
161
|
+
enum: param.enum,
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Convert parameter to TypeScript type
|
|
166
|
+
*/
|
|
167
|
+
parameterToTypeScript(param) {
|
|
168
|
+
if (param.schema) {
|
|
169
|
+
return this.schemaToTypeScript(param.schema);
|
|
170
|
+
}
|
|
171
|
+
const typeMap = {
|
|
172
|
+
string: 'string',
|
|
173
|
+
integer: 'number',
|
|
174
|
+
number: 'number',
|
|
175
|
+
boolean: 'boolean',
|
|
176
|
+
array: 'unknown[]',
|
|
177
|
+
object: 'Record<string, unknown>',
|
|
178
|
+
file: 'File',
|
|
179
|
+
};
|
|
180
|
+
if (param.enum) {
|
|
181
|
+
return param.enum.map((e) => `'${e}'`).join(' | ');
|
|
182
|
+
}
|
|
183
|
+
return typeMap[param.type || 'string'] || 'unknown';
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Parse schema into TypeScript representation
|
|
187
|
+
*/
|
|
188
|
+
parseSchema(schema, defaultName) {
|
|
189
|
+
// Handle $ref
|
|
190
|
+
if (schema.$ref) {
|
|
191
|
+
const refName = this.extractRefName(schema.$ref);
|
|
192
|
+
const resolvedSchema = this.resolveRef(schema.$ref);
|
|
193
|
+
if (resolvedSchema) {
|
|
194
|
+
return {
|
|
195
|
+
typeName: (0, naming_1.toPascalCase)(refName),
|
|
196
|
+
typeDefinition: this.schemaToTypeScript(resolvedSchema),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
typeName: (0, naming_1.toPascalCase)(refName),
|
|
201
|
+
typeDefinition: (0, naming_1.toPascalCase)(refName),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
// Handle array
|
|
205
|
+
if (schema.type === 'array' && schema.items) {
|
|
206
|
+
const itemsSchema = this.parseSchema(schema.items, `${defaultName}Item`);
|
|
207
|
+
return {
|
|
208
|
+
typeName: `${itemsSchema.typeName}[]`,
|
|
209
|
+
typeDefinition: `${itemsSchema.typeDefinition}[]`,
|
|
210
|
+
isArray: true,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
// Handle enum
|
|
214
|
+
if (schema.enum) {
|
|
215
|
+
return {
|
|
216
|
+
typeName: defaultName,
|
|
217
|
+
typeDefinition: schema.enum.map((e) => (typeof e === 'string' ? `'${e}'` : e)).join(' | '),
|
|
218
|
+
isEnum: true,
|
|
219
|
+
enumValues: schema.enum,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// Handle allOf, oneOf, anyOf
|
|
223
|
+
if (schema.allOf) {
|
|
224
|
+
const types = schema.allOf.map((s, i) => this.parseSchema(s, `${defaultName}AllOf${i}`));
|
|
225
|
+
return {
|
|
226
|
+
typeName: defaultName,
|
|
227
|
+
typeDefinition: types.map((t) => t.typeDefinition).join(' & '),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (schema.oneOf || schema.anyOf) {
|
|
231
|
+
const schemas = schema.oneOf || schema.anyOf || [];
|
|
232
|
+
const types = schemas.map((s, i) => this.parseSchema(s, `${defaultName}Union${i}`));
|
|
233
|
+
return {
|
|
234
|
+
typeName: defaultName,
|
|
235
|
+
typeDefinition: types.map((t) => t.typeDefinition).join(' | '),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
// Handle object
|
|
239
|
+
if (schema.type === 'object' || schema.properties) {
|
|
240
|
+
return {
|
|
241
|
+
typeName: defaultName,
|
|
242
|
+
typeDefinition: this.objectSchemaToTypeScript(schema),
|
|
243
|
+
properties: schema.properties
|
|
244
|
+
? Object.fromEntries(Object.entries(schema.properties).map(([key, value]) => [
|
|
245
|
+
key,
|
|
246
|
+
this.parseSchema(value, key),
|
|
247
|
+
]))
|
|
248
|
+
: undefined,
|
|
249
|
+
required: schema.required,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// Handle primitive types
|
|
253
|
+
return {
|
|
254
|
+
typeName: defaultName,
|
|
255
|
+
typeDefinition: this.schemaToTypeScript(schema),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Convert schema to TypeScript type string
|
|
260
|
+
*/
|
|
261
|
+
schemaToTypeScript(schema) {
|
|
262
|
+
// Handle $ref
|
|
263
|
+
if (schema.$ref) {
|
|
264
|
+
return (0, naming_1.toPascalCase)(this.extractRefName(schema.$ref));
|
|
265
|
+
}
|
|
266
|
+
// Handle array
|
|
267
|
+
if (schema.type === 'array' && schema.items) {
|
|
268
|
+
return `${this.schemaToTypeScript(schema.items)}[]`;
|
|
269
|
+
}
|
|
270
|
+
// Handle enum
|
|
271
|
+
if (schema.enum) {
|
|
272
|
+
return schema.enum.map((e) => (typeof e === 'string' ? `'${e}'` : e)).join(' | ');
|
|
273
|
+
}
|
|
274
|
+
// Handle allOf
|
|
275
|
+
if (schema.allOf) {
|
|
276
|
+
return schema.allOf.map((s) => this.schemaToTypeScript(s)).join(' & ');
|
|
277
|
+
}
|
|
278
|
+
// Handle oneOf/anyOf
|
|
279
|
+
if (schema.oneOf || schema.anyOf) {
|
|
280
|
+
const schemas = schema.oneOf || schema.anyOf || [];
|
|
281
|
+
return schemas.map((s) => this.schemaToTypeScript(s)).join(' | ');
|
|
282
|
+
}
|
|
283
|
+
// Handle object with properties
|
|
284
|
+
if (schema.type === 'object' || schema.properties) {
|
|
285
|
+
return this.objectSchemaToTypeScript(schema);
|
|
286
|
+
}
|
|
287
|
+
// Handle additional properties (dictionary)
|
|
288
|
+
if (schema.additionalProperties) {
|
|
289
|
+
if (typeof schema.additionalProperties === 'boolean') {
|
|
290
|
+
return 'Record<string, unknown>';
|
|
291
|
+
}
|
|
292
|
+
return `Record<string, ${this.schemaToTypeScript(schema.additionalProperties)}>`;
|
|
293
|
+
}
|
|
294
|
+
// Handle primitive types
|
|
295
|
+
const typeMap = {
|
|
296
|
+
string: 'string',
|
|
297
|
+
integer: 'number',
|
|
298
|
+
number: 'number',
|
|
299
|
+
boolean: 'boolean',
|
|
300
|
+
null: 'null',
|
|
301
|
+
file: 'File',
|
|
302
|
+
};
|
|
303
|
+
const baseType = typeMap[schema.type || 'unknown'] || 'unknown';
|
|
304
|
+
// Handle nullable
|
|
305
|
+
if (schema.nullable) {
|
|
306
|
+
return `${baseType} | null`;
|
|
307
|
+
}
|
|
308
|
+
return baseType;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Convert object schema to TypeScript interface body
|
|
312
|
+
*/
|
|
313
|
+
objectSchemaToTypeScript(schema) {
|
|
314
|
+
if (!schema.properties) {
|
|
315
|
+
if (schema.additionalProperties) {
|
|
316
|
+
if (typeof schema.additionalProperties === 'boolean') {
|
|
317
|
+
return 'Record<string, unknown>';
|
|
318
|
+
}
|
|
319
|
+
return `Record<string, ${this.schemaToTypeScript(schema.additionalProperties)}>`;
|
|
320
|
+
}
|
|
321
|
+
return 'Record<string, unknown>';
|
|
322
|
+
}
|
|
323
|
+
const required = new Set(schema.required || []);
|
|
324
|
+
const props = [];
|
|
325
|
+
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
326
|
+
const isRequired = required.has(propName);
|
|
327
|
+
const nullable = propSchema.nullable ? ' | null' : '';
|
|
328
|
+
const type = this.schemaToTypeScript(propSchema);
|
|
329
|
+
const safeName = /[^a-zA-Z0-9_$]/.test(propName) ? `'${propName}'` : propName;
|
|
330
|
+
props.push(`${safeName}${isRequired ? '' : '?'}: ${type}${nullable}`);
|
|
331
|
+
}
|
|
332
|
+
return `{\n ${props.join(';\n ')}\n}`;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Get all schemas for type generation
|
|
336
|
+
*/
|
|
337
|
+
getAllSchemas() {
|
|
338
|
+
return this.schemas;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Get base URL from document
|
|
342
|
+
*/
|
|
343
|
+
getBaseUrl() {
|
|
344
|
+
if (this.isSwagger2()) {
|
|
345
|
+
const doc = this.document;
|
|
346
|
+
const scheme = doc.schemes?.[0] || 'https';
|
|
347
|
+
const host = doc.host || 'api.example.com';
|
|
348
|
+
const basePath = doc.basePath || '';
|
|
349
|
+
return `${scheme}://${host}${basePath}`;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
const doc = this.document;
|
|
353
|
+
return doc.servers?.[0]?.url || 'https://api.example.com';
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
exports.SwaggerParser = SwaggerParser;
|
|
358
|
+
//# sourceMappingURL=SwaggerParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwaggerParser.js","sourceRoot":"","sources":["../../../src/utils/swagger/SwaggerParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,2CAA8C;AAE9C,MAAa,aAAa;IACjB,QAAQ,CAAkB;IAC1B,OAAO,GAA8B,IAAI,GAAG,EAAE,CAAC;IAC/C,cAAc,GAAwB,IAAI,GAAG,EAAE,CAAC;IAExD,YAAY,QAAyB;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,UAAU;QACT,OAAO,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,KAAK,KAAK,CAAC;IACtE,CAAC;IAED,UAAU;QACT,OAAO,SAAS,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,cAAc;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC;QACvD,OAAO,IAAA,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,CAAC;YACP,MAAM,GAAG,GAAG,IAAI,CAAC,QAA4B,CAAC;YAC9C,OAAO,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,yBAAyB,CAAC;QAC3D,CAAC;IACF,CAAC;CACD;AAnZD,sCAmZC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeGenerator - Generates TypeScript interfaces from parsed endpoints
|
|
3
|
+
* Handles deduplication and proper naming conventions
|
|
4
|
+
*/
|
|
5
|
+
import { SwaggerParser } from './SwaggerParser';
|
|
6
|
+
import { ParsedEndpoint, GeneratedType } from './types';
|
|
7
|
+
export declare class TypeGenerator {
|
|
8
|
+
private parser;
|
|
9
|
+
private generatedTypes;
|
|
10
|
+
private typeDefinitions;
|
|
11
|
+
constructor(parser: SwaggerParser);
|
|
12
|
+
/**
|
|
13
|
+
* Generate all types from endpoints
|
|
14
|
+
*/
|
|
15
|
+
generateAllTypes(endpoints: ParsedEndpoint[]): GeneratedType[];
|
|
16
|
+
/**
|
|
17
|
+
* Generate types from top-level schemas
|
|
18
|
+
*/
|
|
19
|
+
private generateSchemaTypes;
|
|
20
|
+
/**
|
|
21
|
+
* Generate types for a specific endpoint
|
|
22
|
+
*/
|
|
23
|
+
private generateEndpointTypes;
|
|
24
|
+
/**
|
|
25
|
+
* Build request type from endpoint
|
|
26
|
+
*/
|
|
27
|
+
private buildRequestType;
|
|
28
|
+
/**
|
|
29
|
+
* Generate type body from schema
|
|
30
|
+
*/
|
|
31
|
+
private generateTypeBody;
|
|
32
|
+
/**
|
|
33
|
+
* Add a type with deduplication
|
|
34
|
+
*/
|
|
35
|
+
private addType;
|
|
36
|
+
/**
|
|
37
|
+
* Generate TypeScript type declarations as string
|
|
38
|
+
*/
|
|
39
|
+
generateTypeDeclarations(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get type name for an endpoint's request
|
|
42
|
+
*/
|
|
43
|
+
getRequestTypeName(endpoint: ParsedEndpoint): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Get type name for an endpoint's response
|
|
46
|
+
*/
|
|
47
|
+
getResponseTypeName(endpoint: ParsedEndpoint): string | null;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=TypeGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGenerator.d.ts","sourceRoot":"","sources":["../../../src/utils/swagger/TypeGenerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAgB,MAAM,SAAS,CAAC;AAQtE,qBAAa,aAAa;IACzB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,eAAe,CAAkC;gBAE7C,MAAM,EAAE,aAAa;IAIjC;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE;IAY9D;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAe3B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAuD7B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,OAAO;IAwBf;;OAEG;IACH,wBAAwB,IAAI,MAAM;IAuBlC;;OAEG;IACH,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI;IAU3D;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI;CAW5D"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TypeGenerator - Generates TypeScript interfaces from parsed endpoints
|
|
4
|
+
* Handles deduplication and proper naming conventions
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TypeGenerator = void 0;
|
|
8
|
+
const naming_1 = require("./utils/naming");
|
|
9
|
+
class TypeGenerator {
|
|
10
|
+
parser;
|
|
11
|
+
generatedTypes = new Map();
|
|
12
|
+
typeDefinitions = new Map();
|
|
13
|
+
constructor(parser) {
|
|
14
|
+
this.parser = parser;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Generate all types from endpoints
|
|
18
|
+
*/
|
|
19
|
+
generateAllTypes(endpoints) {
|
|
20
|
+
// First, generate shared schema types
|
|
21
|
+
this.generateSchemaTypes();
|
|
22
|
+
// Then generate endpoint-specific types
|
|
23
|
+
for (const endpoint of endpoints) {
|
|
24
|
+
this.generateEndpointTypes(endpoint);
|
|
25
|
+
}
|
|
26
|
+
return Array.from(this.generatedTypes.values());
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Generate types from top-level schemas
|
|
30
|
+
*/
|
|
31
|
+
generateSchemaTypes() {
|
|
32
|
+
const schemas = this.parser.getAllSchemas();
|
|
33
|
+
for (const [name, schema] of schemas) {
|
|
34
|
+
// Skip refs, only process actual schema definitions
|
|
35
|
+
if (name.startsWith('#/'))
|
|
36
|
+
continue;
|
|
37
|
+
const typeName = (0, naming_1.toPascalCase)(name);
|
|
38
|
+
if (this.typeDefinitions.has(typeName))
|
|
39
|
+
continue;
|
|
40
|
+
const typeBody = this.generateTypeBody(schema);
|
|
41
|
+
this.addType(typeName, typeBody, `schema:${name}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Generate types for a specific endpoint
|
|
46
|
+
*/
|
|
47
|
+
generateEndpointTypes(endpoint) {
|
|
48
|
+
const resourceName = (0, naming_1.extractResourceName)(endpoint.path);
|
|
49
|
+
const pathParams = (0, naming_1.extractPathParams)(endpoint.path);
|
|
50
|
+
// Generate request type only if there's a request body
|
|
51
|
+
if (endpoint.requestBody) {
|
|
52
|
+
const requestTypeName = (0, naming_1.generateTypeName)(endpoint.method, resourceName, pathParams, 'Request');
|
|
53
|
+
if (!this.typeDefinitions.has(requestTypeName)) {
|
|
54
|
+
const requestBody = this.buildRequestType(endpoint);
|
|
55
|
+
if (requestBody) {
|
|
56
|
+
this.addType(requestTypeName, requestBody, `endpoint:${endpoint.method}:${endpoint.path}:request`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Generate response type (use the success response, typically 200 or 201)
|
|
61
|
+
const successCodes = ['200', '201', '202', '204'];
|
|
62
|
+
const responseTypeName = (0, naming_1.generateTypeName)(endpoint.method, resourceName, pathParams, 'Response');
|
|
63
|
+
if (!this.typeDefinitions.has(responseTypeName)) {
|
|
64
|
+
let responseBody;
|
|
65
|
+
for (const code of successCodes) {
|
|
66
|
+
if (endpoint.responses[code]?.typeDefinition) {
|
|
67
|
+
responseBody = endpoint.responses[code].typeDefinition;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Default to 'any' if no response schema defined or empty object
|
|
72
|
+
const trimmed = responseBody?.replace(/\s/g, '') || '';
|
|
73
|
+
const finalResponseBody = responseBody && trimmed !== '{}' ? responseBody : 'any';
|
|
74
|
+
this.addType(responseTypeName, finalResponseBody, `endpoint:${endpoint.method}:${endpoint.path}:response`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Build request type from endpoint
|
|
79
|
+
*/
|
|
80
|
+
buildRequestType(endpoint) {
|
|
81
|
+
// Only generate type for request body
|
|
82
|
+
if (endpoint.requestBody) {
|
|
83
|
+
return endpoint.requestBody.typeDefinition;
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Generate type body from schema
|
|
89
|
+
*/
|
|
90
|
+
generateTypeBody(schema) {
|
|
91
|
+
return this.parser.schemaToTypeScript(schema);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Add a type with deduplication
|
|
95
|
+
*/
|
|
96
|
+
addType(name, definition, source) {
|
|
97
|
+
// Check if we already have this exact definition
|
|
98
|
+
const existingDef = this.typeDefinitions.get(name);
|
|
99
|
+
if (existingDef === definition)
|
|
100
|
+
return;
|
|
101
|
+
// If name exists with different definition, make it unique
|
|
102
|
+
let uniqueName = name;
|
|
103
|
+
let counter = 1;
|
|
104
|
+
while (this.typeDefinitions.has(uniqueName) &&
|
|
105
|
+
this.typeDefinitions.get(uniqueName) !== definition) {
|
|
106
|
+
uniqueName = `${name}${counter}`;
|
|
107
|
+
counter++;
|
|
108
|
+
}
|
|
109
|
+
this.typeDefinitions.set(uniqueName, definition);
|
|
110
|
+
this.generatedTypes.set(uniqueName, {
|
|
111
|
+
name: uniqueName,
|
|
112
|
+
definition,
|
|
113
|
+
source,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Generate TypeScript type declarations as string
|
|
118
|
+
*/
|
|
119
|
+
generateTypeDeclarations() {
|
|
120
|
+
const types = [];
|
|
121
|
+
for (const [name, definition] of this.typeDefinitions) {
|
|
122
|
+
// Check if it's an interface (object type) or type alias
|
|
123
|
+
if (definition.startsWith('{') ||
|
|
124
|
+
definition.includes('Record<') ||
|
|
125
|
+
definition.includes('[]')) {
|
|
126
|
+
if (definition.startsWith('{')) {
|
|
127
|
+
types.push(`export interface ${name} ${definition}`);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
types.push(`export type ${name} = ${definition};`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
types.push(`export type ${name} = ${definition};`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return types.join('\n\n');
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get type name for an endpoint's request
|
|
141
|
+
*/
|
|
142
|
+
getRequestTypeName(endpoint) {
|
|
143
|
+
if (!endpoint.requestBody) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const resourceName = (0, naming_1.extractResourceName)(endpoint.path);
|
|
147
|
+
const pathParams = (0, naming_1.extractPathParams)(endpoint.path);
|
|
148
|
+
return (0, naming_1.generateTypeName)(endpoint.method, resourceName, pathParams, 'Request');
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get type name for an endpoint's response
|
|
152
|
+
*/
|
|
153
|
+
getResponseTypeName(endpoint) {
|
|
154
|
+
const successCodes = ['200', '201', '202', '204'];
|
|
155
|
+
for (const code of successCodes) {
|
|
156
|
+
if (endpoint.responses[code]) {
|
|
157
|
+
const resourceName = (0, naming_1.extractResourceName)(endpoint.path);
|
|
158
|
+
const pathParams = (0, naming_1.extractPathParams)(endpoint.path);
|
|
159
|
+
return (0, naming_1.generateTypeName)(endpoint.method, resourceName, pathParams, 'Response');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.TypeGenerator = TypeGenerator;
|
|
166
|
+
//# sourceMappingURL=TypeGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeGenerator.js","sourceRoot":"","sources":["../../../src/utils/swagger/TypeGenerator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2CAKwB;AAExB,MAAa,aAAa;IACjB,MAAM,CAAgB;IACtB,cAAc,GAA+B,IAAI,GAAG,EAAE,CAAC;IACvD,eAAe,GAAwB,IAAI,GAAG,EAAE,CAAC;IAEzD,YAAY,MAAqB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,SAA2B;QAC3C,sCAAsC;QACtC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAE3B,wCAAwC;QACxC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC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,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAvMD,sCAuMC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generator module exports
|
|
3
|
+
*/
|
|
4
|
+
export { SwaggerParser } from './SwaggerParser';
|
|
5
|
+
export { TypeGenerator } from './TypeGenerator';
|
|
6
|
+
export { ClientGenerator } from './ClientGenerator';
|
|
7
|
+
export { FileWriter } from './FileWriter';
|
|
8
|
+
export { SwaggerGenerator, generateFromFile, generateFromUrl, GeneratorOptions, GeneratorResult, } from './SwaggerGenerator';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './utils/naming';
|
|
11
|
+
export * from './utils/pathUtils';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/swagger/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,GACf,MAAM,oBAAoB,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generator module exports
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.generateFromUrl = exports.generateFromFile = exports.SwaggerGenerator = exports.FileWriter = exports.ClientGenerator = exports.TypeGenerator = exports.SwaggerParser = void 0;
|
|
21
|
+
var SwaggerParser_1 = require("./SwaggerParser");
|
|
22
|
+
Object.defineProperty(exports, "SwaggerParser", { enumerable: true, get: function () { return SwaggerParser_1.SwaggerParser; } });
|
|
23
|
+
var TypeGenerator_1 = require("./TypeGenerator");
|
|
24
|
+
Object.defineProperty(exports, "TypeGenerator", { enumerable: true, get: function () { return TypeGenerator_1.TypeGenerator; } });
|
|
25
|
+
var ClientGenerator_1 = require("./ClientGenerator");
|
|
26
|
+
Object.defineProperty(exports, "ClientGenerator", { enumerable: true, get: function () { return ClientGenerator_1.ClientGenerator; } });
|
|
27
|
+
var FileWriter_1 = require("./FileWriter");
|
|
28
|
+
Object.defineProperty(exports, "FileWriter", { enumerable: true, get: function () { return FileWriter_1.FileWriter; } });
|
|
29
|
+
var SwaggerGenerator_1 = require("./SwaggerGenerator");
|
|
30
|
+
Object.defineProperty(exports, "SwaggerGenerator", { enumerable: true, get: function () { return SwaggerGenerator_1.SwaggerGenerator; } });
|
|
31
|
+
Object.defineProperty(exports, "generateFromFile", { enumerable: true, get: function () { return SwaggerGenerator_1.generateFromFile; } });
|
|
32
|
+
Object.defineProperty(exports, "generateFromUrl", { enumerable: true, get: function () { return SwaggerGenerator_1.generateFromUrl; } });
|
|
33
|
+
// Re-export types
|
|
34
|
+
__exportStar(require("./types"), exports);
|
|
35
|
+
// Re-export utilities
|
|
36
|
+
__exportStar(require("./utils/naming"), exports);
|
|
37
|
+
__exportStar(require("./utils/pathUtils"), exports);
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/swagger/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,uDAM4B;AAL3B,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,mHAAA,eAAe,OAAA;AAKhB,kBAAkB;AAClB,0CAAwB;AAExB,sBAAsB;AACtB,iDAA+B;AAC/B,oDAAkC"}
|