@eventcatalog/generator-openapi 7.6.2 → 7.6.3
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.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +7 -13
- package/dist/types.d.ts +7 -13
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -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.
|
|
4070
|
+
version: "7.6.3",
|
|
4071
4071
|
description: "OpenAPI generator for EventCatalog",
|
|
4072
4072
|
scripts: {
|
|
4073
4073
|
build: "tsup",
|
|
@@ -4177,6 +4177,9 @@ var isVersionLessThan = (version, givenVersion) => {
|
|
|
4177
4177
|
};
|
|
4178
4178
|
|
|
4179
4179
|
// src/index.ts
|
|
4180
|
+
var toUniqueArray = (array) => {
|
|
4181
|
+
return array.filter((item, index, self) => index === self.findIndex((t) => t.id === item.id && t.version === item.version));
|
|
4182
|
+
};
|
|
4180
4183
|
var index_default = async (_, options) => {
|
|
4181
4184
|
if (!process.env.PROJECT_DIR) {
|
|
4182
4185
|
process.env.PROJECT_DIR = process.cwd();
|
|
@@ -4237,8 +4240,8 @@ var index_default = async (_, options) => {
|
|
|
4237
4240
|
let serviceSpecifications = service.specifications;
|
|
4238
4241
|
let serviceBadges = null;
|
|
4239
4242
|
let serviceAttachments = null;
|
|
4240
|
-
let
|
|
4241
|
-
let
|
|
4243
|
+
let configuredWritesTo = service.writesTo || [];
|
|
4244
|
+
let configuredReadsFrom = service.readsFrom || [];
|
|
4242
4245
|
const isDomainMarkedAsDraft = options.domain?.draft || null;
|
|
4243
4246
|
const isServiceMarkedAsDraft = (
|
|
4244
4247
|
// @ts-ignore
|
|
@@ -4301,6 +4304,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4301
4304
|
let owners = service.owners || [];
|
|
4302
4305
|
let repository = null;
|
|
4303
4306
|
let styles2 = null;
|
|
4307
|
+
let serviceWritesTo = configuredWritesTo;
|
|
4308
|
+
let serviceReadsFrom = configuredReadsFrom;
|
|
4304
4309
|
const persistPreviousSpecificationFiles = Array.isArray(serviceSpec.path) === false;
|
|
4305
4310
|
if (latestServiceInCatalog) {
|
|
4306
4311
|
serviceMarkdown = latestServiceInCatalog.markdown;
|
|
@@ -4318,7 +4323,13 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4318
4323
|
...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
|
|
4319
4324
|
};
|
|
4320
4325
|
if (latestServiceInCatalog.version === version) {
|
|
4321
|
-
receives = latestServiceInCatalog.receives ?
|
|
4326
|
+
receives = latestServiceInCatalog.receives ? (
|
|
4327
|
+
// @ts-ignore
|
|
4328
|
+
toUniqueArray([...latestServiceInCatalog.receives, ...receives])
|
|
4329
|
+
) : receives;
|
|
4330
|
+
console.log("MEOW", "HELLO", latestServiceInCatalog.writesTo, serviceWritesTo);
|
|
4331
|
+
serviceWritesTo = latestServiceInCatalog.writesTo ? toUniqueArray([...latestServiceInCatalog.writesTo, ...configuredWritesTo]) : configuredWritesTo;
|
|
4332
|
+
serviceReadsFrom = latestServiceInCatalog.readsFrom ? toUniqueArray([...latestServiceInCatalog.readsFrom, ...configuredReadsFrom]) : configuredReadsFrom;
|
|
4322
4333
|
}
|
|
4323
4334
|
}
|
|
4324
4335
|
await writeService(
|