@eventcatalog/generator-openapi 7.11.0 → 7.11.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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2024-2026 EventCatalog Ltd
2
+
3
+ This software is dual-licensed:
4
+
5
+ * For open-source projects: licensed under the GNU Affero General Public
6
+ License v3.0 (AGPL-3.0). See LICENSE-OPENSOURCE.md for the full terms.
7
+
8
+ * For proprietary, internal, or commercial use: licensed under the EventCatalog
9
+ Commercial License. See LICENSE-COMMERCIAL.md for the full terms.
10
+
11
+ If you are using these plugins for internal business purposes and do not wish
12
+ to release your source code under AGPL-3.0, you must obtain a Commercial
13
+ License.
14
+
15
+ To obtain a Commercial License:
16
+ - Purchase a subscription at https://www.eventcatalog.dev/pricing
17
+ - Purchase individual plugins at https://eventcatalog.cloud/
18
+ - Free 14-day trial at https://eventcatalog.cloud/
19
+ - Contact us at hello@eventcatalog.dev
package/dist/index.js CHANGED
@@ -4213,7 +4213,7 @@ var import_node_path = require("path");
4213
4213
  // package.json
4214
4214
  var package_default = {
4215
4215
  name: "@eventcatalog/generator-openapi",
4216
- version: "7.11.0",
4216
+ version: "7.11.2",
4217
4217
  description: "OpenAPI generator for EventCatalog",
4218
4218
  scripts: {
4219
4219
  build: "tsup",
@@ -4250,7 +4250,7 @@ var package_default = {
4250
4250
  dependencies: {
4251
4251
  "@apidevtools/swagger-parser": "^10.1.0",
4252
4252
  "@changesets/cli": "^2.27.7",
4253
- "@eventcatalog/sdk": "^2.18.2",
4253
+ "@eventcatalog/sdk": "^2.18.4",
4254
4254
  chalk: "4.1.2",
4255
4255
  "js-yaml": "^4.1.0",
4256
4256
  "openapi-types": "^12.1.3",
@@ -4431,7 +4431,7 @@ var filterMessagesByRoutes = (allMessages, routes) => {
4431
4431
  }
4432
4432
  return Array.from(matched.values());
4433
4433
  };
4434
- var mergeReceives = (existing, incoming) => {
4434
+ var mergeSends = (existing, incoming) => {
4435
4435
  const merged = /* @__PURE__ */ new Map();
4436
4436
  for (const entry of existing) {
4437
4437
  merged.set(entry.id, { ...entry });
@@ -4613,6 +4613,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
4613
4613
  let repository = null;
4614
4614
  let styles2 = null;
4615
4615
  let serviceDiagrams = null;
4616
+ let serviceFlows = null;
4617
+ let serviceEntities = null;
4616
4618
  let serviceWritesTo = configuredWritesTo;
4617
4619
  let serviceReadsFrom = configuredReadsFrom;
4618
4620
  const persistPreviousSpecificationFiles = Array.isArray(serviceSpec.path) === false;
@@ -4626,6 +4628,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
4626
4628
  serviceBadges = latestServiceInCatalog.badges || null;
4627
4629
  serviceAttachments = latestServiceInCatalog.attachments || null;
4628
4630
  serviceDiagrams = latestServiceInCatalog.diagrams || null;
4631
+ serviceFlows = latestServiceInCatalog.flows || null;
4632
+ serviceEntities = latestServiceInCatalog.entities || null;
4629
4633
  serviceWritesTo = latestServiceInCatalog.writesTo || [];
4630
4634
  serviceReadsFrom = latestServiceInCatalog.readsFrom || [];
4631
4635
  if (persistPreviousSpecificationFiles) {
@@ -4656,6 +4660,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
4656
4660
  ...repository ? { repository } : {},
4657
4661
  ...styles2 ? { styles: styles2 } : {},
4658
4662
  ...serviceDiagrams ? { diagrams: serviceDiagrams } : {},
4663
+ ...serviceFlows ? { flows: serviceFlows } : {},
4664
+ ...serviceEntities ? { entities: serviceEntities } : {},
4659
4665
  ...isServiceMarkedAsDraft ? { draft: true } : {},
4660
4666
  ...serviceAttachments ? { attachments: serviceAttachments } : {},
4661
4667
  ...serviceWritesTo.length > 0 ? { writesTo: serviceWritesTo } : {},
@@ -4685,16 +4691,16 @@ Processing domain: ${domainName} (v${domainVersion})`));
4685
4691
  const consumers = serviceSpec.consumers || [];
4686
4692
  for (const consumer of consumers) {
4687
4693
  const consumerVersion = consumer.version || "1.0.0";
4688
- const filteredReceives = filterMessagesByRoutes(allGeneratedMessages, consumer.routes);
4694
+ const filteredSends = filterMessagesByRoutes(allGeneratedMessages, consumer.routes);
4689
4695
  const existingConsumer = await getService(consumer.id, consumerVersion);
4690
4696
  if (existingConsumer) {
4691
- const mergedReceives = mergeReceives(existingConsumer.receives || [], filteredReceives);
4697
+ const mergedSends = mergeSends(existingConsumer.sends || [], filteredSends);
4692
4698
  const consumerResource = await getResourcePath(process.env.PROJECT_DIR, consumer.id, consumerVersion);
4693
4699
  const consumerWritePath = consumerResource ? (0, import_node_path.join)("../", consumerResource.directory) : consumer.id;
4694
4700
  await writeService(
4695
4701
  {
4696
4702
  ...existingConsumer,
4697
- ...mergedReceives.length > 0 ? { receives: mergedReceives } : {}
4703
+ ...mergedSends.length > 0 ? { sends: mergedSends } : {}
4698
4704
  },
4699
4705
  { path: consumerWritePath, override: true }
4700
4706
  );
@@ -4707,9 +4713,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
4707
4713
  options.domain.version
4708
4714
  );
4709
4715
  if (domainResource) {
4710
- consumerPath = (0, import_node_path.join)(domainResource.directory, "services", consumer.id);
4716
+ consumerPath = (0, import_node_path.join)("../", domainResource.directory, "services", consumer.id);
4711
4717
  } else {
4712
- consumerPath = (0, import_node_path.join)("domains", options.domain.id, "services", consumer.id);
4718
+ consumerPath = (0, import_node_path.join)("../", "domains", options.domain.id, "services", consumer.id);
4713
4719
  }
4714
4720
  }
4715
4721
  await writeService(
@@ -4718,7 +4724,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
4718
4724
  version: consumerVersion,
4719
4725
  name: consumer.id,
4720
4726
  markdown: "<NodeGraph />",
4721
- ...filteredReceives.length > 0 ? { receives: filteredReceives } : {}
4727
+ ...filteredSends.length > 0 ? { sends: filteredSends } : {}
4722
4728
  },
4723
4729
  { path: consumerPath, override: true }
4724
4730
  );