@eventcatalog/generator-asyncapi 4.5.2 → 4.5.4
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 +57 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +36 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -292,7 +292,7 @@ import path3 from "path";
|
|
|
292
292
|
// package.json
|
|
293
293
|
var package_default = {
|
|
294
294
|
name: "@eventcatalog/generator-asyncapi",
|
|
295
|
-
version: "4.5.
|
|
295
|
+
version: "4.5.4",
|
|
296
296
|
description: "AsyncAPI generator for EventCatalog",
|
|
297
297
|
scripts: {
|
|
298
298
|
build: "tsup",
|
|
@@ -330,7 +330,7 @@ var package_default = {
|
|
|
330
330
|
dependencies: {
|
|
331
331
|
"@asyncapi/avro-schema-parser": "^3.0.24",
|
|
332
332
|
"@asyncapi/parser": "^3.4.0",
|
|
333
|
-
"@eventcatalog/sdk": "^2.
|
|
333
|
+
"@eventcatalog/sdk": "^2.8.3",
|
|
334
334
|
chalk: "^4",
|
|
335
335
|
"fs-extra": "^11.2.0",
|
|
336
336
|
glob: "^11.0.0",
|
|
@@ -1172,31 +1172,34 @@ var getInstalledVersionOfPackage = (packageName) => {
|
|
|
1172
1172
|
async function checkForPackageUpdate(packageName) {
|
|
1173
1173
|
const installedVersion = getInstalledVersionOfPackage(packageName);
|
|
1174
1174
|
if (!installedVersion || installedVersion === "latest") return;
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1175
|
+
try {
|
|
1176
|
+
const pkg = { name: packageName, version: installedVersion };
|
|
1177
|
+
const updateNotifierModule = await import("update-notifier");
|
|
1178
|
+
const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
|
|
1179
|
+
const info = await notifier.fetchInfo();
|
|
1180
|
+
if (info?.type !== "latest") {
|
|
1181
|
+
const message2 = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
|
|
1181
1182
|
Run npm i ${packageName} to update`;
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1183
|
+
console.log(
|
|
1184
|
+
boxen(message2, {
|
|
1185
|
+
padding: 1,
|
|
1186
|
+
margin: 1,
|
|
1187
|
+
align: "center",
|
|
1188
|
+
borderColor: "yellow",
|
|
1189
|
+
borderStyle: {
|
|
1190
|
+
topLeft: " ",
|
|
1191
|
+
topRight: " ",
|
|
1192
|
+
bottomLeft: " ",
|
|
1193
|
+
bottomRight: " ",
|
|
1194
|
+
right: " ",
|
|
1195
|
+
top: "-",
|
|
1196
|
+
bottom: "-",
|
|
1197
|
+
left: " "
|
|
1198
|
+
}
|
|
1199
|
+
})
|
|
1200
|
+
);
|
|
1201
|
+
}
|
|
1202
|
+
} catch (error) {
|
|
1200
1203
|
}
|
|
1201
1204
|
}
|
|
1202
1205
|
|
|
@@ -2716,6 +2719,9 @@ var optionsSchema = z.object({
|
|
|
2716
2719
|
path: z.string({ required_error: "The service path is required. please provide the path to specification file" }),
|
|
2717
2720
|
draft: z.boolean().optional(),
|
|
2718
2721
|
name: z.string().optional(),
|
|
2722
|
+
summary: z.string().optional(),
|
|
2723
|
+
writesTo: z.array(z.object({ id: z.string(), version: z.string().optional() })).optional(),
|
|
2724
|
+
readsFrom: z.array(z.object({ id: z.string(), version: z.string().optional() })).optional(),
|
|
2719
2725
|
owners: z.array(z.string()).optional(),
|
|
2720
2726
|
generateMarkdown: z.function().args(
|
|
2721
2727
|
z.object({
|
|
@@ -3081,7 +3087,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3081
3087
|
id: serviceId,
|
|
3082
3088
|
name: serviceName,
|
|
3083
3089
|
version,
|
|
3084
|
-
summary: getSummary2(document),
|
|
3090
|
+
summary: service.summary || getSummary2(document),
|
|
3085
3091
|
badges: badges || documentTags.map((tag2) => ({ content: tag2.name(), textColor: "blue", backgroundColor: "blue" })),
|
|
3086
3092
|
markdown: serviceMarkdown,
|
|
3087
3093
|
sends,
|
|
@@ -3095,7 +3101,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
3095
3101
|
...repository && { repository },
|
|
3096
3102
|
...styles2 && { styles: styles2 },
|
|
3097
3103
|
...isServiceMarkedAsDraft && { draft: true },
|
|
3098
|
-
...attachments && { attachments }
|
|
3104
|
+
...attachments && { attachments },
|
|
3105
|
+
...service.writesTo && { writesTo: service.writesTo },
|
|
3106
|
+
...service.readsFrom && { readsFrom: service.readsFrom }
|
|
3099
3107
|
},
|
|
3100
3108
|
{
|
|
3101
3109
|
path: servicePath,
|