@eventcatalog/generator-asyncapi 4.0.0 → 4.0.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.mjs CHANGED
@@ -290,7 +290,7 @@ import path2 from "path";
290
290
  // package.json
291
291
  var package_default = {
292
292
  name: "@eventcatalog/generator-asyncapi",
293
- version: "4.0.0",
293
+ version: "4.0.2",
294
294
  description: "AsyncAPI generator for EventCatalog",
295
295
  scripts: {
296
296
  build: "tsup",
@@ -328,7 +328,7 @@ var package_default = {
328
328
  dependencies: {
329
329
  "@asyncapi/avro-schema-parser": "^3.0.24",
330
330
  "@asyncapi/parser": "^3.3.0",
331
- "@eventcatalog/sdk": "^2.0.0",
331
+ "@eventcatalog/sdk": "^2.2.4",
332
332
  chalk: "^4",
333
333
  "fs-extra": "^11.2.0",
334
334
  glob: "^11.0.0",
@@ -1504,6 +1504,7 @@ var index_default = async (config, options) => {
1504
1504
  let serviceSpecifications = {};
1505
1505
  let serviceSpecificationsFiles = [];
1506
1506
  let serviceMarkdown = defaultMarkdown2(document);
1507
+ let styles2 = null;
1507
1508
  let servicePath = options.domain ? path2.join("../", "domains", options.domain.id, "services", service.id) : path2.join("../", "services", service.id);
1508
1509
  if (options.writeFilesToRoot) {
1509
1510
  servicePath = service.id;
@@ -1633,7 +1634,10 @@ Processing domain: ${domainName} (v${domainVersion})`));
1633
1634
  );
1634
1635
  console.log(chalk3.cyan(` - Message (v${messageVersion}) created`));
1635
1636
  if (messageHasSchema(message)) {
1636
- const schema = message.payload()?.extensions()?.get("x-parser-original-payload")?.json() || message.payload()?.json();
1637
+ let schema = message.payload()?.extensions()?.get("x-parser-original-payload")?.json() || message.payload()?.json();
1638
+ if (schema?.schema) {
1639
+ schema = schema.schema;
1640
+ }
1637
1641
  await addSchemaToMessage(
1638
1642
  messageId,
1639
1643
  {
@@ -1657,6 +1661,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
1657
1661
  serviceMarkdown = latestServiceInCatalog.markdown;
1658
1662
  owners = latestServiceInCatalog.owners || owners;
1659
1663
  repository = latestServiceInCatalog.repository || null;
1664
+ styles2 = latestServiceInCatalog.styles || null;
1660
1665
  if (latestServiceInCatalog.version !== version) {
1661
1666
  await versionService(serviceId);
1662
1667
  console.log(chalk3.cyan(` - Versioned previous service (v${latestServiceInCatalog.version})`));
@@ -1686,7 +1691,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
1686
1691
  asyncapiPath: fileName || "asyncapi.yml"
1687
1692
  },
1688
1693
  ...owners && { owners },
1689
- ...repository && { repository }
1694
+ ...repository && { repository },
1695
+ ...styles2 && { styles: styles2 }
1690
1696
  },
1691
1697
  {
1692
1698
  path: servicePath,