@eventcatalog/core 3.46.0 → 3.47.0
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/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-FNOYJEUK.js → chunk-ALXVETEP.js} +1 -1
- package/dist/{chunk-DOHA5HNJ.js → chunk-GBC637Z2.js} +1 -1
- package/dist/{chunk-JS6IYB55.js → chunk-XYCPSZ4V.js} +1 -1
- package/dist/{chunk-TLLUDBO4.js → chunk-ZM5P2252.js} +1 -1
- package/dist/{chunk-X4AESI6E.js → chunk-ZRLFPUCO.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +10 -10
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewerRoot.astro +11 -1
- package/eventcatalog/src/components/MDX/SchemaViewer/schema-viewer-utils.spec.ts +63 -0
- package/eventcatalog/src/components/MDX/SchemaViewer/schema-viewer-utils.ts +20 -7
- package/eventcatalog/src/components/SchemaExplorer/ProtobufSchemaViewer.tsx +532 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaContentViewer.tsx +6 -0
- package/eventcatalog/src/components/SchemaExplorer/SchemaDetailsPanel.tsx +20 -2
- package/eventcatalog/src/components/SchemaExplorer/SchemaExplorer.tsx +14 -5
- package/eventcatalog/src/components/SchemaExplorer/SchemaViewerModal.tsx +8 -2
- package/eventcatalog/src/components/SchemaExplorer/utils.ts +4 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/language/_index.data.ts +19 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/language.mdx.ts +16 -5
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +4 -2
- package/eventcatalog/src/stores/sidebar-store/builders/entity.ts +87 -0
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +1 -0
- package/eventcatalog/src/stores/sidebar-store/state.ts +15 -14
- package/eventcatalog/src/styles/tailwind.css +18 -0
- package/eventcatalog/src/utils/collections/domains.ts +39 -0
- package/eventcatalog/src/utils/collections/entities.ts +3 -1
- package/eventcatalog/src/utils/files.ts +9 -0
- package/eventcatalog/src/utils/node-graphs/domain-entity-map.ts +24 -12
- package/eventcatalog/src/utils/protobuf-schema.ts +476 -0
- package/package.json +3 -4
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight Protocol Buffers (.proto) parser.
|
|
3
|
+
*
|
|
4
|
+
* Parses proto2/proto3 files into a plain JSON tree used by the
|
|
5
|
+
* ProtobufSchemaViewer component. Runs in both Node (Astro build) and the
|
|
6
|
+
* browser (Schema Explorer), so it must stay dependency free.
|
|
7
|
+
*
|
|
8
|
+
* Captures doc comments (leading `//`, `/* ... *\/` and trailing same-line
|
|
9
|
+
* comments) so they can be displayed alongside fields, like Avro `doc`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export interface ProtobufField {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
number?: number;
|
|
16
|
+
label?: 'repeated' | 'optional' | 'required';
|
|
17
|
+
map?: { keyType: string; valueType: string };
|
|
18
|
+
oneof?: string;
|
|
19
|
+
doc?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ProtobufEnumValue {
|
|
23
|
+
name: string;
|
|
24
|
+
value?: number;
|
|
25
|
+
doc?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ProtobufEnum {
|
|
29
|
+
name: string;
|
|
30
|
+
doc?: string;
|
|
31
|
+
values: ProtobufEnumValue[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ProtobufMessage {
|
|
35
|
+
name: string;
|
|
36
|
+
doc?: string;
|
|
37
|
+
fields: ProtobufField[];
|
|
38
|
+
messages: ProtobufMessage[];
|
|
39
|
+
enums: ProtobufEnum[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ProtobufSchema {
|
|
43
|
+
syntax?: string;
|
|
44
|
+
package?: string;
|
|
45
|
+
messages: ProtobufMessage[];
|
|
46
|
+
enums: ProtobufEnum[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface Token {
|
|
50
|
+
value: string;
|
|
51
|
+
line: number;
|
|
52
|
+
doc?: string;
|
|
53
|
+
isString?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const SYMBOLS = new Set(['{', '}', ';', '=', '<', '>', ',', '[', ']', '(', ')', ':']);
|
|
57
|
+
|
|
58
|
+
const isIdentifierStart = (char: string) => /[A-Za-z_]/.test(char);
|
|
59
|
+
const isIdentifierChar = (char: string) => /[A-Za-z0-9_.]/.test(char);
|
|
60
|
+
const isNumberStart = (char: string) => /[0-9-]/.test(char);
|
|
61
|
+
const isNumberChar = (char: string) => /[0-9a-fA-FxX.+-]/.test(char);
|
|
62
|
+
|
|
63
|
+
function tokenize(content: string): { tokens: Token[]; trailingComments: Map<number, string> } {
|
|
64
|
+
const tokens: Token[] = [];
|
|
65
|
+
const trailingComments = new Map<number, string>();
|
|
66
|
+
let pendingDoc: string[] = [];
|
|
67
|
+
let line = 1;
|
|
68
|
+
let lineHasTokens = false;
|
|
69
|
+
let i = 0;
|
|
70
|
+
|
|
71
|
+
const pushToken = (token: Omit<Token, 'doc'>) => {
|
|
72
|
+
tokens.push(pendingDoc.length > 0 ? { ...token, doc: pendingDoc.join('\n') } : token);
|
|
73
|
+
pendingDoc = [];
|
|
74
|
+
lineHasTokens = true;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
while (i < content.length) {
|
|
78
|
+
const char = content[i];
|
|
79
|
+
|
|
80
|
+
if (char === '\n') {
|
|
81
|
+
line++;
|
|
82
|
+
lineHasTokens = false;
|
|
83
|
+
i++;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (/\s/.test(char)) {
|
|
88
|
+
i++;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Line comment
|
|
93
|
+
if (char === '/' && content[i + 1] === '/') {
|
|
94
|
+
let comment = '';
|
|
95
|
+
i += 2;
|
|
96
|
+
while (i < content.length && content[i] !== '\n') {
|
|
97
|
+
comment += content[i];
|
|
98
|
+
i++;
|
|
99
|
+
}
|
|
100
|
+
comment = comment.replace(/^\/*\s?/, '').trim();
|
|
101
|
+
if (lineHasTokens) {
|
|
102
|
+
trailingComments.set(line, trailingComments.has(line) ? `${trailingComments.get(line)}\n${comment}` : comment);
|
|
103
|
+
} else if (comment) {
|
|
104
|
+
pendingDoc.push(comment);
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Block comment
|
|
110
|
+
if (char === '/' && content[i + 1] === '*') {
|
|
111
|
+
let comment = '';
|
|
112
|
+
i += 2;
|
|
113
|
+
while (i < content.length && !(content[i] === '*' && content[i + 1] === '/')) {
|
|
114
|
+
if (content[i] === '\n') line++;
|
|
115
|
+
comment += content[i];
|
|
116
|
+
i++;
|
|
117
|
+
}
|
|
118
|
+
i += 2;
|
|
119
|
+
const cleaned = comment
|
|
120
|
+
.split('\n')
|
|
121
|
+
.map((commentLine) => commentLine.replace(/^\s*\*?\s?/, '').trim())
|
|
122
|
+
.filter(Boolean)
|
|
123
|
+
.join('\n');
|
|
124
|
+
if (cleaned) pendingDoc.push(cleaned);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// String literal
|
|
129
|
+
if (char === '"' || char === "'") {
|
|
130
|
+
const quote = char;
|
|
131
|
+
let value = '';
|
|
132
|
+
i++;
|
|
133
|
+
while (i < content.length && content[i] !== quote) {
|
|
134
|
+
if (content[i] === '\\') {
|
|
135
|
+
value += content[i + 1];
|
|
136
|
+
i += 2;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
if (content[i] === '\n') line++;
|
|
140
|
+
value += content[i];
|
|
141
|
+
i++;
|
|
142
|
+
}
|
|
143
|
+
i++;
|
|
144
|
+
pushToken({ value, line, isString: true });
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (SYMBOLS.has(char)) {
|
|
149
|
+
pushToken({ value: char, line });
|
|
150
|
+
i++;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Identifiers, including fully-qualified type names with a leading dot
|
|
155
|
+
// (e.g. ".google.protobuf.Timestamp")
|
|
156
|
+
if (isIdentifierStart(char) || (char === '.' && isIdentifierStart(content[i + 1] || ''))) {
|
|
157
|
+
let value = char === '.' ? '.' : '';
|
|
158
|
+
if (char === '.') i++;
|
|
159
|
+
while (i < content.length && isIdentifierChar(content[i])) {
|
|
160
|
+
value += content[i];
|
|
161
|
+
i++;
|
|
162
|
+
}
|
|
163
|
+
pushToken({ value, line });
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (isNumberStart(char)) {
|
|
168
|
+
let value = content[i];
|
|
169
|
+
i++;
|
|
170
|
+
while (i < content.length && isNumberChar(content[i])) {
|
|
171
|
+
value += content[i];
|
|
172
|
+
i++;
|
|
173
|
+
}
|
|
174
|
+
pushToken({ value, line });
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
throw new Error(`Unexpected character "${char}" at line ${line}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return { tokens, trailingComments };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
class ProtobufParser {
|
|
185
|
+
private tokens: Token[];
|
|
186
|
+
private trailingComments: Map<number, string>;
|
|
187
|
+
private pos = 0;
|
|
188
|
+
|
|
189
|
+
constructor(content: string) {
|
|
190
|
+
const { tokens, trailingComments } = tokenize(content);
|
|
191
|
+
this.tokens = tokens;
|
|
192
|
+
this.trailingComments = trailingComments;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
private peek(): Token | undefined {
|
|
196
|
+
return this.tokens[this.pos];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private next(): Token {
|
|
200
|
+
const token = this.tokens[this.pos];
|
|
201
|
+
if (!token) throw new Error('Unexpected end of protobuf schema');
|
|
202
|
+
this.pos++;
|
|
203
|
+
return token;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private expect(value: string): Token {
|
|
207
|
+
const token = this.next();
|
|
208
|
+
if (token.value !== value) {
|
|
209
|
+
throw new Error(`Expected "${value}" but found "${token.value}" at line ${token.line}`);
|
|
210
|
+
}
|
|
211
|
+
return token;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Consume tokens until a top-level ";" (skips over nested braces, e.g. aggregate options)
|
|
215
|
+
private skipStatement() {
|
|
216
|
+
let depth = 0;
|
|
217
|
+
while (this.pos < this.tokens.length) {
|
|
218
|
+
const token = this.next();
|
|
219
|
+
if (token.value === '{') depth++;
|
|
220
|
+
if (token.value === '}') depth--;
|
|
221
|
+
if (token.value === ';' && depth <= 0) return;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private skipBlock() {
|
|
226
|
+
this.expect('{');
|
|
227
|
+
let depth = 1;
|
|
228
|
+
while (this.pos < this.tokens.length && depth > 0) {
|
|
229
|
+
const token = this.next();
|
|
230
|
+
if (token.value === '{') depth++;
|
|
231
|
+
if (token.value === '}') depth--;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Skip field options like [deprecated = true, (custom) = "value"]
|
|
236
|
+
private skipFieldOptions() {
|
|
237
|
+
if (this.peek()?.value !== '[') return;
|
|
238
|
+
let depth = 0;
|
|
239
|
+
while (this.pos < this.tokens.length) {
|
|
240
|
+
const token = this.next();
|
|
241
|
+
if (token.value === '[') depth++;
|
|
242
|
+
if (token.value === ']') depth--;
|
|
243
|
+
if (depth === 0) return;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private getTrailingDoc(line: number): string | undefined {
|
|
248
|
+
return this.trailingComments.get(line);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
parse(): ProtobufSchema {
|
|
252
|
+
const schema: ProtobufSchema = { messages: [], enums: [] };
|
|
253
|
+
|
|
254
|
+
while (this.pos < this.tokens.length) {
|
|
255
|
+
const token = this.peek()!;
|
|
256
|
+
|
|
257
|
+
switch (token.value) {
|
|
258
|
+
case 'syntax':
|
|
259
|
+
case 'edition': {
|
|
260
|
+
this.next();
|
|
261
|
+
this.expect('=');
|
|
262
|
+
schema.syntax = this.next().value;
|
|
263
|
+
this.expect(';');
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 'package': {
|
|
267
|
+
this.next();
|
|
268
|
+
schema.package = this.next().value;
|
|
269
|
+
this.expect(';');
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
case 'import':
|
|
273
|
+
case 'option': {
|
|
274
|
+
this.next();
|
|
275
|
+
this.skipStatement();
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
case 'message': {
|
|
279
|
+
schema.messages.push(this.parseMessage());
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
case 'enum': {
|
|
283
|
+
schema.enums.push(this.parseEnum());
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
case 'service':
|
|
287
|
+
case 'extend': {
|
|
288
|
+
this.next();
|
|
289
|
+
this.next(); // name
|
|
290
|
+
this.skipBlock();
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case ';': {
|
|
294
|
+
this.next();
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
default:
|
|
298
|
+
throw new Error(`Unexpected token "${token.value}" at line ${token.line}`);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return schema;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
private parseMessage(): ProtobufMessage {
|
|
306
|
+
const keyword = this.expect('message');
|
|
307
|
+
const name = this.next().value;
|
|
308
|
+
const message: ProtobufMessage = { name, doc: keyword.doc, fields: [], messages: [], enums: [] };
|
|
309
|
+
|
|
310
|
+
this.expect('{');
|
|
311
|
+
|
|
312
|
+
while (this.pos < this.tokens.length) {
|
|
313
|
+
const token = this.peek()!;
|
|
314
|
+
|
|
315
|
+
if (token.value === '}') {
|
|
316
|
+
this.next();
|
|
317
|
+
return message;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
switch (token.value) {
|
|
321
|
+
case 'message':
|
|
322
|
+
message.messages.push(this.parseMessage());
|
|
323
|
+
break;
|
|
324
|
+
case 'enum':
|
|
325
|
+
message.enums.push(this.parseEnum());
|
|
326
|
+
break;
|
|
327
|
+
case 'oneof': {
|
|
328
|
+
this.next();
|
|
329
|
+
const oneofName = this.next().value;
|
|
330
|
+
this.expect('{');
|
|
331
|
+
while (this.peek() && this.peek()!.value !== '}') {
|
|
332
|
+
if (this.peek()!.value === 'option') {
|
|
333
|
+
this.next();
|
|
334
|
+
this.skipStatement();
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
message.fields.push(this.parseField(oneofName));
|
|
338
|
+
}
|
|
339
|
+
this.expect('}');
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
case 'map':
|
|
343
|
+
message.fields.push(this.parseMapField());
|
|
344
|
+
break;
|
|
345
|
+
case 'option':
|
|
346
|
+
case 'reserved':
|
|
347
|
+
case 'extensions': {
|
|
348
|
+
this.next();
|
|
349
|
+
this.skipStatement();
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
case 'extend': {
|
|
353
|
+
this.next();
|
|
354
|
+
this.next(); // type name
|
|
355
|
+
this.skipBlock();
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
case ';':
|
|
359
|
+
this.next();
|
|
360
|
+
break;
|
|
361
|
+
default:
|
|
362
|
+
message.fields.push(this.parseField());
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
throw new Error(`Unexpected end of message "${name}"`);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
private parseField(oneof?: string): ProtobufField {
|
|
370
|
+
let firstToken = this.peek()!;
|
|
371
|
+
let label: ProtobufField['label'];
|
|
372
|
+
|
|
373
|
+
if (firstToken.value === 'repeated' || firstToken.value === 'optional' || firstToken.value === 'required') {
|
|
374
|
+
label = firstToken.value;
|
|
375
|
+
this.next();
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (this.peek()?.value === 'map') {
|
|
379
|
+
const mapField = this.parseMapField();
|
|
380
|
+
return { ...mapField, doc: mapField.doc || firstToken.doc, oneof };
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const typeToken = this.next();
|
|
384
|
+
const name = this.next().value;
|
|
385
|
+
this.expect('=');
|
|
386
|
+
const numberToken = this.next();
|
|
387
|
+
this.skipFieldOptions();
|
|
388
|
+
const terminator = this.expect(';');
|
|
389
|
+
|
|
390
|
+
const parsedNumber = Number.parseInt(numberToken.value, 10);
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
name,
|
|
394
|
+
type: typeToken.value,
|
|
395
|
+
number: Number.isNaN(parsedNumber) ? undefined : parsedNumber,
|
|
396
|
+
label,
|
|
397
|
+
oneof,
|
|
398
|
+
doc: firstToken.doc || typeToken.doc || this.getTrailingDoc(terminator.line),
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
private parseMapField(): ProtobufField {
|
|
403
|
+
const keyword = this.expect('map');
|
|
404
|
+
this.expect('<');
|
|
405
|
+
const keyType = this.next().value;
|
|
406
|
+
this.expect(',');
|
|
407
|
+
const valueType = this.next().value;
|
|
408
|
+
this.expect('>');
|
|
409
|
+
const name = this.next().value;
|
|
410
|
+
this.expect('=');
|
|
411
|
+
const numberToken = this.next();
|
|
412
|
+
this.skipFieldOptions();
|
|
413
|
+
const terminator = this.expect(';');
|
|
414
|
+
|
|
415
|
+
const parsedNumber = Number.parseInt(numberToken.value, 10);
|
|
416
|
+
|
|
417
|
+
return {
|
|
418
|
+
name,
|
|
419
|
+
type: `map<${keyType}, ${valueType}>`,
|
|
420
|
+
map: { keyType, valueType },
|
|
421
|
+
number: Number.isNaN(parsedNumber) ? undefined : parsedNumber,
|
|
422
|
+
doc: keyword.doc || this.getTrailingDoc(terminator.line),
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
private parseEnum(): ProtobufEnum {
|
|
427
|
+
const keyword = this.expect('enum');
|
|
428
|
+
const name = this.next().value;
|
|
429
|
+
const protoEnum: ProtobufEnum = { name, doc: keyword.doc, values: [] };
|
|
430
|
+
|
|
431
|
+
this.expect('{');
|
|
432
|
+
|
|
433
|
+
while (this.pos < this.tokens.length) {
|
|
434
|
+
const token = this.peek()!;
|
|
435
|
+
|
|
436
|
+
if (token.value === '}') {
|
|
437
|
+
this.next();
|
|
438
|
+
return protoEnum;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (token.value === 'option' || token.value === 'reserved') {
|
|
442
|
+
this.next();
|
|
443
|
+
this.skipStatement();
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (token.value === ';') {
|
|
448
|
+
this.next();
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const valueToken = this.next();
|
|
453
|
+
this.expect('=');
|
|
454
|
+
const numberToken = this.next();
|
|
455
|
+
this.skipFieldOptions();
|
|
456
|
+
const terminator = this.expect(';');
|
|
457
|
+
|
|
458
|
+
const parsedNumber = Number.parseInt(numberToken.value, 10);
|
|
459
|
+
|
|
460
|
+
protoEnum.values.push({
|
|
461
|
+
name: valueToken.value,
|
|
462
|
+
value: Number.isNaN(parsedNumber) ? undefined : parsedNumber,
|
|
463
|
+
doc: valueToken.doc || this.getTrailingDoc(terminator.line),
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
throw new Error(`Unexpected end of enum "${name}"`);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export function parseProtobufSchema(content: string): ProtobufSchema {
|
|
472
|
+
if (!content || content.trim() === '') {
|
|
473
|
+
throw new Error('Protobuf schema is empty');
|
|
474
|
+
}
|
|
475
|
+
return new ProtobufParser(content).parse();
|
|
476
|
+
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.47.0",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"auth-astro": "^4.2.0",
|
|
66
66
|
"boxen": "^8.0.1",
|
|
67
67
|
"commander": "^12.1.0",
|
|
68
|
-
"concurrently": "^8.2.2",
|
|
69
68
|
"cross-env": "^7.0.3",
|
|
70
69
|
"dagre": "^0.8.5",
|
|
71
70
|
"diff": "^8.0.3",
|
|
@@ -113,8 +112,8 @@
|
|
|
113
112
|
"uuid": "^10.0.0",
|
|
114
113
|
"zod": "^4.3.6",
|
|
115
114
|
"@eventcatalog/linter": "1.0.29",
|
|
116
|
-
"@eventcatalog/
|
|
117
|
-
"@eventcatalog/
|
|
115
|
+
"@eventcatalog/visualiser": "^3.22.1",
|
|
116
|
+
"@eventcatalog/sdk": "2.24.1"
|
|
118
117
|
},
|
|
119
118
|
"devDependencies": {
|
|
120
119
|
"@astrojs/check": "^0.9.9",
|