@eventcatalog/generator-openapi 7.4.1 → 7.4.2
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.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2822,7 +2822,7 @@ import { join } from "path";
|
|
|
2822
2822
|
// package.json
|
|
2823
2823
|
var package_default = {
|
|
2824
2824
|
name: "@eventcatalog/generator-openapi",
|
|
2825
|
-
version: "7.4.
|
|
2825
|
+
version: "7.4.2",
|
|
2826
2826
|
description: "OpenAPI generator for EventCatalog",
|
|
2827
2827
|
scripts: {
|
|
2828
2828
|
build: "tsup",
|
|
@@ -2859,7 +2859,7 @@ var package_default = {
|
|
|
2859
2859
|
dependencies: {
|
|
2860
2860
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
2861
2861
|
"@changesets/cli": "^2.27.7",
|
|
2862
|
-
"@eventcatalog/sdk": "^2.
|
|
2862
|
+
"@eventcatalog/sdk": "^2.7.5",
|
|
2863
2863
|
chalk: "^4",
|
|
2864
2864
|
"js-yaml": "^4.1.0",
|
|
2865
2865
|
"openapi-types": "^12.1.3",
|
|
@@ -2977,6 +2977,8 @@ var index_default = async (_, options) => {
|
|
|
2977
2977
|
let serviceMarkdown = service.markdown;
|
|
2978
2978
|
let serviceSpecificationsFiles = [];
|
|
2979
2979
|
let serviceSpecifications = service.specifications;
|
|
2980
|
+
let serviceBadges = null;
|
|
2981
|
+
let serviceAttachments = null;
|
|
2980
2982
|
const isDomainMarkedAsDraft = options.domain?.draft || null;
|
|
2981
2983
|
const isServiceMarkedAsDraft = (
|
|
2982
2984
|
// @ts-ignore
|
|
@@ -3040,6 +3042,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3040
3042
|
owners = latestServiceInCatalog.owners || [];
|
|
3041
3043
|
repository = latestServiceInCatalog.repository || null;
|
|
3042
3044
|
styles2 = latestServiceInCatalog.styles || null;
|
|
3045
|
+
serviceBadges = latestServiceInCatalog.badges || null;
|
|
3046
|
+
serviceAttachments = latestServiceInCatalog.attachments || null;
|
|
3043
3047
|
serviceSpecifications = {
|
|
3044
3048
|
...serviceSpecifications,
|
|
3045
3049
|
...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
|
|
@@ -3051,6 +3055,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3051
3055
|
await writeService(
|
|
3052
3056
|
{
|
|
3053
3057
|
...service,
|
|
3058
|
+
badges: serviceBadges || service.badges,
|
|
3054
3059
|
markdown: serviceMarkdown,
|
|
3055
3060
|
specifications: serviceSpecifications,
|
|
3056
3061
|
sends,
|
|
@@ -3058,7 +3063,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3058
3063
|
...owners ? { owners } : {},
|
|
3059
3064
|
...repository ? { repository } : {},
|
|
3060
3065
|
...styles2 ? { styles: styles2 } : {},
|
|
3061
|
-
...isServiceMarkedAsDraft ? { draft: true } : {}
|
|
3066
|
+
...isServiceMarkedAsDraft ? { draft: true } : {},
|
|
3067
|
+
...serviceAttachments ? { attachments: serviceAttachments } : {}
|
|
3062
3068
|
},
|
|
3063
3069
|
{ path: join(servicePath), override: true }
|
|
3064
3070
|
);
|
|
@@ -3102,6 +3108,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3102
3108
|
let messageMarkdown = message2.markdown;
|
|
3103
3109
|
const messageType = operation.type;
|
|
3104
3110
|
const messageAction = operation.action;
|
|
3111
|
+
let messageBadges = null;
|
|
3112
|
+
let messageAttachments = null;
|
|
3105
3113
|
console.log(chalk4.blue(`Processing message: ${message2.name} (v${message2.version})`));
|
|
3106
3114
|
const {
|
|
3107
3115
|
addFileToMessage,
|
|
@@ -3112,6 +3120,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3112
3120
|
} = getMessageTypeUtils(process.env.PROJECT_DIR, messageType);
|
|
3113
3121
|
const catalogedMessage = await getMessage(message2.id, "latest");
|
|
3114
3122
|
if (catalogedMessage) {
|
|
3123
|
+
messageBadges = catalogedMessage.badges || null;
|
|
3124
|
+
messageAttachments = catalogedMessage.attachments || null;
|
|
3115
3125
|
if (preserveExistingMessages) {
|
|
3116
3126
|
messageMarkdown = catalogedMessage.markdown;
|
|
3117
3127
|
}
|
|
@@ -3127,8 +3137,10 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3127
3137
|
await writeMessage(
|
|
3128
3138
|
{
|
|
3129
3139
|
...message2,
|
|
3140
|
+
badges: messageBadges || message2.badges,
|
|
3130
3141
|
markdown: messageMarkdown,
|
|
3131
3142
|
...options.owners ? { owners: options.owners } : {},
|
|
3143
|
+
...messageAttachments ? { attachments: messageAttachments } : {},
|
|
3132
3144
|
// only if its defined add it to the sidebar
|
|
3133
3145
|
...sidebarBadgeType === "HTTP_METHOD" ? { sidebar } : {},
|
|
3134
3146
|
...isDraft ? { draft: true } : {}
|