@eventcatalog/generator-openapi 7.6.3 → 7.6.5

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
@@ -1163,7 +1163,7 @@ var require_dist = __commonJS({
1163
1163
  var http2 = __importStar(__require("http"));
1164
1164
  var https_1 = __require("https");
1165
1165
  __exportStar(require_helpers(), exports);
1166
- var INTERNAL = Symbol("AgentBaseInternalState");
1166
+ var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState");
1167
1167
  var Agent = class extends http2.Agent {
1168
1168
  constructor(opts) {
1169
1169
  super(opts);
@@ -4067,7 +4067,7 @@ import { join } from "path";
4067
4067
  // package.json
4068
4068
  var package_default = {
4069
4069
  name: "@eventcatalog/generator-openapi",
4070
- version: "7.6.3",
4070
+ version: "7.6.5",
4071
4071
  description: "OpenAPI generator for EventCatalog",
4072
4072
  scripts: {
4073
4073
  build: "tsup",
@@ -4104,7 +4104,7 @@ var package_default = {
4104
4104
  dependencies: {
4105
4105
  "@apidevtools/swagger-parser": "^10.1.0",
4106
4106
  "@changesets/cli": "^2.27.7",
4107
- "@eventcatalog/sdk": "^2.9.2",
4107
+ "@eventcatalog/sdk": "^2.9.6",
4108
4108
  chalk: "4.1.2",
4109
4109
  "js-yaml": "^4.1.0",
4110
4110
  "openapi-types": "^12.1.3",
@@ -4180,6 +4180,13 @@ var isVersionLessThan = (version, givenVersion) => {
4180
4180
  var toUniqueArray = (array) => {
4181
4181
  return array.filter((item, index, self) => index === self.findIndex((t) => t.id === item.id && t.version === item.version));
4182
4182
  };
4183
+ var mergeOpenApiIntoSpecifications = (existingSpecs, openapiFileName) => {
4184
+ if (Array.isArray(existingSpecs)) {
4185
+ return [...existingSpecs.filter((spec) => spec.type !== "openapi"), { type: "openapi", path: openapiFileName }];
4186
+ }
4187
+ const { openapiPath: _, ...rest } = existingSpecs || {};
4188
+ return { openapiPath: openapiFileName, ...rest };
4189
+ };
4183
4190
  var index_default = async (_, options) => {
4184
4191
  if (!process.env.PROJECT_DIR) {
4185
4192
  process.env.PROJECT_DIR = process.cwd();
@@ -4318,10 +4325,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
4318
4325
  serviceAttachments = latestServiceInCatalog.attachments || null;
4319
4326
  serviceWritesTo = latestServiceInCatalog.writesTo || [];
4320
4327
  serviceReadsFrom = latestServiceInCatalog.readsFrom || [];
4321
- serviceSpecifications = {
4322
- ...serviceSpecifications,
4323
- ...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
4324
- };
4328
+ if (persistPreviousSpecificationFiles && latestServiceInCatalog.specifications) {
4329
+ serviceSpecifications = mergeOpenApiIntoSpecifications(latestServiceInCatalog.specifications, service.schemaPath);
4330
+ }
4325
4331
  if (latestServiceInCatalog.version === version) {
4326
4332
  receives = latestServiceInCatalog.receives ? (
4327
4333
  // @ts-ignore