@scalar/cli 2.10.0 → 2.11.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 +82 -1290
- package/chunks/{action-YSVTZVKV.js → action-25QMCP5G.js} +37 -26
- package/chunks/{action-X7BA7PQQ.js → action-2VF6LODL.js} +20 -18
- package/chunks/{action-5N3P43MD.js → action-5I4XDPPG.js} +16 -15
- package/chunks/action-6M5PTDF6.js +100 -0
- package/chunks/{action-PAM2EZ22.js → action-73ELLN3T.js} +8 -7
- package/chunks/{action-XOADBXSX.js → action-7H3AWCHX.js} +17 -16
- package/chunks/{action-KDUFU7TZ.js → action-BRSLSOE5.js} +19 -16
- package/chunks/{action-7XOHYWYM.js → action-CQQCKSNS.js} +13 -15
- package/chunks/action-D5QWDNQ2.js +65 -0
- package/chunks/{action-5RL4NWUZ.js → action-DQDHBOLJ.js} +33 -30
- package/chunks/{action-DKDRAIKV.js → action-EYPYQQVM.js} +13 -15
- package/chunks/{action-ZFI77WA5.js → action-FMA5ECUA.js} +10 -10
- package/chunks/{action-DTEO4YNX.js → action-GXDJLF2G.js} +13 -11
- package/chunks/{action-657A4K2D.js → action-HUICEXJZ.js} +26 -23
- package/chunks/action-IH6G77C5.js +38 -0
- package/chunks/{action-H3RTILLM.js → action-IIQMZVRJ.js} +1 -1
- package/chunks/action-IQM54ITT.js +164 -0
- package/chunks/{action-EAUTQ77U.js → action-J5TO3UJW.js} +26 -24
- package/chunks/{action-UUL6SWV4.js → action-KC3ZCNDR.js} +12 -14
- package/chunks/{action-HT42NUUX.js → action-L7TMS3Q3.js} +40 -38
- package/chunks/{action-GWYYTUTM.js → action-LAAHRDSR.js} +5 -5
- package/chunks/{action-5LF4XYHX.js → action-LR75GHBA.js} +12 -12
- package/chunks/{action-PPTFYZWD.js → action-MJMLQFLT.js} +12 -12
- package/chunks/action-NHU4CUKT.js +130 -0
- package/chunks/{action-4GZI2M5B.js → action-NKTFNFU7.js} +19 -17
- package/chunks/{action-CB55NWAU.js → action-NMW5WPD2.js} +9 -9
- package/chunks/{action-GFLRD7LO.js → action-OTPXODUE.js} +8 -8
- package/chunks/{action-R4PGILN4.js → action-RPCDNGCI.js} +47 -36
- package/chunks/{action-TOBU74JH.js → action-RQCXSJPZ.js} +51 -27
- package/chunks/{action-JEYDBB3P.js → action-SOYSVG67.js} +15 -15
- package/chunks/action-Y7EBKCUU.js +16 -0
- package/chunks/{action-XLE37MZL.js → action-YN4TE7TG.js} +23 -22
- package/chunks/{action-CABLS46Q.js → action-ZGNVWTHZ.js} +11 -11
- package/chunks/{action-4W5GUGEG.js → action-ZKKRPLDK.js} +20 -19
- package/chunks/{action-ZKA3RR3S.js → action-ZUZL7R3H.js} +18 -17
- package/chunks/{actions-3SAMH7A5.js → actions-S6K76HCW.js} +23 -20
- package/chunks/{agent-2ESZI7NO.js → agent-IRNEV4K5.js} +44 -9
- package/chunks/{asyncapi-4HGVM3PR.js → asyncapi-WQPIQMEZ.js} +13 -12
- package/chunks/{build.action-VBGFGACM.js → build.action-CLBVKFWD.js} +28 -26
- package/chunks/chunk-25XERWCE.js +1058 -0
- package/chunks/{chunk-35Z7VTJT.js → chunk-3RIUDHLG.js} +52 -38
- package/chunks/{chunk-ZYBLQ5CT.js → chunk-3TFOA64C.js} +9 -4
- package/chunks/{chunk-CWVYOXXM.js → chunk-4JKXZ5CF.js} +11 -7
- package/chunks/{chunk-XAGJJNQW.js → chunk-5L7V7RCH.js} +10 -10
- package/chunks/{chunk-KZNRQVMY.js → chunk-ALYM4ZB2.js} +1 -1
- package/chunks/chunk-AVZFSWPD.js +37 -0
- package/chunks/{chunk-GYRQPDTK.js → chunk-BQYVSPAI.js} +14 -2
- package/chunks/{chunk-UDBSV3CK.js → chunk-CSSTCHHF.js} +6083 -4167
- package/chunks/{chunk-ZGNDXPLU.js → chunk-DQD2753S.js} +3 -3
- package/chunks/{action-F2ZJNURT.js → chunk-EBNFCIKS.js} +7 -10
- package/chunks/{chunk-ATNTXKMS.js → chunk-F3OPMYME.js} +118 -38
- package/chunks/{chunk-KHF2QXBG.js → chunk-FG5AOTDN.js} +1433 -641
- package/chunks/{chunk-K2HIB5BA.js → chunk-GKCVATQJ.js} +3 -3
- package/chunks/{chunk-BIMLCGKS.js → chunk-GMHIK5K2.js} +1 -1
- package/chunks/{chunk-5SMP756H.js → chunk-GYR5E6RB.js} +2 -2
- package/chunks/{chunk-MC4EMNOR.js → chunk-HZN6IIPZ.js} +7 -6
- package/chunks/{chunk-VVRUSQCY.js → chunk-I57ID5K7.js} +13 -0
- package/chunks/{chunk-VYFGRLVQ.js → chunk-KOD2HX5I.js} +1 -1
- package/chunks/{chunk-ZKJPLWRJ.js → chunk-LOLVJNI5.js} +4 -4
- package/chunks/{chunk-GLWTVLKM.js → chunk-MN2AFJXM.js} +9 -2
- package/chunks/{chunk-WB6PWTMU.js → chunk-N5CJ5MTY.js} +1 -1
- package/chunks/{chunk-JXGF5EHC.js → chunk-NWJ37GI2.js} +23 -13
- package/chunks/{chunk-3ZJYGGAA.js → chunk-ORCUZITN.js} +1 -1
- package/chunks/{chunk-H467HDVV.js → chunk-QMLRYD76.js} +1 -1
- package/chunks/{chunk-43WALAW3.js → chunk-SEURG74P.js} +64 -115
- package/chunks/{chunk-G4HRW2FZ.js → chunk-SOV4POMS.js} +366 -253
- package/chunks/chunk-T34TL6KL.js +222 -0
- package/chunks/{chunk-WDIWLXLV.js → chunk-U6VE6JOS.js} +3 -3
- package/chunks/{chunk-MMWSCTDB.js → chunk-UFSFY7Z4.js} +19 -19
- package/chunks/{chunk-WIEXQUTD.js → chunk-ULRJZXMS.js} +1 -1
- package/chunks/{chunk-DHZW7Q7U.js → chunk-US54KYOJ.js} +2 -4
- package/chunks/{chunk-36LXIJIZ.js → chunk-V6LUKXBV.js} +1 -16
- package/chunks/{chunk-6M7TL2G2.js → chunk-VRZSDUZK.js} +45 -5
- package/chunks/chunk-VUXPDHTQ.js +22 -0
- package/chunks/chunk-XP5UM7SF.js +21 -0
- package/chunks/{chunk-IPZP3VRA.js → chunk-Y6XGC4K5.js} +5 -21
- package/chunks/{create.action-DBNIS665.js → create.action-ITEOQ644.js} +34 -32
- package/chunks/{delete.action-K7BLK7DK.js → delete.action-77MFPLUN.js} +29 -27
- package/chunks/{delete.action-GBOZC45K.js → delete.action-C6VX4S5Q.js} +30 -28
- package/chunks/{get.action-N3JOY3OU.js → get.action-3BP4FHZC.js} +16 -15
- package/chunks/{get.action-QHKMYZBK.js → get.action-LNBOWUVE.js} +24 -20
- package/chunks/{list.action-6SSO3JVN.js → list.action-6CRFQPJT.js} +39 -29
- package/chunks/{list.action-TJCS6UEY.js → list.action-KR5YIDR4.js} +37 -26
- package/chunks/{publish.action-T24VHRMR.js → publish.action-YBORRPBM.js} +45 -43
- package/chunks/{scripts-VIBLGKYG.js → scripts-6CI6U32J.js} +1 -1
- package/chunks/{update.action-VOE6PH5F.js → update.action-O7TSXDGV.js} +29 -27
- package/chunks/{update.action-OGYNBXRU.js → update.action-QZI7M2MV.js} +30 -28
- package/index.js +283 -278
- package/package.json +2 -2
- package/skills/scalar-cli/SKILL.md +49 -49
- package/template.md +66 -253
- package/chunks/action-FBRY5JKU.js +0 -37
- package/chunks/action-LYCNT3KA.js +0 -73
- package/chunks/action-OJ2NK25F.js +0 -121
- package/chunks/action-U2L5DCFG.js +0 -91
- package/chunks/chunk-MNNGUUKJ.js +0 -405
- package/chunks/chunk-ZGVZU6L2.js +0 -422
- package/docs.html +0 -6977
package/index.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
DownloadIsolateCommand
|
|
5
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-KOD2HX5I.js";
|
|
6
|
+
import {
|
|
7
|
+
buildCliContext,
|
|
8
|
+
runnableCommands
|
|
9
|
+
} from "./chunks/chunk-EBNFCIKS.js";
|
|
6
10
|
import {
|
|
7
11
|
openBrowser
|
|
8
12
|
} from "./chunks/chunk-JFIXNSPP.js";
|
|
@@ -13,7 +17,7 @@ import {
|
|
|
13
17
|
BundleCommand,
|
|
14
18
|
parseFetchLimit,
|
|
15
19
|
parsePort
|
|
16
|
-
} from "./chunks/chunk-
|
|
20
|
+
} from "./chunks/chunk-HZN6IIPZ.js";
|
|
17
21
|
import {
|
|
18
22
|
completeFiles
|
|
19
23
|
} from "./chunks/chunk-DFOZG7ZV.js";
|
|
@@ -21,40 +25,36 @@ import {
|
|
|
21
25
|
DOCUMENT_FORMATS,
|
|
22
26
|
PRIVACY_VALUES
|
|
23
27
|
} from "./chunks/chunk-NAC63XJF.js";
|
|
24
|
-
import "./chunks/chunk-KHF2QXBG.js";
|
|
25
28
|
import {
|
|
26
29
|
SdkLanguage
|
|
27
|
-
} from "./chunks/chunk-
|
|
28
|
-
import "./chunks/chunk-5ENKYZA4.js";
|
|
30
|
+
} from "./chunks/chunk-Y6XGC4K5.js";
|
|
29
31
|
import {
|
|
30
32
|
checkNodeVersion
|
|
31
|
-
} from "./chunks/chunk-
|
|
33
|
+
} from "./chunks/chunk-VUXPDHTQ.js";
|
|
32
34
|
import {
|
|
33
|
-
getAuthData,
|
|
34
35
|
getMetadata,
|
|
35
36
|
logout,
|
|
36
37
|
setMetadata
|
|
37
|
-
} from "./chunks/chunk-
|
|
38
|
-
import "./chunks/chunk-
|
|
38
|
+
} from "./chunks/chunk-3RIUDHLG.js";
|
|
39
|
+
import "./chunks/chunk-N5CJ5MTY.js";
|
|
39
40
|
import {
|
|
40
41
|
bin,
|
|
41
42
|
name,
|
|
42
43
|
version
|
|
43
|
-
} from "./chunks/chunk-
|
|
44
|
-
import "./chunks/chunk-
|
|
45
|
-
import "./chunks/chunk-
|
|
44
|
+
} from "./chunks/chunk-US54KYOJ.js";
|
|
45
|
+
import "./chunks/chunk-BQYVSPAI.js";
|
|
46
|
+
import "./chunks/chunk-VRZSDUZK.js";
|
|
46
47
|
import {
|
|
47
48
|
requireInteractive
|
|
48
49
|
} from "./chunks/chunk-EGOXR5FB.js";
|
|
49
|
-
import "./chunks/chunk-4ORL4MST.js";
|
|
50
|
-
import "./chunks/chunk-MNNGUUKJ.js";
|
|
51
50
|
import {
|
|
52
51
|
output
|
|
53
52
|
} from "./chunks/chunk-T5HJUAWB.js";
|
|
54
|
-
import "./chunks/chunk-
|
|
53
|
+
import "./chunks/chunk-25XERWCE.js";
|
|
54
|
+
import "./chunks/chunk-AVZFSWPD.js";
|
|
55
55
|
import {
|
|
56
56
|
external_exports
|
|
57
|
-
} from "./chunks/chunk-
|
|
57
|
+
} from "./chunks/chunk-I57ID5K7.js";
|
|
58
58
|
import "./chunks/chunk-3MZYUBJ6.js";
|
|
59
59
|
|
|
60
60
|
// src/index.ts
|
|
@@ -70,11 +70,11 @@ import { Command as Command6 } from "commander";
|
|
|
70
70
|
import { Command } from "commander";
|
|
71
71
|
var DeleteSchemaCommand = () => {
|
|
72
72
|
const cmd3 = new Command("delete");
|
|
73
|
-
cmd3.description("Delete a schema
|
|
73
|
+
cmd3.description("Delete a shared schema");
|
|
74
74
|
cmd3.option("-s, --slug <slug>", "Schema slug");
|
|
75
75
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
76
76
|
cmd3.action(async (...args) => {
|
|
77
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
77
|
+
const { deleteAction } = await import("./chunks/delete.action-77MFPLUN.js");
|
|
78
78
|
return deleteAction(...args);
|
|
79
79
|
});
|
|
80
80
|
return cmd3;
|
|
@@ -84,17 +84,17 @@ var DeleteSchemaCommand = () => {
|
|
|
84
84
|
import { Command as Command2, Option } from "commander";
|
|
85
85
|
var GetSchemaCommand = () => {
|
|
86
86
|
const cmd3 = new Command2("get");
|
|
87
|
-
cmd3.description("
|
|
87
|
+
cmd3.description("Download a shared schema version from the Scalar Registry");
|
|
88
88
|
cmd3.argument("[namespace]", "Team namespace");
|
|
89
89
|
cmd3.argument("[slug]", "Schema slug");
|
|
90
90
|
cmd3.option("--version <version>", "Schema version (defaults to latest)");
|
|
91
91
|
cmd3.addOption(
|
|
92
|
-
new Option("--format <format>", "Output format
|
|
92
|
+
new Option("--format <format>", "Output format").choices([...DOCUMENT_FORMATS]).default("json")
|
|
93
93
|
);
|
|
94
94
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
95
95
|
completeFiles(cmd3, [], ["--output"]);
|
|
96
96
|
cmd3.action(async (...args) => {
|
|
97
|
-
const { getAction } = await import("./chunks/get.action-
|
|
97
|
+
const { getAction } = await import("./chunks/get.action-3BP4FHZC.js");
|
|
98
98
|
return getAction(...args);
|
|
99
99
|
});
|
|
100
100
|
return cmd3;
|
|
@@ -104,11 +104,11 @@ var GetSchemaCommand = () => {
|
|
|
104
104
|
import { Command as Command3 } from "commander";
|
|
105
105
|
var ListSchemaCommand = () => {
|
|
106
106
|
const cmd3 = new Command3("list");
|
|
107
|
-
cmd3.description("List
|
|
107
|
+
cmd3.description("List shared schemas in a team namespace");
|
|
108
108
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
109
109
|
cmd3.option("--json", "Output schema metadata as JSON");
|
|
110
110
|
cmd3.action(async (...args) => {
|
|
111
|
-
const { listAction } = await import("./chunks/list.action-
|
|
111
|
+
const { listAction } = await import("./chunks/list.action-KR5YIDR4.js");
|
|
112
112
|
return listAction(...args);
|
|
113
113
|
});
|
|
114
114
|
return cmd3;
|
|
@@ -118,17 +118,14 @@ var ListSchemaCommand = () => {
|
|
|
118
118
|
import { Command as Command4 } from "commander";
|
|
119
119
|
var PublishSchemaCommand = () => {
|
|
120
120
|
const cmd3 = new Command4("publish");
|
|
121
|
-
cmd3.description("Publish a shared schema to the Scalar
|
|
122
|
-
cmd3.argument("[file]", "
|
|
123
|
-
cmd3.option(
|
|
124
|
-
"--slug <slug>",
|
|
125
|
-
"Slug identifier for the registry entry. Defaults to title."
|
|
126
|
-
);
|
|
121
|
+
cmd3.description("Publish a shared schema to the Scalar Registry");
|
|
122
|
+
cmd3.argument("[file]", "Shared schema file path or URL to upload");
|
|
123
|
+
cmd3.option("--slug <slug>", "Shared schema slug");
|
|
127
124
|
cmd3.option("--title <title>", "Schema title");
|
|
128
125
|
cmd3.option("--namespace <namespace>", "Scalar team namespace");
|
|
129
|
-
cmd3.option("--version <version>", "
|
|
130
|
-
cmd3.option("--private", "Make
|
|
131
|
-
cmd3.option("--force", "
|
|
126
|
+
cmd3.option("--version <version>", "Schema version (for example, 0.1.0)");
|
|
127
|
+
cmd3.option("--private", "Make the shared schema private", false);
|
|
128
|
+
cmd3.option("--force", "Overwrite an existing version", false);
|
|
132
129
|
cmd3.option("--bundle", "Bundle all external references before uploading");
|
|
133
130
|
cmd3.option(
|
|
134
131
|
"--treeShake",
|
|
@@ -140,12 +137,12 @@ var PublishSchemaCommand = () => {
|
|
|
140
137
|
);
|
|
141
138
|
cmd3.option(
|
|
142
139
|
"--fetchLimit <limit>",
|
|
143
|
-
"Maximum number of concurrent
|
|
140
|
+
"Maximum number of concurrent URL fetches when bundling",
|
|
144
141
|
parseFetchLimit
|
|
145
142
|
);
|
|
146
143
|
completeFiles(cmd3, ["file"], []);
|
|
147
144
|
cmd3.action(async (...args) => {
|
|
148
|
-
const { publishAction } = await import("./chunks/publish.action-
|
|
145
|
+
const { publishAction } = await import("./chunks/publish.action-YBORRPBM.js");
|
|
149
146
|
return publishAction(...args);
|
|
150
147
|
});
|
|
151
148
|
return cmd3;
|
|
@@ -155,19 +152,19 @@ var PublishSchemaCommand = () => {
|
|
|
155
152
|
import { Command as Command5, Option as Option2 } from "commander";
|
|
156
153
|
var UpdateSchemaCommand = () => {
|
|
157
154
|
const cmd3 = new Command5("update");
|
|
158
|
-
cmd3.description("Update schema metadata
|
|
155
|
+
cmd3.description("Update shared schema metadata");
|
|
159
156
|
cmd3.option("-s, --slug <slug>", "Schema slug");
|
|
160
157
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
161
|
-
cmd3.option("--title <title>", "
|
|
162
|
-
cmd3.option("--description <description>", "
|
|
158
|
+
cmd3.option("--title <title>", "Schema title");
|
|
159
|
+
cmd3.option("--description <description>", "Schema description");
|
|
163
160
|
cmd3.addOption(
|
|
164
161
|
new Option2(
|
|
165
162
|
"--isPrivate <isPrivate>",
|
|
166
|
-
"
|
|
163
|
+
"Access setting (true/private or false/public)"
|
|
167
164
|
).choices([...PRIVACY_VALUES])
|
|
168
165
|
);
|
|
169
166
|
cmd3.action(async (...args) => {
|
|
170
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
167
|
+
const { updateAction } = await import("./chunks/update.action-O7TSXDGV.js");
|
|
171
168
|
return updateAction(...args);
|
|
172
169
|
});
|
|
173
170
|
return cmd3;
|
|
@@ -182,7 +179,7 @@ var schemaCommands = [
|
|
|
182
179
|
PublishSchemaCommand
|
|
183
180
|
];
|
|
184
181
|
var schemaDomain = new Command6("schema");
|
|
185
|
-
schemaDomain.description("Manage
|
|
182
|
+
schemaDomain.description("Manage shared schemas in the Scalar Registry");
|
|
186
183
|
schemaCommands.forEach((command) => void schemaDomain.addCommand(command()));
|
|
187
184
|
var schema_default = schemaDomain;
|
|
188
185
|
|
|
@@ -193,11 +190,11 @@ import { Command as Command13 } from "commander";
|
|
|
193
190
|
import { Command as Command7 } from "commander";
|
|
194
191
|
var BuildSdkCommand = () => {
|
|
195
192
|
const cmd3 = new Command7("build");
|
|
196
|
-
cmd3.description("
|
|
193
|
+
cmd3.description("Start an SDK build");
|
|
197
194
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
198
195
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
199
196
|
cmd3.action(async (...args) => {
|
|
200
|
-
const { buildAction } = await import("./chunks/build.action-
|
|
197
|
+
const { buildAction } = await import("./chunks/build.action-CLBVKFWD.js");
|
|
201
198
|
return buildAction(...args);
|
|
202
199
|
});
|
|
203
200
|
return cmd3;
|
|
@@ -207,21 +204,16 @@ var BuildSdkCommand = () => {
|
|
|
207
204
|
import { Command as Command8, Option as Option3 } from "commander";
|
|
208
205
|
var CreateSdkCommand = () => {
|
|
209
206
|
const cmd3 = new Command8("create");
|
|
210
|
-
cmd3.description(
|
|
211
|
-
|
|
212
|
-
);
|
|
213
|
-
cmd3.option("-a, --api <api>", "Registry API slug");
|
|
214
|
-
cmd3.option(
|
|
215
|
-
"-n, --namespace <namespace>",
|
|
216
|
-
"Team namespace to look the API up in"
|
|
217
|
-
);
|
|
207
|
+
cmd3.description("Create an SDK in the namespace of its source API");
|
|
208
|
+
cmd3.option("-a, --api <api>", "Scalar Registry API slug");
|
|
209
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace of the source API");
|
|
218
210
|
cmd3.addOption(
|
|
219
|
-
new Option3("-l, --language <language>", "
|
|
211
|
+
new Option3("-l, --language <language>", "SDK language").choices(
|
|
220
212
|
Object.values(SdkLanguage)
|
|
221
213
|
)
|
|
222
214
|
);
|
|
223
215
|
cmd3.action(async (...args) => {
|
|
224
|
-
const { createAction } = await import("./chunks/create.action-
|
|
216
|
+
const { createAction } = await import("./chunks/create.action-ITEOQ644.js");
|
|
225
217
|
return createAction(...args);
|
|
226
218
|
});
|
|
227
219
|
return cmd3;
|
|
@@ -231,11 +223,11 @@ var CreateSdkCommand = () => {
|
|
|
231
223
|
import { Command as Command9 } from "commander";
|
|
232
224
|
var DeleteSdkCommand = () => {
|
|
233
225
|
const cmd3 = new Command9("delete");
|
|
234
|
-
cmd3.description("Delete an SDK
|
|
226
|
+
cmd3.description("Delete an SDK");
|
|
235
227
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
236
228
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
237
229
|
cmd3.action(async (...args) => {
|
|
238
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
230
|
+
const { deleteAction } = await import("./chunks/delete.action-C6VX4S5Q.js");
|
|
239
231
|
return deleteAction(...args);
|
|
240
232
|
});
|
|
241
233
|
return cmd3;
|
|
@@ -245,18 +237,18 @@ var DeleteSdkCommand = () => {
|
|
|
245
237
|
import { Command as Command10, Option as Option4 } from "commander";
|
|
246
238
|
var UpdateSdkCommand = () => {
|
|
247
239
|
const cmd3 = new Command10("update");
|
|
248
|
-
cmd3.description("Update SDK metadata
|
|
240
|
+
cmd3.description("Update SDK metadata");
|
|
249
241
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
250
242
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
251
|
-
cmd3.option("--title <title>", "
|
|
243
|
+
cmd3.option("--title <title>", "SDK title");
|
|
252
244
|
cmd3.addOption(
|
|
253
245
|
new Option4(
|
|
254
246
|
"--isPrivate <isPrivate>",
|
|
255
|
-
"
|
|
247
|
+
"Access setting (true/private or false/public)"
|
|
256
248
|
).choices([...PRIVACY_VALUES])
|
|
257
249
|
);
|
|
258
250
|
cmd3.action(async (...args) => {
|
|
259
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
251
|
+
const { updateAction } = await import("./chunks/update.action-QZI7M2MV.js");
|
|
260
252
|
return updateAction(...args);
|
|
261
253
|
});
|
|
262
254
|
return cmd3;
|
|
@@ -273,7 +265,7 @@ var GetSdkCommand = () => {
|
|
|
273
265
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
274
266
|
cmd3.option("--json", "Output structured SDK metadata as JSON");
|
|
275
267
|
cmd3.action(async (...args) => {
|
|
276
|
-
const { getAction } = await import("./chunks/get.action-
|
|
268
|
+
const { getAction } = await import("./chunks/get.action-LNBOWUVE.js");
|
|
277
269
|
return getAction(...args);
|
|
278
270
|
});
|
|
279
271
|
return cmd3;
|
|
@@ -283,11 +275,11 @@ var GetSdkCommand = () => {
|
|
|
283
275
|
import { Command as Command12 } from "commander";
|
|
284
276
|
var ListSdkCommand = () => {
|
|
285
277
|
const cmd3 = new Command12("list");
|
|
286
|
-
cmd3.description("List
|
|
278
|
+
cmd3.description("List SDKs in a team namespace");
|
|
287
279
|
cmd3.option("--json", "Output structured SDK metadata as JSON");
|
|
288
280
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
289
281
|
cmd3.action(async (...args) => {
|
|
290
|
-
const { listAction } = await import("./chunks/list.action-
|
|
282
|
+
const { listAction } = await import("./chunks/list.action-6CRFQPJT.js");
|
|
291
283
|
return listAction(...args);
|
|
292
284
|
});
|
|
293
285
|
return cmd3;
|
|
@@ -303,7 +295,7 @@ var sdkCommands = [
|
|
|
303
295
|
BuildSdkCommand
|
|
304
296
|
];
|
|
305
297
|
var sdkDomain = new Command13("sdk");
|
|
306
|
-
sdkDomain.description("Manage
|
|
298
|
+
sdkDomain.description("Manage Scalar SDKs (Enterprise only)");
|
|
307
299
|
sdkCommands.forEach((command) => {
|
|
308
300
|
sdkDomain.addCommand(command());
|
|
309
301
|
});
|
|
@@ -316,41 +308,41 @@ function createAccessGroupCommand() {
|
|
|
316
308
|
"Manage access groups and allowed email domains for the current team"
|
|
317
309
|
);
|
|
318
310
|
command.command("list").description("List access groups for the current team").option("--json", "Print the result as JSON").action(async (options) => {
|
|
319
|
-
const { runAction } = await import("./chunks/actions-
|
|
311
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
320
312
|
await runAction({ operation: "list", ...options });
|
|
321
313
|
});
|
|
322
314
|
command.command("create").description("Create an access group (Pro or above)").argument("<slug>", "New access group slug").option("--name <name>", "Display name").option("--domain <domains...>", "Allowed email domains").option("--json", "Print the result as JSON").action(
|
|
323
315
|
async (slug, options) => {
|
|
324
|
-
const { runAction } = await import("./chunks/actions-
|
|
316
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
325
317
|
await runAction({ operation: "create", slug, ...options });
|
|
326
318
|
}
|
|
327
319
|
);
|
|
328
320
|
command.command("get").description("Get an access group and its allowlists").argument("<slug>", "Access group slug").option("--json", "Print the result as JSON").action(async (slug, options) => {
|
|
329
|
-
const { runAction } = await import("./chunks/actions-
|
|
321
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
330
322
|
await runAction({ operation: "get", slug, ...options });
|
|
331
323
|
});
|
|
332
324
|
command.command("update").description("Update access group metadata").argument("<slug>", "Current access group slug").option("--name <name>", "New display name").option("--new-slug <slug>", "New access group slug").option("--json", "Print the result as JSON").action(
|
|
333
325
|
async (slug, options) => {
|
|
334
|
-
const { runAction } = await import("./chunks/actions-
|
|
326
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
335
327
|
await runAction({ operation: "update", slug, ...options });
|
|
336
328
|
}
|
|
337
329
|
);
|
|
338
330
|
command.command("delete").description("Delete an access group and remove its project assignments").argument("<slug>", "Access group slug").option("-y, --yes", "Confirm deletion without prompting").option("--json", "Print the result as JSON (requires --yes)").action(
|
|
339
331
|
async (slug, options) => {
|
|
340
|
-
const { runAction } = await import("./chunks/actions-
|
|
332
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
341
333
|
await runAction({ operation: "delete", slug, ...options });
|
|
342
334
|
}
|
|
343
335
|
);
|
|
344
336
|
const domain = command.command("domain").description("Manage allowed email domains");
|
|
345
337
|
domain.command("add").description("Add an exact email domain to an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
|
|
346
338
|
async (slug, domain2, options) => {
|
|
347
|
-
const { runAction } = await import("./chunks/actions-
|
|
339
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
348
340
|
await runAction({ operation: "add-domain", slug, domain: domain2, ...options });
|
|
349
341
|
}
|
|
350
342
|
);
|
|
351
343
|
domain.command("remove").description("Remove an exact email domain from an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
|
|
352
344
|
async (slug, domain2, options) => {
|
|
353
|
-
const { runAction } = await import("./chunks/actions-
|
|
345
|
+
const { runAction } = await import("./chunks/actions-S6K76HCW.js");
|
|
354
346
|
await runAction({
|
|
355
347
|
operation: "remove-domain",
|
|
356
348
|
slug,
|
|
@@ -370,12 +362,22 @@ import { Command as Command18 } from "commander";
|
|
|
370
362
|
import { Command as Command15, Option as Option5 } from "commander";
|
|
371
363
|
var LoginCommand = () => {
|
|
372
364
|
const cmd3 = new Command15("login");
|
|
373
|
-
cmd3.description("
|
|
374
|
-
cmd3.option("--token <token>", "Personal token");
|
|
375
|
-
cmd3.addOption(
|
|
376
|
-
|
|
365
|
+
cmd3.description("Log in to Scalar");
|
|
366
|
+
cmd3.option("--token <token>", "Personal token for authentication");
|
|
367
|
+
cmd3.addOption(
|
|
368
|
+
new Option5(
|
|
369
|
+
"--email <email>",
|
|
370
|
+
"Email address (unsupported; use browser or token authentication)"
|
|
371
|
+
).hideHelp()
|
|
372
|
+
);
|
|
373
|
+
cmd3.addOption(
|
|
374
|
+
new Option5(
|
|
375
|
+
"--password <password>",
|
|
376
|
+
"Password (unsupported; use browser or token authentication)"
|
|
377
|
+
).hideHelp()
|
|
378
|
+
);
|
|
377
379
|
cmd3.action(async (...args) => {
|
|
378
|
-
const { loginAction } = await import("./chunks/action-
|
|
380
|
+
const { loginAction } = await import("./chunks/action-SOYSVG67.js");
|
|
379
381
|
return loginAction(...args);
|
|
380
382
|
});
|
|
381
383
|
return cmd3;
|
|
@@ -385,25 +387,23 @@ var LoginCommand = () => {
|
|
|
385
387
|
import { Command as Command16 } from "commander";
|
|
386
388
|
var LogoutCommand = () => {
|
|
387
389
|
const cmd3 = new Command16("logout");
|
|
388
|
-
cmd3.description("
|
|
390
|
+
cmd3.description("Log out of Scalar");
|
|
389
391
|
cmd3.action(async () => {
|
|
390
392
|
await logout();
|
|
391
|
-
output.info().message("
|
|
393
|
+
output.info().message("Logged out of Scalar.").print();
|
|
392
394
|
});
|
|
393
395
|
return cmd3;
|
|
394
396
|
};
|
|
395
397
|
|
|
396
398
|
// src/domains/auth/whoami/index.ts
|
|
397
|
-
import as from "ansis";
|
|
398
399
|
import { Command as Command17 } from "commander";
|
|
399
400
|
var WhoAmICommand = () => {
|
|
400
401
|
const cmd3 = new Command17("whoami");
|
|
401
|
-
cmd3.description("
|
|
402
|
-
cmd3.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
).line().print();
|
|
402
|
+
cmd3.description("Show the logged-in user and current team");
|
|
403
|
+
cmd3.option("--json", "Output authentication details as JSON");
|
|
404
|
+
cmd3.action(async (options) => {
|
|
405
|
+
const { whoamiAction } = await import("./chunks/action-D5QWDNQ2.js");
|
|
406
|
+
return whoamiAction(options);
|
|
407
407
|
});
|
|
408
408
|
return cmd3;
|
|
409
409
|
};
|
|
@@ -411,7 +411,7 @@ var WhoAmICommand = () => {
|
|
|
411
411
|
// src/domains/auth/index.ts
|
|
412
412
|
var authCommands = [LoginCommand, WhoAmICommand, LogoutCommand];
|
|
413
413
|
var authDomain = new Command18("auth");
|
|
414
|
-
authDomain.description("
|
|
414
|
+
authDomain.description("Log in to Scalar and manage your session");
|
|
415
415
|
authCommands.forEach((command) => authDomain.addCommand(command()));
|
|
416
416
|
var auth_default = authDomain;
|
|
417
417
|
|
|
@@ -427,7 +427,7 @@ var createCompletionCommand = () => new Command19("completion").description("Gen
|
|
|
427
427
|
...COMPLETION_SHELLS
|
|
428
428
|
])
|
|
429
429
|
).action(async (shell) => {
|
|
430
|
-
const { renderCompletionScript } = await import("./chunks/scripts-
|
|
430
|
+
const { renderCompletionScript } = await import("./chunks/scripts-6CI6U32J.js");
|
|
431
431
|
process.stdout.write(renderCompletionScript(shell));
|
|
432
432
|
});
|
|
433
433
|
var createCompletionQueryCommand = () => new Command19("__complete").description("Query shell completion candidates").argument("<cursor>", "Zero-based cursor word index").argument("[words...]", "Shell words including the executable").action(
|
|
@@ -455,7 +455,7 @@ cmd.description(
|
|
|
455
455
|
"Print every command, argument, and option as JSON for AI agents"
|
|
456
456
|
);
|
|
457
457
|
cmd.action(async () => {
|
|
458
|
-
const { contextAction } = await import("./chunks/action-
|
|
458
|
+
const { contextAction } = await import("./chunks/action-Y7EBKCUU.js");
|
|
459
459
|
return contextAction(cmd);
|
|
460
460
|
});
|
|
461
461
|
var context_default = cmd;
|
|
@@ -468,17 +468,20 @@ import { Command as Command21 } from "commander";
|
|
|
468
468
|
function JoinCommand() {
|
|
469
469
|
const cmd3 = new Command21("join");
|
|
470
470
|
cmd3.description(
|
|
471
|
-
"
|
|
471
|
+
"Join API descriptions of the same format into one description"
|
|
472
|
+
);
|
|
473
|
+
cmd3.argument("<files...>", "OpenAPI or AsyncAPI file paths to join");
|
|
474
|
+
cmd3.option(
|
|
475
|
+
"-o, --output <file>",
|
|
476
|
+
"Output file for the joined description (required)"
|
|
472
477
|
);
|
|
473
|
-
cmd3.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
|
|
474
|
-
cmd3.option("-o, --output <file>", "Path to save the merged output file");
|
|
475
478
|
cmd3.option(
|
|
476
479
|
"-p, --prefix-components-with-path-value <path>",
|
|
477
480
|
"Dot-separated path to extract a prefix value from each input file for component names"
|
|
478
481
|
);
|
|
479
482
|
completeFiles(cmd3, ["files"], ["--output"]);
|
|
480
483
|
cmd3.action(async (...args) => {
|
|
481
|
-
const { joinAction } = await import("./chunks/action-
|
|
484
|
+
const { joinAction } = await import("./chunks/action-GXDJLF2G.js");
|
|
482
485
|
return joinAction(...args);
|
|
483
486
|
});
|
|
484
487
|
return cmd3;
|
|
@@ -488,16 +491,21 @@ function JoinCommand() {
|
|
|
488
491
|
import { Command as Command22 } from "commander";
|
|
489
492
|
function SplitCommand() {
|
|
490
493
|
const cmd3 = new Command22("split");
|
|
491
|
-
cmd3.description(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
+
cmd3.description(
|
|
495
|
+
"Split an OpenAPI or AsyncAPI description into referenced JSON files"
|
|
496
|
+
);
|
|
497
|
+
cmd3.argument("[file|url]", "API description file path or URL to split");
|
|
498
|
+
cmd3.option(
|
|
499
|
+
"-o, --output <path>",
|
|
500
|
+
"Output directory for the split description and referenced files"
|
|
501
|
+
);
|
|
494
502
|
cmd3.addHelpText(
|
|
495
503
|
"after",
|
|
496
504
|
"\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
|
|
497
505
|
);
|
|
498
506
|
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
499
507
|
cmd3.action(async (...args) => {
|
|
500
|
-
const { splitAction } = await import("./chunks/action-
|
|
508
|
+
const { splitAction } = await import("./chunks/action-FMA5ECUA.js");
|
|
501
509
|
return splitAction(...args);
|
|
502
510
|
});
|
|
503
511
|
return cmd3;
|
|
@@ -507,12 +515,15 @@ function SplitCommand() {
|
|
|
507
515
|
import { Command as Command23 } from "commander";
|
|
508
516
|
function FormatCommand() {
|
|
509
517
|
const cmd3 = new Command23("format");
|
|
510
|
-
cmd3.description("Format an OpenAPI or AsyncAPI
|
|
518
|
+
cmd3.description("Format an OpenAPI or AsyncAPI description");
|
|
511
519
|
cmd3.argument("[file|url]", "File or URL to format");
|
|
512
|
-
cmd3.option(
|
|
520
|
+
cmd3.option(
|
|
521
|
+
"-o, --output <file>",
|
|
522
|
+
"Output file (required for URLs; otherwise overwrites the input file)"
|
|
523
|
+
);
|
|
513
524
|
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
514
525
|
cmd3.action(async (...args) => {
|
|
515
|
-
const { formatAction } = await import("./chunks/action-
|
|
526
|
+
const { formatAction } = await import("./chunks/action-KC3ZCNDR.js");
|
|
516
527
|
return formatAction(...args);
|
|
517
528
|
});
|
|
518
529
|
return cmd3;
|
|
@@ -535,9 +546,9 @@ var reportFormats = [
|
|
|
535
546
|
// src/domains/document/lint/index.ts
|
|
536
547
|
function LintCommand() {
|
|
537
548
|
const cmd3 = new Command24("lint");
|
|
538
|
-
cmd3.description("Lint
|
|
539
|
-
cmd3.argument("[file|url]", "
|
|
540
|
-
cmd3.option("-r, --rule <file|url>", "
|
|
549
|
+
cmd3.description("Lint an OpenAPI or AsyncAPI description with Spectral rules");
|
|
550
|
+
cmd3.argument("[file|url]", "API description file path or URL to lint");
|
|
551
|
+
cmd3.option("-r, --rule <file|url>", "Spectral ruleset file path or URL");
|
|
541
552
|
cmd3.addOption(
|
|
542
553
|
new Option6("--format <format>", "Report format").choices([...reportFormats]).default("codeframe")
|
|
543
554
|
);
|
|
@@ -565,7 +576,7 @@ function LintCommand() {
|
|
|
565
576
|
);
|
|
566
577
|
completeFiles(cmd3, ["file|url"], ["--rule", "--output", "--ignore-file"]);
|
|
567
578
|
cmd3.action(async (...args) => {
|
|
568
|
-
const { lintAction } = await import("./chunks/action-
|
|
579
|
+
const { lintAction } = await import("./chunks/action-MJMLQFLT.js");
|
|
569
580
|
return lintAction(...args);
|
|
570
581
|
});
|
|
571
582
|
return cmd3;
|
|
@@ -575,12 +586,12 @@ function LintCommand() {
|
|
|
575
586
|
import { Command as Command25 } from "commander";
|
|
576
587
|
function MarkdownCommand() {
|
|
577
588
|
const cmd3 = new Command25("markdown");
|
|
578
|
-
cmd3.description("Generate Markdown from an OpenAPI
|
|
589
|
+
cmd3.description("Generate Markdown documentation from an OpenAPI description");
|
|
579
590
|
cmd3.argument("[file|url]", "OpenAPI file path or URL to convert");
|
|
580
591
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
581
592
|
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
582
593
|
cmd3.action(async (...args) => {
|
|
583
|
-
const { markdownAction } = await import("./chunks/action-
|
|
594
|
+
const { markdownAction } = await import("./chunks/action-OTPXODUE.js");
|
|
584
595
|
return markdownAction(...args);
|
|
585
596
|
});
|
|
586
597
|
return cmd3;
|
|
@@ -590,18 +601,16 @@ function MarkdownCommand() {
|
|
|
590
601
|
import { Command as Command26 } from "commander";
|
|
591
602
|
function MockCommand() {
|
|
592
603
|
const cmd3 = new Command26("mock");
|
|
593
|
-
cmd3.description(
|
|
594
|
-
|
|
595
|
-
cmd3.option("-w, --watch", "watch the file for changes");
|
|
596
|
-
cmd3.option("-o, --once", "run the server only once and exit after that");
|
|
597
|
-
cmd3.option(
|
|
598
|
-
"-p, --port <port>",
|
|
599
|
-
"set the HTTP port for the mock server",
|
|
600
|
-
parsePort
|
|
604
|
+
cmd3.description(
|
|
605
|
+
"Run a Mock Server for OpenAPI operations or AsyncAPI WebSocket and SSE channels"
|
|
601
606
|
);
|
|
607
|
+
cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
|
|
608
|
+
cmd3.option("-w, --watch", "Watch the file or URL for changes");
|
|
609
|
+
cmd3.option("-o, --once", "Start the server, then stop it after two seconds");
|
|
610
|
+
cmd3.option("-p, --port <port>", "HTTP port for the Mock Server", parsePort);
|
|
602
611
|
completeFiles(cmd3, ["file|url"], []);
|
|
603
612
|
cmd3.action(async (...args) => {
|
|
604
|
-
const { mockAction } = await import("./chunks/action-
|
|
613
|
+
const { mockAction } = await import("./chunks/action-ZUZL7R3H.js");
|
|
605
614
|
return mockAction(...args);
|
|
606
615
|
});
|
|
607
616
|
return cmd3;
|
|
@@ -611,7 +620,7 @@ function MockCommand() {
|
|
|
611
620
|
import { Command as Command27 } from "commander";
|
|
612
621
|
function ConvertCommand() {
|
|
613
622
|
const cmd3 = new Command27("convert");
|
|
614
|
-
cmd3.description("Convert a Postman collection to an OpenAPI
|
|
623
|
+
cmd3.description("Convert a Postman collection to an OpenAPI description");
|
|
615
624
|
cmd3.argument("[file|url]", "Postman collection file path or URL to convert");
|
|
616
625
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
617
626
|
cmd3.option(
|
|
@@ -620,7 +629,7 @@ function ConvertCommand() {
|
|
|
620
629
|
);
|
|
621
630
|
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
622
631
|
cmd3.action(async (...args) => {
|
|
623
|
-
const { convertAction } = await import("./chunks/action-
|
|
632
|
+
const { convertAction } = await import("./chunks/action-NMW5WPD2.js");
|
|
624
633
|
return convertAction(...args);
|
|
625
634
|
});
|
|
626
635
|
return cmd3;
|
|
@@ -630,25 +639,24 @@ function ConvertCommand() {
|
|
|
630
639
|
import { Command as Command28 } from "commander";
|
|
631
640
|
function ServeCommand() {
|
|
632
641
|
const cmd3 = new Command28("serve");
|
|
633
|
-
cmd3.description(
|
|
634
|
-
|
|
635
|
-
"[file|url]",
|
|
636
|
-
"OpenAPI or AsyncAPI file or URL to show the reference for"
|
|
642
|
+
cmd3.description(
|
|
643
|
+
"Serve API Reference documentation from an OpenAPI or AsyncAPI description"
|
|
637
644
|
);
|
|
645
|
+
cmd3.argument("[file|url]", "API description file path or URL to preview");
|
|
638
646
|
cmd3.option(
|
|
639
647
|
"-c, --config <file>",
|
|
640
648
|
"JSON file with API Reference configuration"
|
|
641
649
|
);
|
|
642
|
-
cmd3.option("-w, --watch", "
|
|
643
|
-
cmd3.option("-o, --once", "
|
|
650
|
+
cmd3.option("-w, --watch", "Watch the file or URL for changes");
|
|
651
|
+
cmd3.option("-o, --once", "Start the server, then stop it after two seconds");
|
|
644
652
|
cmd3.option(
|
|
645
653
|
"-p, --port <port>",
|
|
646
|
-
"
|
|
654
|
+
"HTTP port for the API Reference server",
|
|
647
655
|
parsePort
|
|
648
656
|
);
|
|
649
657
|
completeFiles(cmd3, ["file|url"], ["--config"]);
|
|
650
658
|
cmd3.action(async (...args) => {
|
|
651
|
-
const { serveAction } = await import("./chunks/action-
|
|
659
|
+
const { serveAction } = await import("./chunks/action-7H3AWCHX.js");
|
|
652
660
|
return serveAction(...args);
|
|
653
661
|
});
|
|
654
662
|
return cmd3;
|
|
@@ -658,15 +666,17 @@ function ServeCommand() {
|
|
|
658
666
|
import { Command as Command29 } from "commander";
|
|
659
667
|
function ShareCommand() {
|
|
660
668
|
const cmd3 = new Command29("share");
|
|
661
|
-
cmd3.description(
|
|
662
|
-
|
|
669
|
+
cmd3.description(
|
|
670
|
+
"Publish an OpenAPI or AsyncAPI description to a public sandbox"
|
|
671
|
+
);
|
|
672
|
+
cmd3.argument("[file]", "API description file path or URL to share");
|
|
663
673
|
cmd3.option(
|
|
664
674
|
"-t, --token <token>",
|
|
665
|
-
"
|
|
675
|
+
"Token to update an existing public sandbox"
|
|
666
676
|
);
|
|
667
677
|
completeFiles(cmd3, ["file"], []);
|
|
668
678
|
cmd3.action(async (...args) => {
|
|
669
|
-
const { shareAction } = await import("./chunks/action-
|
|
679
|
+
const { shareAction } = await import("./chunks/action-LR75GHBA.js");
|
|
670
680
|
return shareAction(...args);
|
|
671
681
|
});
|
|
672
682
|
return cmd3;
|
|
@@ -676,12 +686,17 @@ function ShareCommand() {
|
|
|
676
686
|
import { Command as Command30 } from "commander";
|
|
677
687
|
function UpgradeCommand() {
|
|
678
688
|
const cmd3 = new Command30("upgrade");
|
|
679
|
-
cmd3.description(
|
|
689
|
+
cmd3.description(
|
|
690
|
+
"Upgrade an API description to OpenAPI 3.1 or the latest supported AsyncAPI version"
|
|
691
|
+
);
|
|
680
692
|
cmd3.argument("[file|url]", "File or URL to upgrade");
|
|
681
|
-
cmd3.option(
|
|
693
|
+
cmd3.option(
|
|
694
|
+
"-o, --output <file>",
|
|
695
|
+
"Output file (required for URLs; otherwise overwrites the input file)"
|
|
696
|
+
);
|
|
682
697
|
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
683
698
|
cmd3.action(async (...args) => {
|
|
684
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
699
|
+
const { upgradeAction } = await import("./chunks/action-EYPYQQVM.js");
|
|
685
700
|
return upgradeAction(...args);
|
|
686
701
|
});
|
|
687
702
|
return cmd3;
|
|
@@ -691,11 +706,11 @@ function UpgradeCommand() {
|
|
|
691
706
|
import { Command as Command31 } from "commander";
|
|
692
707
|
function ValidateCommand() {
|
|
693
708
|
const cmd3 = new Command31("validate");
|
|
694
|
-
cmd3.description("Validate an OpenAPI or AsyncAPI
|
|
709
|
+
cmd3.description("Validate an OpenAPI or AsyncAPI description");
|
|
695
710
|
cmd3.argument("[file|url]", "File or URL to validate");
|
|
696
711
|
completeFiles(cmd3, ["file|url"], []);
|
|
697
712
|
cmd3.action(async (...args) => {
|
|
698
|
-
const { validateAction } = await import("./chunks/action-
|
|
713
|
+
const { validateAction } = await import("./chunks/action-ZGNVWTHZ.js");
|
|
699
714
|
return validateAction(...args);
|
|
700
715
|
});
|
|
701
716
|
return cmd3;
|
|
@@ -705,15 +720,15 @@ function ValidateCommand() {
|
|
|
705
720
|
import { Command as Command32 } from "commander";
|
|
706
721
|
function VoidCommand() {
|
|
707
722
|
const cmd3 = new Command32("void");
|
|
708
|
-
cmd3.description("
|
|
709
|
-
cmd3.option("-o, --once", "
|
|
723
|
+
cmd3.description("Mirror HTTP requests with a local server");
|
|
724
|
+
cmd3.option("-o, --once", "Start the server, then stop it after two seconds");
|
|
710
725
|
cmd3.option(
|
|
711
726
|
"-p, --port <port>",
|
|
712
|
-
"
|
|
727
|
+
"HTTP port for the request-mirroring server",
|
|
713
728
|
parsePort
|
|
714
729
|
);
|
|
715
730
|
cmd3.action(async (...args) => {
|
|
716
|
-
const { voidAction } = await import("./chunks/action-
|
|
731
|
+
const { voidAction } = await import("./chunks/action-IIQMZVRJ.js");
|
|
717
732
|
return voidAction(...args);
|
|
718
733
|
});
|
|
719
734
|
return cmd3;
|
|
@@ -736,7 +751,7 @@ var documentCommands = [
|
|
|
736
751
|
UpgradeCommand
|
|
737
752
|
];
|
|
738
753
|
var documentDomain = new Command33("document");
|
|
739
|
-
documentDomain.description("
|
|
754
|
+
documentDomain.description("Work with OpenAPI and AsyncAPI descriptions");
|
|
740
755
|
documentCommands.forEach((command) => documentDomain.addCommand(command()));
|
|
741
756
|
var document_default = documentDomain;
|
|
742
757
|
|
|
@@ -747,27 +762,24 @@ import { Command as Command45 } from "commander";
|
|
|
747
762
|
import { Command as Command34, Option as Option7 } from "commander";
|
|
748
763
|
var PreviewCommand = () => {
|
|
749
764
|
const cmd3 = new Command34("preview");
|
|
750
|
-
cmd3.description("Preview
|
|
765
|
+
cmd3.description("Preview a Scalar Docs project locally");
|
|
751
766
|
cmd3.argument(
|
|
752
767
|
"[config]",
|
|
753
768
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
754
769
|
);
|
|
755
770
|
cmd3.option(
|
|
756
771
|
"-p, --port [port]",
|
|
757
|
-
"
|
|
772
|
+
"Preferred server port (uses another port if unavailable)",
|
|
758
773
|
"7970"
|
|
759
774
|
);
|
|
760
|
-
cmd3.option(
|
|
761
|
-
"-H, --host [host]",
|
|
762
|
-
"Specify which IP addresses the server should listen on."
|
|
763
|
-
);
|
|
775
|
+
cmd3.option("-H, --host [host]", "Host address for the preview server");
|
|
764
776
|
cmd3.addOption(
|
|
765
777
|
new Option7("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
|
|
766
778
|
);
|
|
767
779
|
cmd3.option("-N, --no-open", "Do not open the browser automatically", true);
|
|
768
780
|
completeFiles(cmd3, ["config"], []);
|
|
769
781
|
cmd3.action(async (...args) => {
|
|
770
|
-
const { previewAction } = await import("./chunks/action-
|
|
782
|
+
const { previewAction } = await import("./chunks/action-BRSLSOE5.js");
|
|
771
783
|
return previewAction(...args);
|
|
772
784
|
});
|
|
773
785
|
return cmd3;
|
|
@@ -777,11 +789,14 @@ var PreviewCommand = () => {
|
|
|
777
789
|
import { Command as Command35 } from "commander";
|
|
778
790
|
function CheckConfigCommand() {
|
|
779
791
|
const cmd3 = new Command35("check-config");
|
|
780
|
-
cmd3.description("
|
|
781
|
-
cmd3.argument(
|
|
792
|
+
cmd3.description("Validate a Scalar configuration file");
|
|
793
|
+
cmd3.argument(
|
|
794
|
+
"[file]",
|
|
795
|
+
"Scalar configuration file path (discovered in the current directory if omitted)"
|
|
796
|
+
);
|
|
782
797
|
completeFiles(cmd3, ["file"], []);
|
|
783
798
|
cmd3.action(async (...args) => {
|
|
784
|
-
const { checkConfigAction } = await import("./chunks/action-
|
|
799
|
+
const { checkConfigAction } = await import("./chunks/action-73ELLN3T.js");
|
|
785
800
|
return checkConfigAction(...args);
|
|
786
801
|
});
|
|
787
802
|
return cmd3;
|
|
@@ -791,13 +806,11 @@ function CheckConfigCommand() {
|
|
|
791
806
|
import { Command as Command36 } from "commander";
|
|
792
807
|
var CreateCommand = () => {
|
|
793
808
|
const cmd3 = new Command36("create");
|
|
794
|
-
cmd3.description(
|
|
795
|
-
|
|
796
|
-
);
|
|
797
|
-
cmd3.option("-n, --name <name>", "name of your project");
|
|
798
|
-
cmd3.option("-s, --slug <slug>", "project slug");
|
|
809
|
+
cmd3.description("Create a Scalar project without a linked GitHub repository");
|
|
810
|
+
cmd3.option("-n, --name <name>", "Project name");
|
|
811
|
+
cmd3.option("-s, --slug <slug>", "Project slug");
|
|
799
812
|
cmd3.action(async (...args) => {
|
|
800
|
-
const { createAction } = await import("./chunks/action-
|
|
813
|
+
const { createAction } = await import("./chunks/action-YN4TE7TG.js");
|
|
801
814
|
return createAction(...args);
|
|
802
815
|
});
|
|
803
816
|
return cmd3;
|
|
@@ -810,10 +823,10 @@ import { Command as Command38 } from "commander";
|
|
|
810
823
|
import { Command as Command37 } from "commander";
|
|
811
824
|
var ListCommand = () => {
|
|
812
825
|
const cmd3 = new Command37("list");
|
|
813
|
-
cmd3.description("List
|
|
826
|
+
cmd3.description("List production deployments for a project");
|
|
814
827
|
cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
|
|
815
828
|
cmd3.action(async (...args) => {
|
|
816
|
-
const { listAction } = await import("./chunks/action-
|
|
829
|
+
const { listAction } = await import("./chunks/action-RQCXSJPZ.js");
|
|
817
830
|
return listAction(...args);
|
|
818
831
|
});
|
|
819
832
|
return cmd3;
|
|
@@ -822,7 +835,7 @@ var ListCommand = () => {
|
|
|
822
835
|
// src/domains/project/deployments/index.ts
|
|
823
836
|
var DeploymentsCommand = () => {
|
|
824
837
|
const cmd3 = new Command38("deployments");
|
|
825
|
-
cmd3.description("
|
|
838
|
+
cmd3.description("Show project deployment history");
|
|
826
839
|
cmd3.addCommand(ListCommand());
|
|
827
840
|
return cmd3;
|
|
828
841
|
};
|
|
@@ -830,10 +843,10 @@ var DeploymentsCommand = () => {
|
|
|
830
843
|
// src/domains/project/get/index.ts
|
|
831
844
|
import { Command as Command39 } from "commander";
|
|
832
845
|
function GetCommand() {
|
|
833
|
-
const command = new Command39("get").description("
|
|
846
|
+
const command = new Command39("get").description("Show project details for the current team").argument("<slug>", "Project slug from scalar project list").option("--json", "Print project details as JSON");
|
|
834
847
|
command.action(
|
|
835
848
|
async (slug, options) => {
|
|
836
|
-
const { getAction } = await import("./chunks/action-
|
|
849
|
+
const { getAction } = await import("./chunks/action-ZKKRPLDK.js");
|
|
837
850
|
await getAction(slug, options);
|
|
838
851
|
}
|
|
839
852
|
);
|
|
@@ -844,11 +857,14 @@ function GetCommand() {
|
|
|
844
857
|
import { Command as Command40 } from "commander";
|
|
845
858
|
var InitCommand = () => {
|
|
846
859
|
const cmd3 = new Command40("init");
|
|
847
|
-
cmd3.description("
|
|
848
|
-
cmd3.option(
|
|
849
|
-
|
|
860
|
+
cmd3.description("Initialize a local Scalar Docs project");
|
|
861
|
+
cmd3.option(
|
|
862
|
+
"-s, --subdomain [url]",
|
|
863
|
+
"Subdomain for the published documentation"
|
|
864
|
+
);
|
|
865
|
+
cmd3.option("--force", "Overwrite existing configuration");
|
|
850
866
|
cmd3.action(async (...args) => {
|
|
851
|
-
const { initAction } = await import("./chunks/action-
|
|
867
|
+
const { initAction } = await import("./chunks/action-DQDHBOLJ.js");
|
|
852
868
|
return initAction(...args);
|
|
853
869
|
});
|
|
854
870
|
return cmd3;
|
|
@@ -857,9 +873,9 @@ var InitCommand = () => {
|
|
|
857
873
|
// src/domains/project/list/index.ts
|
|
858
874
|
import { Command as Command41 } from "commander";
|
|
859
875
|
function ListCommand2() {
|
|
860
|
-
const command = new Command41("list").description("List projects and their slugs for the current team
|
|
876
|
+
const command = new Command41("list").description("List projects and their slugs for the current team").option("--json", "Print project details as JSON");
|
|
861
877
|
command.action(async (options) => {
|
|
862
|
-
const { listAction } = await import("./chunks/action-
|
|
878
|
+
const { listAction } = await import("./chunks/action-IQM54ITT.js");
|
|
863
879
|
await listAction(options);
|
|
864
880
|
});
|
|
865
881
|
return command;
|
|
@@ -869,19 +885,23 @@ function ListCommand2() {
|
|
|
869
885
|
import { Command as Command42 } from "commander";
|
|
870
886
|
var PublishCommand = () => {
|
|
871
887
|
const cmd3 = new Command42("publish");
|
|
872
|
-
cmd3.description(
|
|
873
|
-
"Publish new build for a github sync project that is not linked."
|
|
874
|
-
);
|
|
888
|
+
cmd3.description("Publish a new build of a Scalar project");
|
|
875
889
|
cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
|
|
876
|
-
cmd3.option(
|
|
877
|
-
|
|
890
|
+
cmd3.option(
|
|
891
|
+
"-c, --config [config]",
|
|
892
|
+
"Scalar configuration file path for local publishing"
|
|
893
|
+
);
|
|
894
|
+
cmd3.option(
|
|
895
|
+
"-p, --preview",
|
|
896
|
+
"Publish a preview without replacing the live deployment"
|
|
897
|
+
);
|
|
878
898
|
cmd3.option(
|
|
879
899
|
"-g, --github",
|
|
880
|
-
"Publish from
|
|
900
|
+
"Publish from the linked GitHub repository instead of local files"
|
|
881
901
|
);
|
|
882
902
|
completeFiles(cmd3, [], ["--config"]);
|
|
883
903
|
cmd3.action(async (...args) => {
|
|
884
|
-
const { publishAction } = await import("./chunks/action-
|
|
904
|
+
const { publishAction } = await import("./chunks/action-RPCDNGCI.js");
|
|
885
905
|
return publishAction(...args);
|
|
886
906
|
});
|
|
887
907
|
return cmd3;
|
|
@@ -901,7 +921,7 @@ var RollbackCommand = () => {
|
|
|
901
921
|
);
|
|
902
922
|
cmd3.option("-y, --yes", "Skip the confirmation prompt");
|
|
903
923
|
cmd3.action(async (...args) => {
|
|
904
|
-
const { rollbackAction } = await import("./chunks/action-
|
|
924
|
+
const { rollbackAction } = await import("./chunks/action-J5TO3UJW.js");
|
|
905
925
|
return rollbackAction(...args);
|
|
906
926
|
});
|
|
907
927
|
return cmd3;
|
|
@@ -911,14 +931,14 @@ var RollbackCommand = () => {
|
|
|
911
931
|
import { Command as Command44 } from "commander";
|
|
912
932
|
var UpgradeCommand2 = () => {
|
|
913
933
|
const cmd3 = new Command44("upgrade");
|
|
914
|
-
cmd3.description("Upgrade
|
|
934
|
+
cmd3.description("Upgrade a Scalar Docs configuration");
|
|
915
935
|
cmd3.argument(
|
|
916
936
|
"[config]",
|
|
917
937
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
918
938
|
);
|
|
919
939
|
completeFiles(cmd3, ["config"], []);
|
|
920
940
|
cmd3.action(async (...args) => {
|
|
921
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
941
|
+
const { upgradeAction } = await import("./chunks/action-NHU4CUKT.js");
|
|
922
942
|
return upgradeAction(...args);
|
|
923
943
|
});
|
|
924
944
|
return cmd3;
|
|
@@ -938,7 +958,7 @@ var projectCommands = [
|
|
|
938
958
|
UpgradeCommand2
|
|
939
959
|
];
|
|
940
960
|
var projectDomain = new Command45("project");
|
|
941
|
-
projectDomain.description("Manage
|
|
961
|
+
projectDomain.description("Manage Scalar Docs projects");
|
|
942
962
|
for (const command of projectCommands) {
|
|
943
963
|
projectDomain.addCommand(command());
|
|
944
964
|
}
|
|
@@ -950,56 +970,43 @@ import { Command as Command47 } from "commander";
|
|
|
950
970
|
|
|
951
971
|
// src/domains/readme/generate.ts
|
|
952
972
|
import { text } from "@clack/prompts";
|
|
953
|
-
import
|
|
973
|
+
import as from "ansis";
|
|
954
974
|
import { Command as Command46 } from "commander";
|
|
955
975
|
|
|
956
976
|
// src/helpers/documentation/index.ts
|
|
957
977
|
import fs from "node:fs/promises";
|
|
958
978
|
import path from "node:path";
|
|
959
|
-
var
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
979
|
+
var COMMAND_REFERENCE_URL = "https://scalar.com/tools/cli/commands";
|
|
980
|
+
var hasOwnPage = (command) => runnableCommands(command.commands).length >= 2;
|
|
981
|
+
var referenceUrl = (command) => hasOwnPage(command) ? `${COMMAND_REFERENCE_URL}/${command.name}` : `${COMMAND_REFERENCE_URL}/general#${command.name}`;
|
|
982
|
+
var generateCommandTable = (commands) => {
|
|
983
|
+
const rows = commands.filter((command) => command.name !== "help").sort((a, b) => Number(hasOwnPage(b)) - Number(hasOwnPage(a))).map((command) => {
|
|
984
|
+
const prefix = `${command.command} `;
|
|
985
|
+
const subcommands = runnableCommands(command.commands).map((subcommand) => `\`${subcommand.command.slice(prefix.length)}\``).join(", ");
|
|
986
|
+
return `| [\`${command.command}\`](${referenceUrl(command)}) | ${command.description} | ${subcommands} |`;
|
|
966
987
|
});
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
const documentation = generateDocs(command);
|
|
973
|
-
const codeBlock = "```";
|
|
974
|
-
const documentationContent = [];
|
|
975
|
-
for (const docs of documentation) {
|
|
976
|
-
if (docs.depth !== 0) {
|
|
977
|
-
documentationContent.push(`${"#".repeat(docs.depth + 2)} ${docs.title}`);
|
|
978
|
-
}
|
|
979
|
-
documentationContent.push(`${codeBlock}
|
|
980
|
-
${docs.content}${codeBlock}`);
|
|
981
|
-
documentationContent.push("");
|
|
982
|
-
}
|
|
983
|
-
return documentationContent.join("\n");
|
|
988
|
+
return [
|
|
989
|
+
"| Command | Description | Subcommands |",
|
|
990
|
+
"| --- | --- | --- |",
|
|
991
|
+
...rows
|
|
992
|
+
].join("\n");
|
|
984
993
|
};
|
|
985
994
|
var generateDocumentationFile = async (outputPath) => {
|
|
986
|
-
const
|
|
995
|
+
const { commands } = buildCliContext(getProgram());
|
|
987
996
|
const template = await fs.readFile(
|
|
988
997
|
path.join(import.meta.dirname, "template.md"),
|
|
989
|
-
{
|
|
990
|
-
encoding: "utf-8"
|
|
991
|
-
}
|
|
998
|
+
{ encoding: "utf-8" }
|
|
992
999
|
);
|
|
993
1000
|
await fs.writeFile(
|
|
994
1001
|
outputPath,
|
|
995
|
-
template.replace("<COMMANDS>",
|
|
1002
|
+
template.replace("<COMMANDS>", generateCommandTable(commands))
|
|
996
1003
|
);
|
|
997
1004
|
};
|
|
998
1005
|
|
|
999
1006
|
// src/domains/readme/generate.ts
|
|
1000
1007
|
function GenerateReadmeCommand() {
|
|
1001
1008
|
const cmd3 = new Command46("generate");
|
|
1002
|
-
cmd3.description("
|
|
1009
|
+
cmd3.description("Generate the CLI README from the command tree");
|
|
1003
1010
|
cmd3.option(
|
|
1004
1011
|
"-o, --output [file]",
|
|
1005
1012
|
"Path where the documentation file will be written"
|
|
@@ -1019,7 +1026,7 @@ function GenerateReadmeCommand() {
|
|
|
1019
1026
|
placeholder: "./README.md"
|
|
1020
1027
|
});
|
|
1021
1028
|
if (typeof outputPath2 !== "string") {
|
|
1022
|
-
return output.error().message("Operation cancelled
|
|
1029
|
+
return output.error().message("Operation cancelled.").exit("error");
|
|
1023
1030
|
}
|
|
1024
1031
|
return outputPath2;
|
|
1025
1032
|
};
|
|
@@ -1027,39 +1034,21 @@ function GenerateReadmeCommand() {
|
|
|
1027
1034
|
const { executionTimeMs } = await measureTime(
|
|
1028
1035
|
() => generateDocumentationFile(outputPath)
|
|
1029
1036
|
);
|
|
1030
|
-
output.info().line().title(
|
|
1031
|
-
`\u23F1\uFE0F Generation completed in ${as2.yellow(executionTimeMs.toFixed(2))}ms`
|
|
1032
|
-
).line("").exit("success");
|
|
1037
|
+
output.info().line().title(as.green("CLI documentation generated")).line().message(`Written to ${as.blue(outputPath)}`).line(`Completed (${as.yellow(executionTimeMs.toFixed(2))} ms)`).line("").exit("success");
|
|
1033
1038
|
});
|
|
1034
1039
|
return cmd3;
|
|
1035
1040
|
}
|
|
1036
1041
|
|
|
1037
1042
|
// src/domains/readme/serve.ts
|
|
1038
|
-
import
|
|
1039
|
-
|
|
1040
|
-
import as3 from "ansis";
|
|
1041
|
-
var fileExists = async (filePath) => {
|
|
1042
|
-
try {
|
|
1043
|
-
await fs2.access(filePath);
|
|
1044
|
-
return true;
|
|
1045
|
-
} catch {
|
|
1046
|
-
return false;
|
|
1047
|
-
}
|
|
1048
|
-
};
|
|
1043
|
+
import as2 from "ansis";
|
|
1044
|
+
var CLI_DOCS_URL = "https://scalar.com/tools/cli/getting-started";
|
|
1049
1045
|
function ServeReadmeCommand(cmd3) {
|
|
1050
|
-
cmd3.description("Open documentation
|
|
1051
|
-
cmd3.action(
|
|
1052
|
-
|
|
1053
|
-
if (await fileExists(docsPath) === false) {
|
|
1054
|
-
return output.error().title("Documentation not found").message(
|
|
1055
|
-
"You can access documentation only by running the bundled version of the CLI."
|
|
1056
|
-
).exit("error");
|
|
1057
|
-
}
|
|
1058
|
-
const docsUrl = `file://${path2.join(import.meta.dirname, "docs.html")}`;
|
|
1059
|
-
openBrowser(docsUrl);
|
|
1046
|
+
cmd3.description("Open CLI documentation in your browser");
|
|
1047
|
+
cmd3.action(() => {
|
|
1048
|
+
openBrowser(CLI_DOCS_URL);
|
|
1060
1049
|
output.info().message(
|
|
1061
|
-
"
|
|
1062
|
-
).line(
|
|
1050
|
+
"Opening CLI documentation in your default browser. If it does not open, visit:"
|
|
1051
|
+
).line(as2.blue(CLI_DOCS_URL)).line().exit("success");
|
|
1063
1052
|
});
|
|
1064
1053
|
return cmd3;
|
|
1065
1054
|
}
|
|
@@ -1077,17 +1066,20 @@ import { Command as Command53 } from "commander";
|
|
|
1077
1066
|
import { Command as Command48 } from "commander";
|
|
1078
1067
|
var PublishCommand2 = () => {
|
|
1079
1068
|
const cmd3 = new Command48("publish");
|
|
1080
|
-
cmd3.description("Publish an OpenAPI
|
|
1081
|
-
cmd3.argument("[file]", "
|
|
1069
|
+
cmd3.description("Publish an OpenAPI description to the Scalar Registry");
|
|
1070
|
+
cmd3.argument("[file]", "API description file path or URL to upload");
|
|
1082
1071
|
cmd3.option(
|
|
1083
1072
|
"--slug <slug>",
|
|
1084
|
-
"
|
|
1073
|
+
"Scalar Registry entry slug (defaults to a slug generated from the title)"
|
|
1085
1074
|
);
|
|
1086
1075
|
cmd3.option("--namespace <namespace>", "Scalar team namespace");
|
|
1087
|
-
cmd3.option(
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1076
|
+
cmd3.option(
|
|
1077
|
+
"--version <version>",
|
|
1078
|
+
"API description version (for example, 0.1.0)"
|
|
1079
|
+
);
|
|
1080
|
+
cmd3.option("--private", "Make the API description private", false);
|
|
1081
|
+
cmd3.option("--no-current", "Keep the existing current version");
|
|
1082
|
+
cmd3.option("--force", "Overwrite an existing version", false);
|
|
1091
1083
|
cmd3.option("--bundle", "Bundle all external references before uploading");
|
|
1092
1084
|
cmd3.option(
|
|
1093
1085
|
"--treeShake",
|
|
@@ -1099,12 +1091,12 @@ var PublishCommand2 = () => {
|
|
|
1099
1091
|
);
|
|
1100
1092
|
cmd3.option(
|
|
1101
1093
|
"--fetchLimit <limit>",
|
|
1102
|
-
"Maximum number of concurrent
|
|
1094
|
+
"Maximum number of concurrent URL fetches when bundling",
|
|
1103
1095
|
parseFetchLimit
|
|
1104
1096
|
);
|
|
1105
1097
|
completeFiles(cmd3, ["file"], []);
|
|
1106
1098
|
cmd3.action(async (...args) => {
|
|
1107
|
-
const { publishAction } = await import("./chunks/action-
|
|
1099
|
+
const { publishAction } = await import("./chunks/action-L7TMS3Q3.js");
|
|
1108
1100
|
return publishAction(...args);
|
|
1109
1101
|
});
|
|
1110
1102
|
return cmd3;
|
|
@@ -1114,11 +1106,11 @@ var PublishCommand2 = () => {
|
|
|
1114
1106
|
import { Command as Command49 } from "commander";
|
|
1115
1107
|
var DeleteCommand = () => {
|
|
1116
1108
|
const cmd3 = new Command49("delete");
|
|
1117
|
-
cmd3.description("Delete
|
|
1109
|
+
cmd3.description("Delete an API description from the Scalar Registry");
|
|
1118
1110
|
cmd3.argument("[namespace]", "Team namespace");
|
|
1119
|
-
cmd3.argument("[slug]", "
|
|
1111
|
+
cmd3.argument("[slug]", "API description slug");
|
|
1120
1112
|
cmd3.action(async (...args) => {
|
|
1121
|
-
const { deleteAction } = await import("./chunks/action-
|
|
1113
|
+
const { deleteAction } = await import("./chunks/action-IH6G77C5.js");
|
|
1122
1114
|
return deleteAction(...args);
|
|
1123
1115
|
});
|
|
1124
1116
|
return cmd3;
|
|
@@ -1128,17 +1120,22 @@ var DeleteCommand = () => {
|
|
|
1128
1120
|
import { Command as Command50, Option as Option8 } from "commander";
|
|
1129
1121
|
var GetCommand2 = () => {
|
|
1130
1122
|
const cmd3 = new Command50("get");
|
|
1131
|
-
cmd3.description(
|
|
1123
|
+
cmd3.description(
|
|
1124
|
+
"Download an API description version from the Scalar Registry"
|
|
1125
|
+
);
|
|
1132
1126
|
cmd3.argument("[namespace]", "Team namespace");
|
|
1133
|
-
cmd3.argument("[slug]", "
|
|
1134
|
-
cmd3.option(
|
|
1127
|
+
cmd3.argument("[slug]", "API description slug");
|
|
1128
|
+
cmd3.option(
|
|
1129
|
+
"--version <version>",
|
|
1130
|
+
"API description version (defaults to latest)"
|
|
1131
|
+
);
|
|
1135
1132
|
cmd3.addOption(
|
|
1136
|
-
new Option8("--format <format>", "Output format
|
|
1133
|
+
new Option8("--format <format>", "Output format").choices([...DOCUMENT_FORMATS]).default("json")
|
|
1137
1134
|
);
|
|
1138
1135
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
1139
1136
|
completeFiles(cmd3, [], ["--output"]);
|
|
1140
1137
|
cmd3.action(async (...args) => {
|
|
1141
|
-
const { getAction } = await import("./chunks/action-
|
|
1138
|
+
const { getAction } = await import("./chunks/action-5I4XDPPG.js");
|
|
1142
1139
|
return getAction(...args);
|
|
1143
1140
|
});
|
|
1144
1141
|
return cmd3;
|
|
@@ -1148,11 +1145,11 @@ var GetCommand2 = () => {
|
|
|
1148
1145
|
import { Command as Command51 } from "commander";
|
|
1149
1146
|
var ListCommand3 = () => {
|
|
1150
1147
|
const cmd3 = new Command51("list");
|
|
1151
|
-
cmd3.description("List
|
|
1148
|
+
cmd3.description("List Scalar Registry API descriptions in a team namespace");
|
|
1152
1149
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
1153
|
-
cmd3.option("--json", "Output
|
|
1150
|
+
cmd3.option("--json", "Output Scalar Registry API metadata as JSON");
|
|
1154
1151
|
cmd3.action(async (...args) => {
|
|
1155
|
-
const { listAction } = await import("./chunks/action-
|
|
1152
|
+
const { listAction } = await import("./chunks/action-25QMCP5G.js");
|
|
1156
1153
|
return listAction(...args);
|
|
1157
1154
|
});
|
|
1158
1155
|
return cmd3;
|
|
@@ -1162,13 +1159,13 @@ var ListCommand3 = () => {
|
|
|
1162
1159
|
import { Command as Command52 } from "commander";
|
|
1163
1160
|
var UpdateCommand = () => {
|
|
1164
1161
|
const cmd3 = new Command52("update");
|
|
1165
|
-
cmd3.description("Update
|
|
1166
|
-
cmd3.argument("[namespace]", "namespace
|
|
1167
|
-
cmd3.argument("[slug]", "
|
|
1168
|
-
cmd3.option("--title <title>", "
|
|
1169
|
-
cmd3.option("--description <description>", "
|
|
1162
|
+
cmd3.description("Update API description metadata in the Scalar Registry");
|
|
1163
|
+
cmd3.argument("[namespace]", "Team namespace");
|
|
1164
|
+
cmd3.argument("[slug]", "API description slug");
|
|
1165
|
+
cmd3.option("--title <title>", "API description title");
|
|
1166
|
+
cmd3.option("--description <description>", "API description summary");
|
|
1170
1167
|
cmd3.action(async (...args) => {
|
|
1171
|
-
const { updateAction } = await import("./chunks/action-
|
|
1168
|
+
const { updateAction } = await import("./chunks/action-HUICEXJZ.js");
|
|
1172
1169
|
return updateAction(...args);
|
|
1173
1170
|
});
|
|
1174
1171
|
return cmd3;
|
|
@@ -1183,7 +1180,7 @@ var registryCommands = [
|
|
|
1183
1180
|
GetCommand2
|
|
1184
1181
|
];
|
|
1185
1182
|
var registryDomain = new Command53("registry");
|
|
1186
|
-
registryDomain.description("Manage
|
|
1183
|
+
registryDomain.description("Manage API descriptions in the Scalar Registry");
|
|
1187
1184
|
registryCommands.forEach((command) => registryDomain.addCommand(command()));
|
|
1188
1185
|
var registry_default = registryDomain;
|
|
1189
1186
|
|
|
@@ -1194,10 +1191,10 @@ import { Command as Command57 } from "commander";
|
|
|
1194
1191
|
import { Command as Command54 } from "commander";
|
|
1195
1192
|
var GetCommand3 = () => {
|
|
1196
1193
|
const cmd3 = new Command54("get");
|
|
1197
|
-
cmd3.description("
|
|
1194
|
+
cmd3.description("Show the current team and its namespaces");
|
|
1198
1195
|
cmd3.option("--json", "Output the current team as JSON");
|
|
1199
1196
|
cmd3.action(async (...args) => {
|
|
1200
|
-
const { getAction } = await import("./chunks/action-
|
|
1197
|
+
const { getAction } = await import("./chunks/action-NKTFNFU7.js");
|
|
1201
1198
|
return getAction(...args);
|
|
1202
1199
|
});
|
|
1203
1200
|
return cmd3;
|
|
@@ -1207,10 +1204,10 @@ var GetCommand3 = () => {
|
|
|
1207
1204
|
import { Command as Command55 } from "commander";
|
|
1208
1205
|
var ListCommand4 = () => {
|
|
1209
1206
|
const cmd3 = new Command55("list");
|
|
1210
|
-
cmd3.description("List
|
|
1207
|
+
cmd3.description("List your Scalar teams");
|
|
1211
1208
|
cmd3.option("--json", "Output teams as JSON");
|
|
1212
1209
|
cmd3.action(async (...args) => {
|
|
1213
|
-
const { listAction } = await import("./chunks/action-
|
|
1210
|
+
const { listAction } = await import("./chunks/action-6M5PTDF6.js");
|
|
1214
1211
|
return listAction(...args);
|
|
1215
1212
|
});
|
|
1216
1213
|
return cmd3;
|
|
@@ -1220,10 +1217,10 @@ var ListCommand4 = () => {
|
|
|
1220
1217
|
import { Command as Command56 } from "commander";
|
|
1221
1218
|
var SetCommand = () => {
|
|
1222
1219
|
const cmd3 = new Command56("set");
|
|
1223
|
-
cmd3.description("
|
|
1224
|
-
cmd3.option("--team <team>", "Team
|
|
1220
|
+
cmd3.description("Select the current team");
|
|
1221
|
+
cmd3.option("--team <team>", "Team ID");
|
|
1225
1222
|
cmd3.action(async (...args) => {
|
|
1226
|
-
const { setAction } = await import("./chunks/action-
|
|
1223
|
+
const { setAction } = await import("./chunks/action-2VF6LODL.js");
|
|
1227
1224
|
return setAction(...args);
|
|
1228
1225
|
});
|
|
1229
1226
|
return cmd3;
|
|
@@ -1232,7 +1229,7 @@ var SetCommand = () => {
|
|
|
1232
1229
|
// src/domains/team/index.ts
|
|
1233
1230
|
var teamCommands = [ListCommand4, GetCommand3, SetCommand];
|
|
1234
1231
|
var teamDomain = new Command57("team");
|
|
1235
|
-
teamDomain.description("
|
|
1232
|
+
teamDomain.description("List and switch between your Scalar teams");
|
|
1236
1233
|
teamCommands.forEach((command) => {
|
|
1237
1234
|
teamDomain.addCommand(command());
|
|
1238
1235
|
});
|
|
@@ -1240,11 +1237,11 @@ var team_default = teamDomain;
|
|
|
1240
1237
|
|
|
1241
1238
|
// src/domains/upgrade/index.ts
|
|
1242
1239
|
import { execSync } from "node:child_process";
|
|
1243
|
-
import
|
|
1240
|
+
import as4 from "ansis";
|
|
1244
1241
|
import { Command as Command58 } from "commander";
|
|
1245
1242
|
|
|
1246
1243
|
// src/helpers/upgrade.ts
|
|
1247
|
-
import
|
|
1244
|
+
import as3 from "ansis";
|
|
1248
1245
|
import semver from "semver";
|
|
1249
1246
|
var packageJsonSchema = external_exports.object({
|
|
1250
1247
|
version: external_exports.string()
|
|
@@ -1284,12 +1281,12 @@ async function checkUpgrade(stream = "stdout") {
|
|
|
1284
1281
|
const emitOutput = () => {
|
|
1285
1282
|
if (stream === "stderr") {
|
|
1286
1283
|
process.stderr.write(
|
|
1287
|
-
"
|
|
1284
|
+
"A new Scalar CLI version is available. Run `scalar upgrade` to install the latest version.\n"
|
|
1288
1285
|
);
|
|
1289
1286
|
return;
|
|
1290
1287
|
}
|
|
1291
1288
|
return output.info().message(
|
|
1292
|
-
`
|
|
1289
|
+
`A new Scalar CLI version is available. Run ${as3.cyan("`scalar upgrade`")} to install the latest version.`
|
|
1293
1290
|
).print();
|
|
1294
1291
|
};
|
|
1295
1292
|
const now = Date.now();
|
|
@@ -1317,29 +1314,29 @@ async function checkUpgrade(stream = "stdout") {
|
|
|
1317
1314
|
|
|
1318
1315
|
// src/domains/upgrade/index.ts
|
|
1319
1316
|
var cmd2 = new Command58("upgrade");
|
|
1320
|
-
cmd2.description("Upgrade
|
|
1317
|
+
cmd2.description("Upgrade the Scalar CLI to the latest version");
|
|
1321
1318
|
cmd2.action(async () => {
|
|
1322
1319
|
if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
|
|
1323
1320
|
output.info().message(
|
|
1324
|
-
"To upgrade
|
|
1321
|
+
"To upgrade an installer-managed Scalar CLI, run the installer again. For a manually extracted installation, download and extract the newer archive and replace the installation directory."
|
|
1325
1322
|
).print();
|
|
1326
1323
|
return;
|
|
1327
1324
|
}
|
|
1328
1325
|
const upgradeStatus = await getUpgradeInformation();
|
|
1329
1326
|
if (!upgradeStatus.upgrade) {
|
|
1330
|
-
output.info().message("
|
|
1327
|
+
output.info().message("Scalar CLI is already up to date.").print();
|
|
1331
1328
|
return;
|
|
1332
1329
|
}
|
|
1333
1330
|
output.info().message(
|
|
1334
|
-
`Upgrading from ${upgradeStatus.currentVersion} to ${upgradeStatus.latestVersion}
|
|
1331
|
+
`Upgrading from ${upgradeStatus.currentVersion} to ${upgradeStatus.latestVersion}\u2026`
|
|
1335
1332
|
).print();
|
|
1336
1333
|
try {
|
|
1337
1334
|
execSync(`npm install -g ${upgradeStatus.name}@latest`, {
|
|
1338
1335
|
stdio: "inherit"
|
|
1339
1336
|
});
|
|
1340
|
-
output.info().message("
|
|
1337
|
+
output.info().message("Scalar CLI upgraded to the latest version.").print();
|
|
1341
1338
|
} catch {
|
|
1342
|
-
output.error().title("Upgrade failed").message("
|
|
1339
|
+
output.error().title("Upgrade failed").message("Could not upgrade Scalar CLI. Run:").message(as4.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
|
|
1343
1340
|
}
|
|
1344
1341
|
});
|
|
1345
1342
|
var upgrade_default = cmd2;
|
|
@@ -1364,10 +1361,18 @@ var domains_default = domains;
|
|
|
1364
1361
|
// src/program.ts
|
|
1365
1362
|
var getProgram = () => {
|
|
1366
1363
|
const program2 = new Command59();
|
|
1367
|
-
program2.enablePositionalOptions().name(Object.keys(bin)[0]).description(
|
|
1364
|
+
program2.enablePositionalOptions().name(Object.keys(bin)[0]).description(
|
|
1365
|
+
"Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar"
|
|
1366
|
+
).version(version, "-v, --version", "Show the version number");
|
|
1368
1367
|
program2.showHelpAfterError();
|
|
1369
1368
|
domains_default.forEach((domain) => program2.addCommand(domain));
|
|
1370
1369
|
program2.addCommand(createCompletionQueryCommand(), { hidden: true });
|
|
1370
|
+
const configureHelpCopy = (command) => {
|
|
1371
|
+
command.helpOption("-h, --help", "Show help for this command");
|
|
1372
|
+
command.createHelp().visibleCommands(command).find((child) => child.name() === "help")?.description("Show help for a command");
|
|
1373
|
+
for (const child of command.commands) configureHelpCopy(child);
|
|
1374
|
+
};
|
|
1375
|
+
configureHelpCopy(program2);
|
|
1371
1376
|
return program2;
|
|
1372
1377
|
};
|
|
1373
1378
|
|