@eventcatalog/generator-openapi 7.4.1 → 7.4.3
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 +44 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -27
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js.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.3",
|
|
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",
|
|
@@ -2897,31 +2897,34 @@ var getInstalledVersionOfPackage = (packageName) => {
|
|
|
2897
2897
|
async function checkForPackageUpdate(packageName) {
|
|
2898
2898
|
const installedVersion = getInstalledVersionOfPackage(packageName);
|
|
2899
2899
|
if (!installedVersion || installedVersion === "latest") return;
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2900
|
+
try {
|
|
2901
|
+
const pkg = { name: packageName, version: installedVersion };
|
|
2902
|
+
const updateNotifierModule = await import("update-notifier");
|
|
2903
|
+
const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
|
|
2904
|
+
const info = await notifier.fetchInfo();
|
|
2905
|
+
if (info?.type !== "latest") {
|
|
2906
|
+
const message2 = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
|
|
2906
2907
|
Run npm i ${packageName} to update`;
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2908
|
+
console.log(
|
|
2909
|
+
boxen(message2, {
|
|
2910
|
+
padding: 1,
|
|
2911
|
+
margin: 1,
|
|
2912
|
+
align: "center",
|
|
2913
|
+
borderColor: "yellow",
|
|
2914
|
+
borderStyle: {
|
|
2915
|
+
topLeft: " ",
|
|
2916
|
+
topRight: " ",
|
|
2917
|
+
bottomLeft: " ",
|
|
2918
|
+
bottomRight: " ",
|
|
2919
|
+
right: " ",
|
|
2920
|
+
top: "-",
|
|
2921
|
+
bottom: "-",
|
|
2922
|
+
left: " "
|
|
2923
|
+
}
|
|
2924
|
+
})
|
|
2925
|
+
);
|
|
2926
|
+
}
|
|
2927
|
+
} catch (error) {
|
|
2925
2928
|
}
|
|
2926
2929
|
}
|
|
2927
2930
|
|
|
@@ -2988,6 +2991,8 @@ var index_default = async (_, options) => {
|
|
|
2988
2991
|
let serviceMarkdown = service.markdown;
|
|
2989
2992
|
let serviceSpecificationsFiles = [];
|
|
2990
2993
|
let serviceSpecifications = service.specifications;
|
|
2994
|
+
let serviceBadges = null;
|
|
2995
|
+
let serviceAttachments = null;
|
|
2991
2996
|
const isDomainMarkedAsDraft = options.domain?.draft || null;
|
|
2992
2997
|
const isServiceMarkedAsDraft = (
|
|
2993
2998
|
// @ts-ignore
|
|
@@ -3051,6 +3056,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3051
3056
|
owners = latestServiceInCatalog.owners || [];
|
|
3052
3057
|
repository = latestServiceInCatalog.repository || null;
|
|
3053
3058
|
styles2 = latestServiceInCatalog.styles || null;
|
|
3059
|
+
serviceBadges = latestServiceInCatalog.badges || null;
|
|
3060
|
+
serviceAttachments = latestServiceInCatalog.attachments || null;
|
|
3054
3061
|
serviceSpecifications = {
|
|
3055
3062
|
...serviceSpecifications,
|
|
3056
3063
|
...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
|
|
@@ -3062,6 +3069,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3062
3069
|
await writeService(
|
|
3063
3070
|
{
|
|
3064
3071
|
...service,
|
|
3072
|
+
name: serviceSpec.name || service.name,
|
|
3073
|
+
summary: serviceSpec.summary || service.summary,
|
|
3074
|
+
badges: serviceBadges || service.badges,
|
|
3065
3075
|
markdown: serviceMarkdown,
|
|
3066
3076
|
specifications: serviceSpecifications,
|
|
3067
3077
|
sends,
|
|
@@ -3069,7 +3079,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3069
3079
|
...owners ? { owners } : {},
|
|
3070
3080
|
...repository ? { repository } : {},
|
|
3071
3081
|
...styles2 ? { styles: styles2 } : {},
|
|
3072
|
-
...isServiceMarkedAsDraft ? { draft: true } : {}
|
|
3082
|
+
...isServiceMarkedAsDraft ? { draft: true } : {},
|
|
3083
|
+
...serviceAttachments ? { attachments: serviceAttachments } : {}
|
|
3073
3084
|
},
|
|
3074
3085
|
{ path: (0, import_node_path.join)(servicePath), override: true }
|
|
3075
3086
|
);
|
|
@@ -3113,6 +3124,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3113
3124
|
let messageMarkdown = message2.markdown;
|
|
3114
3125
|
const messageType = operation.type;
|
|
3115
3126
|
const messageAction = operation.action;
|
|
3127
|
+
let messageBadges = null;
|
|
3128
|
+
let messageAttachments = null;
|
|
3116
3129
|
console.log(import_chalk4.default.blue(`Processing message: ${message2.name} (v${message2.version})`));
|
|
3117
3130
|
const {
|
|
3118
3131
|
addFileToMessage,
|
|
@@ -3123,6 +3136,8 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3123
3136
|
} = getMessageTypeUtils(process.env.PROJECT_DIR, messageType);
|
|
3124
3137
|
const catalogedMessage = await getMessage(message2.id, "latest");
|
|
3125
3138
|
if (catalogedMessage) {
|
|
3139
|
+
messageBadges = catalogedMessage.badges || null;
|
|
3140
|
+
messageAttachments = catalogedMessage.attachments || null;
|
|
3126
3141
|
if (preserveExistingMessages) {
|
|
3127
3142
|
messageMarkdown = catalogedMessage.markdown;
|
|
3128
3143
|
}
|
|
@@ -3138,8 +3153,10 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
3138
3153
|
await writeMessage(
|
|
3139
3154
|
{
|
|
3140
3155
|
...message2,
|
|
3156
|
+
badges: messageBadges || message2.badges,
|
|
3141
3157
|
markdown: messageMarkdown,
|
|
3142
3158
|
...options.owners ? { owners: options.owners } : {},
|
|
3159
|
+
...messageAttachments ? { attachments: messageAttachments } : {},
|
|
3143
3160
|
// only if its defined add it to the sidebar
|
|
3144
3161
|
...sidebarBadgeType === "HTTP_METHOD" ? { sidebar } : {},
|
|
3145
3162
|
...isDraft ? { draft: true } : {}
|