@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.js
CHANGED
|
@@ -4072,7 +4072,7 @@ var import_node_path = require("path");
|
|
|
4072
4072
|
// package.json
|
|
4073
4073
|
var package_default = {
|
|
4074
4074
|
name: "@eventcatalog/generator-openapi",
|
|
4075
|
-
version: "7.6.
|
|
4075
|
+
version: "7.6.3",
|
|
4076
4076
|
description: "OpenAPI generator for EventCatalog",
|
|
4077
4077
|
scripts: {
|
|
4078
4078
|
build: "tsup",
|
|
@@ -4182,6 +4182,9 @@ var isVersionLessThan = (version, givenVersion) => {
|
|
|
4182
4182
|
};
|
|
4183
4183
|
|
|
4184
4184
|
// src/index.ts
|
|
4185
|
+
var toUniqueArray = (array) => {
|
|
4186
|
+
return array.filter((item, index, self) => index === self.findIndex((t) => t.id === item.id && t.version === item.version));
|
|
4187
|
+
};
|
|
4185
4188
|
var index_default = async (_, options) => {
|
|
4186
4189
|
if (!process.env.PROJECT_DIR) {
|
|
4187
4190
|
process.env.PROJECT_DIR = process.cwd();
|
|
@@ -4242,8 +4245,8 @@ var index_default = async (_, options) => {
|
|
|
4242
4245
|
let serviceSpecifications = service.specifications;
|
|
4243
4246
|
let serviceBadges = null;
|
|
4244
4247
|
let serviceAttachments = null;
|
|
4245
|
-
let
|
|
4246
|
-
let
|
|
4248
|
+
let configuredWritesTo = service.writesTo || [];
|
|
4249
|
+
let configuredReadsFrom = service.readsFrom || [];
|
|
4247
4250
|
const isDomainMarkedAsDraft = options.domain?.draft || null;
|
|
4248
4251
|
const isServiceMarkedAsDraft = (
|
|
4249
4252
|
// @ts-ignore
|
|
@@ -4306,6 +4309,8 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4306
4309
|
let owners = service.owners || [];
|
|
4307
4310
|
let repository = null;
|
|
4308
4311
|
let styles2 = null;
|
|
4312
|
+
let serviceWritesTo = configuredWritesTo;
|
|
4313
|
+
let serviceReadsFrom = configuredReadsFrom;
|
|
4309
4314
|
const persistPreviousSpecificationFiles = Array.isArray(serviceSpec.path) === false;
|
|
4310
4315
|
if (latestServiceInCatalog) {
|
|
4311
4316
|
serviceMarkdown = latestServiceInCatalog.markdown;
|
|
@@ -4323,7 +4328,13 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4323
4328
|
...persistPreviousSpecificationFiles ? latestServiceInCatalog.specifications : {}
|
|
4324
4329
|
};
|
|
4325
4330
|
if (latestServiceInCatalog.version === version) {
|
|
4326
|
-
receives = latestServiceInCatalog.receives ?
|
|
4331
|
+
receives = latestServiceInCatalog.receives ? (
|
|
4332
|
+
// @ts-ignore
|
|
4333
|
+
toUniqueArray([...latestServiceInCatalog.receives, ...receives])
|
|
4334
|
+
) : receives;
|
|
4335
|
+
console.log("MEOW", "HELLO", latestServiceInCatalog.writesTo, serviceWritesTo);
|
|
4336
|
+
serviceWritesTo = latestServiceInCatalog.writesTo ? toUniqueArray([...latestServiceInCatalog.writesTo, ...configuredWritesTo]) : configuredWritesTo;
|
|
4337
|
+
serviceReadsFrom = latestServiceInCatalog.readsFrom ? toUniqueArray([...latestServiceInCatalog.readsFrom, ...configuredReadsFrom]) : configuredReadsFrom;
|
|
4327
4338
|
}
|
|
4328
4339
|
}
|
|
4329
4340
|
await writeService(
|