@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.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
declare const optionsSchema: z.ZodObject<{
|
|
4
4
|
licenseKey: z.ZodOptional<z.ZodString>;
|
|
5
5
|
writeFilesToRoot: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
preserveExistingMessages: z.ZodOptional<z.ZodBoolean>;
|
|
6
7
|
services: z.ZodArray<z.ZodObject<{
|
|
7
8
|
id: z.ZodString;
|
|
8
9
|
version: z.ZodOptional<z.ZodString>;
|
|
@@ -279,6 +280,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
279
280
|
}[];
|
|
280
281
|
licenseKey?: string | undefined;
|
|
281
282
|
writeFilesToRoot?: boolean | undefined;
|
|
283
|
+
preserveExistingMessages?: boolean | undefined;
|
|
282
284
|
messages?: {
|
|
283
285
|
id?: {
|
|
284
286
|
lowerCase?: boolean | undefined;
|
|
@@ -344,6 +346,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
344
346
|
}[];
|
|
345
347
|
licenseKey?: string | undefined;
|
|
346
348
|
writeFilesToRoot?: boolean | undefined;
|
|
349
|
+
preserveExistingMessages?: boolean | undefined;
|
|
347
350
|
messages?: {
|
|
348
351
|
id?: {
|
|
349
352
|
lowerCase?: boolean | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
declare const optionsSchema: z.ZodObject<{
|
|
4
4
|
licenseKey: z.ZodOptional<z.ZodString>;
|
|
5
5
|
writeFilesToRoot: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
preserveExistingMessages: z.ZodOptional<z.ZodBoolean>;
|
|
6
7
|
services: z.ZodArray<z.ZodObject<{
|
|
7
8
|
id: z.ZodString;
|
|
8
9
|
version: z.ZodOptional<z.ZodString>;
|
|
@@ -279,6 +280,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
279
280
|
}[];
|
|
280
281
|
licenseKey?: string | undefined;
|
|
281
282
|
writeFilesToRoot?: boolean | undefined;
|
|
283
|
+
preserveExistingMessages?: boolean | undefined;
|
|
282
284
|
messages?: {
|
|
283
285
|
id?: {
|
|
284
286
|
lowerCase?: boolean | undefined;
|
|
@@ -344,6 +346,7 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
344
346
|
}[];
|
|
345
347
|
licenseKey?: string | undefined;
|
|
346
348
|
writeFilesToRoot?: boolean | undefined;
|
|
349
|
+
preserveExistingMessages?: boolean | undefined;
|
|
347
350
|
messages?: {
|
|
348
351
|
id?: {
|
|
349
352
|
lowerCase?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1543,7 +1543,7 @@ var import_path3 = __toESM(require("path"));
|
|
|
1543
1543
|
// package.json
|
|
1544
1544
|
var package_default = {
|
|
1545
1545
|
name: "@eventcatalog/generator-asyncapi",
|
|
1546
|
-
version: "7.0.
|
|
1546
|
+
version: "7.0.1",
|
|
1547
1547
|
description: "AsyncAPI generator for EventCatalog",
|
|
1548
1548
|
scripts: {
|
|
1549
1549
|
build: "tsup",
|
|
@@ -4161,6 +4161,7 @@ var cliArgs = (0, import_minimist.default)(process.argv.slice(2));
|
|
|
4161
4161
|
var optionsSchema = import_zod.z.object({
|
|
4162
4162
|
licenseKey: import_zod.z.string().optional(),
|
|
4163
4163
|
writeFilesToRoot: import_zod.z.boolean().optional(),
|
|
4164
|
+
preserveExistingMessages: import_zod.z.boolean().optional(),
|
|
4164
4165
|
services: import_zod.z.array(
|
|
4165
4166
|
import_zod.z.object({
|
|
4166
4167
|
id: import_zod.z.string({ required_error: "The service id is required. please provide the service id" }),
|
|
@@ -4348,7 +4349,8 @@ var index_default = async (config, options) => {
|
|
|
4348
4349
|
parseSchemas = true,
|
|
4349
4350
|
parseChannels = false,
|
|
4350
4351
|
parseExamples = true,
|
|
4351
|
-
attachHeadersToSchema = false
|
|
4352
|
+
attachHeadersToSchema = false,
|
|
4353
|
+
preserveExistingMessages = true
|
|
4352
4354
|
} = options;
|
|
4353
4355
|
console.log(import_chalk4.default.green(`Processing ${services.length} AsyncAPI files...`));
|
|
4354
4356
|
for (const service of services) {
|
|
@@ -4548,9 +4550,11 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4548
4550
|
let shouldWriteMessage = true;
|
|
4549
4551
|
let existingMessageDirectoryToRelocate = null;
|
|
4550
4552
|
if (serviceOwnsMessageContract && catalogedMessage) {
|
|
4551
|
-
messageMarkdown = catalogedMessage.markdown;
|
|
4552
4553
|
messageBadges = catalogedMessage.badges || null;
|
|
4553
4554
|
messageAttachments = catalogedMessage.attachments || null;
|
|
4555
|
+
if (preserveExistingMessages) {
|
|
4556
|
+
messageMarkdown = catalogedMessage.markdown;
|
|
4557
|
+
}
|
|
4554
4558
|
const catalogedVersion = catalogedMessage.version ?? "";
|
|
4555
4559
|
if (isSameVersion(catalogedVersion, messageVersion)) {
|
|
4556
4560
|
const catalogedMessagePath = await getResourcePath(process.env.PROJECT_DIR, messageId, catalogedVersion);
|