@eventcatalog/generator-asyncapi 7.0.0 → 7.0.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: "7.0.0",
1541
+ version: "7.0.1",
1542
1542
  description: "AsyncAPI generator for EventCatalog",
1543
1543
  scripts: {
1544
1544
  build: "tsup",
@@ -4156,6 +4156,7 @@ var cliArgs = argv(process.argv.slice(2));
4156
4156
  var optionsSchema = z.object({
4157
4157
  licenseKey: z.string().optional(),
4158
4158
  writeFilesToRoot: z.boolean().optional(),
4159
+ preserveExistingMessages: z.boolean().optional(),
4159
4160
  services: z.array(
4160
4161
  z.object({
4161
4162
  id: z.string({ required_error: "The service id is required. please provide the service id" }),
@@ -4343,7 +4344,8 @@ var index_default = async (config, options) => {
4343
4344
  parseSchemas = true,
4344
4345
  parseChannels = false,
4345
4346
  parseExamples = true,
4346
- attachHeadersToSchema = false
4347
+ attachHeadersToSchema = false,
4348
+ preserveExistingMessages = true
4347
4349
  } = options;
4348
4350
  console.log(chalk4.green(`Processing ${services.length} AsyncAPI files...`));
4349
4351
  for (const service of services) {
@@ -4543,9 +4545,11 @@ Processing domain: ${domainName} (v${domainVersion})`));
4543
4545
  let shouldWriteMessage = true;
4544
4546
  let existingMessageDirectoryToRelocate = null;
4545
4547
  if (serviceOwnsMessageContract && catalogedMessage) {
4546
- messageMarkdown = catalogedMessage.markdown;
4547
4548
  messageBadges = catalogedMessage.badges || null;
4548
4549
  messageAttachments = catalogedMessage.attachments || null;
4550
+ if (preserveExistingMessages) {
4551
+ messageMarkdown = catalogedMessage.markdown;
4552
+ }
4549
4553
  const catalogedVersion = catalogedMessage.version ?? "";
4550
4554
  if (isSameVersion(catalogedVersion, messageVersion)) {
4551
4555
  const catalogedMessagePath = await getResourcePath(process.env.PROJECT_DIR, messageId, catalogedVersion);