@eventcatalog/generator-asyncapi 4.5.2 → 4.5.4

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 CHANGED
@@ -8,6 +8,27 @@ declare const optionsSchema: z.ZodObject<{
8
8
  path: z.ZodString;
9
9
  draft: z.ZodOptional<z.ZodBoolean>;
10
10
  name: z.ZodOptional<z.ZodString>;
11
+ summary: z.ZodOptional<z.ZodString>;
12
+ writesTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
13
+ id: z.ZodString;
14
+ version: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ id: string;
17
+ version?: string | undefined;
18
+ }, {
19
+ id: string;
20
+ version?: string | undefined;
21
+ }>, "many">>;
22
+ readsFrom: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ version: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id: string;
27
+ version?: string | undefined;
28
+ }, {
29
+ id: string;
30
+ version?: string | undefined;
31
+ }>, "many">>;
11
32
  owners: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
33
  generateMarkdown: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
13
34
  service: z.ZodObject<{
@@ -47,6 +68,15 @@ declare const optionsSchema: z.ZodObject<{
47
68
  id: string;
48
69
  draft?: boolean | undefined;
49
70
  name?: string | undefined;
71
+ summary?: string | undefined;
72
+ writesTo?: {
73
+ id: string;
74
+ version?: string | undefined;
75
+ }[] | undefined;
76
+ readsFrom?: {
77
+ id: string;
78
+ version?: string | undefined;
79
+ }[] | undefined;
50
80
  owners?: string[] | undefined;
51
81
  generateMarkdown?: ((args_0: {
52
82
  service: {
@@ -62,6 +92,15 @@ declare const optionsSchema: z.ZodObject<{
62
92
  id: string;
63
93
  draft?: boolean | undefined;
64
94
  name?: string | undefined;
95
+ summary?: string | undefined;
96
+ writesTo?: {
97
+ id: string;
98
+ version?: string | undefined;
99
+ }[] | undefined;
100
+ readsFrom?: {
101
+ id: string;
102
+ version?: string | undefined;
103
+ }[] | undefined;
65
104
  owners?: string[] | undefined;
66
105
  generateMarkdown?: ((args_0: {
67
106
  service: {
@@ -198,6 +237,15 @@ declare const optionsSchema: z.ZodObject<{
198
237
  id: string;
199
238
  draft?: boolean | undefined;
200
239
  name?: string | undefined;
240
+ summary?: string | undefined;
241
+ writesTo?: {
242
+ id: string;
243
+ version?: string | undefined;
244
+ }[] | undefined;
245
+ readsFrom?: {
246
+ id: string;
247
+ version?: string | undefined;
248
+ }[] | undefined;
201
249
  owners?: string[] | undefined;
202
250
  generateMarkdown?: ((args_0: {
203
251
  service: {
@@ -248,6 +296,15 @@ declare const optionsSchema: z.ZodObject<{
248
296
  id: string;
249
297
  draft?: boolean | undefined;
250
298
  name?: string | undefined;
299
+ summary?: string | undefined;
300
+ writesTo?: {
301
+ id: string;
302
+ version?: string | undefined;
303
+ }[] | undefined;
304
+ readsFrom?: {
305
+ id: string;
306
+ version?: string | undefined;
307
+ }[] | undefined;
251
308
  owners?: string[] | undefined;
252
309
  generateMarkdown?: ((args_0: {
253
310
  service: {
package/dist/index.d.ts CHANGED
@@ -8,6 +8,27 @@ declare const optionsSchema: z.ZodObject<{
8
8
  path: z.ZodString;
9
9
  draft: z.ZodOptional<z.ZodBoolean>;
10
10
  name: z.ZodOptional<z.ZodString>;
11
+ summary: z.ZodOptional<z.ZodString>;
12
+ writesTo: z.ZodOptional<z.ZodArray<z.ZodObject<{
13
+ id: z.ZodString;
14
+ version: z.ZodOptional<z.ZodString>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ id: string;
17
+ version?: string | undefined;
18
+ }, {
19
+ id: string;
20
+ version?: string | undefined;
21
+ }>, "many">>;
22
+ readsFrom: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ version: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ id: string;
27
+ version?: string | undefined;
28
+ }, {
29
+ id: string;
30
+ version?: string | undefined;
31
+ }>, "many">>;
11
32
  owners: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
33
  generateMarkdown: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
13
34
  service: z.ZodObject<{
@@ -47,6 +68,15 @@ declare const optionsSchema: z.ZodObject<{
47
68
  id: string;
48
69
  draft?: boolean | undefined;
49
70
  name?: string | undefined;
71
+ summary?: string | undefined;
72
+ writesTo?: {
73
+ id: string;
74
+ version?: string | undefined;
75
+ }[] | undefined;
76
+ readsFrom?: {
77
+ id: string;
78
+ version?: string | undefined;
79
+ }[] | undefined;
50
80
  owners?: string[] | undefined;
51
81
  generateMarkdown?: ((args_0: {
52
82
  service: {
@@ -62,6 +92,15 @@ declare const optionsSchema: z.ZodObject<{
62
92
  id: string;
63
93
  draft?: boolean | undefined;
64
94
  name?: string | undefined;
95
+ summary?: string | undefined;
96
+ writesTo?: {
97
+ id: string;
98
+ version?: string | undefined;
99
+ }[] | undefined;
100
+ readsFrom?: {
101
+ id: string;
102
+ version?: string | undefined;
103
+ }[] | undefined;
65
104
  owners?: string[] | undefined;
66
105
  generateMarkdown?: ((args_0: {
67
106
  service: {
@@ -198,6 +237,15 @@ declare const optionsSchema: z.ZodObject<{
198
237
  id: string;
199
238
  draft?: boolean | undefined;
200
239
  name?: string | undefined;
240
+ summary?: string | undefined;
241
+ writesTo?: {
242
+ id: string;
243
+ version?: string | undefined;
244
+ }[] | undefined;
245
+ readsFrom?: {
246
+ id: string;
247
+ version?: string | undefined;
248
+ }[] | undefined;
201
249
  owners?: string[] | undefined;
202
250
  generateMarkdown?: ((args_0: {
203
251
  service: {
@@ -248,6 +296,15 @@ declare const optionsSchema: z.ZodObject<{
248
296
  id: string;
249
297
  draft?: boolean | undefined;
250
298
  name?: string | undefined;
299
+ summary?: string | undefined;
300
+ writesTo?: {
301
+ id: string;
302
+ version?: string | undefined;
303
+ }[] | undefined;
304
+ readsFrom?: {
305
+ id: string;
306
+ version?: string | undefined;
307
+ }[] | undefined;
251
308
  owners?: string[] | undefined;
252
309
  generateMarkdown?: ((args_0: {
253
310
  service: {
package/dist/index.js CHANGED
@@ -303,7 +303,7 @@ var import_path3 = __toESM(require("path"));
303
303
  // package.json
304
304
  var package_default = {
305
305
  name: "@eventcatalog/generator-asyncapi",
306
- version: "4.5.2",
306
+ version: "4.5.4",
307
307
  description: "AsyncAPI generator for EventCatalog",
308
308
  scripts: {
309
309
  build: "tsup",
@@ -341,7 +341,7 @@ var package_default = {
341
341
  dependencies: {
342
342
  "@asyncapi/avro-schema-parser": "^3.0.24",
343
343
  "@asyncapi/parser": "^3.4.0",
344
- "@eventcatalog/sdk": "^2.7.5",
344
+ "@eventcatalog/sdk": "^2.8.3",
345
345
  chalk: "^4",
346
346
  "fs-extra": "^11.2.0",
347
347
  glob: "^11.0.0",
@@ -1183,31 +1183,34 @@ var getInstalledVersionOfPackage = (packageName) => {
1183
1183
  async function checkForPackageUpdate(packageName) {
1184
1184
  const installedVersion = getInstalledVersionOfPackage(packageName);
1185
1185
  if (!installedVersion || installedVersion === "latest") return;
1186
- const pkg = { name: packageName, version: installedVersion };
1187
- const updateNotifierModule = await import("update-notifier");
1188
- const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
1189
- const info = await notifier.fetchInfo();
1190
- if (info?.type !== "latest") {
1191
- const message2 = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
1186
+ try {
1187
+ const pkg = { name: packageName, version: installedVersion };
1188
+ const updateNotifierModule = await import("update-notifier");
1189
+ const notifier = updateNotifierModule.default({ pkg, updateCheckInterval: 0, shouldNotifyInNpmScript: true });
1190
+ const info = await notifier.fetchInfo();
1191
+ if (info?.type !== "latest") {
1192
+ const message2 = `Package ${packageName} update available ${info.current} \u2192 ${info.latest}
1192
1193
  Run npm i ${packageName} to update`;
1193
- console.log(
1194
- boxen(message2, {
1195
- padding: 1,
1196
- margin: 1,
1197
- align: "center",
1198
- borderColor: "yellow",
1199
- borderStyle: {
1200
- topLeft: " ",
1201
- topRight: " ",
1202
- bottomLeft: " ",
1203
- bottomRight: " ",
1204
- right: " ",
1205
- top: "-",
1206
- bottom: "-",
1207
- left: " "
1208
- }
1209
- })
1210
- );
1194
+ console.log(
1195
+ boxen(message2, {
1196
+ padding: 1,
1197
+ margin: 1,
1198
+ align: "center",
1199
+ borderColor: "yellow",
1200
+ borderStyle: {
1201
+ topLeft: " ",
1202
+ topRight: " ",
1203
+ bottomLeft: " ",
1204
+ bottomRight: " ",
1205
+ right: " ",
1206
+ top: "-",
1207
+ bottom: "-",
1208
+ left: " "
1209
+ }
1210
+ })
1211
+ );
1212
+ }
1213
+ } catch (error) {
1211
1214
  }
1212
1215
  }
1213
1216
 
@@ -2727,6 +2730,9 @@ var optionsSchema = import_zod.z.object({
2727
2730
  path: import_zod.z.string({ required_error: "The service path is required. please provide the path to specification file" }),
2728
2731
  draft: import_zod.z.boolean().optional(),
2729
2732
  name: import_zod.z.string().optional(),
2733
+ summary: import_zod.z.string().optional(),
2734
+ writesTo: import_zod.z.array(import_zod.z.object({ id: import_zod.z.string(), version: import_zod.z.string().optional() })).optional(),
2735
+ readsFrom: import_zod.z.array(import_zod.z.object({ id: import_zod.z.string(), version: import_zod.z.string().optional() })).optional(),
2730
2736
  owners: import_zod.z.array(import_zod.z.string()).optional(),
2731
2737
  generateMarkdown: import_zod.z.function().args(
2732
2738
  import_zod.z.object({
@@ -3092,7 +3098,7 @@ Processing domain: ${domainName} (v${domainVersion})`));
3092
3098
  id: serviceId,
3093
3099
  name: serviceName,
3094
3100
  version,
3095
- summary: getSummary2(document),
3101
+ summary: service.summary || getSummary2(document),
3096
3102
  badges: badges || documentTags.map((tag2) => ({ content: tag2.name(), textColor: "blue", backgroundColor: "blue" })),
3097
3103
  markdown: serviceMarkdown,
3098
3104
  sends,
@@ -3106,7 +3112,9 @@ Processing domain: ${domainName} (v${domainVersion})`));
3106
3112
  ...repository && { repository },
3107
3113
  ...styles2 && { styles: styles2 },
3108
3114
  ...isServiceMarkedAsDraft && { draft: true },
3109
- ...attachments && { attachments }
3115
+ ...attachments && { attachments },
3116
+ ...service.writesTo && { writesTo: service.writesTo },
3117
+ ...service.readsFrom && { readsFrom: service.readsFrom }
3110
3118
  },
3111
3119
  {
3112
3120
  path: servicePath,