@scalar/cli 2.17.0 → 2.18.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/README.md +77 -3
- package/chunks/{action-Y4L4OPPH.js → action-2WVJ2WEW.js} +15 -16
- package/chunks/{action-UOUS2G2B.js → action-4BDZ2CXP.js} +6 -7
- package/chunks/{action-52ZSECW2.js → action-5AXDB5VN.js} +14 -15
- package/chunks/{action-7PVWQJ7V.js → action-6I3TJLRO.js} +28 -26
- package/chunks/{action-MPBZUWQ2.js → action-6WZN63LT.js} +20 -19
- package/chunks/{action-5NYKJDBG.js → action-7GZGVTYI.js} +1067 -766
- package/chunks/{action-2Y6UTXAG.js → action-7ZCJAWI2.js} +5 -5
- package/chunks/{action-UWVZ6V7B.js → action-A6YOY24G.js} +5 -5
- package/chunks/{action-KJJ35X2T.js → action-AGGHY4N2.js} +21 -20
- package/chunks/{action-MKZYWAXH.js → action-BVZOA2G5.js} +9 -10
- package/chunks/{action-5TQHROY5.js → action-BYDJ4R4F.js} +14 -15
- package/chunks/{action-VJDK7ROI.js → action-CBAL5CYB.js} +16 -17
- package/chunks/action-COFGCCYS.js +89 -0
- package/chunks/action-CYU5Q5LT.js +254 -0
- package/chunks/{action-XMANK72Z.js → action-DTQH6CKR.js} +24 -23
- package/chunks/{action-AFZE62DU.js → action-ED5WLLIE.js} +6 -7
- package/chunks/action-F4CQ4DW3.js +654 -0
- package/chunks/{action-TA6VOPQ5.js → action-GVW5PSPT.js} +17 -18
- package/chunks/{action-TTDV5NIP.js → action-H5VRLFCY.js} +5 -5
- package/chunks/{action-2SZMLOYJ.js → action-IWEAWDT3.js} +9 -10
- package/chunks/{action-3EATJRIK.js → action-JN6JVQUV.js} +14 -15
- package/chunks/{action-WPUITVPF.js → action-KVM76ZKQ.js} +11 -11
- package/chunks/{action-PS4F4QWI.js → action-LLMFEBHH.js} +3 -4
- package/chunks/{action-WUMW2GH6.js → action-PEG7AUA6.js} +14 -13
- package/chunks/{action-UVWH2KZY.js → action-QC72LLYE.js} +7 -5
- package/chunks/{action-P5MGMJG3.js → action-QP6MRSQW.js} +15 -14
- package/chunks/{action-W47MFJSP.js → action-R53K22GE.js} +219 -45
- package/chunks/{action-RWITXLMW.js → action-SJPWL723.js} +5 -4
- package/chunks/{action-SBD4TFRS.js → action-T3R4SDAI.js} +5 -5
- package/chunks/{action-GOKWY3AQ.js → action-TT7ZJNST.js} +20 -19
- package/chunks/{action-LALZGEVR.js → action-UPVVJE26.js} +14 -15
- package/chunks/{action-RM4RZFZV.js → action-V35W4MRK.js} +10 -11
- package/chunks/{action-J3C4LAT5.js → action-W4KGRBRV.js} +5 -5
- package/chunks/{action-VWQNDXZT.js → action-ZIVYJCC2.js} +14 -15
- package/chunks/{action-LI6DZLDZ.js → action-ZU5X2KQX.js} +22 -21
- package/chunks/{actions-GWMW7V2B.js → actions-CERT7BL4.js} +16 -16
- package/chunks/{actions-4X5RTQCM.js → actions-RCIS37Y6.js} +14 -15
- package/chunks/{agent-LB5ZCVUN.js → agent-CT3RRYPJ.js} +7 -7
- package/chunks/{asyncapi-J6VAMIMO.js → asyncapi-DVBS23QW.js} +9 -10
- package/chunks/{build.action-YP46CGLS.js → build.action-7MKMMV6V.js} +16 -17
- package/chunks/{chunk-B3CMXTHQ.js → chunk-36UI2W7I.js} +1 -1
- package/chunks/{chunk-4TSZVWGM.js → chunk-4BMOCIYO.js} +19 -4
- package/chunks/{chunk-SKXMYIA2.js → chunk-5EO2CVAR.js} +4 -4
- package/chunks/{chunk-4YQNT5UH.js → chunk-5GZAGHKL.js} +1 -1
- package/chunks/{chunk-3BZ3VY6H.js → chunk-7LUXRNKV.js} +27 -2
- package/chunks/{chunk-KDEKIOIP.js → chunk-CWCRBWA6.js} +1 -1
- package/chunks/{chunk-YFUHTGGP.js → chunk-CYIGEQOJ.js} +2 -2
- package/chunks/{chunk-I4FQOD5L.js → chunk-DVA4NCCY.js} +3 -3
- package/chunks/{chunk-63AB5A5B.js → chunk-F6E7FJEC.js} +6 -6
- package/chunks/{chunk-2KMYC3ZI.js → chunk-FMPJSW6A.js} +2 -2
- package/chunks/{chunk-IZ3UMB7D.js → chunk-GCVB22TG.js} +2 -2
- package/chunks/{chunk-36AMOACU.js → chunk-GXKNYM54.js} +3 -3
- package/chunks/chunk-I25ZCHBJ.js +22 -0
- package/chunks/{chunk-KYCM5SL3.js → chunk-JBMHCTZD.js} +1 -0
- package/chunks/{chunk-57EMU765.js → chunk-JEOQ7LSA.js} +1 -1
- package/chunks/{chunk-DXEHHE6H.js → chunk-KI2AVDKM.js} +6 -4
- package/chunks/{chunk-QDT27U6O.js → chunk-KSY2GH53.js} +2 -2
- package/chunks/{chunk-LS6XOFVD.js → chunk-KWQVA66H.js} +11 -23
- package/chunks/{chunk-KJT4VYUO.js → chunk-LPWRG2MS.js} +1 -1
- package/chunks/{chunk-NKCM2UH5.js → chunk-LVUMNGVA.js} +1 -1
- package/chunks/{chunk-H6LOSAC7.js → chunk-M34HMQMV.js} +39 -83
- package/chunks/{chunk-XGKFAPON.js → chunk-MRZ5A7LB.js} +4 -4
- package/chunks/chunk-O3I3LTTJ.js +24 -0
- package/chunks/{chunk-XQPB4OGW.js → chunk-O4DJIA6Y.js} +2 -19
- package/chunks/{action-B3IDMFFO.js → chunk-OKLL5422.js} +5 -243
- package/chunks/{chunk-RVZZQKVE.js → chunk-PMDHYIB4.js} +4 -22
- package/chunks/{chunk-BIYCLKLZ.js → chunk-RELSIFIL.js} +1 -1
- package/chunks/{chunk-QLKBXVUV.js → chunk-RGJPENX7.js} +1 -1
- package/chunks/{chunk-3KK72EMO.js → chunk-RHAQ4XBA.js} +3 -3
- package/chunks/{action-S7DB6MBK.js → chunk-RQ7QBRJT.js} +1 -82
- package/chunks/chunk-S3LY7RKP.js +54 -0
- package/chunks/{chunk-X2NZINNR.js → chunk-S5OGPH2P.js} +3 -3
- package/chunks/{chunk-VNMVAJ6X.js → chunk-U36HEOGO.js} +17 -21
- package/chunks/{chunk-CAD672DX.js → chunk-Y3CXAIAG.js} +1 -1
- package/chunks/{chunk-HNWIIDGX.js → chunk-Z7EH7CJC.js} +3 -3
- package/chunks/{chunk-SVDXXGEO.js → chunk-ZMJW5UWU.js} +3 -3
- package/chunks/{chunk-UI5PWDNE.js → chunk-ZQDAPKWX.js} +9 -16
- package/chunks/{create.action-PRZKNQHM.js → create.action-VA2ISPIM.js} +16 -17
- package/chunks/{delete.action-G7OAQBR5.js → delete.action-AIWMDGXV.js} +16 -17
- package/chunks/{delete.action-2BLCOX6Y.js → delete.action-GEN6OD7A.js} +16 -17
- package/chunks/{diff.action-KDOJQVJ5.js → diff.action-LBK656RN.js} +15 -14
- package/chunks/{get.action-IKO22SCB.js → get.action-5SWRNQ3D.js} +15 -14
- package/chunks/{get.action-HSYV5TFY.js → get.action-UPPPGGI4.js} +17 -18
- package/chunks/{list.action-KYIFUM3C.js → list.action-YJZBC25S.js} +17 -18
- package/chunks/{list.action-IVJS7UFI.js → list.action-YOWWC4I4.js} +19 -20
- package/chunks/{publish.action-2QIOUMVY.js → publish.action-QMVDHDJZ.js} +22 -21
- package/chunks/{update.action-XZD6T5UR.js → update.action-GFDZIGEP.js} +17 -18
- package/chunks/{update.action-7QATFOGP.js → update.action-SNGKPS7A.js} +16 -17
- package/index.js +194 -154
- package/package.json +11 -11
- package/skills/scalar-cli/SKILL.md +3 -2
- package/template.md +76 -2
- package/chunks/chunk-YTJ67DWS.js +0 -32
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-WGTZEX4Y.js";
|
|
8
8
|
import {
|
|
9
9
|
isAsyncApiDocument
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CWCRBWA6.js";
|
|
11
11
|
import "./chunk-A2MPF6GE.js";
|
|
12
12
|
import "./chunk-FDW4LC45.js";
|
|
13
13
|
import {
|
|
@@ -18,14 +18,14 @@ import "./chunk-IRQJDPZE.js";
|
|
|
18
18
|
import {
|
|
19
19
|
isUrl
|
|
20
20
|
} from "./chunk-4ORL4MST.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-KSY2GH53.js";
|
|
22
22
|
import {
|
|
23
23
|
output
|
|
24
24
|
} from "./chunk-T5HJUAWB.js";
|
|
25
25
|
import "./chunk-DUIMDHQQ.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-Y3CXAIAG.js";
|
|
27
|
+
import "./chunk-5GZAGHKL.js";
|
|
28
|
+
import "./chunk-JBMHCTZD.js";
|
|
29
29
|
import "./chunk-3MZYUBJ6.js";
|
|
30
30
|
|
|
31
31
|
// src/domains/document/split/action.ts
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getFileOrUrl,
|
|
4
4
|
isDocument
|
|
5
5
|
} from "./chunk-WGTZEX4Y.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-CWCRBWA6.js";
|
|
7
7
|
import {
|
|
8
8
|
safeNormalize
|
|
9
9
|
} from "./chunk-A2MPF6GE.js";
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
isUrl,
|
|
13
13
|
isYamlFileName
|
|
14
14
|
} from "./chunk-4ORL4MST.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-KSY2GH53.js";
|
|
16
16
|
import {
|
|
17
17
|
output
|
|
18
18
|
} from "./chunk-T5HJUAWB.js";
|
|
19
19
|
import "./chunk-DUIMDHQQ.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-Y3CXAIAG.js";
|
|
21
|
+
import "./chunk-5GZAGHKL.js";
|
|
22
|
+
import "./chunk-JBMHCTZD.js";
|
|
23
23
|
import "./chunk-3MZYUBJ6.js";
|
|
24
24
|
|
|
25
25
|
// src/domains/document/format/action.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getProjectDeployments
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S5OGPH2P.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveProject
|
|
7
7
|
} from "./chunk-TSURUX4A.js";
|
|
@@ -11,44 +11,45 @@ import {
|
|
|
11
11
|
import "./chunk-AEFPCC4U.js";
|
|
12
12
|
import {
|
|
13
13
|
getPublishPreviewUrl
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-I25ZCHBJ.js";
|
|
15
|
+
import "./chunk-O3I3LTTJ.js";
|
|
16
|
+
import "./chunk-PMDHYIB4.js";
|
|
17
|
+
import "./chunk-O4DJIA6Y.js";
|
|
16
18
|
import {
|
|
17
19
|
writeJson
|
|
18
20
|
} from "./chunk-SNQFFEYH.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-KWQVA66H.js";
|
|
22
|
+
import "./chunk-Z7EH7CJC.js";
|
|
21
23
|
import {
|
|
22
24
|
apiService
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-U36HEOGO.js";
|
|
26
|
+
import "./chunk-MRZ5A7LB.js";
|
|
27
|
+
import "./chunk-CYIGEQOJ.js";
|
|
28
|
+
import "./chunk-4BMOCIYO.js";
|
|
29
|
+
import "./chunk-F6E7FJEC.js";
|
|
30
|
+
import "./chunk-DVA4NCCY.js";
|
|
29
31
|
import "./chunk-BIQFYZP6.js";
|
|
30
32
|
import "./chunk-RE5Z56QD.js";
|
|
31
33
|
import "./chunk-4ORL4MST.js";
|
|
32
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-KSY2GH53.js";
|
|
33
35
|
import "./chunk-VUXPDHTQ.js";
|
|
34
36
|
import {
|
|
35
37
|
getAuthData
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-3BZ3VY6H.js";
|
|
38
|
+
} from "./chunk-ZMJW5UWU.js";
|
|
39
|
+
import "./chunk-7LUXRNKV.js";
|
|
39
40
|
import {
|
|
40
41
|
output,
|
|
41
42
|
printTable
|
|
42
43
|
} from "./chunk-T5HJUAWB.js";
|
|
43
44
|
import "./chunk-DUIMDHQQ.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-Y3CXAIAG.js";
|
|
46
|
+
import "./chunk-GXKNYM54.js";
|
|
47
|
+
import "./chunk-RGJPENX7.js";
|
|
48
|
+
import "./chunk-5GZAGHKL.js";
|
|
48
49
|
import {
|
|
49
50
|
external_exports,
|
|
50
51
|
slugSchema
|
|
51
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-JBMHCTZD.js";
|
|
52
53
|
import "./chunk-3MZYUBJ6.js";
|
|
53
54
|
|
|
54
55
|
// src/domains/project/deployments/list/action.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getUserTeams
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JEOQ7LSA.js";
|
|
5
5
|
import {
|
|
6
6
|
requireInteractive,
|
|
7
7
|
select
|
|
@@ -12,24 +12,23 @@ import {
|
|
|
12
12
|
} from "./chunk-SNQFFEYH.js";
|
|
13
13
|
import {
|
|
14
14
|
getDatabaseClient
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-Z7EH7CJC.js";
|
|
16
|
+
import "./chunk-CYIGEQOJ.js";
|
|
17
17
|
import "./chunk-RE5Z56QD.js";
|
|
18
18
|
import "./chunk-4ORL4MST.js";
|
|
19
19
|
import "./chunk-VUXPDHTQ.js";
|
|
20
20
|
import {
|
|
21
21
|
getAuthData,
|
|
22
22
|
refreshToken
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-3BZ3VY6H.js";
|
|
23
|
+
} from "./chunk-ZMJW5UWU.js";
|
|
24
|
+
import "./chunk-7LUXRNKV.js";
|
|
26
25
|
import {
|
|
27
26
|
output
|
|
28
27
|
} from "./chunk-T5HJUAWB.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-GXKNYM54.js";
|
|
29
|
+
import "./chunk-RGJPENX7.js";
|
|
30
|
+
import "./chunk-5GZAGHKL.js";
|
|
31
|
+
import "./chunk-JBMHCTZD.js";
|
|
33
32
|
import "./chunk-3MZYUBJ6.js";
|
|
34
33
|
|
|
35
34
|
// src/domains/team/set/action.ts
|
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
BaseCollections
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KWQVA66H.js";
|
|
5
5
|
import {
|
|
6
6
|
getDatabaseClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-Z7EH7CJC.js";
|
|
8
|
+
import "./chunk-MRZ5A7LB.js";
|
|
9
|
+
import "./chunk-CYIGEQOJ.js";
|
|
10
|
+
import "./chunk-4BMOCIYO.js";
|
|
11
|
+
import "./chunk-DVA4NCCY.js";
|
|
12
12
|
import "./chunk-RE5Z56QD.js";
|
|
13
13
|
import "./chunk-4ORL4MST.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-KSY2GH53.js";
|
|
15
15
|
import "./chunk-VUXPDHTQ.js";
|
|
16
16
|
import {
|
|
17
17
|
getAuthData
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-3BZ3VY6H.js";
|
|
18
|
+
} from "./chunk-ZMJW5UWU.js";
|
|
19
|
+
import "./chunk-7LUXRNKV.js";
|
|
21
20
|
import {
|
|
22
21
|
output
|
|
23
22
|
} from "./chunk-T5HJUAWB.js";
|
|
24
23
|
import "./chunk-DUIMDHQQ.js";
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-Y3CXAIAG.js";
|
|
26
25
|
import {
|
|
27
26
|
teamSchema
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-GXKNYM54.js";
|
|
28
|
+
import "./chunk-RGJPENX7.js";
|
|
29
|
+
import "./chunk-5GZAGHKL.js";
|
|
30
|
+
import "./chunk-JBMHCTZD.js";
|
|
32
31
|
import "./chunk-3MZYUBJ6.js";
|
|
33
32
|
|
|
34
33
|
// src/domains/team/get/action.ts
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
getUserTeams
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JEOQ7LSA.js";
|
|
5
5
|
import {
|
|
6
6
|
getDatabaseClient
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z7EH7CJC.js";
|
|
8
8
|
import {
|
|
9
9
|
apiService
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-U36HEOGO.js";
|
|
11
|
+
import "./chunk-MRZ5A7LB.js";
|
|
12
|
+
import "./chunk-CYIGEQOJ.js";
|
|
13
|
+
import "./chunk-4BMOCIYO.js";
|
|
14
|
+
import "./chunk-F6E7FJEC.js";
|
|
15
|
+
import "./chunk-DVA4NCCY.js";
|
|
16
16
|
import "./chunk-BIQFYZP6.js";
|
|
17
17
|
import "./chunk-RE5Z56QD.js";
|
|
18
18
|
import "./chunk-4ORL4MST.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-KSY2GH53.js";
|
|
20
20
|
import "./chunk-VUXPDHTQ.js";
|
|
21
21
|
import {
|
|
22
22
|
getAuthData
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-3BZ3VY6H.js";
|
|
23
|
+
} from "./chunk-ZMJW5UWU.js";
|
|
24
|
+
import "./chunk-7LUXRNKV.js";
|
|
26
25
|
import {
|
|
27
26
|
output,
|
|
28
27
|
printTable
|
|
29
28
|
} from "./chunk-T5HJUAWB.js";
|
|
30
29
|
import "./chunk-DUIMDHQQ.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-Y3CXAIAG.js";
|
|
31
|
+
import "./chunk-GXKNYM54.js";
|
|
32
|
+
import "./chunk-RGJPENX7.js";
|
|
33
|
+
import "./chunk-5GZAGHKL.js";
|
|
34
|
+
import "./chunk-JBMHCTZD.js";
|
|
36
35
|
import "./chunk-3MZYUBJ6.js";
|
|
37
36
|
|
|
38
37
|
// src/domains/team/list/action.ts
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveForValidation
|
|
4
|
+
} from "./chunk-RQ7QBRJT.js";
|
|
5
|
+
import "./chunk-DWWY3LPC.js";
|
|
6
|
+
import {
|
|
7
|
+
isDocument
|
|
8
|
+
} from "./chunk-WGTZEX4Y.js";
|
|
9
|
+
import {
|
|
10
|
+
isAsyncApiDocument
|
|
11
|
+
} from "./chunk-CWCRBWA6.js";
|
|
12
|
+
import "./chunk-A2MPF6GE.js";
|
|
13
|
+
import "./chunk-FDW4LC45.js";
|
|
14
|
+
import {
|
|
15
|
+
isUrl
|
|
16
|
+
} from "./chunk-4ORL4MST.js";
|
|
17
|
+
import "./chunk-KSY2GH53.js";
|
|
18
|
+
import {
|
|
19
|
+
output
|
|
20
|
+
} from "./chunk-T5HJUAWB.js";
|
|
21
|
+
import "./chunk-DUIMDHQQ.js";
|
|
22
|
+
import "./chunk-Y3CXAIAG.js";
|
|
23
|
+
import "./chunk-5GZAGHKL.js";
|
|
24
|
+
import "./chunk-JBMHCTZD.js";
|
|
25
|
+
import "./chunk-3MZYUBJ6.js";
|
|
26
|
+
|
|
27
|
+
// src/domains/document/validate/action.ts
|
|
28
|
+
import path from "node:path";
|
|
29
|
+
import as from "ansis";
|
|
30
|
+
import prettyjson from "prettyjson";
|
|
31
|
+
import { validate as validateAsyncApi } from "@scalar/asyncapi-validator";
|
|
32
|
+
import { bundle } from "@scalar/json-magic/bundle";
|
|
33
|
+
import { fetchUrls, readFiles } from "@scalar/json-magic/bundle/plugins/node";
|
|
34
|
+
import { validate as validateOpenApi } from "@scalar/openapi-validator";
|
|
35
|
+
async function validateAction(inputArgument) {
|
|
36
|
+
const startTime = performance.now();
|
|
37
|
+
if (!inputArgument) {
|
|
38
|
+
return output.error().title("Invalid argument").message("Provide a file path or URL.").exit("error");
|
|
39
|
+
}
|
|
40
|
+
const document = await bundle(
|
|
41
|
+
isUrl(inputArgument) ? inputArgument : path.resolve(inputArgument),
|
|
42
|
+
{
|
|
43
|
+
plugins: [readFiles(), fetchUrls()],
|
|
44
|
+
treeShake: false
|
|
45
|
+
}
|
|
46
|
+
).catch((error) => {
|
|
47
|
+
return output.error().title("Invalid input").message(error instanceof Error ? error.message : String(error)).exit("error");
|
|
48
|
+
});
|
|
49
|
+
if (!isDocument(document)) {
|
|
50
|
+
return output.error().title("Invalid input").message("Provide a valid JSON or YAML document.").exit("error");
|
|
51
|
+
}
|
|
52
|
+
const resolved = resolveForValidation(document);
|
|
53
|
+
if (!resolved.ok) {
|
|
54
|
+
return output.error().title("Invalid reference").message(resolved.error).exit("error");
|
|
55
|
+
}
|
|
56
|
+
const isAsyncApi = isAsyncApiDocument(document);
|
|
57
|
+
const specification = isAsyncApi ? "AsyncAPI" : "OpenAPI";
|
|
58
|
+
const initialResult = isAsyncApi ? validateAsyncApi(document) : validateOpenApi(document);
|
|
59
|
+
const result = isAsyncApi || !initialResult.valid ? initialResult : validateOpenApi(resolved.data, { checkPathParameters: true });
|
|
60
|
+
if (result.valid && result.version) {
|
|
61
|
+
const endTime = performance.now();
|
|
62
|
+
output.info().line(
|
|
63
|
+
as.green(
|
|
64
|
+
`Matches the ${specification} specification${as.white(` (${specification} ${as.bold(result.version)})`)}
|
|
65
|
+
`
|
|
66
|
+
)
|
|
67
|
+
).line(
|
|
68
|
+
`${as.green("API description validated")} ${as.grey(
|
|
69
|
+
`(${as.white(`${as.bold(`${Math.round(endTime - startTime)}`)} ms`)})
|
|
70
|
+
`
|
|
71
|
+
)}`
|
|
72
|
+
).print();
|
|
73
|
+
} else {
|
|
74
|
+
output.error().message(prettyjson.render(result.errors)).message(
|
|
75
|
+
as.red(
|
|
76
|
+
`File does not match the ${specification} ${result.version ? `${result.version} ` : ""}specification.`
|
|
77
|
+
)
|
|
78
|
+
).message(
|
|
79
|
+
as.red(
|
|
80
|
+
`${as.bold(
|
|
81
|
+
`${result.errors?.length ?? 0} error${result.errors?.length === 1 ? "" : "s"}`
|
|
82
|
+
)} found.`
|
|
83
|
+
)
|
|
84
|
+
).exit("error");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
validateAction
|
|
89
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
bundleDocument,
|
|
4
|
+
inspectReferences
|
|
5
|
+
} from "./chunk-OKLL5422.js";
|
|
6
|
+
import "./chunk-DWWY3LPC.js";
|
|
7
|
+
import {
|
|
8
|
+
writeFileAtomic
|
|
9
|
+
} from "./chunk-CNJ4TLU7.js";
|
|
10
|
+
import "./chunk-WGTZEX4Y.js";
|
|
11
|
+
import "./chunk-CWCRBWA6.js";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_FETCH_CONCURRENCY
|
|
14
|
+
} from "./chunk-V7DBDXSJ.js";
|
|
15
|
+
import "./chunk-A2MPF6GE.js";
|
|
16
|
+
import "./chunk-FDW4LC45.js";
|
|
17
|
+
import {
|
|
18
|
+
confirm,
|
|
19
|
+
requireInteractive
|
|
20
|
+
} from "./chunk-XUX6JXU5.js";
|
|
21
|
+
import "./chunk-IRQJDPZE.js";
|
|
22
|
+
import {
|
|
23
|
+
isUrl,
|
|
24
|
+
isYamlFileName
|
|
25
|
+
} from "./chunk-4ORL4MST.js";
|
|
26
|
+
import "./chunk-KSY2GH53.js";
|
|
27
|
+
import {
|
|
28
|
+
output
|
|
29
|
+
} from "./chunk-T5HJUAWB.js";
|
|
30
|
+
import {
|
|
31
|
+
err,
|
|
32
|
+
ok
|
|
33
|
+
} from "./chunk-DUIMDHQQ.js";
|
|
34
|
+
import "./chunk-Y3CXAIAG.js";
|
|
35
|
+
import "./chunk-5GZAGHKL.js";
|
|
36
|
+
import "./chunk-JBMHCTZD.js";
|
|
37
|
+
import "./chunk-3MZYUBJ6.js";
|
|
38
|
+
|
|
39
|
+
// src/domains/document/bundle/action.ts
|
|
40
|
+
import fs2 from "node:fs/promises";
|
|
41
|
+
import path2 from "node:path";
|
|
42
|
+
import { cwd } from "node:process";
|
|
43
|
+
import as from "ansis";
|
|
44
|
+
import YAML from "yaml";
|
|
45
|
+
import { fetchUrls, readFiles } from "@scalar/json-magic/bundle/plugins/node";
|
|
46
|
+
import { isJsonObject } from "@scalar/json-magic/helpers/is-json-object";
|
|
47
|
+
|
|
48
|
+
// src/domains/document/bundle/inspect-output.ts
|
|
49
|
+
import fs from "node:fs/promises";
|
|
50
|
+
async function inspectOutput(fileName) {
|
|
51
|
+
if (!fileName || fileName === "-")
|
|
52
|
+
return ok({ exists: false, isDirectory: false, isSpecial: false });
|
|
53
|
+
return fs.stat(fileName).then(
|
|
54
|
+
(stat) => ok({
|
|
55
|
+
exists: true,
|
|
56
|
+
isDirectory: stat.isDirectory(),
|
|
57
|
+
isSpecial: !stat.isFile() && !stat.isDirectory()
|
|
58
|
+
})
|
|
59
|
+
).catch((error) => {
|
|
60
|
+
if (error.code === "ENOENT" || error.code === "ENOTDIR")
|
|
61
|
+
return ok({ exists: false, isDirectory: false, isSpecial: false });
|
|
62
|
+
return err(`Could not inspect output ${fileName}: ${error.message}`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/domains/document/bundle/resolve-output.ts
|
|
67
|
+
import path from "node:path";
|
|
68
|
+
function formatOf(extension) {
|
|
69
|
+
return extension === "json" ? "json" : "yaml";
|
|
70
|
+
}
|
|
71
|
+
function formatOfFileName(fileName) {
|
|
72
|
+
return isYamlFileName(fileName) ? "yaml" : "json";
|
|
73
|
+
}
|
|
74
|
+
function resolveOutput(input, output2, ext, state = {}, paths = path) {
|
|
75
|
+
if (!output2) {
|
|
76
|
+
const format = formatOfFileName(input);
|
|
77
|
+
if (ext && formatOf(ext) !== format) {
|
|
78
|
+
return err(
|
|
79
|
+
"Changing the input format requires --output. Use --output <file> with --ext."
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return ok({ fileName: input, format, stdout: false });
|
|
83
|
+
}
|
|
84
|
+
if (output2 === "-") {
|
|
85
|
+
return ok({
|
|
86
|
+
fileName: "-",
|
|
87
|
+
format: ext ? formatOf(ext) : "input",
|
|
88
|
+
stdout: true
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const directory = state.isDirectory || (paths.sep === "\\" ? /[\\/]$/ : /\/$/).test(output2);
|
|
92
|
+
const inputName = isUrl(input) ? urlFileName(input) : paths.basename(input);
|
|
93
|
+
const fileName = directory ? paths.join(output2, inputName) : output2;
|
|
94
|
+
const suffix = paths.extname(fileName);
|
|
95
|
+
const recognized = suffix.toLowerCase() === ".json" || isYamlFileName(fileName);
|
|
96
|
+
if (!directory && (state.isSpecial || state.exists && !ext)) {
|
|
97
|
+
return ok({
|
|
98
|
+
fileName,
|
|
99
|
+
format: ext ? formatOf(ext) : formatOfFileName(fileName),
|
|
100
|
+
stdout: false
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (ext) {
|
|
104
|
+
const stem = recognized ? fileName.slice(0, fileName.length - suffix.length) : fileName;
|
|
105
|
+
return ok({
|
|
106
|
+
fileName: `${stem}.${ext}`,
|
|
107
|
+
format: formatOf(ext),
|
|
108
|
+
stdout: false
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (directory && !recognized || !suffix) {
|
|
112
|
+
return ok({ fileName: `${fileName}.yaml`, format: "yaml", stdout: false });
|
|
113
|
+
}
|
|
114
|
+
return ok({ fileName, format: formatOfFileName(fileName), stdout: false });
|
|
115
|
+
}
|
|
116
|
+
function urlFileName(input) {
|
|
117
|
+
const basename = path.posix.basename(new URL(input).pathname);
|
|
118
|
+
const decoded = (() => {
|
|
119
|
+
try {
|
|
120
|
+
return decodeURIComponent(basename);
|
|
121
|
+
} catch {
|
|
122
|
+
return basename;
|
|
123
|
+
}
|
|
124
|
+
})();
|
|
125
|
+
const name = decoded.replace(/[<>:"|?*\\/\p{Cc}]/gu, "_").replace(/[. ]+$/, "");
|
|
126
|
+
if (!name) return "openapi";
|
|
127
|
+
return /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(name) ? `_${name}` : name;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/domains/document/bundle/action.ts
|
|
131
|
+
function serializeBundle(value, isYaml) {
|
|
132
|
+
try {
|
|
133
|
+
return ok(isYaml ? YAML.stringify(value) : JSON.stringify(value));
|
|
134
|
+
} catch (error) {
|
|
135
|
+
return err(`Could not serialize bundle: ${String(error)}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function bundleAction(input, {
|
|
139
|
+
output: outputFilePath,
|
|
140
|
+
treeShake,
|
|
141
|
+
urlMap,
|
|
142
|
+
fetchLimit,
|
|
143
|
+
force,
|
|
144
|
+
ext
|
|
145
|
+
}) {
|
|
146
|
+
if (!input) {
|
|
147
|
+
return output.error().title("Missing input").message("Provide a file path or URL to bundle.").exit("error");
|
|
148
|
+
}
|
|
149
|
+
const isUrlInput = isUrl(input);
|
|
150
|
+
if (!outputFilePath && isUrlInput) {
|
|
151
|
+
return output.error().message("URL input requires an output file. Use `--output <file>`.").exit("error");
|
|
152
|
+
}
|
|
153
|
+
const inspectedOutput = await inspectOutput(outputFilePath);
|
|
154
|
+
if (!inspectedOutput.ok)
|
|
155
|
+
return output.error().message(inspectedOutput.error).exit("error");
|
|
156
|
+
const destination = resolveOutput(
|
|
157
|
+
input,
|
|
158
|
+
outputFilePath,
|
|
159
|
+
ext,
|
|
160
|
+
inspectedOutput.data
|
|
161
|
+
);
|
|
162
|
+
if (!destination.ok)
|
|
163
|
+
return output.error().message(destination.error).exit("error");
|
|
164
|
+
const resolvedInput = isUrlInput ? input : path2.resolve(cwd(), input);
|
|
165
|
+
const resolvedOutput = destination.data.stdout ? void 0 : await fs2.realpath(destination.data.fileName).catch(() => path2.resolve(destination.data.fileName));
|
|
166
|
+
const inputTarget = isUrlInput ? void 0 : await fs2.realpath(resolvedInput).catch(() => resolvedInput);
|
|
167
|
+
if (!outputFilePath || inputTarget !== void 0 && resolvedOutput === inputTarget) {
|
|
168
|
+
requireInteractive(
|
|
169
|
+
"Pass --output with a different destination to bundle a document in non-interactive mode."
|
|
170
|
+
);
|
|
171
|
+
const shouldContinue = await confirm({
|
|
172
|
+
message: `Overwrite "${input}"?`,
|
|
173
|
+
initialValue: false
|
|
174
|
+
});
|
|
175
|
+
if (shouldContinue !== true) {
|
|
176
|
+
return output.error().message("Operation cancelled.").exit("error");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const {
|
|
180
|
+
fileName: outputFileName,
|
|
181
|
+
format,
|
|
182
|
+
stdout: isStdout
|
|
183
|
+
} = destination.data;
|
|
184
|
+
const startedAt = performance.now();
|
|
185
|
+
const inspected = await inspectReferences(resolvedInput, [
|
|
186
|
+
readFiles(),
|
|
187
|
+
fetchUrls({ limit: fetchLimit ?? DEFAULT_FETCH_CONCURRENCY })
|
|
188
|
+
]);
|
|
189
|
+
if (!inspected.ok) {
|
|
190
|
+
return output.error().message(inspected.error).exit("error");
|
|
191
|
+
}
|
|
192
|
+
const root = format === "input" ? await inspected.data.loader.exec(resolvedInput) : void 0;
|
|
193
|
+
const isYaml = root?.ok ? !isJsonObject(root.raw.trimStart()) : format === "yaml";
|
|
194
|
+
const { diagnostics } = inspected.data;
|
|
195
|
+
for (const diagnostic of diagnostics) {
|
|
196
|
+
const source = path2.isAbsolute(diagnostic.source) ? path2.relative(cwd(), diagnostic.source) || "." : diagnostic.source;
|
|
197
|
+
if (isStdout) {
|
|
198
|
+
process.stderr.write(
|
|
199
|
+
`${source}${diagnostic.pointer}: ${diagnostic.message}
|
|
200
|
+
Reference: ${diagnostic.reference}
|
|
201
|
+
`
|
|
202
|
+
);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const report = force ? output.warn() : output.error();
|
|
206
|
+
report.message(`${source}${diagnostic.pointer}: ${diagnostic.message}`).line(`Reference: ${diagnostic.reference}`).print();
|
|
207
|
+
}
|
|
208
|
+
if (diagnostics.length && !force) {
|
|
209
|
+
return output.error().message(
|
|
210
|
+
"Bundle not written. Fix unresolved references or use --force to write an incomplete document."
|
|
211
|
+
).exit("error");
|
|
212
|
+
}
|
|
213
|
+
if (diagnostics.length) {
|
|
214
|
+
const warning = `Writing an incomplete API description.${treeShake ? " Skipping tree shaking because reference reachability is uncertain." : ""}`;
|
|
215
|
+
if (isStdout) {
|
|
216
|
+
process.stderr.write(`${warning}
|
|
217
|
+
`);
|
|
218
|
+
} else {
|
|
219
|
+
output.warn().message(warning).print();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const bundled = await bundleDocument(inspected.data, resolvedInput, {
|
|
223
|
+
treeShake: !!treeShake,
|
|
224
|
+
urlMap: !!urlMap
|
|
225
|
+
});
|
|
226
|
+
if (!bundled.ok) {
|
|
227
|
+
return output.error().message(bundled.error).exit("error");
|
|
228
|
+
}
|
|
229
|
+
const result = bundled.data;
|
|
230
|
+
const executionTimeMs = performance.now() - startedAt;
|
|
231
|
+
const serialized = serializeBundle(result, isYaml);
|
|
232
|
+
if (!serialized.ok) {
|
|
233
|
+
return output.error().message(serialized.error).exit("error");
|
|
234
|
+
}
|
|
235
|
+
if (isStdout) {
|
|
236
|
+
process.stdout.write(serialized.data);
|
|
237
|
+
process.stderr.write(
|
|
238
|
+
`${diagnostics.length ? "Incomplete API description bundled" : "API description bundled"} (${Math.round(executionTimeMs)} ms)
|
|
239
|
+
`
|
|
240
|
+
);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const written = await writeFileAtomic(outputFileName, serialized.data, {
|
|
244
|
+
createParents: true
|
|
245
|
+
});
|
|
246
|
+
if (!written.ok)
|
|
247
|
+
return output.error().message(`Could not write bundle to ${outputFileName}: ${written.error}`).exit("error");
|
|
248
|
+
output.info().message(
|
|
249
|
+
`${as.green(diagnostics.length ? "Incomplete API description bundled" : "API description bundled")} (${as.white(`${as.bold(`${Math.round(executionTimeMs)}`)} ms`)})`
|
|
250
|
+
).line(`Written to ${as.cyan(outputFileName)}`).print();
|
|
251
|
+
}
|
|
252
|
+
export {
|
|
253
|
+
bundleAction
|
|
254
|
+
};
|