inviton-backduck 1.0.0
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 +302 -0
- package/dist/apidoc/api-doc-generator.d.ts +58 -0
- package/dist/apidoc/api-doc-generator.d.ts.map +1 -0
- package/dist/apidoc/api-doc-generator.js +201 -0
- package/dist/apidoc/api-doc-generator.js.map +1 -0
- package/dist/apidoc/config.d.ts +153 -0
- package/dist/apidoc/config.d.ts.map +1 -0
- package/dist/apidoc/config.js +254 -0
- package/dist/apidoc/config.js.map +1 -0
- package/dist/apidoc/controller-parser.d.ts +208 -0
- package/dist/apidoc/controller-parser.d.ts.map +1 -0
- package/dist/apidoc/controller-parser.js +686 -0
- package/dist/apidoc/controller-parser.js.map +1 -0
- package/dist/apidoc/html-generator.d.ts +290 -0
- package/dist/apidoc/html-generator.d.ts.map +1 -0
- package/dist/apidoc/html-generator.js +2295 -0
- package/dist/apidoc/html-generator.js.map +1 -0
- package/dist/apidoc/index.d.ts +20 -0
- package/dist/apidoc/index.d.ts.map +1 -0
- package/dist/apidoc/index.js +16 -0
- package/dist/apidoc/index.js.map +1 -0
- package/dist/apidoc/openapi-builder.d.ts +169 -0
- package/dist/apidoc/openapi-builder.d.ts.map +1 -0
- package/dist/apidoc/openapi-builder.js +634 -0
- package/dist/apidoc/openapi-builder.js.map +1 -0
- package/dist/apidoc/parameterGeneratorRegistry.d.ts +20 -0
- package/dist/apidoc/parameterGeneratorRegistry.d.ts.map +1 -0
- package/dist/apidoc/parameterGeneratorRegistry.js +6 -0
- package/dist/apidoc/parameterGeneratorRegistry.js.map +1 -0
- package/dist/apidoc/test-type-resolver.d.ts +2 -0
- package/dist/apidoc/test-type-resolver.d.ts.map +1 -0
- package/dist/apidoc/test-type-resolver.js +6 -0
- package/dist/apidoc/test-type-resolver.js.map +1 -0
- package/dist/apidoc/type-resolver.d.ts +266 -0
- package/dist/apidoc/type-resolver.d.ts.map +1 -0
- package/dist/apidoc/type-resolver.js +1226 -0
- package/dist/apidoc/type-resolver.js.map +1 -0
- package/dist/apidoc/verify-type-resolution.d.ts +3 -0
- package/dist/apidoc/verify-type-resolution.d.ts.map +1 -0
- package/dist/apidoc/verify-type-resolution.js +29 -0
- package/dist/apidoc/verify-type-resolution.js.map +1 -0
- package/dist/bun/bunRouter.d.ts +70 -0
- package/dist/bun/bunRouter.d.ts.map +1 -0
- package/dist/bun/bunRouter.js +324 -0
- package/dist/bun/bunRouter.js.map +1 -0
- package/dist/bun/bunServer.d.ts +72 -0
- package/dist/bun/bunServer.d.ts.map +1 -0
- package/dist/bun/bunServer.js +218 -0
- package/dist/bun/bunServer.js.map +1 -0
- package/dist/bun/bunStaticFiles.d.ts +76 -0
- package/dist/bun/bunStaticFiles.d.ts.map +1 -0
- package/dist/bun/bunStaticFiles.js +251 -0
- package/dist/bun/bunStaticFiles.js.map +1 -0
- package/dist/bun/index.d.ts +7 -0
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +7 -0
- package/dist/bun/index.js.map +1 -0
- package/dist/data-contracts.d.ts +132 -0
- package/dist/data-contracts.d.ts.map +1 -0
- package/dist/data-contracts.js +2 -0
- package/dist/data-contracts.js.map +1 -0
- package/dist/decorators.d.ts +75 -0
- package/dist/decorators.d.ts.map +1 -0
- package/dist/decorators.js +101 -0
- package/dist/decorators.js.map +1 -0
- package/dist/express/expressFrontendRouter.d.ts +17 -0
- package/dist/express/expressFrontendRouter.d.ts.map +1 -0
- package/dist/express/expressFrontendRouter.js +33 -0
- package/dist/express/expressFrontendRouter.js.map +1 -0
- package/dist/express/expressRouter.d.ts +25 -0
- package/dist/express/expressRouter.d.ts.map +1 -0
- package/dist/express/expressRouter.js +150 -0
- package/dist/express/expressRouter.js.map +1 -0
- package/dist/express/index.d.ts +6 -0
- package/dist/express/index.d.ts.map +1 -0
- package/dist/express/index.js +6 -0
- package/dist/express/index.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/router.d.ts +162 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +350 -0
- package/dist/router.js.map +1 -0
- package/dist/runtime-detect.d.ts +20 -0
- package/dist/runtime-detect.d.ts.map +1 -0
- package/dist/runtime-detect.js +20 -0
- package/dist/runtime-detect.js.map +1 -0
- package/dist/server.d.ts +126 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +181 -0
- package/dist/server.js.map +1 -0
- package/dist/utils.d.ts +83 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +157 -0
- package/dist/utils.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import { ApiDocConfig } from './config';
|
|
2
|
+
import { parameterGeneratorRegistry } from './parameterGeneratorRegistry';
|
|
3
|
+
/**
|
|
4
|
+
* Builder for OpenAPI 3.0.3 specification documents
|
|
5
|
+
*/
|
|
6
|
+
export class OpenApiBuilder {
|
|
7
|
+
schemas = new Map();
|
|
8
|
+
collectedTags = new Set();
|
|
9
|
+
tagDescriptions = new Map();
|
|
10
|
+
/**
|
|
11
|
+
* Build a complete OpenAPI specification from endpoint data
|
|
12
|
+
*/
|
|
13
|
+
build(endpoints) {
|
|
14
|
+
const paths = this.buildPaths(endpoints);
|
|
15
|
+
const tags = this.buildTags();
|
|
16
|
+
return {
|
|
17
|
+
openapi: '3.0.3',
|
|
18
|
+
info: this.buildInfo(),
|
|
19
|
+
servers: this.buildServers(),
|
|
20
|
+
paths,
|
|
21
|
+
components: {
|
|
22
|
+
schemas: Object.fromEntries(this.schemas),
|
|
23
|
+
securitySchemes: this.buildSecuritySchemes(),
|
|
24
|
+
},
|
|
25
|
+
tags,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build OpenAPI specification from parsed controller information
|
|
30
|
+
*/
|
|
31
|
+
buildFromControllers(controllers, pathResolver) {
|
|
32
|
+
const endpoints = [];
|
|
33
|
+
for (const controller of controllers) {
|
|
34
|
+
const fullPath = pathResolver(controller.className);
|
|
35
|
+
if (!fullPath) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
for (const method of controller.methods) {
|
|
39
|
+
endpoints.push({
|
|
40
|
+
path: fullPath,
|
|
41
|
+
method: method.httpMethod,
|
|
42
|
+
summary: this.generateSummary(controller.className, method.name),
|
|
43
|
+
description: method.description || undefined,
|
|
44
|
+
tag: controller.tag,
|
|
45
|
+
auth: method.auth,
|
|
46
|
+
requestTypeName: method.requestType || undefined,
|
|
47
|
+
responseTypeName: method.responseType || undefined,
|
|
48
|
+
operationId: this.generateOperationId(controller.className, method.name),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return this.build(endpoints);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Register a tag with its description from service interface JSDoc
|
|
56
|
+
*/
|
|
57
|
+
registerTag(tagInfo) {
|
|
58
|
+
this.tagDescriptions.set(tagInfo.name, tagInfo);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Register multiple tags with descriptions from service interfaces
|
|
62
|
+
*/
|
|
63
|
+
registerTags(tags) {
|
|
64
|
+
for (const tag of tags) {
|
|
65
|
+
this.registerTag(tag);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get tag description from registered tags, config, or generate default
|
|
70
|
+
*/
|
|
71
|
+
getTagDescription(tagName) {
|
|
72
|
+
// First check registered tag descriptions (from service interface JSDoc)
|
|
73
|
+
const registered = this.tagDescriptions.get(tagName);
|
|
74
|
+
if (registered) {
|
|
75
|
+
return registered.description;
|
|
76
|
+
}
|
|
77
|
+
// Fall back to config descriptions
|
|
78
|
+
if (ApiDocConfig.tagDescriptions[tagName]) {
|
|
79
|
+
return ApiDocConfig.tagDescriptions[tagName];
|
|
80
|
+
}
|
|
81
|
+
// Generate default description
|
|
82
|
+
return `Operations related to ${tagName}`;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Add a schema to the components section
|
|
86
|
+
*/
|
|
87
|
+
addSchema(name, schema) {
|
|
88
|
+
this.schemas.set(name, schema);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Add multiple schemas from resolved types
|
|
92
|
+
*/
|
|
93
|
+
addSchemasFromResolvedTypes(resolvedTypes) {
|
|
94
|
+
for (const [name, resolved,] of resolvedTypes) {
|
|
95
|
+
const schema = this.resolvedTypeToSchema(resolved);
|
|
96
|
+
this.schemas.set(name, schema);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get all schemas for use in HTML generation
|
|
101
|
+
*/
|
|
102
|
+
getSchemas() {
|
|
103
|
+
return this.schemas;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Convert OpenApiType to OpenAPI schema object
|
|
107
|
+
*/
|
|
108
|
+
typeToSchema(type) {
|
|
109
|
+
// Handle $ref
|
|
110
|
+
if (type.$ref) {
|
|
111
|
+
return { $ref: type.$ref };
|
|
112
|
+
}
|
|
113
|
+
const schema = {};
|
|
114
|
+
// Handle oneOf (union types)
|
|
115
|
+
if (type.oneOf) {
|
|
116
|
+
return {
|
|
117
|
+
oneOf: type.oneOf.map(t => this.typeToSchema(t)),
|
|
118
|
+
nullable: type.nullable || undefined,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
// Set basic type
|
|
122
|
+
if (type.type) {
|
|
123
|
+
schema.type = type.type;
|
|
124
|
+
}
|
|
125
|
+
// Set format
|
|
126
|
+
if (type.format) {
|
|
127
|
+
schema.format = type.format;
|
|
128
|
+
}
|
|
129
|
+
// Set description
|
|
130
|
+
if (type.description) {
|
|
131
|
+
schema.description = type.description;
|
|
132
|
+
}
|
|
133
|
+
// Set nullable
|
|
134
|
+
if (type.nullable) {
|
|
135
|
+
schema.nullable = type.nullable;
|
|
136
|
+
}
|
|
137
|
+
// Handle enum
|
|
138
|
+
if (type.enum) {
|
|
139
|
+
schema.enum = type.enum;
|
|
140
|
+
}
|
|
141
|
+
// Handle x-enum-members extension
|
|
142
|
+
if (type['x-enum-members']) {
|
|
143
|
+
schema['x-enum-members'] = type['x-enum-members'];
|
|
144
|
+
}
|
|
145
|
+
// Handle array items
|
|
146
|
+
if (type.items) {
|
|
147
|
+
schema.items = this.typeToSchema(type.items);
|
|
148
|
+
}
|
|
149
|
+
// Handle object properties
|
|
150
|
+
if (type.properties) {
|
|
151
|
+
schema.properties = {};
|
|
152
|
+
for (const [propName, propType,] of Object.entries(type.properties)) {
|
|
153
|
+
schema.properties[propName] = this.typeToSchema(propType);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Handle required properties
|
|
157
|
+
if (type.required && type.required.length > 0) {
|
|
158
|
+
schema.required = type.required;
|
|
159
|
+
}
|
|
160
|
+
// Handle additionalProperties
|
|
161
|
+
if (type.additionalProperties !== undefined) {
|
|
162
|
+
if (typeof type.additionalProperties === 'boolean') {
|
|
163
|
+
schema.additionalProperties = type.additionalProperties;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
schema.additionalProperties = this.typeToSchema(type.additionalProperties);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return schema;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Build the info section
|
|
173
|
+
*/
|
|
174
|
+
buildInfo() {
|
|
175
|
+
return {
|
|
176
|
+
title: ApiDocConfig.title,
|
|
177
|
+
version: ApiDocConfig.version,
|
|
178
|
+
description: ApiDocConfig.description,
|
|
179
|
+
contact: {
|
|
180
|
+
name: ApiDocConfig.contact.name,
|
|
181
|
+
email: ApiDocConfig.contact.email,
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Build the servers section
|
|
187
|
+
*/
|
|
188
|
+
buildServers() {
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
url: ApiDocConfig.servers.development.url,
|
|
192
|
+
description: ApiDocConfig.servers.development.description,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
url: ApiDocConfig.servers.staging.url,
|
|
196
|
+
description: ApiDocConfig.servers.staging.description,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
url: ApiDocConfig.servers.production.url,
|
|
200
|
+
description: ApiDocConfig.servers.production.description,
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Build security schemes
|
|
206
|
+
*/
|
|
207
|
+
buildSecuritySchemes() {
|
|
208
|
+
return {
|
|
209
|
+
shopApiAuth: {
|
|
210
|
+
type: ApiDocConfig.securitySchemes.shopApiAuth.type,
|
|
211
|
+
name: ApiDocConfig.securitySchemes.shopApiAuth.name,
|
|
212
|
+
in: ApiDocConfig.securitySchemes.shopApiAuth.in,
|
|
213
|
+
description: ApiDocConfig.securitySchemes.shopApiAuth.description,
|
|
214
|
+
},
|
|
215
|
+
bearerAuth: {
|
|
216
|
+
type: ApiDocConfig.securitySchemes.bearerAuth.type,
|
|
217
|
+
scheme: ApiDocConfig.securitySchemes.bearerAuth.scheme,
|
|
218
|
+
bearerFormat: ApiDocConfig.securitySchemes.bearerAuth.bearerFormat,
|
|
219
|
+
description: ApiDocConfig.securitySchemes.bearerAuth.description,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Build paths from endpoints
|
|
225
|
+
*/
|
|
226
|
+
buildPaths(endpoints) {
|
|
227
|
+
const paths = {};
|
|
228
|
+
for (const endpoint of endpoints) {
|
|
229
|
+
const pathKey = endpoint.path;
|
|
230
|
+
if (!paths[pathKey]) {
|
|
231
|
+
paths[pathKey] = {};
|
|
232
|
+
}
|
|
233
|
+
const operation = this.buildOperation(endpoint);
|
|
234
|
+
const methodKey = endpoint.method.toLowerCase();
|
|
235
|
+
// Cast to mutable path item
|
|
236
|
+
const pathItem = paths[pathKey];
|
|
237
|
+
pathItem[methodKey] = operation;
|
|
238
|
+
// Collect tags
|
|
239
|
+
this.collectedTags.add(endpoint.tag);
|
|
240
|
+
}
|
|
241
|
+
return paths;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Convert SwaggerParameter to OpenAPIV3.ParameterObject
|
|
245
|
+
*/
|
|
246
|
+
swaggerParameterToOpenApi(swaggerParam) {
|
|
247
|
+
// SwaggerParameter and OpenAPIV3.ParameterObject have compatible structures
|
|
248
|
+
return {
|
|
249
|
+
name: swaggerParam.name,
|
|
250
|
+
in: swaggerParam.in,
|
|
251
|
+
description: swaggerParam.description,
|
|
252
|
+
required: swaggerParam.required || false,
|
|
253
|
+
schema: swaggerParam.schema,
|
|
254
|
+
style: swaggerParam.style,
|
|
255
|
+
explode: swaggerParam.explode,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Build parameters (path and query) for an endpoint
|
|
260
|
+
*/
|
|
261
|
+
buildParameters(endpoint) {
|
|
262
|
+
const parameters = [];
|
|
263
|
+
// Add path parameters
|
|
264
|
+
const pathParams = this.extractPathParams(endpoint.path);
|
|
265
|
+
for (const paramName of pathParams) {
|
|
266
|
+
parameters.push({
|
|
267
|
+
name: paramName,
|
|
268
|
+
in: 'path',
|
|
269
|
+
required: true,
|
|
270
|
+
schema: { type: 'string' },
|
|
271
|
+
description: `Path parameter ${paramName}`,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
// Add query parameters for methods that support them
|
|
275
|
+
if ([
|
|
276
|
+
'GET',
|
|
277
|
+
'DELETE',
|
|
278
|
+
'HEAD',
|
|
279
|
+
'OPTIONS',
|
|
280
|
+
].includes(endpoint.method)) {
|
|
281
|
+
const queryParams = this.schemaToQueryParams(endpoint);
|
|
282
|
+
parameters.push(...queryParams);
|
|
283
|
+
}
|
|
284
|
+
// Add extra parameters from generator if specified
|
|
285
|
+
if (endpoint.extraParameterGenerator) {
|
|
286
|
+
const generator = parameterGeneratorRegistry[endpoint.extraParameterGenerator.name];
|
|
287
|
+
if (generator) {
|
|
288
|
+
const extraParams = generator(...endpoint.extraParameterGenerator.args);
|
|
289
|
+
// Convert SwaggerParameter[] to OpenAPIV3.ParameterObject[]
|
|
290
|
+
const openApiParams = extraParams.map(this.swaggerParameterToOpenApi);
|
|
291
|
+
parameters.push(...openApiParams);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return parameters;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Extract path parameter names from a path string
|
|
298
|
+
* e.g., "/api/shop/auth/callback/:provider" -> ["provider"]
|
|
299
|
+
*/
|
|
300
|
+
extractPathParams(path) {
|
|
301
|
+
const matches = path.matchAll(/:([a-z_]\w*)/gi);
|
|
302
|
+
return [...matches].map(match => match[1]);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Convert request schema properties to query parameters
|
|
306
|
+
*/
|
|
307
|
+
schemaToQueryParams(endpoint) {
|
|
308
|
+
const parameters = [];
|
|
309
|
+
// Get the schema to work with
|
|
310
|
+
let schema = null;
|
|
311
|
+
if (endpoint.requestSchema) {
|
|
312
|
+
schema = endpoint.requestSchema;
|
|
313
|
+
}
|
|
314
|
+
else if (endpoint.requestTypeName && this.schemas.has(endpoint.requestTypeName)) {
|
|
315
|
+
// If we have a reference but no resolved schema, we can't extract properties
|
|
316
|
+
// This shouldn't happen as requestSchema should be resolved in index.ts
|
|
317
|
+
return parameters;
|
|
318
|
+
}
|
|
319
|
+
if (!schema || schema.type !== 'object' || !schema.properties) {
|
|
320
|
+
return parameters;
|
|
321
|
+
}
|
|
322
|
+
// Convert each property to a query parameter
|
|
323
|
+
for (const [propName, propType,] of Object.entries(schema.properties)) {
|
|
324
|
+
// Skip if property type is not supported for query params
|
|
325
|
+
if (this.isUnsupportedQueryParamType(propType)) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
const parameter = {
|
|
329
|
+
name: propName,
|
|
330
|
+
in: 'query',
|
|
331
|
+
required: schema.required?.includes(propName) || false,
|
|
332
|
+
schema: this.convertPropertyToParameterSchema(propType),
|
|
333
|
+
};
|
|
334
|
+
// Add description if available
|
|
335
|
+
if (propType.description) {
|
|
336
|
+
parameter.description = propType.description;
|
|
337
|
+
}
|
|
338
|
+
parameters.push(parameter);
|
|
339
|
+
}
|
|
340
|
+
return parameters;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Check if a property type is supported for query parameters
|
|
344
|
+
* We support primitives, arrays of primitives, and dates
|
|
345
|
+
*/
|
|
346
|
+
isUnsupportedQueryParamType(propType) {
|
|
347
|
+
// Skip objects and unknown types
|
|
348
|
+
if (propType.type === 'object' || !propType.type) {
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
// Allow primitives, arrays, and special formats
|
|
352
|
+
if ([
|
|
353
|
+
'string',
|
|
354
|
+
'number',
|
|
355
|
+
'integer',
|
|
356
|
+
'boolean',
|
|
357
|
+
].includes(propType.type) || propType.type === 'array') {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
// Allow if it has a special format (dates, etc.)
|
|
361
|
+
if (propType.format) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Convert a property type to a parameter schema suitable for query params
|
|
368
|
+
*/
|
|
369
|
+
convertPropertyToParameterSchema(propType) {
|
|
370
|
+
// Handle arrays - preserve enum in items if present
|
|
371
|
+
if (propType.type === 'array') {
|
|
372
|
+
if (propType.items) {
|
|
373
|
+
// Use recursive call to preserve enum in array items
|
|
374
|
+
const itemSchema = this.convertPropertyToParameterSchema(propType.items);
|
|
375
|
+
return {
|
|
376
|
+
type: 'array',
|
|
377
|
+
items: itemSchema,
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
// Default to array of strings
|
|
381
|
+
return {
|
|
382
|
+
type: 'array',
|
|
383
|
+
items: { type: 'string' },
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
// For other types, return a schema with enum preservation
|
|
387
|
+
const schema = {
|
|
388
|
+
type: propType.type,
|
|
389
|
+
};
|
|
390
|
+
if (propType.format) {
|
|
391
|
+
schema.format = propType.format;
|
|
392
|
+
}
|
|
393
|
+
// Preserve enum values for dropdown display
|
|
394
|
+
if (propType.enum) {
|
|
395
|
+
schema.enum = propType.enum;
|
|
396
|
+
}
|
|
397
|
+
// Preserve enum members for better descriptions
|
|
398
|
+
if (propType['x-enum-members']) {
|
|
399
|
+
schema['x-enum-members'] = propType['x-enum-members'];
|
|
400
|
+
}
|
|
401
|
+
return schema;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Build an operation object for an endpoint
|
|
405
|
+
*/
|
|
406
|
+
buildOperation(endpoint) {
|
|
407
|
+
const operation = {
|
|
408
|
+
tags: [endpoint.tag],
|
|
409
|
+
summary: endpoint.summary,
|
|
410
|
+
description: endpoint.description,
|
|
411
|
+
operationId: endpoint.operationId,
|
|
412
|
+
responses: this.buildResponses(endpoint),
|
|
413
|
+
};
|
|
414
|
+
// Add request body for methods that support it
|
|
415
|
+
if ([
|
|
416
|
+
'POST',
|
|
417
|
+
'PUT',
|
|
418
|
+
'PATCH',
|
|
419
|
+
].includes(endpoint.method)) {
|
|
420
|
+
const requestBody = this.buildRequestBody(endpoint);
|
|
421
|
+
if (requestBody) {
|
|
422
|
+
operation.requestBody = requestBody;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
// Add parameters (path and query)
|
|
426
|
+
const parameters = this.buildParameters(endpoint);
|
|
427
|
+
if (parameters.length > 0) {
|
|
428
|
+
operation.parameters = parameters;
|
|
429
|
+
}
|
|
430
|
+
// Add security requirements if authentication is required
|
|
431
|
+
if (endpoint.auth.hasAuth) {
|
|
432
|
+
operation.security = [{ shopApiAuth: [] }];
|
|
433
|
+
// Add authentication-related description
|
|
434
|
+
const authDesc = this.buildAuthDescription(endpoint.auth);
|
|
435
|
+
if (authDesc) {
|
|
436
|
+
operation.description = operation.description
|
|
437
|
+
? `${operation.description}\n\n${authDesc}`
|
|
438
|
+
: authDesc;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return operation;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Build request body schema
|
|
445
|
+
*/
|
|
446
|
+
buildRequestBody(endpoint) {
|
|
447
|
+
if (endpoint.requestSchema) {
|
|
448
|
+
return {
|
|
449
|
+
required: true,
|
|
450
|
+
content: {
|
|
451
|
+
'application/json': {
|
|
452
|
+
schema: this.typeToSchema(endpoint.requestSchema),
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
if (endpoint.requestTypeName) {
|
|
458
|
+
return {
|
|
459
|
+
required: true,
|
|
460
|
+
content: {
|
|
461
|
+
'application/json': {
|
|
462
|
+
schema: { $ref: `#/components/schemas/${endpoint.requestTypeName}` },
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Build responses object
|
|
471
|
+
*/
|
|
472
|
+
buildResponses(endpoint) {
|
|
473
|
+
const responses = {};
|
|
474
|
+
// Success response
|
|
475
|
+
if (endpoint.responseSchema) {
|
|
476
|
+
responses['200'] = {
|
|
477
|
+
description: 'Successful response',
|
|
478
|
+
content: {
|
|
479
|
+
'application/json': {
|
|
480
|
+
schema: this.typeToSchema(endpoint.responseSchema),
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
else if (endpoint.responseTypeName) {
|
|
486
|
+
responses['200'] = {
|
|
487
|
+
description: 'Successful response',
|
|
488
|
+
content: {
|
|
489
|
+
'application/json': {
|
|
490
|
+
schema: { $ref: `#/components/schemas/${endpoint.responseTypeName}` },
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
responses['200'] = {
|
|
497
|
+
description: 'Successful response',
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
// Error responses
|
|
501
|
+
responses['400'] = {
|
|
502
|
+
description: 'Bad Request - Invalid input parameters',
|
|
503
|
+
};
|
|
504
|
+
if (endpoint.auth.hasAuth) {
|
|
505
|
+
responses['401'] = {
|
|
506
|
+
description: 'Unauthorized - Authentication required',
|
|
507
|
+
};
|
|
508
|
+
if (endpoint.auth.requiresLogin) {
|
|
509
|
+
responses['403'] = {
|
|
510
|
+
description: 'Forbidden - Login required',
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
responses['500'] = {
|
|
515
|
+
description: 'Internal Server Error',
|
|
516
|
+
};
|
|
517
|
+
return responses;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Build authentication description
|
|
521
|
+
*/
|
|
522
|
+
buildAuthDescription(auth) {
|
|
523
|
+
const parts = [];
|
|
524
|
+
if (auth.requiresLogin) {
|
|
525
|
+
parts.push('**Requires Login**: User must be logged in to access this endpoint.');
|
|
526
|
+
}
|
|
527
|
+
if (auth.requiresVerifiedAccount) {
|
|
528
|
+
parts.push('**Requires Verified Account**: User account must be verified.');
|
|
529
|
+
}
|
|
530
|
+
if (parts.length === 0 && auth.hasAuth) {
|
|
531
|
+
parts.push('**Authentication Required**: Valid session cookie required.');
|
|
532
|
+
}
|
|
533
|
+
return parts.length > 0 ? parts.join('\n') : null;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Build tags from collected endpoint tags with descriptions from router hierarchy
|
|
537
|
+
*/
|
|
538
|
+
buildTags() {
|
|
539
|
+
const tags = [];
|
|
540
|
+
for (const tagName of this.collectedTags) {
|
|
541
|
+
const registered = this.tagDescriptions.get(tagName);
|
|
542
|
+
const description = this.getTagDescription(tagName);
|
|
543
|
+
const tagObject = {
|
|
544
|
+
name: tagName,
|
|
545
|
+
description,
|
|
546
|
+
};
|
|
547
|
+
// Add external docs if router path is available
|
|
548
|
+
if (registered?.routerPath) {
|
|
549
|
+
tagObject.externalDocs = {
|
|
550
|
+
description: `Router: ${registered.routerPath}`,
|
|
551
|
+
url: `#/paths/${registered.routerPath.replace(/\//g, '~1')}`,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
tags.push(tagObject);
|
|
555
|
+
}
|
|
556
|
+
// Sort tags alphabetically for consistent output
|
|
557
|
+
return tags.sort((a, b) => a.name.localeCompare(b.name));
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Convert resolved type to OpenAPI schema
|
|
561
|
+
*/
|
|
562
|
+
resolvedTypeToSchema(resolved) {
|
|
563
|
+
if (resolved.isEnum && resolved.enumValues) {
|
|
564
|
+
const schema = {
|
|
565
|
+
type: typeof resolved.enumValues[0] === 'string' ? 'string' : 'integer',
|
|
566
|
+
enum: resolved.enumValues,
|
|
567
|
+
description: resolved.description || undefined,
|
|
568
|
+
};
|
|
569
|
+
// Add enum member details as extension
|
|
570
|
+
if (resolved.enumMembers && resolved.enumMembers.length > 0) {
|
|
571
|
+
schema['x-enum-members'] = resolved.enumMembers;
|
|
572
|
+
}
|
|
573
|
+
return schema;
|
|
574
|
+
}
|
|
575
|
+
const properties = {};
|
|
576
|
+
const required = [];
|
|
577
|
+
for (const prop of resolved.properties) {
|
|
578
|
+
const propSchema = this.typeToSchema(prop.type);
|
|
579
|
+
// Add property description if available (from JSDoc comments)
|
|
580
|
+
if (prop.description && !('$ref' in propSchema)) {
|
|
581
|
+
propSchema.description = prop.description;
|
|
582
|
+
}
|
|
583
|
+
properties[prop.name] = propSchema;
|
|
584
|
+
if (!prop.optional) {
|
|
585
|
+
required.push(prop.name);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return {
|
|
589
|
+
type: 'object',
|
|
590
|
+
properties: Object.keys(properties).length > 0 ? properties : undefined,
|
|
591
|
+
required: required.length > 0 ? required : undefined,
|
|
592
|
+
description: resolved.description || undefined,
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Generate operation ID from controller and method names
|
|
597
|
+
*/
|
|
598
|
+
generateOperationId(controllerClassName, methodName) {
|
|
599
|
+
// Remove 'Controller' suffix and convert to camelCase
|
|
600
|
+
const baseName = controllerClassName
|
|
601
|
+
.replace(/Controller$/, '')
|
|
602
|
+
.replace(/^(.)/, match => match.toLowerCase());
|
|
603
|
+
return `${baseName}_${methodName}`;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Generate summary from controller and method names
|
|
607
|
+
*/
|
|
608
|
+
generateSummary(controllerClassName, methodName) {
|
|
609
|
+
// Convert PascalCase to sentence
|
|
610
|
+
const name = controllerClassName
|
|
611
|
+
.replace(/Controller$/, '')
|
|
612
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
613
|
+
.toLowerCase();
|
|
614
|
+
const methodMap = {
|
|
615
|
+
get: 'Get',
|
|
616
|
+
getAll: 'List all',
|
|
617
|
+
post: 'Create or process',
|
|
618
|
+
put: 'Update',
|
|
619
|
+
patch: 'Partially update',
|
|
620
|
+
delete: 'Delete',
|
|
621
|
+
};
|
|
622
|
+
const action = methodMap[methodName] || methodName;
|
|
623
|
+
return `${action} ${name}`;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Clear all collected data
|
|
627
|
+
*/
|
|
628
|
+
clear() {
|
|
629
|
+
this.schemas.clear();
|
|
630
|
+
this.collectedTags.clear();
|
|
631
|
+
this.tagDescriptions.clear();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
//# sourceMappingURL=openapi-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-builder.js","sourceRoot":"","sources":["../../src/apidoc/openapi-builder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,C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
+
export interface SwaggerParameter {
|
|
2
|
+
name: string;
|
|
3
|
+
in: 'path' | 'query' | 'header' | 'cookie';
|
|
4
|
+
description?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
schema: {
|
|
7
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
8
|
+
format?: string;
|
|
9
|
+
items?: any;
|
|
10
|
+
enum?: any[];
|
|
11
|
+
};
|
|
12
|
+
style?: 'form' | 'simple' | 'matrix' | 'label' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject';
|
|
13
|
+
explode?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registry mapping parameter generator names to functions.
|
|
17
|
+
* Functions take args as (string | number)[] and return SwaggerParameter[].
|
|
18
|
+
*/
|
|
19
|
+
export declare const parameterGeneratorRegistry: Record<string, (...args: (string | number)[]) => SwaggerParameter[]>;
|
|
20
|
+
//# sourceMappingURL=parameterGeneratorRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameterGeneratorRegistry.d.ts","sourceRoot":"","sources":["../../src/apidoc/parameterGeneratorRegistry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE;QACP,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;QACvE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;KACb,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAC;IACnG,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,gBAAgB,EAAE,CAE3G,CAAC"}
|