@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.js
CHANGED
|
@@ -2833,7 +2833,7 @@ var import_node_path = require("path");
|
|
|
2833
2833
|
// package.json
|
|
2834
2834
|
var package_default = {
|
|
2835
2835
|
name: "@eventcatalog/generator-openapi",
|
|
2836
|
-
version: "7.4.
|
|
2836
|
+
version: "7.4.2",
|
|
2837
2837
|
description: "OpenAPI generator for EventCatalog",
|
|
2838
2838
|
scripts: {
|
|
2839
2839
|
build: "tsup",
|
|
@@ -2870,7 +2870,7 @@ var package_default = {
|
|
|
2870
2870
|
dependencies: {
|
|
2871
2871
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
2872
2872
|
"@changesets/cli": "^2.27.7",
|
|
2873
|
-
"@eventcatalog/sdk": "^2.
|
|
2873
|
+
"@eventcatalog/sdk": "^2.7.5",
|
|
2874
2874
|
chalk: "^4",
|
|
2875
2875
|
"js-yaml": "^4.1.0",
|
|
2876
2876
|
"openapi-types": "^12.1.3",
|
|
@@ -2988,6 +2988,8 @@ var index_default = async (_, options) => {
|
|
|
2988
2988
|
let serviceMarkdown = service.markdown;
|
|
2989
2989
|
let serviceSpecificationsFiles = [];
|
|
2990
2990
|
let serviceSpecifications = service.specifications;
|
|
2991
|
+
let serviceBadges = null;
|
|
2992
|
+
let serviceAttachments = null;
|
|
2991
2993
|
const isDomainMarkedAsDraft = options.domain?.draft || null;
|
|
2992
2994
|
const isServiceMarkedAsDraft = (
|
|
2993
2995
|
// @ts-ignore
|
|
@@ -3051,6 +3053,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3051
3053
|
owners = latestServiceInCatalog.owners || [];
|
|
3052
3054
|
repository = latestServiceInCatalog.repository || null;
|
|
3053
3055
|
styles2 = latestServiceInCatalog.styles || null;
|
|
3056
|
+
serviceBadges = latestServiceInCatalog.badges || null;
|
|
3057
|
+
serviceAttachments = latestServiceInCatalog.attachments || null;
|
|
3054
3058
|
serviceSpecifications = {
|
|
3055
3059
|
...serviceSpecifications,
|
|
3056
3060
|
...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
|
|
@@ -3062,6 +3066,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3062
3066
|
await writeService(
|
|
3063
3067
|
{
|
|
3064
3068
|
...service,
|
|
3069
|
+
badges: serviceBadges || service.badges,
|
|
3065
3070
|
markdown: serviceMarkdown,
|
|
3066
3071
|
specifications: serviceSpecifications,
|
|
3067
3072
|
sends,
|
|
@@ -3069,7 +3074,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3069
3074
|
...owners ? { owners } : {},
|
|
3070
3075
|
...repository ? { repository } : {},
|
|
3071
3076
|
...styles2 ? { styles: styles2 } : {},
|
|
3072
|
-
...isServiceMarkedAsDraft ? { draft: true } : {}
|
|
3077
|
+
...isServiceMarkedAsDraft ? { draft: true } : {},
|
|
3078
|
+
...serviceAttachments ? { attachments: serviceAttachments } : {}
|
|
3073
3079
|
},
|
|
3074
3080
|
{ path: (0, import_node_path.join)(servicePath), override: true }
|
|
3075
3081
|
);
|
|
@@ -3113,6 +3119,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3113
3119
|
let messageMarkdown = message2.markdown;
|
|
3114
3120
|
const messageType = operation.type;
|
|
3115
3121
|
const messageAction = operation.action;
|
|
3122
|
+
let messageBadges = null;
|
|
3123
|
+
let messageAttachments = null;
|
|
3116
3124
|
console.log(import_chalk4.default.blue(`Processing message: ${message2.name} (v${message2.version})`));
|
|
3117
3125
|
const {
|
|
3118
3126
|
addFileToMessage,
|
|
@@ -3123,6 +3131,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3123
3131
|
} = getMessageTypeUtils(process.env.PROJECT_DIR, messageType);
|
|
3124
3132
|
const catalogedMessage = await getMessage(message2.id, "latest");
|
|
3125
3133
|
if (catalogedMessage) {
|
|
3134
|
+
messageBadges = catalogedMessage.badges || null;
|
|
3135
|
+
messageAttachments = catalogedMessage.attachments || null;
|
|
3126
3136
|
if (preserveExistingMessages) {
|
|
3127
3137
|
messageMarkdown = catalogedMessage.markdown;
|
|
3128
3138
|
}
|
|
@@ -3138,8 +3148,10 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3138
3148
|
await writeMessage(
|
|
3139
3149
|
{
|
|
3140
3150
|
...message2,
|
|
3151
|
+
badges: messageBadges || message2.badges,
|
|
3141
3152
|
markdown: messageMarkdown,
|
|
3142
3153
|
...options.owners ? { owners: options.owners } : {},
|
|
3154
|
+
...messageAttachments ? { attachments: messageAttachments } : {},
|
|
3143
3155
|
// only if its defined add it to the sidebar
|
|
3144
3156
|
...sidebarBadgeType === "HTTP_METHOD" ? { sidebar } : {},
|
|
3145
3157
|
...isDraft ? { draft: true } : {}
|