@eventcatalog/generator-openapi 7.2.0 → 7.2.1
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +16 -2
- package/dist/types.d.ts +16 -2
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6643,6 +6643,7 @@ var buildService = (serviceOptions, document2, generateMarkdown) => {
|
|
|
6643
6643
|
const schemaPath = path.basename(serviceOptions.path) || "openapi.yml";
|
|
6644
6644
|
const documentTags = document2.tags || [];
|
|
6645
6645
|
const serviceId = serviceOptions.id || slugify(document2.info.title, { lower: true, strict: true });
|
|
6646
|
+
const generatedMarkdownForService = defaultMarkdown2(document2, schemaPath);
|
|
6646
6647
|
return {
|
|
6647
6648
|
id: serviceId,
|
|
6648
6649
|
version: document2.info.version,
|
|
@@ -6652,7 +6653,7 @@ var buildService = (serviceOptions, document2, generateMarkdown) => {
|
|
|
6652
6653
|
specifications: {
|
|
6653
6654
|
openapiPath: schemaPath
|
|
6654
6655
|
},
|
|
6655
|
-
markdown: generateMarkdown ? generateMarkdown(
|
|
6656
|
+
markdown: generateMarkdown ? generateMarkdown({ service: serviceOptions, document: document2, markdown: generatedMarkdownForService }) : generatedMarkdownForService,
|
|
6656
6657
|
badges: documentTags.map((tag) => ({ content: tag.name, textColor: "blue", backgroundColor: "blue" })),
|
|
6657
6658
|
owners: serviceOptions.owners || [],
|
|
6658
6659
|
setMessageOwnersToServiceOwners: serviceOptions.setMessageOwnersToServiceOwners || true
|
|
@@ -6866,7 +6867,7 @@ var getSummary2 = (message) => {
|
|
|
6866
6867
|
}
|
|
6867
6868
|
return eventCatalogMessageSummary;
|
|
6868
6869
|
};
|
|
6869
|
-
var buildMessage = async (pathToFile, document2, operation) => {
|
|
6870
|
+
var buildMessage = async (pathToFile, document2, operation, generateMarkdown) => {
|
|
6870
6871
|
const requestBodiesAndResponses = await getSchemasByOperationId(pathToFile, operation.operationId);
|
|
6871
6872
|
const extensions = operation.extensions || {};
|
|
6872
6873
|
const operationTags = operation.tags.map((badge) => ({
|
|
@@ -6882,12 +6883,13 @@ var buildMessage = async (pathToFile, document2, operation) => {
|
|
|
6882
6883
|
uniqueIdentifier = uniqueIdentifier.concat(`_${path3}`);
|
|
6883
6884
|
}
|
|
6884
6885
|
const httpVerb = operation.method.toUpperCase() || "";
|
|
6886
|
+
const generatedMarkdownForMessage = defaultMarkdown3(operation, requestBodiesAndResponses);
|
|
6885
6887
|
return {
|
|
6886
6888
|
id: extensions["x-eventcatalog-message-id"] || uniqueIdentifier,
|
|
6887
6889
|
version: extensions["x-eventcatalog-message-version"] || document2.info.version,
|
|
6888
6890
|
name: extensions["x-eventcatalog-message-name"] || uniqueIdentifier,
|
|
6889
6891
|
summary: getSummary2(operation),
|
|
6890
|
-
markdown:
|
|
6892
|
+
markdown: generateMarkdown ? generateMarkdown({ operation, markdown: generatedMarkdownForMessage }) : generatedMarkdownForMessage,
|
|
6891
6893
|
schemaPath: requestBodiesAndResponses?.requestBody ? "request-body.json" : "",
|
|
6892
6894
|
badges,
|
|
6893
6895
|
requestBodiesAndResponses,
|
|
@@ -8292,7 +8294,7 @@ import { join } from "path";
|
|
|
8292
8294
|
// package.json
|
|
8293
8295
|
var package_default = {
|
|
8294
8296
|
name: "@eventcatalog/generator-openapi",
|
|
8295
|
-
version: "7.2.
|
|
8297
|
+
version: "7.2.1",
|
|
8296
8298
|
description: "OpenAPI generator for EventCatalog",
|
|
8297
8299
|
scripts: {
|
|
8298
8300
|
build: "tsup",
|
|
@@ -9274,11 +9276,12 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
9274
9276
|
console.log(chalk3.cyan(` - Versioned previous domain (v${currentDomain.version})`));
|
|
9275
9277
|
}
|
|
9276
9278
|
if (!domain || domain && domain.version !== domainVersion) {
|
|
9279
|
+
const generatedMarkdownForDomain = defaultMarkdown();
|
|
9277
9280
|
await writeDomain({
|
|
9278
9281
|
id: domainId,
|
|
9279
9282
|
name: domainName,
|
|
9280
9283
|
version: domainVersion,
|
|
9281
|
-
markdown:
|
|
9284
|
+
markdown: options.domain?.generateMarkdown ? options.domain.generateMarkdown({ domain: options.domain, markdown: generatedMarkdownForDomain }) : generatedMarkdownForDomain,
|
|
9282
9285
|
...options.domain?.owners ? { owners: options.domain.owners } : {}
|
|
9283
9286
|
});
|
|
9284
9287
|
console.log(chalk3.cyan(` - Domain (v${domainVersion}) created`));
|
|
@@ -9364,7 +9367,12 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document2, servicePath, o
|
|
|
9364
9367
|
const preserveExistingMessages = options.preserveExistingMessages ?? true;
|
|
9365
9368
|
let receives = [], sends = [];
|
|
9366
9369
|
for (const operation of operations) {
|
|
9367
|
-
const { requestBodiesAndResponses, sidebar, ...message } = await buildMessage(
|
|
9370
|
+
const { requestBodiesAndResponses, sidebar, ...message } = await buildMessage(
|
|
9371
|
+
pathToSpec,
|
|
9372
|
+
document2,
|
|
9373
|
+
operation,
|
|
9374
|
+
options.messages?.generateMarkdown
|
|
9375
|
+
);
|
|
9368
9376
|
let messageMarkdown = message.markdown;
|
|
9369
9377
|
const messageType = operation.type;
|
|
9370
9378
|
const messageAction = operation.action;
|