@eventcatalog/generator-asyncapi 6.1.1 → 6.2.1

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
@@ -1538,7 +1538,7 @@ import path3 from "path";
1538
1538
  // package.json
1539
1539
  var package_default = {
1540
1540
  name: "@eventcatalog/generator-asyncapi",
1541
- version: "6.1.1",
1541
+ version: "6.2.1",
1542
1542
  description: "AsyncAPI generator for EventCatalog",
1543
1543
  scripts: {
1544
1544
  build: "tsup",
@@ -1576,7 +1576,7 @@ var package_default = {
1576
1576
  dependencies: {
1577
1577
  "@asyncapi/avro-schema-parser": "3.0.24",
1578
1578
  "@asyncapi/parser": "3.6.0",
1579
- "@eventcatalog/sdk": "2.17.4",
1579
+ "@eventcatalog/sdk": "2.18.4",
1580
1580
  chalk: "4.1.2",
1581
1581
  "fs-extra": "^11.2.0",
1582
1582
  glob: "^12.0.0",
@@ -4205,6 +4205,7 @@ var index_default = async (config, options) => {
4205
4205
  addSchemaToQuery,
4206
4206
  addFileToService,
4207
4207
  versionDomain,
4208
+ getResourcePath,
4208
4209
  getSpecificationFilesForService,
4209
4210
  writeChannel,
4210
4211
  getChannel,
@@ -4280,6 +4281,8 @@ var index_default = async (config, options) => {
4280
4281
  let badges = null;
4281
4282
  let attachments = null;
4282
4283
  let diagrams = null;
4284
+ let flows = null;
4285
+ let entities = null;
4283
4286
  let serviceSpecifications = {};
4284
4287
  let serviceSpecificationsFiles = [];
4285
4288
  let configuredWritesTo = service.writesTo || [];
@@ -4293,10 +4296,6 @@ var index_default = async (config, options) => {
4293
4296
  markdown: generatedMarkdownForService
4294
4297
  }) : generatedMarkdownForService;
4295
4298
  let styles2 = null;
4296
- let servicePath = options.domain ? path3.join("../", "domains", options.domain.id, "services", service.id) : path3.join("../", "services", service.id);
4297
- if (options.writeFilesToRoot) {
4298
- servicePath = service.id;
4299
- }
4300
4299
  if (options.domain) {
4301
4300
  const { id: domainId, name: domainName, version: domainVersion, owners: domainOwners } = options.domain;
4302
4301
  const domain = await getDomain(options.domain.id, domainVersion || "latest");
@@ -4326,6 +4325,18 @@ Processing domain: ${domainName} (v${domainVersion})`));
4326
4325
  }
4327
4326
  await addServiceToDomain(domainId, { id: serviceId, version }, domainVersion);
4328
4327
  }
4328
+ let servicePath = path3.join("../", "services", service.id);
4329
+ if (options.domain) {
4330
+ const domainResource = await getResourcePath(process.env.PROJECT_DIR, options.domain.id, options.domain.version);
4331
+ if (domainResource) {
4332
+ servicePath = path3.join("../", domainResource.directory, "services", service.id);
4333
+ } else {
4334
+ servicePath = path3.join("../", "domains", options.domain.id, "services", service.id);
4335
+ }
4336
+ }
4337
+ if (options.writeFilesToRoot) {
4338
+ servicePath = service.id;
4339
+ }
4329
4340
  if (parseChannels) {
4330
4341
  for (const channel of channels) {
4331
4342
  const channelAsJSON = channel.json();
@@ -4509,6 +4520,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
4509
4520
  badges = latestServiceInCatalog.badges || null;
4510
4521
  attachments = latestServiceInCatalog.attachments || null;
4511
4522
  diagrams = latestServiceInCatalog.diagrams || null;
4523
+ flows = latestServiceInCatalog.flows || null;
4524
+ entities = latestServiceInCatalog.entities || null;
4512
4525
  serviceWritesTo = latestServiceInCatalog.writesTo ? latestServiceInCatalog.writesTo : configuredWritesTo;
4513
4526
  serviceReadsFrom = latestServiceInCatalog.readsFrom ? latestServiceInCatalog.readsFrom : configuredReadsFrom;
4514
4527
  if (latestServiceInCatalog.version !== version) {
@@ -4542,6 +4555,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
4542
4555
  ...repository && { repository },
4543
4556
  ...styles2 && { styles: styles2 },
4544
4557
  ...diagrams && { diagrams },
4558
+ ...flows && { flows },
4559
+ ...entities && { entities },
4545
4560
  ...isServiceMarkedAsDraft && { draft: true },
4546
4561
  ...attachments && { attachments },
4547
4562
  ...serviceWritesTo.length > 0 ? { writesTo: serviceWritesTo } : {},