@eventcatalog/linter 0.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/README.md +583 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +54 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/index.d.ts +17 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +43 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/reporters/index.d.ts +16 -0
- package/dist/reporters/index.d.ts.map +1 -0
- package/dist/reporters/index.js +151 -0
- package/dist/reporters/index.js.map +1 -0
- package/dist/scanner/index.d.ts +14 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +99 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/schemas/channel.d.ts +389 -0
- package/dist/schemas/channel.d.ts.map +1 -0
- package/dist/schemas/channel.js +20 -0
- package/dist/schemas/channel.js.map +1 -0
- package/dist/schemas/common.d.ts +550 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +144 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/domain.d.ts +381 -0
- package/dist/schemas/domain.d.ts.map +1 -0
- package/dist/schemas/domain.js +13 -0
- package/dist/schemas/domain.js.map +1 -0
- package/dist/schemas/entity.d.ts +382 -0
- package/dist/schemas/entity.d.ts.map +1 -0
- package/dist/schemas/entity.js +24 -0
- package/dist/schemas/entity.js.map +1 -0
- package/dist/schemas/flow.d.ts +733 -0
- package/dist/schemas/flow.d.ts.map +1 -0
- package/dist/schemas/flow.js +70 -0
- package/dist/schemas/flow.js.map +1 -0
- package/dist/schemas/index.d.ts +3432 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +47 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/message.d.ts +1076 -0
- package/dist/schemas/message.d.ts.map +1 -0
- package/dist/schemas/message.js +17 -0
- package/dist/schemas/message.js.map +1 -0
- package/dist/schemas/service.d.ts +381 -0
- package/dist/schemas/service.d.ts.map +1 -0
- package/dist/schemas/service.js +13 -0
- package/dist/schemas/service.js.map +1 -0
- package/dist/schemas/team.d.ts +45 -0
- package/dist/schemas/team.d.ts.map +1 -0
- package/dist/schemas/team.js +20 -0
- package/dist/schemas/team.js.map +1 -0
- package/dist/schemas/user.d.ts +48 -0
- package/dist/schemas/user.d.ts.map +1 -0
- package/dist/schemas/user.js +21 -0
- package/dist/schemas/user.js.map +1 -0
- package/dist/types/index.d.ts +81 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/validators/index.d.ts +6 -0
- package/dist/validators/index.d.ts.map +1 -0
- package/dist/validators/index.js +28 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/reference-validator.d.ts +11 -0
- package/dist/validators/reference-validator.d.ts.map +1 -0
- package/dist/validators/reference-validator.js +171 -0
- package/dist/validators/reference-validator.js.map +1 -0
- package/dist/validators/schema-validator.d.ts +5 -0
- package/dist/validators/schema-validator.d.ts.map +1 -0
- package/dist/validators/schema-validator.js +50 -0
- package/dist/validators/schema-validator.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const badgeSchema: z.ZodObject<{
|
|
3
|
+
content: z.ZodString;
|
|
4
|
+
backgroundColor: z.ZodString;
|
|
5
|
+
textColor: z.ZodString;
|
|
6
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
content: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
textColor: string;
|
|
11
|
+
icon?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
content: string;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
textColor: string;
|
|
16
|
+
icon?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ownerReferenceSchema: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
collection: z.ZodEnum<["users", "teams"]>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
id: string;
|
|
23
|
+
collection: "users" | "teams";
|
|
24
|
+
}, {
|
|
25
|
+
id: string;
|
|
26
|
+
collection: "users" | "teams";
|
|
27
|
+
}>]>, {
|
|
28
|
+
id: string;
|
|
29
|
+
}, string | {
|
|
30
|
+
id: string;
|
|
31
|
+
collection: "users" | "teams";
|
|
32
|
+
}>;
|
|
33
|
+
export declare const specificationSchema: z.ZodUnion<[z.ZodObject<{
|
|
34
|
+
openapiPath: z.ZodOptional<z.ZodString>;
|
|
35
|
+
asyncapiPath: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
openapiPath?: string | undefined;
|
|
38
|
+
asyncapiPath?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
openapiPath?: string | undefined;
|
|
41
|
+
asyncapiPath?: string | undefined;
|
|
42
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
43
|
+
type: z.ZodEnum<["openapi", "asyncapi"]>;
|
|
44
|
+
path: z.ZodString;
|
|
45
|
+
name: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
path: string;
|
|
48
|
+
type: "asyncapi" | "openapi";
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
path: string;
|
|
52
|
+
type: "asyncapi" | "openapi";
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
}>, "many">]>;
|
|
55
|
+
export declare const repositorySchema: z.ZodObject<{
|
|
56
|
+
language: z.ZodOptional<z.ZodString>;
|
|
57
|
+
url: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
language?: string | undefined;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
language?: string | undefined;
|
|
63
|
+
url?: string | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export declare const draftSchema: z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
66
|
+
title: z.ZodOptional<z.ZodString>;
|
|
67
|
+
message: z.ZodString;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
message: string;
|
|
70
|
+
title?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
message: string;
|
|
73
|
+
title?: string | undefined;
|
|
74
|
+
}>]>;
|
|
75
|
+
export declare const deprecatedSchema: z.ZodUnion<[z.ZodObject<{
|
|
76
|
+
message: z.ZodOptional<z.ZodString>;
|
|
77
|
+
date: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
message?: string | undefined;
|
|
80
|
+
date?: string | Date | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
message?: string | undefined;
|
|
83
|
+
date?: string | Date | undefined;
|
|
84
|
+
}>, z.ZodOptional<z.ZodBoolean>]>;
|
|
85
|
+
export declare const pointerSchema: z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
id: string;
|
|
90
|
+
version: string;
|
|
91
|
+
}, {
|
|
92
|
+
id: string;
|
|
93
|
+
version?: string | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const resourcePointerSchema: z.ZodObject<{
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
98
|
+
type: z.ZodEnum<["service", "event", "command", "query", "flow", "channel", "domain", "user", "team"]>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
101
|
+
id: string;
|
|
102
|
+
version: string;
|
|
103
|
+
}, {
|
|
104
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
105
|
+
id: string;
|
|
106
|
+
version?: string | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
export declare const channelPointerSchema: z.ZodObject<{
|
|
109
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
|
+
} & {
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
id: string;
|
|
115
|
+
version: string;
|
|
116
|
+
parameters?: Record<string, string> | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
id: string;
|
|
119
|
+
version?: string | undefined;
|
|
120
|
+
parameters?: Record<string, string> | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const resourceReferenceSchema: z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
id: string;
|
|
127
|
+
version: string;
|
|
128
|
+
}, {
|
|
129
|
+
id: string;
|
|
130
|
+
version?: string | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
export declare const semverSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
133
|
+
export declare const sidebarSchema: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
label: z.ZodOptional<z.ZodString>;
|
|
135
|
+
badge: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
label?: string | undefined;
|
|
138
|
+
badge?: string | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
label?: string | undefined;
|
|
141
|
+
badge?: string | undefined;
|
|
142
|
+
}>>;
|
|
143
|
+
export declare const stylesSchema: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
145
|
+
node: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
color: z.ZodOptional<z.ZodString>;
|
|
147
|
+
label: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
label?: string | undefined;
|
|
150
|
+
color?: string | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
label?: string | undefined;
|
|
153
|
+
color?: string | undefined;
|
|
154
|
+
}>>;
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
icon?: string | undefined;
|
|
157
|
+
node?: {
|
|
158
|
+
label?: string | undefined;
|
|
159
|
+
color?: string | undefined;
|
|
160
|
+
} | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
icon?: string | undefined;
|
|
163
|
+
node?: {
|
|
164
|
+
label?: string | undefined;
|
|
165
|
+
color?: string | undefined;
|
|
166
|
+
} | undefined;
|
|
167
|
+
}>>;
|
|
168
|
+
export declare const resourceGroupSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
|
+
id: z.ZodOptional<z.ZodString>;
|
|
170
|
+
title: z.ZodOptional<z.ZodString>;
|
|
171
|
+
items: z.ZodArray<z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
174
|
+
type: z.ZodEnum<["service", "event", "command", "query", "flow", "channel", "domain", "user", "team"]>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
177
|
+
id: string;
|
|
178
|
+
version: string;
|
|
179
|
+
}, {
|
|
180
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
181
|
+
id: string;
|
|
182
|
+
version?: string | undefined;
|
|
183
|
+
}>, "many">;
|
|
184
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
185
|
+
sidebar: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
items: {
|
|
188
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
189
|
+
id: string;
|
|
190
|
+
version: string;
|
|
191
|
+
}[];
|
|
192
|
+
limit: number;
|
|
193
|
+
sidebar: boolean;
|
|
194
|
+
id?: string | undefined;
|
|
195
|
+
title?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
items: {
|
|
198
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
199
|
+
id: string;
|
|
200
|
+
version?: string | undefined;
|
|
201
|
+
}[];
|
|
202
|
+
id?: string | undefined;
|
|
203
|
+
title?: string | undefined;
|
|
204
|
+
limit?: number | undefined;
|
|
205
|
+
sidebar?: boolean | undefined;
|
|
206
|
+
}>, "many">>;
|
|
207
|
+
export declare const catalogMetadataSchema: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
path: z.ZodString;
|
|
209
|
+
filePath: z.ZodString;
|
|
210
|
+
astroContentFilePath: z.ZodString;
|
|
211
|
+
publicPath: z.ZodString;
|
|
212
|
+
type: z.ZodString;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
path: string;
|
|
215
|
+
type: string;
|
|
216
|
+
filePath: string;
|
|
217
|
+
astroContentFilePath: string;
|
|
218
|
+
publicPath: string;
|
|
219
|
+
}, {
|
|
220
|
+
path: string;
|
|
221
|
+
type: string;
|
|
222
|
+
filePath: string;
|
|
223
|
+
astroContentFilePath: string;
|
|
224
|
+
publicPath: string;
|
|
225
|
+
}>>;
|
|
226
|
+
export declare const baseSchema: z.ZodObject<{
|
|
227
|
+
id: z.ZodString;
|
|
228
|
+
name: z.ZodString;
|
|
229
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
230
|
+
version: z.ZodEffects<z.ZodString, string, string>;
|
|
231
|
+
draft: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
232
|
+
title: z.ZodOptional<z.ZodString>;
|
|
233
|
+
message: z.ZodString;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
message: string;
|
|
236
|
+
title?: string | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
message: string;
|
|
239
|
+
title?: string | undefined;
|
|
240
|
+
}>]>>;
|
|
241
|
+
badges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
242
|
+
content: z.ZodString;
|
|
243
|
+
backgroundColor: z.ZodString;
|
|
244
|
+
textColor: z.ZodString;
|
|
245
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
content: string;
|
|
248
|
+
backgroundColor: string;
|
|
249
|
+
textColor: string;
|
|
250
|
+
icon?: string | undefined;
|
|
251
|
+
}, {
|
|
252
|
+
content: string;
|
|
253
|
+
backgroundColor: string;
|
|
254
|
+
textColor: string;
|
|
255
|
+
icon?: string | undefined;
|
|
256
|
+
}>, "many">>;
|
|
257
|
+
owners: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
258
|
+
id: z.ZodString;
|
|
259
|
+
collection: z.ZodEnum<["users", "teams"]>;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
id: string;
|
|
262
|
+
collection: "users" | "teams";
|
|
263
|
+
}, {
|
|
264
|
+
id: string;
|
|
265
|
+
collection: "users" | "teams";
|
|
266
|
+
}>]>, {
|
|
267
|
+
id: string;
|
|
268
|
+
}, string | {
|
|
269
|
+
id: string;
|
|
270
|
+
collection: "users" | "teams";
|
|
271
|
+
}>, "many">>;
|
|
272
|
+
schemaPath: z.ZodOptional<z.ZodString>;
|
|
273
|
+
sidebar: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
label: z.ZodOptional<z.ZodString>;
|
|
275
|
+
badge: z.ZodOptional<z.ZodString>;
|
|
276
|
+
}, "strip", z.ZodTypeAny, {
|
|
277
|
+
label?: string | undefined;
|
|
278
|
+
badge?: string | undefined;
|
|
279
|
+
}, {
|
|
280
|
+
label?: string | undefined;
|
|
281
|
+
badge?: string | undefined;
|
|
282
|
+
}>>;
|
|
283
|
+
repository: z.ZodOptional<z.ZodObject<{
|
|
284
|
+
language: z.ZodOptional<z.ZodString>;
|
|
285
|
+
url: z.ZodOptional<z.ZodString>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
language?: string | undefined;
|
|
288
|
+
url?: string | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
language?: string | undefined;
|
|
291
|
+
url?: string | undefined;
|
|
292
|
+
}>>;
|
|
293
|
+
specifications: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
294
|
+
openapiPath: z.ZodOptional<z.ZodString>;
|
|
295
|
+
asyncapiPath: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
openapiPath?: string | undefined;
|
|
298
|
+
asyncapiPath?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
openapiPath?: string | undefined;
|
|
301
|
+
asyncapiPath?: string | undefined;
|
|
302
|
+
}>, z.ZodArray<z.ZodObject<{
|
|
303
|
+
type: z.ZodEnum<["openapi", "asyncapi"]>;
|
|
304
|
+
path: z.ZodString;
|
|
305
|
+
name: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, "strip", z.ZodTypeAny, {
|
|
307
|
+
path: string;
|
|
308
|
+
type: "asyncapi" | "openapi";
|
|
309
|
+
name?: string | undefined;
|
|
310
|
+
}, {
|
|
311
|
+
path: string;
|
|
312
|
+
type: "asyncapi" | "openapi";
|
|
313
|
+
name?: string | undefined;
|
|
314
|
+
}>, "many">]>>;
|
|
315
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
resourceGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
317
|
+
id: z.ZodOptional<z.ZodString>;
|
|
318
|
+
title: z.ZodOptional<z.ZodString>;
|
|
319
|
+
items: z.ZodArray<z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
322
|
+
type: z.ZodEnum<["service", "event", "command", "query", "flow", "channel", "domain", "user", "team"]>;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
325
|
+
id: string;
|
|
326
|
+
version: string;
|
|
327
|
+
}, {
|
|
328
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
329
|
+
id: string;
|
|
330
|
+
version?: string | undefined;
|
|
331
|
+
}>, "many">;
|
|
332
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
333
|
+
sidebar: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
334
|
+
}, "strip", z.ZodTypeAny, {
|
|
335
|
+
items: {
|
|
336
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
337
|
+
id: string;
|
|
338
|
+
version: string;
|
|
339
|
+
}[];
|
|
340
|
+
limit: number;
|
|
341
|
+
sidebar: boolean;
|
|
342
|
+
id?: string | undefined;
|
|
343
|
+
title?: string | undefined;
|
|
344
|
+
}, {
|
|
345
|
+
items: {
|
|
346
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
347
|
+
id: string;
|
|
348
|
+
version?: string | undefined;
|
|
349
|
+
}[];
|
|
350
|
+
id?: string | undefined;
|
|
351
|
+
title?: string | undefined;
|
|
352
|
+
limit?: number | undefined;
|
|
353
|
+
sidebar?: boolean | undefined;
|
|
354
|
+
}>, "many">>;
|
|
355
|
+
styles: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
357
|
+
node: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
color: z.ZodOptional<z.ZodString>;
|
|
359
|
+
label: z.ZodOptional<z.ZodString>;
|
|
360
|
+
}, "strip", z.ZodTypeAny, {
|
|
361
|
+
label?: string | undefined;
|
|
362
|
+
color?: string | undefined;
|
|
363
|
+
}, {
|
|
364
|
+
label?: string | undefined;
|
|
365
|
+
color?: string | undefined;
|
|
366
|
+
}>>;
|
|
367
|
+
}, "strip", z.ZodTypeAny, {
|
|
368
|
+
icon?: string | undefined;
|
|
369
|
+
node?: {
|
|
370
|
+
label?: string | undefined;
|
|
371
|
+
color?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
}, {
|
|
374
|
+
icon?: string | undefined;
|
|
375
|
+
node?: {
|
|
376
|
+
label?: string | undefined;
|
|
377
|
+
color?: string | undefined;
|
|
378
|
+
} | undefined;
|
|
379
|
+
}>>;
|
|
380
|
+
deprecated: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
381
|
+
message: z.ZodOptional<z.ZodString>;
|
|
382
|
+
date: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDate]>>;
|
|
383
|
+
}, "strip", z.ZodTypeAny, {
|
|
384
|
+
message?: string | undefined;
|
|
385
|
+
date?: string | Date | undefined;
|
|
386
|
+
}, {
|
|
387
|
+
message?: string | undefined;
|
|
388
|
+
date?: string | Date | undefined;
|
|
389
|
+
}>, z.ZodOptional<z.ZodBoolean>]>>;
|
|
390
|
+
visualiser: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
+
versions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
392
|
+
latestVersion: z.ZodOptional<z.ZodString>;
|
|
393
|
+
catalog: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
path: z.ZodString;
|
|
395
|
+
filePath: z.ZodString;
|
|
396
|
+
astroContentFilePath: z.ZodString;
|
|
397
|
+
publicPath: z.ZodString;
|
|
398
|
+
type: z.ZodString;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
path: string;
|
|
401
|
+
type: string;
|
|
402
|
+
filePath: string;
|
|
403
|
+
astroContentFilePath: string;
|
|
404
|
+
publicPath: string;
|
|
405
|
+
}, {
|
|
406
|
+
path: string;
|
|
407
|
+
type: string;
|
|
408
|
+
filePath: string;
|
|
409
|
+
astroContentFilePath: string;
|
|
410
|
+
publicPath: string;
|
|
411
|
+
}>>;
|
|
412
|
+
}, "strip", z.ZodTypeAny, {
|
|
413
|
+
id: string;
|
|
414
|
+
name: string;
|
|
415
|
+
version: string;
|
|
416
|
+
sidebar?: {
|
|
417
|
+
label?: string | undefined;
|
|
418
|
+
badge?: string | undefined;
|
|
419
|
+
} | undefined;
|
|
420
|
+
summary?: string | undefined;
|
|
421
|
+
draft?: boolean | {
|
|
422
|
+
message: string;
|
|
423
|
+
title?: string | undefined;
|
|
424
|
+
} | undefined;
|
|
425
|
+
badges?: {
|
|
426
|
+
content: string;
|
|
427
|
+
backgroundColor: string;
|
|
428
|
+
textColor: string;
|
|
429
|
+
icon?: string | undefined;
|
|
430
|
+
}[] | undefined;
|
|
431
|
+
owners?: {
|
|
432
|
+
id: string;
|
|
433
|
+
}[] | undefined;
|
|
434
|
+
schemaPath?: string | undefined;
|
|
435
|
+
repository?: {
|
|
436
|
+
language?: string | undefined;
|
|
437
|
+
url?: string | undefined;
|
|
438
|
+
} | undefined;
|
|
439
|
+
specifications?: {
|
|
440
|
+
openapiPath?: string | undefined;
|
|
441
|
+
asyncapiPath?: string | undefined;
|
|
442
|
+
} | {
|
|
443
|
+
path: string;
|
|
444
|
+
type: "asyncapi" | "openapi";
|
|
445
|
+
name?: string | undefined;
|
|
446
|
+
}[] | undefined;
|
|
447
|
+
hidden?: boolean | undefined;
|
|
448
|
+
resourceGroups?: {
|
|
449
|
+
items: {
|
|
450
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
451
|
+
id: string;
|
|
452
|
+
version: string;
|
|
453
|
+
}[];
|
|
454
|
+
limit: number;
|
|
455
|
+
sidebar: boolean;
|
|
456
|
+
id?: string | undefined;
|
|
457
|
+
title?: string | undefined;
|
|
458
|
+
}[] | undefined;
|
|
459
|
+
styles?: {
|
|
460
|
+
icon?: string | undefined;
|
|
461
|
+
node?: {
|
|
462
|
+
label?: string | undefined;
|
|
463
|
+
color?: string | undefined;
|
|
464
|
+
} | undefined;
|
|
465
|
+
} | undefined;
|
|
466
|
+
deprecated?: boolean | {
|
|
467
|
+
message?: string | undefined;
|
|
468
|
+
date?: string | Date | undefined;
|
|
469
|
+
} | undefined;
|
|
470
|
+
visualiser?: boolean | undefined;
|
|
471
|
+
versions?: string[] | undefined;
|
|
472
|
+
latestVersion?: string | undefined;
|
|
473
|
+
catalog?: {
|
|
474
|
+
path: string;
|
|
475
|
+
type: string;
|
|
476
|
+
filePath: string;
|
|
477
|
+
astroContentFilePath: string;
|
|
478
|
+
publicPath: string;
|
|
479
|
+
} | undefined;
|
|
480
|
+
}, {
|
|
481
|
+
id: string;
|
|
482
|
+
name: string;
|
|
483
|
+
version: string;
|
|
484
|
+
sidebar?: {
|
|
485
|
+
label?: string | undefined;
|
|
486
|
+
badge?: string | undefined;
|
|
487
|
+
} | undefined;
|
|
488
|
+
summary?: string | undefined;
|
|
489
|
+
draft?: boolean | {
|
|
490
|
+
message: string;
|
|
491
|
+
title?: string | undefined;
|
|
492
|
+
} | undefined;
|
|
493
|
+
badges?: {
|
|
494
|
+
content: string;
|
|
495
|
+
backgroundColor: string;
|
|
496
|
+
textColor: string;
|
|
497
|
+
icon?: string | undefined;
|
|
498
|
+
}[] | undefined;
|
|
499
|
+
owners?: (string | {
|
|
500
|
+
id: string;
|
|
501
|
+
collection: "users" | "teams";
|
|
502
|
+
})[] | undefined;
|
|
503
|
+
schemaPath?: string | undefined;
|
|
504
|
+
repository?: {
|
|
505
|
+
language?: string | undefined;
|
|
506
|
+
url?: string | undefined;
|
|
507
|
+
} | undefined;
|
|
508
|
+
specifications?: {
|
|
509
|
+
openapiPath?: string | undefined;
|
|
510
|
+
asyncapiPath?: string | undefined;
|
|
511
|
+
} | {
|
|
512
|
+
path: string;
|
|
513
|
+
type: "asyncapi" | "openapi";
|
|
514
|
+
name?: string | undefined;
|
|
515
|
+
}[] | undefined;
|
|
516
|
+
hidden?: boolean | undefined;
|
|
517
|
+
resourceGroups?: {
|
|
518
|
+
items: {
|
|
519
|
+
type: "service" | "event" | "command" | "query" | "flow" | "channel" | "domain" | "user" | "team";
|
|
520
|
+
id: string;
|
|
521
|
+
version?: string | undefined;
|
|
522
|
+
}[];
|
|
523
|
+
id?: string | undefined;
|
|
524
|
+
title?: string | undefined;
|
|
525
|
+
limit?: number | undefined;
|
|
526
|
+
sidebar?: boolean | undefined;
|
|
527
|
+
}[] | undefined;
|
|
528
|
+
styles?: {
|
|
529
|
+
icon?: string | undefined;
|
|
530
|
+
node?: {
|
|
531
|
+
label?: string | undefined;
|
|
532
|
+
color?: string | undefined;
|
|
533
|
+
} | undefined;
|
|
534
|
+
} | undefined;
|
|
535
|
+
deprecated?: boolean | {
|
|
536
|
+
message?: string | undefined;
|
|
537
|
+
date?: string | Date | undefined;
|
|
538
|
+
} | undefined;
|
|
539
|
+
visualiser?: boolean | undefined;
|
|
540
|
+
versions?: string[] | undefined;
|
|
541
|
+
latestVersion?: string | undefined;
|
|
542
|
+
catalog?: {
|
|
543
|
+
path: string;
|
|
544
|
+
type: string;
|
|
545
|
+
filePath: string;
|
|
546
|
+
astroContentFilePath: string;
|
|
547
|
+
publicPath: string;
|
|
548
|
+
} | undefined;
|
|
549
|
+
}>;
|
|
550
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/schemas/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;EAc9B,CAAC;AAEJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;aAY9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;IAMtB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;iCAM3B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAIV,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;EAAgB,CAAC;AAErD,eAAO,MAAM,YAAY,2CAoBY,CAAC;AAEtC,eAAO,MAAM,aAAa;;;;;;;;;GAKb,CAAC;AAEd,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;GAUZ,CAAC;AAEd,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUnB,CAAC;AAEd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;GAQrB,CAAC;AAEd,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBrB,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseSchema = exports.catalogMetadataSchema = exports.resourceGroupSchema = exports.stylesSchema = exports.sidebarSchema = exports.semverSchema = exports.resourceReferenceSchema = exports.channelPointerSchema = exports.resourcePointerSchema = exports.pointerSchema = exports.deprecatedSchema = exports.draftSchema = exports.repositorySchema = exports.specificationSchema = exports.ownerReferenceSchema = exports.badgeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.badgeSchema = zod_1.z.object({
|
|
6
|
+
content: zod_1.z.string(),
|
|
7
|
+
backgroundColor: zod_1.z.string(),
|
|
8
|
+
textColor: zod_1.z.string(),
|
|
9
|
+
icon: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
exports.ownerReferenceSchema = zod_1.z
|
|
12
|
+
.union([
|
|
13
|
+
// The ID of the user or team
|
|
14
|
+
zod_1.z.string(),
|
|
15
|
+
// The full object with the ID and collection (keep compatibility with `reference`)
|
|
16
|
+
zod_1.z.object({
|
|
17
|
+
id: zod_1.z.string(),
|
|
18
|
+
collection: zod_1.z.enum(['users', 'teams']),
|
|
19
|
+
}),
|
|
20
|
+
])
|
|
21
|
+
.transform(
|
|
22
|
+
// This transformation is needed to keep compatibility with `reference`.
|
|
23
|
+
// The utilities `getTeams` and `getUsers` rely on this transformation.
|
|
24
|
+
(lookup) => ({ id: typeof lookup === 'string' ? lookup : lookup.id }));
|
|
25
|
+
exports.specificationSchema = zod_1.z.union([
|
|
26
|
+
zod_1.z.object({
|
|
27
|
+
openapiPath: zod_1.z.string().optional(),
|
|
28
|
+
asyncapiPath: zod_1.z.string().optional(),
|
|
29
|
+
}),
|
|
30
|
+
zod_1.z.array(zod_1.z.object({
|
|
31
|
+
type: zod_1.z.enum(['openapi', 'asyncapi']),
|
|
32
|
+
path: zod_1.z.string(),
|
|
33
|
+
name: zod_1.z.string().optional(),
|
|
34
|
+
})),
|
|
35
|
+
]);
|
|
36
|
+
exports.repositorySchema = zod_1.z.object({
|
|
37
|
+
language: zod_1.z.string().optional(),
|
|
38
|
+
url: zod_1.z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
exports.draftSchema = zod_1.z.union([
|
|
41
|
+
zod_1.z.boolean(),
|
|
42
|
+
zod_1.z.object({
|
|
43
|
+
title: zod_1.z.string().optional(),
|
|
44
|
+
message: zod_1.z.string(),
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
exports.deprecatedSchema = zod_1.z.union([
|
|
48
|
+
zod_1.z.object({
|
|
49
|
+
message: zod_1.z.string().optional(),
|
|
50
|
+
date: zod_1.z.union([zod_1.z.string(), zod_1.z.date()]).optional(),
|
|
51
|
+
}),
|
|
52
|
+
zod_1.z.boolean().optional(),
|
|
53
|
+
]);
|
|
54
|
+
exports.pointerSchema = zod_1.z.object({
|
|
55
|
+
id: zod_1.z.string(),
|
|
56
|
+
version: zod_1.z.string().optional().default('latest'),
|
|
57
|
+
});
|
|
58
|
+
exports.resourcePointerSchema = zod_1.z.object({
|
|
59
|
+
id: zod_1.z.string(),
|
|
60
|
+
version: zod_1.z.string().optional().default('latest'),
|
|
61
|
+
type: zod_1.z.enum(['service', 'event', 'command', 'query', 'flow', 'channel', 'domain', 'user', 'team']),
|
|
62
|
+
});
|
|
63
|
+
exports.channelPointerSchema = zod_1.z
|
|
64
|
+
.object({
|
|
65
|
+
parameters: zod_1.z.record(zod_1.z.string()).optional(),
|
|
66
|
+
})
|
|
67
|
+
.merge(exports.pointerSchema);
|
|
68
|
+
exports.resourceReferenceSchema = exports.pointerSchema;
|
|
69
|
+
exports.semverSchema = zod_1.z.string().refine((version) => {
|
|
70
|
+
// Allow common patterns used in EventCatalog
|
|
71
|
+
if (version === 'latest')
|
|
72
|
+
return true;
|
|
73
|
+
// Allow x patterns like 0.0.x, 1.x, 2.1.x but not x.x.x
|
|
74
|
+
if (version.includes('.x')) {
|
|
75
|
+
const xPattern = /^\d+(\.\d+)*\.x$/;
|
|
76
|
+
return xPattern.test(version);
|
|
77
|
+
}
|
|
78
|
+
// Allow semver ranges like ^1.0.0, ~1.2.0
|
|
79
|
+
if (version.startsWith('^') || version.startsWith('~')) {
|
|
80
|
+
const rangeVersion = version.substring(1);
|
|
81
|
+
const semverRegex = /^\d+\.\d+\.\d+(-[\w\d-.]+)?(\+[\w\d-.]+)?$/;
|
|
82
|
+
return semverRegex.test(rangeVersion);
|
|
83
|
+
}
|
|
84
|
+
// For strict semver, use a regex that matches the semver spec
|
|
85
|
+
const semverRegex = /^\d+\.\d+\.\d+(-[\w\d-.]+)?(\+[\w\d-.]+)?$/;
|
|
86
|
+
return semverRegex.test(version);
|
|
87
|
+
}, 'Invalid semantic version format');
|
|
88
|
+
exports.sidebarSchema = zod_1.z
|
|
89
|
+
.object({
|
|
90
|
+
label: zod_1.z.string().optional(),
|
|
91
|
+
badge: zod_1.z.string().optional(),
|
|
92
|
+
})
|
|
93
|
+
.optional();
|
|
94
|
+
exports.stylesSchema = zod_1.z
|
|
95
|
+
.object({
|
|
96
|
+
icon: zod_1.z.string().optional(),
|
|
97
|
+
node: zod_1.z
|
|
98
|
+
.object({
|
|
99
|
+
color: zod_1.z.string().optional(),
|
|
100
|
+
label: zod_1.z.string().optional(),
|
|
101
|
+
})
|
|
102
|
+
.optional(),
|
|
103
|
+
})
|
|
104
|
+
.optional();
|
|
105
|
+
exports.resourceGroupSchema = zod_1.z
|
|
106
|
+
.array(zod_1.z.object({
|
|
107
|
+
id: zod_1.z.string().optional(),
|
|
108
|
+
title: zod_1.z.string().optional(),
|
|
109
|
+
items: zod_1.z.array(exports.resourcePointerSchema),
|
|
110
|
+
limit: zod_1.z.number().optional().default(10),
|
|
111
|
+
sidebar: zod_1.z.boolean().optional().default(true),
|
|
112
|
+
}))
|
|
113
|
+
.optional();
|
|
114
|
+
exports.catalogMetadataSchema = zod_1.z
|
|
115
|
+
.object({
|
|
116
|
+
path: zod_1.z.string(),
|
|
117
|
+
filePath: zod_1.z.string(),
|
|
118
|
+
astroContentFilePath: zod_1.z.string(),
|
|
119
|
+
publicPath: zod_1.z.string(),
|
|
120
|
+
type: zod_1.z.string(),
|
|
121
|
+
})
|
|
122
|
+
.optional();
|
|
123
|
+
exports.baseSchema = zod_1.z.object({
|
|
124
|
+
id: zod_1.z.string(),
|
|
125
|
+
name: zod_1.z.string(),
|
|
126
|
+
summary: zod_1.z.string().optional(),
|
|
127
|
+
version: exports.semverSchema,
|
|
128
|
+
draft: zod_1.z.union([zod_1.z.boolean(), zod_1.z.object({ title: zod_1.z.string().optional(), message: zod_1.z.string() })]).optional(),
|
|
129
|
+
badges: zod_1.z.array(exports.badgeSchema).optional(),
|
|
130
|
+
owners: zod_1.z.array(exports.ownerReferenceSchema).optional(),
|
|
131
|
+
schemaPath: zod_1.z.string().optional(),
|
|
132
|
+
sidebar: exports.sidebarSchema,
|
|
133
|
+
repository: exports.repositorySchema.optional(),
|
|
134
|
+
specifications: exports.specificationSchema.optional(),
|
|
135
|
+
hidden: zod_1.z.boolean().optional(),
|
|
136
|
+
resourceGroups: exports.resourceGroupSchema,
|
|
137
|
+
styles: exports.stylesSchema,
|
|
138
|
+
deprecated: exports.deprecatedSchema.optional(),
|
|
139
|
+
visualiser: zod_1.z.boolean().optional(),
|
|
140
|
+
versions: zod_1.z.array(zod_1.z.string()).optional(),
|
|
141
|
+
latestVersion: zod_1.z.string().optional(),
|
|
142
|
+
catalog: exports.catalogMetadataSchema,
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=common.js.map
|