@redocly/replay 0.31.0-next.4 → 0.31.0-next.6
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/{replay-AiChatProvider-DmFb_KEh.js → replay-AiChatProvider-CV9DUb_-.js} +6 -6
- package/dist/{replay-AiChatSqliteDBStorage-DPCC1JxA.js → replay-AiChatSqliteDBStorage-BFEyqvr8.js} +1 -1
- package/dist/{replay-AiPanel-Duce6bPI.js → replay-AiPanel-DmzGuuSQ.js} +26 -31
- package/dist/{replay-FileWatcher-CuDTvKR_.js → replay-FileWatcher-CIGL35HB.js} +2 -2
- package/dist/{replay-SemanticSearchService-UD-ISya0.js → replay-SemanticSearchService-CUfoNuvR.js} +1 -1
- package/dist/{replay-SqliteDBStorage-yz16M_Mv.js → replay-SqliteDBStorage-DrRaVJqC.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-D6ELx87H.js → replay-TauriFileSystemAdapter-Bwl7UUzV.js} +1 -1
- package/dist/{replay-TauriRootStorage-BBtrm1uU.js → replay-TauriRootStorage-D26SUyiD.js} +2 -2
- package/dist/{replay-agent-loop-X-3QP3_I.js → replay-agent-loop-CrimHDXe.js} +3 -3
- package/dist/{replay-ai-chat-mappers-Cn5M5bfQ.js → replay-ai-chat-mappers-C8SbEqZQ.js} +1 -1
- package/dist/{replay-create-model-I01u52en.js → replay-create-model-Bb6G3SMI.js} +16108 -17055
- package/dist/{replay-db-_AqPojpS.js → replay-db-D6OPItrR.js} +1 -1
- package/dist/{replay-external-resolver-B9jDVIjA.js → replay-external-resolver-BivDnyzd.js} +2 -2
- package/dist/replay-index-CEqJEwMV.js +917 -0
- package/dist/{replay-index-NeiVLZKP.js → replay-index-D9fqcKuo.js} +1 -1
- package/dist/{replay-index-vq6dCDYU.js → replay-index-DBOkHLJ1.js} +1 -1
- package/dist/{replay-index-5x470UiG.js → replay-index-DpNZqtfa.js} +1 -1
- package/dist/{replay-index-Bd6nBD-g.js → replay-index-DxQ-bRJ-.js} +24248 -23603
- package/dist/replay-index-Dzrhrnzp.js +4 -0
- package/dist/{replay-lint-Bag9E2VE.js → replay-lint-B1carxC2.js} +6569 -5787
- package/dist/{replay-lint-graphql-Dy_zzWSu.js → replay-lint-graphql-DxiD9Apj.js} +2 -2
- package/dist/{replay-periodic-revalidation-ZF9THDF0.js → replay-periodic-revalidation-Z92wFdAa.js} +1 -1
- package/dist/{replay-resolve-C-3GwDKX.js → replay-resolve-KCayE22f.js} +886 -866
- package/dist/{replay-respect-run-CGAeb4ct.js → replay-respect-run-CJZW6ZvP.js} +123 -123
- package/dist/{replay-tauri-path-JPWbAoK0.js → replay-tauri-path-goqCdKKW.js} +2 -2
- package/dist/{replay-useAiChatQueries-B8RKvZ6W.js → replay-useAiChatQueries-BHjMUusg.js} +83 -81
- package/dist/{replay-validate-key-BA81wxhp.js → replay-validate-key-DpxgR65_.js} +2 -2
- package/dist/replay.d.ts +25 -10
- package/dist/replay.js +1 -1
- package/package.json +6 -6
- package/dist/replay-index-BW65Uxno.js +0 -4
- package/dist/replay-index-CryjpI5N.js +0 -576
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/replay",
|
|
3
|
-
"version": "0.31.0-next.
|
|
3
|
+
"version": "0.31.0-next.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/replay.js",
|
|
6
6
|
"module": "./dist/replay.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@redocly/theme": "0.72.0-next.
|
|
18
|
+
"@redocly/theme": "0.72.0-next.5",
|
|
19
19
|
"@tanstack/react-query": "5.62.3",
|
|
20
20
|
"react": "^19.2.7",
|
|
21
21
|
"react-dom": "^19.2.7",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@lezer/highlight": "^1.1.6",
|
|
51
51
|
"@noble/hashes": "^1.8.0",
|
|
52
52
|
"@opentelemetry/api": "1.9.1",
|
|
53
|
-
"@redocly/openapi-core": "2.
|
|
53
|
+
"@redocly/openapi-core": "2.72.1",
|
|
54
54
|
"@redocly/replay-asyncapi-sdk": "0.0.1",
|
|
55
|
-
"@redocly/respect-core": "2.
|
|
56
|
-
"@redocly/vscode-json-languageservice": "^3.4.
|
|
55
|
+
"@redocly/respect-core": "2.72.1",
|
|
56
|
+
"@redocly/vscode-json-languageservice": "^3.4.10",
|
|
57
57
|
"@redocly/tooling-test-utils": "0.0.0",
|
|
58
58
|
"@tauri-apps/api": "2.4.1",
|
|
59
59
|
"@tauri-apps/plugin-deep-link": "^2.4.5",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"vite-tsconfig-paths": "4.3.2",
|
|
102
102
|
"vitest": "4.1.11",
|
|
103
103
|
"yaml": "^2.0.0",
|
|
104
|
-
"zod": "^
|
|
104
|
+
"zod": "^4.6.6"
|
|
105
105
|
},
|
|
106
106
|
"nx": {
|
|
107
107
|
"targets": {
|
|
@@ -1,576 +0,0 @@
|
|
|
1
|
-
import { a6 as T, a7 as f } from "./replay-index-Bd6nBD-g.js";
|
|
2
|
-
import { a as I, g as x, d as z, o as P, A as L, S as V, N as $, n as U, w as G, D as M, _ as Y, c as b, l as D } from "./replay-lint-Bag9E2VE.js";
|
|
3
|
-
import { b as he, e as ue, f as Ee, h as ve, j as Se, C as Te, k as xe, m as be, p as Oe, q as _e, r as Re, H as Ne, I as Ie, s as Pe, O as De, t as ke, u as Ce, v as je, x as we, y as Fe, P as ze, z as Le, B as Ve, E as $e, F as Ue, G as Ge, J as Me, K as Ye, L as Be, M as Ke, Q as We, R as He, T as Je, U as qe, V as Xe, W as Qe, X as Ze, Y as Ae, Z as es, $ as ss, a0 as ts, a1 as ns, a2 as as, a3 as rs, a4 as os, a5 as is, a6 as ls, a7 as cs, a8 as ps, a9 as ys, $ as fs, aa as ms } from "./replay-lint-Bag9E2VE.js";
|
|
4
|
-
import { i as B, B as E, n as K, a as W, m as k } from "./replay-resolve-C-3GwDKX.js";
|
|
5
|
-
import { R as gs, S as hs, Y as us, e as Es, g as vs, b as Ss, c as Ts, d as xs, f as bs, h as Os, j as _s, p as Rs, r as Ns, k as Is, s as Ps, u as Ds } from "./replay-resolve-C-3GwDKX.js";
|
|
6
|
-
function oe(e) {
|
|
7
|
-
return (T.extname(e) === ".yaml" || T.extname(e) === ".yml") && !1;
|
|
8
|
-
}
|
|
9
|
-
function ie(e) {
|
|
10
|
-
return f(e) && !I(e);
|
|
11
|
-
}
|
|
12
|
-
async function le(e) {
|
|
13
|
-
return new Promise((s) => setTimeout(s, e));
|
|
14
|
-
}
|
|
15
|
-
function ce(e) {
|
|
16
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
17
|
-
}
|
|
18
|
-
const v = "type", O = ["api-description", "api-operation", "data-schema"];
|
|
19
|
-
function H(e, s) {
|
|
20
|
-
const { ctx: t } = x("EntityFileDefault", s), { ctx: a, discriminatorResolver: n } = x("EntityFile", e);
|
|
21
|
-
return {
|
|
22
|
-
entityTypes: {
|
|
23
|
-
...t,
|
|
24
|
-
...a,
|
|
25
|
-
EntityFileArray: {
|
|
26
|
-
properties: {},
|
|
27
|
-
items: (l) => {
|
|
28
|
-
if (f(l)) {
|
|
29
|
-
const c = l[v];
|
|
30
|
-
if (!c)
|
|
31
|
-
return "Entity";
|
|
32
|
-
const o = n?.(l, c);
|
|
33
|
-
if (o && typeof o == "string")
|
|
34
|
-
return o;
|
|
35
|
-
}
|
|
36
|
-
return "Entity";
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
discriminatorResolver: n
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function i(e, s) {
|
|
44
|
-
if (B(s.parent))
|
|
45
|
-
return;
|
|
46
|
-
const t = s.key.toString(), a = e.counts ??= {};
|
|
47
|
-
a[t] = (a[t] ?? 0) + 1;
|
|
48
|
-
}
|
|
49
|
-
function S(e) {
|
|
50
|
-
for (const n of Object.values(e))
|
|
51
|
-
n.items && (n.total = n.items.size);
|
|
52
|
-
const { xExtensions: s } = e, t = s.counts ?? {}, a = Object.keys(t).sort();
|
|
53
|
-
s.total = a.length, s.counts = Object.fromEntries(a.map((n) => [n, t[n]]));
|
|
54
|
-
}
|
|
55
|
-
const pe = (e) => ({
|
|
56
|
-
SpecExtension: {
|
|
57
|
-
enter(s, t) {
|
|
58
|
-
i(e.xExtensions, t);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
XCodeSampleList: {
|
|
62
|
-
enter(s, t) {
|
|
63
|
-
i(e.xExtensions, t);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
ExamplesMap: {
|
|
67
|
-
enter(s, t) {
|
|
68
|
-
t.key.toString() === "x-examples" && i(e.xExtensions, t);
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
EnumDescriptions: {
|
|
72
|
-
enter(s, t) {
|
|
73
|
-
i(e.xExtensions, t);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
TagGroups: {
|
|
77
|
-
enter(s, t) {
|
|
78
|
-
i(e.xExtensions, t);
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
Logo: {
|
|
82
|
-
enter(s, t) {
|
|
83
|
-
i(e.xExtensions, t);
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
XServerList: {
|
|
87
|
-
enter(s, t) {
|
|
88
|
-
i(e.xExtensions, t);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
XUsePkce: {
|
|
92
|
-
enter(s, t) {
|
|
93
|
-
i(e.xExtensions, t);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
Operation: {
|
|
97
|
-
enter(s, t) {
|
|
98
|
-
t.key.toString() === "x-query" && i(e.xExtensions, t);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
ExternalDocs: {
|
|
102
|
-
leave() {
|
|
103
|
-
e.externalDocs.total++;
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
ref: {
|
|
107
|
-
enter(s) {
|
|
108
|
-
e.refs.items.add(s.$ref);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
Tag: {
|
|
112
|
-
leave(s) {
|
|
113
|
-
e.tags.items.add(s.name);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
Link: {
|
|
117
|
-
leave(s) {
|
|
118
|
-
e.links.items.add(s.operationId);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
WebhooksMap: {
|
|
122
|
-
enter(s, t) {
|
|
123
|
-
t.key.toString() === "x-webhooks" && i(e.xExtensions, t);
|
|
124
|
-
},
|
|
125
|
-
Operation: {
|
|
126
|
-
leave(s) {
|
|
127
|
-
if (e.webhooks.total++, s.tags)
|
|
128
|
-
for (const t of s.tags)
|
|
129
|
-
e.tags.items.add(t);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
Paths: {
|
|
134
|
-
PathItem: {
|
|
135
|
-
leave() {
|
|
136
|
-
e.pathItems.total++;
|
|
137
|
-
},
|
|
138
|
-
Operation: {
|
|
139
|
-
leave(s) {
|
|
140
|
-
if (e.operations.total++, s.tags)
|
|
141
|
-
for (const t of s.tags)
|
|
142
|
-
e.tags.items.add(t);
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
Parameter: {
|
|
146
|
-
leave(s) {
|
|
147
|
-
e.parameters.items.add(s.name);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
NamedSchemas: {
|
|
153
|
-
Schema: {
|
|
154
|
-
leave() {
|
|
155
|
-
e.schemas.total++;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
Root: {
|
|
160
|
-
leave() {
|
|
161
|
-
S(e);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}), ye = (e) => ({
|
|
165
|
-
SpecExtension: {
|
|
166
|
-
enter(s, t) {
|
|
167
|
-
i(e.xExtensions, t);
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
ExternalDocs: {
|
|
171
|
-
leave() {
|
|
172
|
-
e.externalDocs.total++;
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
ref: {
|
|
176
|
-
enter(s) {
|
|
177
|
-
e.refs.items.add(s.$ref);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
Tag: {
|
|
181
|
-
leave(s) {
|
|
182
|
-
e.tags.items.add(s.name);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
ChannelMap: {
|
|
186
|
-
Channel: {
|
|
187
|
-
leave() {
|
|
188
|
-
e.channels.total++;
|
|
189
|
-
},
|
|
190
|
-
Operation: {
|
|
191
|
-
leave(s) {
|
|
192
|
-
if (e.operations.total++, s.tags)
|
|
193
|
-
for (const t of s.tags)
|
|
194
|
-
e.tags.items.add(t);
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
Parameter: {
|
|
198
|
-
leave(s, { key: t }) {
|
|
199
|
-
e.parameters.items.add(t.toString());
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
NamedSchemas: {
|
|
205
|
-
Schema: {
|
|
206
|
-
leave() {
|
|
207
|
-
e.schemas.total++;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
Root: {
|
|
212
|
-
leave() {
|
|
213
|
-
S(e);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}), fe = (e) => ({
|
|
217
|
-
SpecExtension: {
|
|
218
|
-
enter(s, t) {
|
|
219
|
-
i(e.xExtensions, t);
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
ExternalDocs: {
|
|
223
|
-
leave() {
|
|
224
|
-
e.externalDocs.total++;
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
ref: {
|
|
228
|
-
enter(s) {
|
|
229
|
-
e.refs.items.add(s.$ref);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
Tag: {
|
|
233
|
-
leave(s) {
|
|
234
|
-
e.tags.items.add(s.name);
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
NamedChannels: {
|
|
238
|
-
Channel: {
|
|
239
|
-
leave() {
|
|
240
|
-
e.channels.total++;
|
|
241
|
-
},
|
|
242
|
-
Parameter: {
|
|
243
|
-
leave(s, { key: t }) {
|
|
244
|
-
e.parameters.items.add(t.toString());
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
NamedOperations: {
|
|
250
|
-
Operation: {
|
|
251
|
-
leave(s) {
|
|
252
|
-
if (e.operations.total++, s.tags)
|
|
253
|
-
for (const t of s.tags)
|
|
254
|
-
e.tags.items.add(t);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
NamedSchemas: {
|
|
259
|
-
Schema: {
|
|
260
|
-
leave() {
|
|
261
|
-
e.schemas.total++;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
Root: {
|
|
266
|
-
leave() {
|
|
267
|
-
S(e);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}), J = /^[a-z0-9]+(?:-[a-z0-9]+)*$/, _ = 2, R = 150, q = () => ({
|
|
271
|
-
any(e, { report: s, location: t }) {
|
|
272
|
-
if (f(e) && "key" in e) {
|
|
273
|
-
const a = e.key;
|
|
274
|
-
if (typeof a != "string") {
|
|
275
|
-
s({
|
|
276
|
-
message: "Entity `key` must be a string.",
|
|
277
|
-
location: t.child(["key"])
|
|
278
|
-
});
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
a.length < _ && s({
|
|
282
|
-
message: `Entity 'key' must be at least ${_} characters long.`,
|
|
283
|
-
location: t.child(["key"])
|
|
284
|
-
}), a.length > R && s({
|
|
285
|
-
message: `Entity 'key' must not exceed ${R} characters.`,
|
|
286
|
-
location: t.child(["key"])
|
|
287
|
-
}), J.test(a) || s({
|
|
288
|
-
message: "Entity `key` must contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen.",
|
|
289
|
-
location: t.child(["key"])
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
function N(e, s) {
|
|
295
|
-
const a = s.split("-").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join("") + e;
|
|
296
|
-
return Object.values(P).includes(a) ? a : e;
|
|
297
|
-
}
|
|
298
|
-
function X(e, s) {
|
|
299
|
-
const t = {};
|
|
300
|
-
for (const [a, n] of Object.entries(s))
|
|
301
|
-
if (C(a, n)) {
|
|
302
|
-
if (n.severity === "off")
|
|
303
|
-
continue;
|
|
304
|
-
t[a] = {
|
|
305
|
-
...ee(e, a, n)
|
|
306
|
-
};
|
|
307
|
-
} else
|
|
308
|
-
t[a] = n;
|
|
309
|
-
return t;
|
|
310
|
-
}
|
|
311
|
-
function Q(e) {
|
|
312
|
-
const s = {}, t = {};
|
|
313
|
-
for (const [a, n] of Object.entries(e))
|
|
314
|
-
if (C(a, n)) {
|
|
315
|
-
const r = n;
|
|
316
|
-
A(r) ? s[a] = r : t[a] = r;
|
|
317
|
-
} else
|
|
318
|
-
t[a] = n;
|
|
319
|
-
return { entityRules: s, apiRules: t };
|
|
320
|
-
}
|
|
321
|
-
function Z(e, s, t) {
|
|
322
|
-
if (!f(t.parsed) || !f(t.parsed.components))
|
|
323
|
-
return null;
|
|
324
|
-
const a = t.parsed.components, n = "schemas" in a ? a.schemas : void 0;
|
|
325
|
-
if (!n || !(e in n))
|
|
326
|
-
return null;
|
|
327
|
-
const r = n[e];
|
|
328
|
-
try {
|
|
329
|
-
const l = JSON.parse(s);
|
|
330
|
-
if (z(r, l))
|
|
331
|
-
return r;
|
|
332
|
-
} catch {
|
|
333
|
-
return null;
|
|
334
|
-
}
|
|
335
|
-
return null;
|
|
336
|
-
}
|
|
337
|
-
function C(e, s) {
|
|
338
|
-
return e.startsWith("rule/") && f(s);
|
|
339
|
-
}
|
|
340
|
-
function A(e) {
|
|
341
|
-
return Object.values(P).some((s) => e.subject.type === s);
|
|
342
|
-
}
|
|
343
|
-
function ee(e, s, t) {
|
|
344
|
-
const a = N(t.subject.type, e), n = t.where?.map((r) => ({
|
|
345
|
-
...r,
|
|
346
|
-
subject: {
|
|
347
|
-
...r.subject,
|
|
348
|
-
type: N(r.subject.type, e)
|
|
349
|
-
}
|
|
350
|
-
}));
|
|
351
|
-
return {
|
|
352
|
-
assertionId: s,
|
|
353
|
-
subject: {
|
|
354
|
-
...t.subject,
|
|
355
|
-
type: a
|
|
356
|
-
},
|
|
357
|
-
assertions: t.assertions,
|
|
358
|
-
...n && { where: n },
|
|
359
|
-
...t.message && { message: t.message },
|
|
360
|
-
...t.severity && { severity: t.severity }
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
async function se(e) {
|
|
364
|
-
const { document: s, entitySchema: t, entityDefaultSchema: a, severity: n, externalRefResolver: r = new E(), assertionConfig: l = {} } = e, c = {
|
|
365
|
-
problems: [],
|
|
366
|
-
specVersion: "entity",
|
|
367
|
-
visitorsData: {}
|
|
368
|
-
}, { entityTypes: o, discriminatorResolver: m } = H(t, a), p = K(o);
|
|
369
|
-
let y = p.Entity;
|
|
370
|
-
if (Array.isArray(s.parsed))
|
|
371
|
-
y = p.EntityFileArray;
|
|
372
|
-
else if (f(s.parsed)) {
|
|
373
|
-
const h = s.parsed[v];
|
|
374
|
-
if (!h)
|
|
375
|
-
y = p.Entity;
|
|
376
|
-
else {
|
|
377
|
-
const u = m?.(s.parsed, h);
|
|
378
|
-
u && typeof u == "string" && p[u] && (y = p[u]);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
const g = L(l), d = Array.isArray(g) ? g.map((h) => ({
|
|
382
|
-
severity: n || "error",
|
|
383
|
-
ruleId: "entity assertions",
|
|
384
|
-
visitor: h
|
|
385
|
-
})) : [
|
|
386
|
-
{
|
|
387
|
-
severity: n || "error",
|
|
388
|
-
ruleId: "entity assertions",
|
|
389
|
-
visitor: g
|
|
390
|
-
}
|
|
391
|
-
], j = [
|
|
392
|
-
{
|
|
393
|
-
severity: n || "error",
|
|
394
|
-
ruleId: "entity struct",
|
|
395
|
-
visitor: V()
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
severity: n || "error",
|
|
399
|
-
ruleId: "entity no-unresolved-refs",
|
|
400
|
-
visitor: $()
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
severity: n || "error",
|
|
404
|
-
ruleId: "entity key-valid",
|
|
405
|
-
visitor: q()
|
|
406
|
-
},
|
|
407
|
-
...d
|
|
408
|
-
], w = U(j, p), F = await W({
|
|
409
|
-
rootDocument: s,
|
|
410
|
-
rootType: y,
|
|
411
|
-
externalRefResolver: r
|
|
412
|
-
});
|
|
413
|
-
return G({
|
|
414
|
-
document: s,
|
|
415
|
-
rootType: y,
|
|
416
|
-
normalizedVisitors: w,
|
|
417
|
-
resolvedRefMap: F,
|
|
418
|
-
ctx: c
|
|
419
|
-
}), c.problems;
|
|
420
|
-
}
|
|
421
|
-
async function me(e, s, t) {
|
|
422
|
-
if (!s.rules)
|
|
423
|
-
throw new Error(`Scorecard level "${s.name}" has no rules defined.`);
|
|
424
|
-
const a = new E(), n = k(JSON.stringify(e, null, 2), "entity"), r = n.parsed[v], l = X(r || "unknown", s.rules), { entityRules: c, apiRules: o } = Q(l), m = await se({
|
|
425
|
-
document: n,
|
|
426
|
-
entitySchema: M,
|
|
427
|
-
entityDefaultSchema: Y,
|
|
428
|
-
externalRefResolver: a,
|
|
429
|
-
assertionConfig: c
|
|
430
|
-
});
|
|
431
|
-
if (O.includes(e.type)) {
|
|
432
|
-
if (Object.keys(o).length === 0)
|
|
433
|
-
return m;
|
|
434
|
-
if (!t)
|
|
435
|
-
throw new Error(`Document is required for entity type "${e.type}". Provide the source API document to lint API rules.`);
|
|
436
|
-
if (e.type === "data-schema" && e.metadata?.schema) {
|
|
437
|
-
Object.values(o).forEach((d) => {
|
|
438
|
-
if (f(d) && f(d.subject) && d.subject.type !== "Schema")
|
|
439
|
-
throw new Error(`API rules for "data-schema" entity must target Schema subject, but found "${d.subject.type}".`);
|
|
440
|
-
});
|
|
441
|
-
const y = Z(e.title, e.metadata.schema, t);
|
|
442
|
-
if (!y)
|
|
443
|
-
throw new Error(`Schema "${e.title}" not found in the document. Ensure the schema exists in components.schemas.`);
|
|
444
|
-
const g = await te({
|
|
445
|
-
schema: y,
|
|
446
|
-
schemaKey: e.title,
|
|
447
|
-
config: await b({
|
|
448
|
-
rules: o
|
|
449
|
-
}),
|
|
450
|
-
specType: e.metadata.specType,
|
|
451
|
-
sourceDocument: t,
|
|
452
|
-
externalRefResolver: a
|
|
453
|
-
});
|
|
454
|
-
return [...m, ...g];
|
|
455
|
-
}
|
|
456
|
-
const p = await D({
|
|
457
|
-
document: t,
|
|
458
|
-
externalRefResolver: a,
|
|
459
|
-
config: await b({
|
|
460
|
-
rules: o
|
|
461
|
-
})
|
|
462
|
-
});
|
|
463
|
-
return [...m, ...p];
|
|
464
|
-
} else if (!I(o))
|
|
465
|
-
throw new Error(`API rules are not supported for entity type "${e.type}". Only ${O.join(", ")} support API rules.`);
|
|
466
|
-
return m;
|
|
467
|
-
}
|
|
468
|
-
async function te(e) {
|
|
469
|
-
const { schema: s, schemaKey: t, config: a, sourceDocument: n, specType: r, externalRefResolver: l = new E(a.resolve) } = e, c = n.parsed, o = c[r], m = c.info, p = k(JSON.stringify({
|
|
470
|
-
[r]: o,
|
|
471
|
-
info: m,
|
|
472
|
-
components: {
|
|
473
|
-
schemas: {
|
|
474
|
-
[t]: s
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}, null, 2), n?.source.absoluteRef || `schema:${t}`);
|
|
478
|
-
return (await D({
|
|
479
|
-
document: p,
|
|
480
|
-
config: a,
|
|
481
|
-
externalRefResolver: l
|
|
482
|
-
})).filter((g) => g.location.some((d) => d.pointer?.includes(`/components/schemas/${t}`)));
|
|
483
|
-
}
|
|
484
|
-
export {
|
|
485
|
-
he as AbortFlowError,
|
|
486
|
-
ue as Arazzo1Types,
|
|
487
|
-
Ee as Arazzo1_1Types,
|
|
488
|
-
ve as AsyncApi2Types,
|
|
489
|
-
Se as AsyncApi3Types,
|
|
490
|
-
E as BaseResolver,
|
|
491
|
-
Te as CONFIG_BUNDLER_VISITOR_ID,
|
|
492
|
-
xe as CONFIG_FILE_NAME,
|
|
493
|
-
be as ConfigTypes,
|
|
494
|
-
Oe as ConfigValidationError,
|
|
495
|
-
_e as DEFAULT_CONFIG,
|
|
496
|
-
Re as DEFAULT_PROJECT_PLUGIN_PATHS,
|
|
497
|
-
Ne as HandledError,
|
|
498
|
-
Ie as IGNORE_BANNER,
|
|
499
|
-
Pe as IGNORE_FILE,
|
|
500
|
-
De as Oas2Types,
|
|
501
|
-
ke as Oas3Types,
|
|
502
|
-
Ce as Oas3_1Types,
|
|
503
|
-
je as Oas3_2Types,
|
|
504
|
-
we as OpenRpcTypes,
|
|
505
|
-
Fe as Overlay1Types,
|
|
506
|
-
ze as PLUGINS_COLLECTOR_VISITOR_ID,
|
|
507
|
-
gs as ResolveError,
|
|
508
|
-
hs as Source,
|
|
509
|
-
ye as StatsAsync2,
|
|
510
|
-
fe as StatsAsync3,
|
|
511
|
-
pe as StatsOAS,
|
|
512
|
-
us as YamlParseError,
|
|
513
|
-
Le as bundle,
|
|
514
|
-
Ve as bundleDocument,
|
|
515
|
-
$e as bundleFromString,
|
|
516
|
-
ce as capitalize,
|
|
517
|
-
Ue as clearPluginsCache,
|
|
518
|
-
b as createConfig,
|
|
519
|
-
Ge as createConfigTypes,
|
|
520
|
-
H as createEntityTypes,
|
|
521
|
-
z as dequal,
|
|
522
|
-
Me as detectSpec,
|
|
523
|
-
oe as doesYamlFileExist,
|
|
524
|
-
Es as escapePointerFragment,
|
|
525
|
-
Ye as findConfig,
|
|
526
|
-
Be as formatProblems,
|
|
527
|
-
Ke as getAstNodeByPointer,
|
|
528
|
-
We as getCodeframe,
|
|
529
|
-
vs as getDir,
|
|
530
|
-
He as getLineColLocation,
|
|
531
|
-
Je as getMajorSpecVersion,
|
|
532
|
-
qe as getPluginCacheVersion,
|
|
533
|
-
Xe as getTotals,
|
|
534
|
-
Qe as getTypes,
|
|
535
|
-
Ss as isAbsoluteUrl,
|
|
536
|
-
Ts as isBrowser,
|
|
537
|
-
I as isEmptyObject,
|
|
538
|
-
xs as isGraphqlRef,
|
|
539
|
-
bs as isMappingRef,
|
|
540
|
-
Ze as isNotEmptyArray,
|
|
541
|
-
ie as isNotEmptyObject,
|
|
542
|
-
f as isPlainObject,
|
|
543
|
-
B as isRef,
|
|
544
|
-
Ae as isString,
|
|
545
|
-
Os as isSupportedExtension,
|
|
546
|
-
_s as isTruthy,
|
|
547
|
-
es as keysOf,
|
|
548
|
-
ss as lint,
|
|
549
|
-
ts as lintConfig,
|
|
550
|
-
D as lintDocument,
|
|
551
|
-
se as lintEntityFile,
|
|
552
|
-
me as lintEntityWithScorecardLevel,
|
|
553
|
-
ns as lintFromString,
|
|
554
|
-
te as lintSchema,
|
|
555
|
-
as as loadConfig,
|
|
556
|
-
rs as loadIgnoreConfig,
|
|
557
|
-
os as logger,
|
|
558
|
-
k as makeDocumentFromString,
|
|
559
|
-
is as mapTypeToComponent,
|
|
560
|
-
K as normalizeTypes,
|
|
561
|
-
U as normalizeVisitors,
|
|
562
|
-
Rs as parseYaml,
|
|
563
|
-
le as pause,
|
|
564
|
-
ls as pluralize,
|
|
565
|
-
Ns as readFileFromUrl,
|
|
566
|
-
cs as regexFromString,
|
|
567
|
-
W as resolveDocument,
|
|
568
|
-
Is as resolvePath,
|
|
569
|
-
ps as resolvePlugins,
|
|
570
|
-
ys as slash,
|
|
571
|
-
Ps as stringifyYaml,
|
|
572
|
-
Ds as unescapePointerFragment,
|
|
573
|
-
fs as validate,
|
|
574
|
-
G as walkDocument,
|
|
575
|
-
ms as xmlEscape
|
|
576
|
-
};
|