@scalar/cli 2.1.0 → 2.5.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 +28 -24
- package/chunks/{action-CYP4VDK3.js → action-37EV4UHW.js} +12 -35
- package/chunks/{action-MENXFJH3.js → action-4XI7XJR4.js} +9 -9
- package/chunks/{action-H5OHT2GV.js → action-5IU77OII.js} +7 -3
- package/chunks/{action-STIEAXOE.js → action-B3KKREWQ.js} +16 -5
- package/chunks/{action-BYZUBXVB.js → action-CH24QGTE.js} +8 -4
- package/chunks/action-F3UX5E3M.js +522 -0
- package/chunks/{action-GB6DM53B.js → action-FDB7NEOK.js} +21 -10
- package/chunks/action-FIXBOJEW.js +244 -0
- package/chunks/{action-DFKHSDFV.js → action-G26LSVZ7.js} +7 -3
- package/chunks/{action-Q5UJ32D6.js → action-H3RTILLM.js} +1 -1
- package/chunks/{action-GEBRPNRT.js → action-HGBBV353.js} +15 -16
- package/chunks/{action-5R5FDF6S.js → action-IUE4IOWO.js} +67 -22
- package/chunks/{action-TPBKPHNS.js → action-JZLZ7ZAD.js} +22 -22
- package/chunks/action-LA6KVAXQ.js +374 -0
- package/chunks/{action-PVDDRIM6.js → action-M7RQKBSB.js} +65 -26
- package/chunks/{action-F4Y6Q2VB.js → action-MSLBC2SO.js} +21 -21
- package/chunks/{action-BNEGJBUH.js → action-NVSZT2ZD.js} +8 -9
- package/chunks/{action-ANU5HGC4.js → action-OGQSTRMX.js} +17 -14
- package/chunks/{action-CLSD7O2R.js → action-PAGJ5PWC.js} +10 -10
- package/chunks/action-QE2ZQQX7.js +250 -0
- package/chunks/{action-HD2T6BFJ.js → action-QPUSPD5M.js} +10 -10
- package/chunks/{action-45OGQB2M.js → action-R7IMFHQ5.js} +17 -8
- package/chunks/{action-UDZUUJSI.js → action-SH4UUXPL.js} +18 -7
- package/chunks/action-SNLCIBQC.js +84 -0
- package/chunks/{action-C5VB4ITT.js → action-SQG3JAII.js} +36 -18
- package/chunks/action-UZQJNYK4.js +18 -0
- package/chunks/{action-HNKM3Q65.js → action-VC4DCVST.js} +17 -14
- package/chunks/{action-BMFXENMX.js → action-VTVFY2MP.js} +39 -34
- package/chunks/{action-TZ5KGAQT.js → action-WFWYGY7O.js} +17 -14
- package/chunks/{action-W5BATF4Q.js → action-XMNX5ZYT.js} +24 -24
- package/chunks/{agent-XGLOHXNA.js → agent-HCQRMHQ5.js} +25 -5
- package/chunks/asyncapi-QM76O55R.js +105 -0
- package/chunks/{build.action-LKOILPA6.js → build.action-P7FCIMYU.js} +22 -22
- package/chunks/{chunk-23I5PKZZ.js → chunk-24WAOKGG.js} +32 -5
- package/chunks/chunk-3L6DLIXJ.js +25530 -0
- package/chunks/chunk-3ZJYGGAA.js +30 -0
- package/chunks/{chunk-ZTVWAKNJ.js → chunk-4NHMAG6F.js} +1 -1
- package/chunks/{chunk-IX7LJ3AD.js → chunk-4ORL4MST.js} +2 -3
- package/chunks/{chunk-OAXFCOJV.js → chunk-4ZDQXWBT.js} +2 -1
- package/chunks/{chunk-ASMHW5AY.js → chunk-6ZMT63IV.js} +1 -1
- package/chunks/{chunk-P2VH7DOC.js → chunk-7AGLC7WV.js} +6 -6
- package/chunks/{chunk-SXYALPYK.js → chunk-AO3F5XWR.js} +498 -60
- package/chunks/{chunk-B6QZJWCQ.js → chunk-B2MHTD3R.js} +4 -6
- package/chunks/{chunk-4QS7SJTG.js → chunk-CISTON3A.js} +51 -36
- package/chunks/chunk-COBPBRQF.js +25 -0
- package/chunks/{chunk-2BSG2QHO.js → chunk-F467BYYR.js} +133 -20
- package/chunks/{chunk-TLFMATXR.js → chunk-GSGZHE26.js} +33 -25
- package/chunks/{chunk-UPUTMFD4.js → chunk-HCPN3KNF.js} +185 -13
- package/chunks/{chunk-P646T2WH.js → chunk-HPL3ZZ2P.js} +131 -13
- package/chunks/{chunk-H2WRMLYY.js → chunk-IKT5F47M.js} +3571 -7
- package/chunks/{chunk-AHWWJ3MD.js → chunk-K4DTP5TV.js} +1 -1
- package/chunks/{chunk-TQ5XC2E3.js → chunk-LFU5ZUAP.js} +77 -11
- package/chunks/{chunk-5BISXQX4.js → chunk-M37TP6U2.js} +11 -13
- package/chunks/chunk-OQKDBLOZ.js +741 -0
- package/chunks/chunk-P7H7GY5A.js +14 -0
- package/chunks/{chunk-47Y4L5IT.js → chunk-PBXZN65A.js} +1031 -481
- package/chunks/{chunk-HQKBZOYU.js → chunk-PT5TI77I.js} +3 -3
- package/chunks/chunk-Q7DOQHZN.js +404 -0
- package/chunks/{chunk-X4QLDBB5.js → chunk-T5HJUAWB.js} +24 -3
- package/chunks/{chunk-NUXPNUSS.js → chunk-UGGNHILG.js} +1 -1
- package/chunks/{chunk-4DGQIAJX.js → chunk-VNYE4R7N.js} +154 -14
- package/chunks/{chunk-KWOL7A6J.js → chunk-X5T526CE.js} +2 -2
- package/chunks/chunk-XCSR4RIT.js +210 -0
- package/chunks/{chunk-SHSHFGA7.js → chunk-Z2KMGFE6.js} +4 -6
- package/chunks/{create.action-FFQLBSJH.js → create.action-HDD2WUON.js} +22 -22
- package/chunks/{delete.action-STHQHP4F.js → delete.action-7GOZY7ID.js} +22 -22
- package/chunks/{delete.action-QNN3LC2F.js → delete.action-VE66JFDS.js} +22 -22
- package/chunks/{get.action-OTKYOP3Z.js → get.action-2745EB4N.js} +15 -16
- package/chunks/{list.action-KDM5RHEH.js → list.action-3VTXQJRA.js} +19 -19
- package/chunks/{list.action-6I5EZAVB.js → list.action-4QDCZLSZ.js} +22 -22
- package/chunks/{publish.action-PODTVRXS.js → publish.action-ULQLZKWU.js} +44 -36
- package/chunks/{update.action-KMD4ZM75.js → update.action-6QEFP7NA.js} +22 -22
- package/chunks/{update.action-4F6STTEQ.js → update.action-OROQSP2S.js} +22 -22
- package/docs.html +104 -103
- package/index.js +84 -68
- package/package.json +16 -12
- package/chunks/action-CCW66QJN.js +0 -72
- package/chunks/action-CQ56FVES.js +0 -65
- package/chunks/action-JOSVV6YA.js +0 -71
- package/chunks/action-P7LN6FGY.js +0 -13
- package/chunks/action-R6ZZO26F.js +0 -299
- package/chunks/action-TWFJNQ2R.js +0 -95
- package/chunks/chunk-5BPPGTUU.js +0 -463
- package/chunks/chunk-DOVIWNKQ.js +0 -108
- package/chunks/chunk-ISGLWBXZ.js +0 -4265
- package/chunks/chunk-T7MDADON.js +0 -17
- package/chunks/chunk-VTYTPSXO.js +0 -161
package/README.md
CHANGED
|
@@ -171,18 +171,18 @@ Options:
|
|
|
171
171
|
|
|
172
172
|
Commands:
|
|
173
173
|
bundle [options] [file|url] Bundle an OpenAPI document by resolving all references and external dependencies
|
|
174
|
-
split [options] [file|url] Split
|
|
175
|
-
join [options] <files...> Merge multiple OpenAPI documents into a single unified document
|
|
176
|
-
format [options] [file|url] Format an OpenAPI file
|
|
174
|
+
split [options] [file|url] Split OpenAPI or AsyncAPI documents into small chunks
|
|
175
|
+
join [options] <files...> Merge multiple OpenAPI or AsyncAPI documents into a single unified document
|
|
176
|
+
format [options] [file|url] Format an OpenAPI or AsyncAPI file
|
|
177
177
|
convert [options] [file|url] Convert a Postman collection to an OpenAPI document
|
|
178
178
|
markdown [options] [file|url] Generate Markdown from an OpenAPI file
|
|
179
|
-
mock [options] [file|url] Mock an API
|
|
180
|
-
serve [options] [file|url] Serve an API Reference from an OpenAPI file
|
|
181
|
-
share [options] [file] Share an OpenAPI file
|
|
182
|
-
validate [file|url] Validate an OpenAPI file
|
|
179
|
+
mock [options] [file|url] Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels
|
|
180
|
+
serve [options] [file|url] Serve an API Reference from an OpenAPI or AsyncAPI file
|
|
181
|
+
share [options] [file] Share an OpenAPI or AsyncAPI file
|
|
182
|
+
validate [file|url] Validate an OpenAPI or AsyncAPI file
|
|
183
183
|
void [options] Boot a server to mirror HTTP requests
|
|
184
|
-
lint [options] [file|url] Lint your OpenAPI file using spectral rules
|
|
185
|
-
upgrade [options] [file|url] Upgrade OpenAPI document to version 3.1
|
|
184
|
+
lint [options] [file|url] Lint your OpenAPI or AsyncAPI file using spectral rules
|
|
185
|
+
upgrade [options] [file|url] Upgrade an OpenAPI or AsyncAPI document to version 3.1
|
|
186
186
|
help [command] display help for command
|
|
187
187
|
```
|
|
188
188
|
|
|
@@ -204,13 +204,16 @@ Options:
|
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
#### split
|
|
207
|
+
|
|
208
|
+
Splits AsyncAPI channels, operations, messages, and reusable components (including payload schemas) into JSON chunks. AsyncAPI versions are preserved, including 2.6, 3.0, and 3.1; splitting does not upgrade the document or add Scalar navigation metadata. Use `scalar document upgrade` separately to normalize versions. Nested external references are bundled relative to their source files or URLs, and chunk references resolve relative to the generated files. Both relative and absolute output directories are supported. The entry point is `out.json`.
|
|
209
|
+
|
|
207
210
|
```
|
|
208
211
|
Usage: scalar document split [options] [file|url]
|
|
209
212
|
|
|
210
|
-
Split
|
|
213
|
+
Split OpenAPI or AsyncAPI documents into small chunks
|
|
211
214
|
|
|
212
215
|
Arguments:
|
|
213
|
-
file|url Path to OpenAPI file or URL to split
|
|
216
|
+
file|url Path to OpenAPI or AsyncAPI file or URL to split
|
|
214
217
|
|
|
215
218
|
Options:
|
|
216
219
|
-o, --output <path> Path to save the chunks
|
|
@@ -221,10 +224,10 @@ Options:
|
|
|
221
224
|
```
|
|
222
225
|
Usage: scalar document join [options] <files...>
|
|
223
226
|
|
|
224
|
-
Merge multiple OpenAPI documents into a single unified document
|
|
227
|
+
Merge multiple OpenAPI or AsyncAPI documents into a single unified document
|
|
225
228
|
|
|
226
229
|
Arguments:
|
|
227
|
-
files Paths to the OpenAPI files to merge
|
|
230
|
+
files Paths to the OpenAPI or AsyncAPI files to merge
|
|
228
231
|
|
|
229
232
|
Options:
|
|
230
233
|
--output -o <file> Path to save the merged output file
|
|
@@ -236,7 +239,7 @@ Options:
|
|
|
236
239
|
```
|
|
237
240
|
Usage: scalar document format [options] [file|url]
|
|
238
241
|
|
|
239
|
-
Format an OpenAPI file
|
|
242
|
+
Format an OpenAPI or AsyncAPI file
|
|
240
243
|
|
|
241
244
|
Arguments:
|
|
242
245
|
file|url File or URL to format
|
|
@@ -279,10 +282,10 @@ Options:
|
|
|
279
282
|
```
|
|
280
283
|
Usage: scalar document mock [options] [file|url]
|
|
281
284
|
|
|
282
|
-
Mock an API
|
|
285
|
+
Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels
|
|
283
286
|
|
|
284
287
|
Arguments:
|
|
285
|
-
file|url OpenAPI file or URL to mock
|
|
288
|
+
file|url OpenAPI or AsyncAPI file or URL to mock
|
|
286
289
|
|
|
287
290
|
Options:
|
|
288
291
|
-w, --watch watch the file for changes
|
|
@@ -295,10 +298,10 @@ Options:
|
|
|
295
298
|
```
|
|
296
299
|
Usage: scalar document serve [options] [file|url]
|
|
297
300
|
|
|
298
|
-
Serve an API Reference from an OpenAPI file
|
|
301
|
+
Serve an API Reference from an OpenAPI or AsyncAPI file
|
|
299
302
|
|
|
300
303
|
Arguments:
|
|
301
|
-
file|url OpenAPI file or URL to show the reference for
|
|
304
|
+
file|url OpenAPI or AsyncAPI file or URL to show the reference for
|
|
302
305
|
|
|
303
306
|
Options:
|
|
304
307
|
-w, --watch watch the file for changes
|
|
@@ -311,7 +314,7 @@ Options:
|
|
|
311
314
|
```
|
|
312
315
|
Usage: scalar document share [options] [file]
|
|
313
316
|
|
|
314
|
-
Share an OpenAPI file
|
|
317
|
+
Share an OpenAPI or AsyncAPI file
|
|
315
318
|
|
|
316
319
|
Arguments:
|
|
317
320
|
file file to share
|
|
@@ -325,7 +328,7 @@ Options:
|
|
|
325
328
|
```
|
|
326
329
|
Usage: scalar document validate [options] [file|url]
|
|
327
330
|
|
|
328
|
-
Validate an OpenAPI file
|
|
331
|
+
Validate an OpenAPI or AsyncAPI file
|
|
329
332
|
|
|
330
333
|
Arguments:
|
|
331
334
|
file|url File or URL to validate
|
|
@@ -350,10 +353,10 @@ Options:
|
|
|
350
353
|
```
|
|
351
354
|
Usage: scalar document lint [options] [file|url]
|
|
352
355
|
|
|
353
|
-
Lint your OpenAPI file using spectral rules
|
|
356
|
+
Lint your OpenAPI or AsyncAPI file using spectral rules
|
|
354
357
|
|
|
355
358
|
Arguments:
|
|
356
|
-
file|url OpenAPI file path or url
|
|
359
|
+
file|url OpenAPI or AsyncAPI file path or url
|
|
357
360
|
|
|
358
361
|
Options:
|
|
359
362
|
-r, --rule <file|url> Rule path or url
|
|
@@ -364,10 +367,10 @@ Options:
|
|
|
364
367
|
```
|
|
365
368
|
Usage: scalar document upgrade [options] [file|url]
|
|
366
369
|
|
|
367
|
-
Upgrade OpenAPI document to version 3.1
|
|
370
|
+
Upgrade an OpenAPI or AsyncAPI document to version 3.1
|
|
368
371
|
|
|
369
372
|
Arguments:
|
|
370
|
-
file|url File or URL to
|
|
373
|
+
file|url File or URL to upgrade
|
|
371
374
|
|
|
372
375
|
Options:
|
|
373
376
|
-o, --output <file> Path to save the upgraded output file
|
|
@@ -819,6 +822,7 @@ Options:
|
|
|
819
822
|
--namespace <namespace> Scalar team namespace
|
|
820
823
|
--version <version> API version (e.g. 0.1.0)
|
|
821
824
|
--private Make API private (default: false)
|
|
825
|
+
--force Force override an existing version (default: false)
|
|
822
826
|
--bundle Bundle all external references before uploading
|
|
823
827
|
--treeShake Remove unused components from the bundled document
|
|
824
828
|
--urlMap Generate a map of resolved URLs when bundling the document
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
createError,
|
|
4
|
+
displayError
|
|
5
|
+
} from "./chunk-3ZJYGGAA.js";
|
|
2
6
|
import {
|
|
3
7
|
readAndParseConfig,
|
|
4
8
|
renderConfigError
|
|
5
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7AGLC7WV.js";
|
|
6
10
|
import {
|
|
7
11
|
CONFIG_FILE_DEFAULT,
|
|
8
12
|
findConfig,
|
|
9
13
|
legacyTo2_0_0
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-5BPPGTUU.js";
|
|
12
|
-
import "./chunk-4QS7SJTG.js";
|
|
13
|
-
import "./chunk-VTYTPSXO.js";
|
|
14
|
-
import "./chunk-TLFMATXR.js";
|
|
14
|
+
} from "./chunk-PBXZN65A.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigVersion
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-H2WRMLYY.js";
|
|
17
|
+
} from "./chunk-OQKDBLOZ.js";
|
|
19
18
|
import "./chunk-K74E42RV.js";
|
|
19
|
+
import "./chunk-CISTON3A.js";
|
|
20
|
+
import "./chunk-Q7DOQHZN.js";
|
|
20
21
|
import {
|
|
21
22
|
output
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-T5HJUAWB.js";
|
|
24
|
+
import "./chunk-GSGZHE26.js";
|
|
25
|
+
import "./chunk-IKT5F47M.js";
|
|
23
26
|
import "./chunk-3MZYUBJ6.js";
|
|
24
27
|
|
|
25
28
|
// src/domains/project/upgrade/action.ts
|
|
@@ -28,32 +31,6 @@ import path from "node:path";
|
|
|
28
31
|
import { text } from "@clack/prompts";
|
|
29
32
|
import as from "ansis";
|
|
30
33
|
import { n } from "neverpanic";
|
|
31
|
-
|
|
32
|
-
// src/errors.ts
|
|
33
|
-
function createError(code, detail) {
|
|
34
|
-
return {
|
|
35
|
-
code,
|
|
36
|
-
detail
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function displayError(error, fallback = "Unknown error occurred. Please contact support@scalar.com") {
|
|
40
|
-
try {
|
|
41
|
-
if (error instanceof Error) {
|
|
42
|
-
return error.message;
|
|
43
|
-
}
|
|
44
|
-
if (typeof error === "object") {
|
|
45
|
-
return JSON.stringify(error);
|
|
46
|
-
}
|
|
47
|
-
if (typeof error === "string") {
|
|
48
|
-
return error;
|
|
49
|
-
}
|
|
50
|
-
return fallback;
|
|
51
|
-
} catch {
|
|
52
|
-
return fallback;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/domains/project/upgrade/action.ts
|
|
57
34
|
async function upgradeAction(__configPath) {
|
|
58
35
|
const configPath = __configPath || findConfig() || await text({
|
|
59
36
|
message: "Where is your configuration file located?",
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
generateAccessByPersonalToken,
|
|
9
9
|
setAuthData,
|
|
10
10
|
tokenResponseSchema
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-M37TP6U2.js";
|
|
12
12
|
import {
|
|
13
13
|
config
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import
|
|
18
|
-
external_exports
|
|
19
|
-
} from "./chunk-H2WRMLYY.js";
|
|
20
|
-
import "./chunk-IX7LJ3AD.js";
|
|
14
|
+
} from "./chunk-4ZDQXWBT.js";
|
|
15
|
+
import "./chunk-VNYE4R7N.js";
|
|
16
|
+
import "./chunk-OQKDBLOZ.js";
|
|
17
|
+
import "./chunk-4ORL4MST.js";
|
|
21
18
|
import {
|
|
22
19
|
output
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-T5HJUAWB.js";
|
|
21
|
+
import {
|
|
22
|
+
external_exports
|
|
23
|
+
} from "./chunk-IKT5F47M.js";
|
|
24
24
|
import "./chunk-3MZYUBJ6.js";
|
|
25
25
|
|
|
26
26
|
// src/domains/auth/login/action.ts
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getFileOrUrl
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-24WAOKGG.js";
|
|
5
5
|
import {
|
|
6
6
|
require_dist
|
|
7
7
|
} from "./chunk-K74E42RV.js";
|
|
8
|
+
import "./chunk-CISTON3A.js";
|
|
9
|
+
import "./chunk-Q7DOQHZN.js";
|
|
8
10
|
import {
|
|
9
11
|
isYamlFileName
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4ORL4MST.js";
|
|
11
13
|
import {
|
|
12
14
|
output
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-T5HJUAWB.js";
|
|
16
|
+
import "./chunk-GSGZHE26.js";
|
|
17
|
+
import "./chunk-IKT5F47M.js";
|
|
14
18
|
import {
|
|
15
19
|
__toESM
|
|
16
20
|
} from "./chunk-3MZYUBJ6.js";
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
isAsyncApiDocument
|
|
4
|
+
} from "./chunk-24WAOKGG.js";
|
|
5
|
+
import "./chunk-CISTON3A.js";
|
|
6
|
+
import "./chunk-Q7DOQHZN.js";
|
|
7
|
+
import "./chunk-4ORL4MST.js";
|
|
2
8
|
import {
|
|
3
9
|
output
|
|
4
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-T5HJUAWB.js";
|
|
11
|
+
import "./chunk-GSGZHE26.js";
|
|
12
|
+
import "./chunk-IKT5F47M.js";
|
|
5
13
|
import "./chunk-3MZYUBJ6.js";
|
|
6
14
|
|
|
7
15
|
// src/domains/document/validate/action.ts
|
|
8
16
|
import as from "ansis";
|
|
9
17
|
import prettyjson from "prettyjson";
|
|
18
|
+
import { validate as validateAsyncApi } from "@scalar/asyncapi-validator";
|
|
10
19
|
import { bundle } from "@scalar/json-magic/bundle";
|
|
11
20
|
import { fetchUrls, readFiles } from "@scalar/json-magic/bundle/plugins/node";
|
|
12
|
-
import { validate } from "@scalar/openapi-
|
|
21
|
+
import { validate as validateOpenApi } from "@scalar/openapi-validator";
|
|
13
22
|
async function validateAction(inputArgument) {
|
|
14
23
|
const startTime = performance.now();
|
|
15
24
|
if (!inputArgument) {
|
|
@@ -20,12 +29,14 @@ async function validateAction(inputArgument) {
|
|
|
20
29
|
treeShake: false,
|
|
21
30
|
depth: -1
|
|
22
31
|
});
|
|
23
|
-
const
|
|
32
|
+
const isAsyncApi = isAsyncApiDocument(document);
|
|
33
|
+
const specification = isAsyncApi ? "AsyncAPI" : "OpenAPI";
|
|
34
|
+
const result = isAsyncApi ? validateAsyncApi(document) : validateOpenApi(document);
|
|
24
35
|
if (result.valid && result.version) {
|
|
25
36
|
const endTime = performance.now();
|
|
26
37
|
output.info().line(
|
|
27
38
|
as.green(
|
|
28
|
-
`Matches the
|
|
39
|
+
`Matches the ${specification} specification${as.white(` (${specification} ${as.bold(result.version)})`)}
|
|
29
40
|
`
|
|
30
41
|
)
|
|
31
42
|
).line(
|
|
@@ -37,7 +48,7 @@ async function validateAction(inputArgument) {
|
|
|
37
48
|
} else {
|
|
38
49
|
output.error().message(prettyjson.render(result.errors)).message(
|
|
39
50
|
as.red(
|
|
40
|
-
`File does not match the
|
|
51
|
+
`File does not match the ${specification} ${result.version ? `${result.version} ` : ""}specification.`
|
|
41
52
|
)
|
|
42
53
|
).message(
|
|
43
54
|
as.red(
|
|
@@ -2,20 +2,24 @@ import { createRequire as $$cR } from "node:module"; const require = $$cR(import
|
|
|
2
2
|
import {
|
|
3
3
|
measureTime
|
|
4
4
|
} from "./chunk-KHDYYVYF.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-24WAOKGG.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_FETCH_CONCURRENCY
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-K4DTP5TV.js";
|
|
9
9
|
import {
|
|
10
10
|
require_dist
|
|
11
11
|
} from "./chunk-K74E42RV.js";
|
|
12
|
+
import "./chunk-CISTON3A.js";
|
|
13
|
+
import "./chunk-Q7DOQHZN.js";
|
|
12
14
|
import {
|
|
13
15
|
isUrl,
|
|
14
16
|
isYamlFileName
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4ORL4MST.js";
|
|
16
18
|
import {
|
|
17
19
|
output
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-T5HJUAWB.js";
|
|
21
|
+
import "./chunk-GSGZHE26.js";
|
|
22
|
+
import "./chunk-IKT5F47M.js";
|
|
19
23
|
import {
|
|
20
24
|
__toESM
|
|
21
25
|
} from "./chunk-3MZYUBJ6.js";
|