lokicms-plugin-api-docs 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/README.md +220 -0
- package/dist/formatters/json-formatter.d.ts +25 -0
- package/dist/formatters/json-formatter.d.ts.map +1 -0
- package/dist/formatters/json-formatter.js +45 -0
- package/dist/formatters/json-formatter.js.map +1 -0
- package/dist/formatters/markdown-formatter.d.ts +21 -0
- package/dist/formatters/markdown-formatter.d.ts.map +1 -0
- package/dist/formatters/markdown-formatter.js +203 -0
- package/dist/formatters/markdown-formatter.js.map +1 -0
- package/dist/formatters/openapi-formatter.d.ts +14 -0
- package/dist/formatters/openapi-formatter.d.ts.map +1 -0
- package/dist/formatters/openapi-formatter.js +505 -0
- package/dist/formatters/openapi-formatter.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +18 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +448 -0
- package/dist/plugin.js.map +1 -0
- package/dist/services/doc-generator.d.ts +22 -0
- package/dist/services/doc-generator.d.ts.map +1 -0
- package/dist/services/doc-generator.js +370 -0
- package/dist/services/doc-generator.js.map +1 -0
- package/dist/services/schema-converter.d.ts +19 -0
- package/dist/services/schema-converter.d.ts.map +1 -0
- package/dist/services/schema-converter.js +371 -0
- package/dist/services/schema-converter.js.map +1 -0
- package/dist/services/typescript-generator.d.ts +27 -0
- package/dist/services/typescript-generator.d.ts.map +1 -0
- package/dist/services/typescript-generator.js +294 -0
- package/dist/services/typescript-generator.js.map +1 -0
- package/dist/types.d.ts +245 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI Formatter
|
|
3
|
+
* Outputs API documentation as OpenAPI 3.0 specification
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Format documentation as OpenAPI 3.0 specification
|
|
7
|
+
*/
|
|
8
|
+
export function formatAsOpenApi(docs, options = {}) {
|
|
9
|
+
const { baseUrl = 'http://localhost:3000', serverDescription = 'LokiCMS API Server', outputFormat = 'json', } = options;
|
|
10
|
+
const spec = buildOpenApiSpec(docs, baseUrl, serverDescription);
|
|
11
|
+
if (outputFormat === 'yaml') {
|
|
12
|
+
return toYaml(spec);
|
|
13
|
+
}
|
|
14
|
+
return JSON.stringify(spec, null, 2);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build OpenAPI specification object
|
|
18
|
+
*/
|
|
19
|
+
function buildOpenApiSpec(docs, baseUrl, serverDescription) {
|
|
20
|
+
const paths = {};
|
|
21
|
+
const schemas = {};
|
|
22
|
+
const tags = new Set();
|
|
23
|
+
// Add tool endpoints
|
|
24
|
+
for (const tool of docs.tools) {
|
|
25
|
+
const path = `/mcp/${tool.name}`;
|
|
26
|
+
const tag = getToolTag(tool.name);
|
|
27
|
+
tags.add(tag);
|
|
28
|
+
// Store input schema
|
|
29
|
+
const schemaName = pascalCase(tool.name) + 'Input';
|
|
30
|
+
schemas[schemaName] = tool.inputSchema;
|
|
31
|
+
paths[path] = {
|
|
32
|
+
post: createToolOperation(tool, schemaName, tag),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Add content type endpoints
|
|
36
|
+
for (const contentType of docs.contentTypes) {
|
|
37
|
+
const basePath = `/content/${contentType.slug}`;
|
|
38
|
+
const schemaName = pascalCase(contentType.name);
|
|
39
|
+
tags.add('Content');
|
|
40
|
+
// Store content type schema
|
|
41
|
+
schemas[schemaName] = buildContentTypeSchema(contentType);
|
|
42
|
+
// List endpoint
|
|
43
|
+
paths[basePath] = {
|
|
44
|
+
get: createListOperation(contentType, schemaName),
|
|
45
|
+
post: createCreateOperation(contentType, schemaName),
|
|
46
|
+
};
|
|
47
|
+
// Single item endpoints
|
|
48
|
+
paths[`${basePath}/{id}`] = {
|
|
49
|
+
get: createGetOperation(contentType, schemaName),
|
|
50
|
+
put: createUpdateOperation(contentType, schemaName),
|
|
51
|
+
delete: createDeleteOperation(contentType),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Add endpoint definitions if present
|
|
55
|
+
if (docs.endpoints) {
|
|
56
|
+
for (const endpoint of docs.endpoints) {
|
|
57
|
+
if (!paths[endpoint.path]) {
|
|
58
|
+
paths[endpoint.path] = {};
|
|
59
|
+
}
|
|
60
|
+
const method = endpoint.method.toLowerCase();
|
|
61
|
+
paths[endpoint.path][method] = createEndpointOperation(endpoint);
|
|
62
|
+
if (endpoint.tags) {
|
|
63
|
+
for (const tag of endpoint.tags) {
|
|
64
|
+
tags.add(tag);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
openapi: '3.0.0',
|
|
71
|
+
info: {
|
|
72
|
+
title: docs.info.title,
|
|
73
|
+
version: docs.info.version,
|
|
74
|
+
description: docs.info.description,
|
|
75
|
+
},
|
|
76
|
+
servers: [
|
|
77
|
+
{
|
|
78
|
+
url: baseUrl,
|
|
79
|
+
description: serverDescription,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
paths,
|
|
83
|
+
components: {
|
|
84
|
+
schemas,
|
|
85
|
+
securitySchemes: {
|
|
86
|
+
bearerAuth: {
|
|
87
|
+
type: 'http',
|
|
88
|
+
scheme: 'bearer',
|
|
89
|
+
bearerFormat: 'JWT',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
tags: Array.from(tags).map((name) => ({
|
|
94
|
+
name,
|
|
95
|
+
description: getTagDescription(name),
|
|
96
|
+
})),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Create OpenAPI operation for a tool
|
|
101
|
+
*/
|
|
102
|
+
function createToolOperation(tool, schemaName, tag) {
|
|
103
|
+
return {
|
|
104
|
+
summary: tool.description,
|
|
105
|
+
description: `Execute the ${tool.name} MCP tool`,
|
|
106
|
+
operationId: tool.name,
|
|
107
|
+
tags: [tag],
|
|
108
|
+
requestBody: {
|
|
109
|
+
required: true,
|
|
110
|
+
content: {
|
|
111
|
+
'application/json': {
|
|
112
|
+
schema: {
|
|
113
|
+
$ref: `#/components/schemas/${schemaName}`,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
responses: {
|
|
119
|
+
'200': {
|
|
120
|
+
description: 'Successful response',
|
|
121
|
+
content: {
|
|
122
|
+
'application/json': {
|
|
123
|
+
schema: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
'400': {
|
|
130
|
+
description: 'Invalid input',
|
|
131
|
+
content: {
|
|
132
|
+
'application/json': {
|
|
133
|
+
schema: {
|
|
134
|
+
type: 'object',
|
|
135
|
+
properties: {
|
|
136
|
+
error: { type: 'string' },
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Create list operation for content type
|
|
147
|
+
*/
|
|
148
|
+
function createListOperation(contentType, schemaName) {
|
|
149
|
+
return {
|
|
150
|
+
summary: `List ${contentType.name} entries`,
|
|
151
|
+
operationId: `list${schemaName}`,
|
|
152
|
+
tags: ['Content'],
|
|
153
|
+
parameters: [
|
|
154
|
+
{
|
|
155
|
+
name: 'limit',
|
|
156
|
+
in: 'query',
|
|
157
|
+
description: 'Maximum number of entries to return',
|
|
158
|
+
schema: { type: 'integer', default: 20 },
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: 'offset',
|
|
162
|
+
in: 'query',
|
|
163
|
+
description: 'Number of entries to skip',
|
|
164
|
+
schema: { type: 'integer', default: 0 },
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
responses: {
|
|
168
|
+
'200': {
|
|
169
|
+
description: 'List of entries',
|
|
170
|
+
content: {
|
|
171
|
+
'application/json': {
|
|
172
|
+
schema: {
|
|
173
|
+
type: 'array',
|
|
174
|
+
items: { $ref: `#/components/schemas/${schemaName}` },
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Create get operation for content type
|
|
184
|
+
*/
|
|
185
|
+
function createGetOperation(contentType, schemaName) {
|
|
186
|
+
return {
|
|
187
|
+
summary: `Get ${contentType.name} by ID`,
|
|
188
|
+
operationId: `get${schemaName}`,
|
|
189
|
+
tags: ['Content'],
|
|
190
|
+
parameters: [
|
|
191
|
+
{
|
|
192
|
+
name: 'id',
|
|
193
|
+
in: 'path',
|
|
194
|
+
required: true,
|
|
195
|
+
description: 'Entry ID',
|
|
196
|
+
schema: { type: 'string' },
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
responses: {
|
|
200
|
+
'200': {
|
|
201
|
+
description: 'Entry details',
|
|
202
|
+
content: {
|
|
203
|
+
'application/json': {
|
|
204
|
+
schema: { $ref: `#/components/schemas/${schemaName}` },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
'404': {
|
|
209
|
+
description: 'Entry not found',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Create create operation for content type
|
|
216
|
+
*/
|
|
217
|
+
function createCreateOperation(contentType, schemaName) {
|
|
218
|
+
return {
|
|
219
|
+
summary: `Create ${contentType.name}`,
|
|
220
|
+
operationId: `create${schemaName}`,
|
|
221
|
+
tags: ['Content'],
|
|
222
|
+
requestBody: {
|
|
223
|
+
required: true,
|
|
224
|
+
content: {
|
|
225
|
+
'application/json': {
|
|
226
|
+
schema: { $ref: `#/components/schemas/${schemaName}` },
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
responses: {
|
|
231
|
+
'201': {
|
|
232
|
+
description: 'Entry created',
|
|
233
|
+
content: {
|
|
234
|
+
'application/json': {
|
|
235
|
+
schema: { $ref: `#/components/schemas/${schemaName}` },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
'400': {
|
|
240
|
+
description: 'Invalid input',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Create update operation for content type
|
|
247
|
+
*/
|
|
248
|
+
function createUpdateOperation(contentType, schemaName) {
|
|
249
|
+
return {
|
|
250
|
+
summary: `Update ${contentType.name}`,
|
|
251
|
+
operationId: `update${schemaName}`,
|
|
252
|
+
tags: ['Content'],
|
|
253
|
+
parameters: [
|
|
254
|
+
{
|
|
255
|
+
name: 'id',
|
|
256
|
+
in: 'path',
|
|
257
|
+
required: true,
|
|
258
|
+
description: 'Entry ID',
|
|
259
|
+
schema: { type: 'string' },
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
requestBody: {
|
|
263
|
+
required: true,
|
|
264
|
+
content: {
|
|
265
|
+
'application/json': {
|
|
266
|
+
schema: { $ref: `#/components/schemas/${schemaName}` },
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
responses: {
|
|
271
|
+
'200': {
|
|
272
|
+
description: 'Entry updated',
|
|
273
|
+
content: {
|
|
274
|
+
'application/json': {
|
|
275
|
+
schema: { $ref: `#/components/schemas/${schemaName}` },
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
'404': {
|
|
280
|
+
description: 'Entry not found',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Create delete operation for content type
|
|
287
|
+
*/
|
|
288
|
+
function createDeleteOperation(contentType) {
|
|
289
|
+
return {
|
|
290
|
+
summary: `Delete ${contentType.name}`,
|
|
291
|
+
operationId: `delete${pascalCase(contentType.name)}`,
|
|
292
|
+
tags: ['Content'],
|
|
293
|
+
parameters: [
|
|
294
|
+
{
|
|
295
|
+
name: 'id',
|
|
296
|
+
in: 'path',
|
|
297
|
+
required: true,
|
|
298
|
+
description: 'Entry ID',
|
|
299
|
+
schema: { type: 'string' },
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
responses: {
|
|
303
|
+
'204': {
|
|
304
|
+
description: 'Entry deleted',
|
|
305
|
+
},
|
|
306
|
+
'404': {
|
|
307
|
+
description: 'Entry not found',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Create operation from endpoint documentation
|
|
314
|
+
*/
|
|
315
|
+
function createEndpointOperation(endpoint) {
|
|
316
|
+
const operation = {
|
|
317
|
+
summary: endpoint.summary,
|
|
318
|
+
description: endpoint.description,
|
|
319
|
+
tags: endpoint.tags || ['General'],
|
|
320
|
+
responses: {},
|
|
321
|
+
};
|
|
322
|
+
if (endpoint.parameters) {
|
|
323
|
+
operation.parameters = endpoint.parameters.map((p) => ({
|
|
324
|
+
name: p.name,
|
|
325
|
+
in: p.name === 'id' ? 'path' : 'query',
|
|
326
|
+
required: p.required,
|
|
327
|
+
description: p.description,
|
|
328
|
+
schema: { type: p.type },
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
if (endpoint.requestBody) {
|
|
332
|
+
operation.requestBody = {
|
|
333
|
+
required: true,
|
|
334
|
+
content: {
|
|
335
|
+
'application/json': {
|
|
336
|
+
schema: endpoint.requestBody,
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
if (endpoint.responses) {
|
|
342
|
+
for (const [code, response] of Object.entries(endpoint.responses)) {
|
|
343
|
+
operation.responses[code] = {
|
|
344
|
+
description: response.description,
|
|
345
|
+
...(response.schema
|
|
346
|
+
? {
|
|
347
|
+
content: {
|
|
348
|
+
'application/json': {
|
|
349
|
+
schema: response.schema,
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
}
|
|
353
|
+
: {}),
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
operation.responses['200'] = { description: 'Success' };
|
|
359
|
+
}
|
|
360
|
+
return operation;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Build JSON Schema from content type
|
|
364
|
+
*/
|
|
365
|
+
function buildContentTypeSchema(contentType) {
|
|
366
|
+
const properties = {
|
|
367
|
+
id: { type: 'string', description: 'Unique identifier' },
|
|
368
|
+
createdAt: { type: 'string', format: 'date-time' },
|
|
369
|
+
updatedAt: { type: 'string', format: 'date-time' },
|
|
370
|
+
};
|
|
371
|
+
const required = ['id'];
|
|
372
|
+
for (const field of contentType.fields) {
|
|
373
|
+
properties[field.name] = {
|
|
374
|
+
type: fieldTypeToSchemaType(field.type),
|
|
375
|
+
description: field.description,
|
|
376
|
+
};
|
|
377
|
+
if (field.required) {
|
|
378
|
+
required.push(field.name);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
type: 'object',
|
|
383
|
+
properties,
|
|
384
|
+
required,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Convert field type to JSON Schema type
|
|
389
|
+
*/
|
|
390
|
+
function fieldTypeToSchemaType(fieldType) {
|
|
391
|
+
const typeMap = {
|
|
392
|
+
string: 'string',
|
|
393
|
+
text: 'string',
|
|
394
|
+
richtext: 'string',
|
|
395
|
+
number: 'number',
|
|
396
|
+
integer: 'integer',
|
|
397
|
+
boolean: 'boolean',
|
|
398
|
+
date: 'string',
|
|
399
|
+
datetime: 'string',
|
|
400
|
+
array: 'array',
|
|
401
|
+
object: 'object',
|
|
402
|
+
reference: 'string',
|
|
403
|
+
media: 'string',
|
|
404
|
+
json: 'object',
|
|
405
|
+
};
|
|
406
|
+
return typeMap[fieldType.toLowerCase()] || 'string';
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get tool category tag from name
|
|
410
|
+
*/
|
|
411
|
+
function getToolTag(toolName) {
|
|
412
|
+
const prefix = toolName.split('_')[0];
|
|
413
|
+
const tags = {
|
|
414
|
+
vault: 'Vault',
|
|
415
|
+
sql: 'SQL',
|
|
416
|
+
mongodb: 'MongoDB',
|
|
417
|
+
vectors: 'Vectors',
|
|
418
|
+
backup: 'Backup',
|
|
419
|
+
docs: 'Documentation',
|
|
420
|
+
content: 'Content',
|
|
421
|
+
media: 'Media',
|
|
422
|
+
auth: 'Authentication',
|
|
423
|
+
};
|
|
424
|
+
return tags[prefix] || 'General';
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Get tag description
|
|
428
|
+
*/
|
|
429
|
+
function getTagDescription(tag) {
|
|
430
|
+
const descriptions = {
|
|
431
|
+
Vault: 'Secure credential storage and management',
|
|
432
|
+
SQL: 'SQL database operations',
|
|
433
|
+
MongoDB: 'MongoDB database operations',
|
|
434
|
+
Vectors: 'Vector search and embeddings',
|
|
435
|
+
Backup: 'Backup and restore operations',
|
|
436
|
+
Documentation: 'API documentation generation',
|
|
437
|
+
Content: 'Content management operations',
|
|
438
|
+
Media: 'Media file operations',
|
|
439
|
+
Authentication: 'Authentication and authorization',
|
|
440
|
+
General: 'General operations',
|
|
441
|
+
};
|
|
442
|
+
return descriptions[tag] || `${tag} operations`;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Convert string to PascalCase
|
|
446
|
+
*/
|
|
447
|
+
function pascalCase(str) {
|
|
448
|
+
return str
|
|
449
|
+
.split(/[_-]/)
|
|
450
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
451
|
+
.join('');
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Simple YAML converter (basic implementation)
|
|
455
|
+
*/
|
|
456
|
+
function toYaml(obj, indent = 0) {
|
|
457
|
+
const spaces = ' '.repeat(indent);
|
|
458
|
+
if (obj === null || obj === undefined) {
|
|
459
|
+
return 'null';
|
|
460
|
+
}
|
|
461
|
+
if (typeof obj === 'string') {
|
|
462
|
+
if (obj.includes('\n') || obj.includes(':') || obj.includes('#')) {
|
|
463
|
+
return `"${obj.replace(/"/g, '\\"')}"`;
|
|
464
|
+
}
|
|
465
|
+
return obj;
|
|
466
|
+
}
|
|
467
|
+
if (typeof obj === 'number' || typeof obj === 'boolean') {
|
|
468
|
+
return String(obj);
|
|
469
|
+
}
|
|
470
|
+
if (Array.isArray(obj)) {
|
|
471
|
+
if (obj.length === 0)
|
|
472
|
+
return '[]';
|
|
473
|
+
return obj
|
|
474
|
+
.map((item) => {
|
|
475
|
+
const value = toYaml(item, indent + 1);
|
|
476
|
+
if (typeof item === 'object' && item !== null) {
|
|
477
|
+
return `${spaces}- ${value.trim().split('\n').join(`\n${spaces} `)}`;
|
|
478
|
+
}
|
|
479
|
+
return `${spaces}- ${value}`;
|
|
480
|
+
})
|
|
481
|
+
.join('\n');
|
|
482
|
+
}
|
|
483
|
+
if (typeof obj === 'object') {
|
|
484
|
+
const entries = Object.entries(obj);
|
|
485
|
+
if (entries.length === 0)
|
|
486
|
+
return '{}';
|
|
487
|
+
return entries
|
|
488
|
+
.map(([key, value]) => {
|
|
489
|
+
if (value === undefined)
|
|
490
|
+
return '';
|
|
491
|
+
const yamlValue = toYaml(value, indent + 1);
|
|
492
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
493
|
+
return `${spaces}${key}:\n${yamlValue}`;
|
|
494
|
+
}
|
|
495
|
+
if (Array.isArray(value)) {
|
|
496
|
+
return `${spaces}${key}:\n${yamlValue}`;
|
|
497
|
+
}
|
|
498
|
+
return `${spaces}${key}: ${yamlValue}`;
|
|
499
|
+
})
|
|
500
|
+
.filter(Boolean)
|
|
501
|
+
.join('\n');
|
|
502
|
+
}
|
|
503
|
+
return String(obj);
|
|
504
|
+
}
|
|
505
|
+
//# sourceMappingURL=openapi-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-formatter.js","sourceRoot":"","sources":["../../src/formatters/openapi-formatter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAsB,EACtB,UAII,EAAE;IAEN,MAAM,EACJ,OAAO,GAAG,uBAAuB,EACjC,iBAAiB,GAAG,oBAAoB,EACxC,YAAY,GAAG,MAAM,GACtB,GAAG,OAAO,CAAC;IAEZ,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAEhE,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CACvB,IAAsB,EACtB,OAAe,EACf,iBAAyB;IAEzB,MAAM,KAAK,GAAgC,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAuC,EAAE,CAAC;IACvD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,qBAAqB;IACrB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEd,qBAAqB;QACrB,MAAM,UAAU,GAAG,UAA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IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO,GAAG,MAAM,GAAG,GAAG,MAAM,SAAS,EAAE,CAAC;YAC1C,CAAC;YACD,OAAO,GAAG,MAAM,GAAG,GAAG,KAAK,SAAS,EAAE,CAAC;QACzC,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LokiCMS API Docs Plugin
|
|
3
|
+
*
|
|
4
|
+
* Generates API documentation from LokiCMS runtime with support for
|
|
5
|
+
* JSON, Markdown, OpenAPI 3.0, and TypeScript output formats.
|
|
6
|
+
*/
|
|
7
|
+
export { default } from './plugin.js';
|
|
8
|
+
export { getDocGenerator } from './plugin.js';
|
|
9
|
+
export type { ApiDocsConfig, ApiDocumentation, ToolDocumentation, ContentTypeDocumentation, EndpointDocumentation, ParameterDoc, JsonSchema, JsonSchemaProperty, OpenApiSpec, TypeScriptOutput, TypeScriptInterface, OutputFormat, PluginDefinition, PluginAPI, Logger, } from './types.js';
|
|
10
|
+
export { createDocGenerator, type DocGenerator } from './services/doc-generator.js';
|
|
11
|
+
export { zodToJsonSchema, extractParameters, generateExample } from './services/schema-converter.js';
|
|
12
|
+
export { generateTypeScript, generateToolTypes, generateContentTypeTypes, jsonSchemaToTypeScript, } from './services/typescript-generator.js';
|
|
13
|
+
export { formatAsJson, formatToolsAsJson, formatContentTypesAsJson, formatEndpointsAsJson, } from './formatters/json-formatter.js';
|
|
14
|
+
export { formatAsMarkdown, formatToolsAsMarkdown, formatContentTypesAsMarkdown, } from './formatters/markdown-formatter.js';
|
|
15
|
+
export { formatAsOpenApi } from './formatters/openapi-formatter.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,MAAM,GACP,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LokiCMS API Docs Plugin
|
|
3
|
+
*
|
|
4
|
+
* Generates API documentation from LokiCMS runtime with support for
|
|
5
|
+
* JSON, Markdown, OpenAPI 3.0, and TypeScript output formats.
|
|
6
|
+
*/
|
|
7
|
+
// Main plugin export
|
|
8
|
+
export { default } from './plugin.js';
|
|
9
|
+
export { getDocGenerator } from './plugin.js';
|
|
10
|
+
// Services
|
|
11
|
+
export { createDocGenerator } from './services/doc-generator.js';
|
|
12
|
+
export { zodToJsonSchema, extractParameters, generateExample } from './services/schema-converter.js';
|
|
13
|
+
export { generateTypeScript, generateToolTypes, generateContentTypeTypes, jsonSchemaToTypeScript, } from './services/typescript-generator.js';
|
|
14
|
+
// Formatters
|
|
15
|
+
export { formatAsJson, formatToolsAsJson, formatContentTypesAsJson, formatEndpointsAsJson, } from './formatters/json-formatter.js';
|
|
16
|
+
export { formatAsMarkdown, formatToolsAsMarkdown, formatContentTypesAsMarkdown, } from './formatters/markdown-formatter.js';
|
|
17
|
+
export { formatAsOpenApi } from './formatters/openapi-formatter.js';
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqB9C,WAAW;AACX,OAAO,EAAE,kBAAkB,EAAqB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,aAAa;AACb,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LokiCMS API Docs Plugin
|
|
3
|
+
*
|
|
4
|
+
* Generates API documentation from LokiCMS runtime with support for
|
|
5
|
+
* JSON, Markdown, OpenAPI 3.0, and TypeScript output formats.
|
|
6
|
+
*/
|
|
7
|
+
import type { PluginDefinition } from './types.js';
|
|
8
|
+
import { DocGenerator } from './services/doc-generator.js';
|
|
9
|
+
/**
|
|
10
|
+
* Get the documentation generator instance
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDocGenerator(): DocGenerator;
|
|
13
|
+
/**
|
|
14
|
+
* LokiCMS API Docs Plugin Definition
|
|
15
|
+
*/
|
|
16
|
+
declare const plugin: PluginDefinition;
|
|
17
|
+
export default plugin;
|
|
18
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAsB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAU/E;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAK9C;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,EAAE,gBAkBb,CAAC;AAseF,eAAe,MAAM,CAAC"}
|