@scalar/cli 2.8.0 → 2.10.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 +281 -65
- package/chunks/action-4GZI2M5B.js +62 -0
- package/chunks/action-4W5GUGEG.js +63 -0
- package/chunks/{action-FCAYFPVR.js → action-5LF4XYHX.js} +10 -7
- package/chunks/{action-XIUO64C7.js → action-5N3P43MD.js} +17 -12
- package/chunks/{action-Y7OUGD56.js → action-5RL4NWUZ.js} +17 -17
- package/chunks/{action-LXGXKXZZ.js → action-657A4K2D.js} +16 -16
- package/chunks/{action-EOAVVL52.js → action-7XOHYWYM.js} +11 -14
- package/chunks/{action-AQRPFQKI.js → action-CABLS46Q.js} +9 -7
- package/chunks/{action-F7A2K74G.js → action-CB55NWAU.js} +9 -13
- package/chunks/{action-5SK5NE7E.js → action-DKDRAIKV.js} +11 -14
- package/chunks/{action-7PEQXDWT.js → action-DTEO4YNX.js} +127 -20
- package/chunks/{action-UIKH4SZX.js → action-EAUTQ77U.js} +27 -23
- package/chunks/{action-YLF2G4G5.js → action-FBRY5JKU.js} +16 -16
- package/chunks/{action-VOFDW3U2.js → action-GFLRD7LO.js} +6 -5
- package/chunks/{action-GWXLHL2Z.js → action-GWYYTUTM.js} +4 -3
- package/chunks/{action-6BYGBXRC.js → action-HT42NUUX.js} +27 -22
- package/chunks/action-JEYDBB3P.js +147 -0
- package/chunks/{action-LLH4QPXM.js → action-KDUFU7TZ.js} +11 -13
- package/chunks/{action-W3C53GPH.js → action-LYCNT3KA.js} +29 -10
- package/chunks/{action-CA4QYPI6.js → action-OJ2NK25F.js} +4 -8
- package/chunks/{action-NVI5DWFP.js → action-PAM2EZ22.js} +4 -8
- package/chunks/action-PPTFYZWD.js +1552 -0
- package/chunks/{action-43YBNBDR.js → action-R4PGILN4.js} +28 -24
- package/chunks/{action-QQZLPI42.js → action-TOBU74JH.js} +23 -19
- package/chunks/action-U2L5DCFG.js +91 -0
- package/chunks/{action-H6OUJWWM.js → action-UUL6SWV4.js} +11 -14
- package/chunks/{action-354TUG4H.js → action-X7BA7PQQ.js} +10 -8
- package/chunks/{action-WFDNRA7D.js → action-XLE37MZL.js} +16 -16
- package/chunks/{action-Y6NXJQ4H.js → action-XOADBXSX.js} +16 -12
- package/chunks/{action-LEUD5P2U.js → action-YSVTZVKV.js} +36 -17
- package/chunks/{action-YRX6SN5F.js → action-ZFI77WA5.js} +8 -6
- package/chunks/{action-HT2DJ34Z.js → action-ZKA3RR3S.js} +15 -11
- package/chunks/{actions-OGIVBQC7.js → actions-3SAMH7A5.js} +41 -17
- package/chunks/{agent-ASPV3R5U.js → agent-2ESZI7NO.js} +7 -5
- package/chunks/{asyncapi-QNFKXHEI.js → asyncapi-4HGVM3PR.js} +14 -10
- package/chunks/{build.action-NM6CAE5F.js → build.action-VBGFGACM.js} +19 -17
- package/chunks/chunk-35Z7VTJT.js +453 -0
- package/chunks/chunk-36LXIJIZ.js +52 -0
- package/chunks/{chunk-KKRGBXCE.js → chunk-43WALAW3.js} +248 -103
- package/chunks/{chunk-C2KAWRIX.js → chunk-5ENKYZA4.js} +1 -1
- package/chunks/{chunk-GTV2BVXV.js → chunk-5SMP756H.js} +2 -2
- package/chunks/{chunk-5JLVQVKO.js → chunk-6M7TL2G2.js} +146 -148
- package/chunks/chunk-6PSYZO3U.js +24 -0
- package/chunks/{chunk-EXY3ZTV4.js → chunk-ATNTXKMS.js} +36 -274
- package/chunks/{chunk-PH3WFNXJ.js → chunk-BIMLCGKS.js} +1 -1
- package/chunks/{chunk-HGOD6THU.js → chunk-CWVYOXXM.js} +2 -19
- package/chunks/chunk-DFOZG7ZV.js +15 -0
- package/chunks/chunk-DHZW7Q7U.js +133 -0
- package/chunks/{chunk-R5LK6VPY.js → chunk-G4HRW2FZ.js} +13 -20
- package/chunks/{chunk-KCCFN4F7.js → chunk-GLWTVLKM.js} +29 -29
- package/chunks/{chunk-5UHLAJQD.js → chunk-GYRQPDTK.js} +24 -10
- package/chunks/chunk-H467HDVV.js +24 -0
- package/chunks/chunk-IPZP3VRA.js +327 -0
- package/chunks/{chunk-2OCWX42S.js → chunk-JXGF5EHC.js} +152 -18
- package/chunks/chunk-K2HIB5BA.js +92 -0
- package/chunks/{chunk-FDC2IESH.js → chunk-KHF2QXBG.js} +1352 -8327
- package/chunks/{chunk-IMG35UXX.js → chunk-KZNRQVMY.js} +1 -1
- package/chunks/{chunk-OJ2EWIJH.js → chunk-MC4EMNOR.js} +5 -1
- package/chunks/{chunk-YILQODZF.js → chunk-MMWSCTDB.js} +7 -4
- package/chunks/{chunk-6XWCMJDB.js → chunk-MNNGUUKJ.js} +12 -11
- package/chunks/chunk-NAC63XJF.js +10 -0
- package/chunks/{chunk-XXSQUBXS.js → chunk-UDBSV3CK.js} +107 -453
- package/chunks/{chunk-IKT5F47M.js → chunk-VVRUSQCY.js} +11 -11
- package/chunks/{chunk-BPGFSSUH.js → chunk-VYFGRLVQ.js} +1 -1
- package/chunks/{chunk-UXJ753NV.js → chunk-WB6PWTMU.js} +5 -13
- package/chunks/{chunk-5DEU2DVL.js → chunk-WDIWLXLV.js} +3 -15
- package/chunks/{chunk-6YPQGVF4.js → chunk-WIEXQUTD.js} +1 -1
- package/chunks/{chunk-W24BETFG.js → chunk-XAGJJNQW.js} +3 -3
- package/chunks/{chunk-22HYZ7LE.js → chunk-ZGNDXPLU.js} +3 -3
- package/chunks/{chunk-XEDGMZJD.js → chunk-ZGVZU6L2.js} +81 -25
- package/chunks/{chunk-L3UXDCBI.js → chunk-ZKJPLWRJ.js} +2 -2
- package/chunks/{chunk-MLSZVVTT.js → chunk-ZYBLQ5CT.js} +13 -7
- package/chunks/{create.action-FUQ2BVJA.js → create.action-DBNIS665.js} +19 -17
- package/chunks/{delete.action-BTDFH7WY.js → delete.action-GBOZC45K.js} +19 -17
- package/chunks/{delete.action-47E66R3I.js → delete.action-K7BLK7DK.js} +19 -17
- package/chunks/{get.action-XC7KC2JO.js → get.action-N3JOY3OU.js} +17 -12
- package/chunks/get.action-QHKMYZBK.js +91 -0
- package/chunks/{list.action-LXKEUYKO.js → list.action-6SSO3JVN.js} +45 -15
- package/chunks/{list.action-OFGLMRE7.js → list.action-TJCS6UEY.js} +39 -19
- package/chunks/{publish.action-OS27XOX4.js → publish.action-T24VHRMR.js} +27 -22
- package/chunks/query-WKATAJJ6.js +129 -0
- package/chunks/scripts-VIBLGKYG.js +102 -0
- package/chunks/{update.action-ZMS4CQ3T.js → update.action-OGYNBXRU.js} +23 -18
- package/chunks/{update.action-AEIBLCWD.js → update.action-VOE6PH5F.js} +23 -18
- package/docs.html +941 -209
- package/index.js +374 -182
- package/package.json +14 -13
- package/skills/scalar-cli/SKILL.md +7 -1
- package/template.md +148 -26
- package/chunks/action-JAHFRYWZ.js +0 -423
- package/chunks/action-KTYOCA2V.js +0 -229
- package/chunks/chunk-K74E42RV.js +0 -7311
- package/chunks/chunk-QVQ4PNVL.js +0 -610
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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-VYFGRLVQ.js";
|
|
6
6
|
import {
|
|
7
7
|
openBrowser
|
|
8
8
|
} from "./chunks/chunk-JFIXNSPP.js";
|
|
@@ -13,45 +13,55 @@ import {
|
|
|
13
13
|
BundleCommand,
|
|
14
14
|
parseFetchLimit,
|
|
15
15
|
parsePort
|
|
16
|
-
} from "./chunks/chunk-
|
|
16
|
+
} from "./chunks/chunk-MC4EMNOR.js";
|
|
17
|
+
import {
|
|
18
|
+
completeFiles
|
|
19
|
+
} from "./chunks/chunk-DFOZG7ZV.js";
|
|
20
|
+
import {
|
|
21
|
+
DOCUMENT_FORMATS,
|
|
22
|
+
PRIVACY_VALUES
|
|
23
|
+
} from "./chunks/chunk-NAC63XJF.js";
|
|
24
|
+
import "./chunks/chunk-KHF2QXBG.js";
|
|
17
25
|
import {
|
|
18
26
|
SdkLanguage
|
|
19
|
-
} from "./chunks/chunk-
|
|
20
|
-
import "./chunks/chunk-
|
|
27
|
+
} from "./chunks/chunk-IPZP3VRA.js";
|
|
28
|
+
import "./chunks/chunk-5ENKYZA4.js";
|
|
29
|
+
import {
|
|
30
|
+
checkNodeVersion
|
|
31
|
+
} from "./chunks/chunk-36LXIJIZ.js";
|
|
21
32
|
import {
|
|
22
|
-
checkNodeVersion,
|
|
23
|
-
clearAuthData,
|
|
24
33
|
getAuthData,
|
|
25
34
|
getMetadata,
|
|
35
|
+
logout,
|
|
26
36
|
setMetadata
|
|
27
|
-
} from "./chunks/chunk-
|
|
37
|
+
} from "./chunks/chunk-35Z7VTJT.js";
|
|
38
|
+
import "./chunks/chunk-WB6PWTMU.js";
|
|
28
39
|
import {
|
|
29
40
|
bin,
|
|
30
41
|
name,
|
|
31
42
|
version
|
|
32
|
-
} from "./chunks/chunk-
|
|
33
|
-
import "./chunks/chunk-
|
|
34
|
-
import "./chunks/chunk-
|
|
43
|
+
} from "./chunks/chunk-DHZW7Q7U.js";
|
|
44
|
+
import "./chunks/chunk-GYRQPDTK.js";
|
|
45
|
+
import "./chunks/chunk-6M7TL2G2.js";
|
|
35
46
|
import {
|
|
36
47
|
requireInteractive
|
|
37
48
|
} from "./chunks/chunk-EGOXR5FB.js";
|
|
38
|
-
import "./chunks/chunk-K74E42RV.js";
|
|
39
|
-
import "./chunks/chunk-6XWCMJDB.js";
|
|
40
49
|
import "./chunks/chunk-4ORL4MST.js";
|
|
50
|
+
import "./chunks/chunk-MNNGUUKJ.js";
|
|
41
51
|
import {
|
|
42
52
|
output
|
|
43
53
|
} from "./chunks/chunk-T5HJUAWB.js";
|
|
44
|
-
import "./chunks/chunk-
|
|
54
|
+
import "./chunks/chunk-ZGVZU6L2.js";
|
|
45
55
|
import {
|
|
46
56
|
external_exports
|
|
47
|
-
} from "./chunks/chunk-
|
|
57
|
+
} from "./chunks/chunk-VVRUSQCY.js";
|
|
48
58
|
import "./chunks/chunk-3MZYUBJ6.js";
|
|
49
59
|
|
|
50
60
|
// src/index.ts
|
|
51
61
|
import { Agent, setGlobalDispatcher } from "undici";
|
|
52
62
|
|
|
53
63
|
// src/program.ts
|
|
54
|
-
import { Command as
|
|
64
|
+
import { Command as Command59 } from "commander";
|
|
55
65
|
|
|
56
66
|
// src/domains/schema/index.ts
|
|
57
67
|
import { Command as Command6 } from "commander";
|
|
@@ -64,24 +74,27 @@ var DeleteSchemaCommand = () => {
|
|
|
64
74
|
cmd3.option("-s, --slug <slug>", "Schema slug");
|
|
65
75
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
66
76
|
cmd3.action(async (...args) => {
|
|
67
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
77
|
+
const { deleteAction } = await import("./chunks/delete.action-K7BLK7DK.js");
|
|
68
78
|
return deleteAction(...args);
|
|
69
79
|
});
|
|
70
80
|
return cmd3;
|
|
71
81
|
};
|
|
72
82
|
|
|
73
83
|
// src/domains/schema/get.ts
|
|
74
|
-
import { Command as Command2 } from "commander";
|
|
84
|
+
import { Command as Command2, Option } from "commander";
|
|
75
85
|
var GetSchemaCommand = () => {
|
|
76
86
|
const cmd3 = new Command2("get");
|
|
77
87
|
cmd3.description("Get a schema document version from the Scalar registry");
|
|
78
88
|
cmd3.argument("[namespace]", "Team namespace");
|
|
79
89
|
cmd3.argument("[slug]", "Schema slug");
|
|
80
90
|
cmd3.option("--version <version>", "Schema version (defaults to latest)");
|
|
81
|
-
cmd3.
|
|
91
|
+
cmd3.addOption(
|
|
92
|
+
new Option("--format <format>", "Output format (json or yaml)").choices([...DOCUMENT_FORMATS]).default("json")
|
|
93
|
+
);
|
|
82
94
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
95
|
+
completeFiles(cmd3, [], ["--output"]);
|
|
83
96
|
cmd3.action(async (...args) => {
|
|
84
|
-
const { getAction } = await import("./chunks/get.action-
|
|
97
|
+
const { getAction } = await import("./chunks/get.action-N3JOY3OU.js");
|
|
85
98
|
return getAction(...args);
|
|
86
99
|
});
|
|
87
100
|
return cmd3;
|
|
@@ -93,8 +106,9 @@ var ListSchemaCommand = () => {
|
|
|
93
106
|
const cmd3 = new Command3("list");
|
|
94
107
|
cmd3.description("List all schemas for a team namespace");
|
|
95
108
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
109
|
+
cmd3.option("--json", "Output schema metadata as JSON");
|
|
96
110
|
cmd3.action(async (...args) => {
|
|
97
|
-
const { listAction } = await import("./chunks/list.action-
|
|
111
|
+
const { listAction } = await import("./chunks/list.action-TJCS6UEY.js");
|
|
98
112
|
return listAction(...args);
|
|
99
113
|
});
|
|
100
114
|
return cmd3;
|
|
@@ -129,15 +143,16 @@ var PublishSchemaCommand = () => {
|
|
|
129
143
|
"Maximum number of concurrent URLs to fetch when bundling the document",
|
|
130
144
|
parseFetchLimit
|
|
131
145
|
);
|
|
146
|
+
completeFiles(cmd3, ["file"], []);
|
|
132
147
|
cmd3.action(async (...args) => {
|
|
133
|
-
const { publishAction } = await import("./chunks/publish.action-
|
|
148
|
+
const { publishAction } = await import("./chunks/publish.action-T24VHRMR.js");
|
|
134
149
|
return publishAction(...args);
|
|
135
150
|
});
|
|
136
151
|
return cmd3;
|
|
137
152
|
};
|
|
138
153
|
|
|
139
154
|
// src/domains/schema/update.ts
|
|
140
|
-
import { Command as Command5 } from "commander";
|
|
155
|
+
import { Command as Command5, Option as Option2 } from "commander";
|
|
141
156
|
var UpdateSchemaCommand = () => {
|
|
142
157
|
const cmd3 = new Command5("update");
|
|
143
158
|
cmd3.description("Update schema metadata.");
|
|
@@ -145,12 +160,14 @@ var UpdateSchemaCommand = () => {
|
|
|
145
160
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
146
161
|
cmd3.option("--title <title>", "Title");
|
|
147
162
|
cmd3.option("--description <description>", "Description");
|
|
148
|
-
cmd3.
|
|
149
|
-
|
|
150
|
-
|
|
163
|
+
cmd3.addOption(
|
|
164
|
+
new Option2(
|
|
165
|
+
"--isPrivate <isPrivate>",
|
|
166
|
+
"Privacy (true/false or public/private)"
|
|
167
|
+
).choices([...PRIVACY_VALUES])
|
|
151
168
|
);
|
|
152
169
|
cmd3.action(async (...args) => {
|
|
153
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
170
|
+
const { updateAction } = await import("./chunks/update.action-VOE6PH5F.js");
|
|
154
171
|
return updateAction(...args);
|
|
155
172
|
});
|
|
156
173
|
return cmd3;
|
|
@@ -170,7 +187,7 @@ schemaCommands.forEach((command) => void schemaDomain.addCommand(command()));
|
|
|
170
187
|
var schema_default = schemaDomain;
|
|
171
188
|
|
|
172
189
|
// src/domains/sdk/index.ts
|
|
173
|
-
import { Command as
|
|
190
|
+
import { Command as Command13 } from "commander";
|
|
174
191
|
|
|
175
192
|
// src/domains/sdk/build.ts
|
|
176
193
|
import { Command as Command7 } from "commander";
|
|
@@ -180,14 +197,14 @@ var BuildSdkCommand = () => {
|
|
|
180
197
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
181
198
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
182
199
|
cmd3.action(async (...args) => {
|
|
183
|
-
const { buildAction } = await import("./chunks/build.action-
|
|
200
|
+
const { buildAction } = await import("./chunks/build.action-VBGFGACM.js");
|
|
184
201
|
return buildAction(...args);
|
|
185
202
|
});
|
|
186
203
|
return cmd3;
|
|
187
204
|
};
|
|
188
205
|
|
|
189
206
|
// src/domains/sdk/create.ts
|
|
190
|
-
import { Command as Command8, Option } from "commander";
|
|
207
|
+
import { Command as Command8, Option as Option3 } from "commander";
|
|
191
208
|
var CreateSdkCommand = () => {
|
|
192
209
|
const cmd3 = new Command8("create");
|
|
193
210
|
cmd3.description(
|
|
@@ -199,12 +216,12 @@ var CreateSdkCommand = () => {
|
|
|
199
216
|
"Team namespace to look the API up in"
|
|
200
217
|
);
|
|
201
218
|
cmd3.addOption(
|
|
202
|
-
new
|
|
219
|
+
new Option3("-l, --language <language>", "Language of your SDK").choices(
|
|
203
220
|
Object.values(SdkLanguage)
|
|
204
221
|
)
|
|
205
222
|
);
|
|
206
223
|
cmd3.action(async (...args) => {
|
|
207
|
-
const { createAction } = await import("./chunks/create.action-
|
|
224
|
+
const { createAction } = await import("./chunks/create.action-DBNIS665.js");
|
|
208
225
|
return createAction(...args);
|
|
209
226
|
});
|
|
210
227
|
return cmd3;
|
|
@@ -218,39 +235,59 @@ var DeleteSdkCommand = () => {
|
|
|
218
235
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
219
236
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
220
237
|
cmd3.action(async (...args) => {
|
|
221
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
238
|
+
const { deleteAction } = await import("./chunks/delete.action-GBOZC45K.js");
|
|
222
239
|
return deleteAction(...args);
|
|
223
240
|
});
|
|
224
241
|
return cmd3;
|
|
225
242
|
};
|
|
226
243
|
|
|
227
244
|
// src/domains/sdk/update.ts
|
|
228
|
-
import { Command as Command10 } from "commander";
|
|
245
|
+
import { Command as Command10, Option as Option4 } from "commander";
|
|
229
246
|
var UpdateSdkCommand = () => {
|
|
230
247
|
const cmd3 = new Command10("update");
|
|
231
248
|
cmd3.description("Update SDK metadata.");
|
|
232
249
|
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
233
250
|
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
234
251
|
cmd3.option("--title <title>", "Title");
|
|
235
|
-
cmd3.
|
|
236
|
-
|
|
237
|
-
|
|
252
|
+
cmd3.addOption(
|
|
253
|
+
new Option4(
|
|
254
|
+
"--isPrivate <isPrivate>",
|
|
255
|
+
"Privacy (true/false or public/private)"
|
|
256
|
+
).choices([...PRIVACY_VALUES])
|
|
238
257
|
);
|
|
239
258
|
cmd3.action(async (...args) => {
|
|
240
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
259
|
+
const { updateAction } = await import("./chunks/update.action-OGYNBXRU.js");
|
|
241
260
|
return updateAction(...args);
|
|
242
261
|
});
|
|
243
262
|
return cmd3;
|
|
244
263
|
};
|
|
245
264
|
|
|
246
|
-
// src/domains/sdk/
|
|
265
|
+
// src/domains/sdk/get.ts
|
|
247
266
|
import { Command as Command11 } from "commander";
|
|
267
|
+
var GetSdkCommand = () => {
|
|
268
|
+
const cmd3 = new Command11("get");
|
|
269
|
+
cmd3.description(
|
|
270
|
+
"Inspect SDK metadata, API source, versions, and build status"
|
|
271
|
+
);
|
|
272
|
+
cmd3.requiredOption("-s, --slug <slug>", "SDK slug");
|
|
273
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
274
|
+
cmd3.option("--json", "Output structured SDK metadata as JSON");
|
|
275
|
+
cmd3.action(async (...args) => {
|
|
276
|
+
const { getAction } = await import("./chunks/get.action-QHKMYZBK.js");
|
|
277
|
+
return getAction(...args);
|
|
278
|
+
});
|
|
279
|
+
return cmd3;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// src/domains/sdk/list.ts
|
|
283
|
+
import { Command as Command12 } from "commander";
|
|
248
284
|
var ListSdkCommand = () => {
|
|
249
|
-
const cmd3 = new
|
|
285
|
+
const cmd3 = new Command12("list");
|
|
250
286
|
cmd3.description("List all SDKs for a team namespace");
|
|
287
|
+
cmd3.option("--json", "Output structured SDK metadata as JSON");
|
|
251
288
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
252
289
|
cmd3.action(async (...args) => {
|
|
253
|
-
const { listAction } = await import("./chunks/list.action-
|
|
290
|
+
const { listAction } = await import("./chunks/list.action-6SSO3JVN.js");
|
|
254
291
|
return listAction(...args);
|
|
255
292
|
});
|
|
256
293
|
return cmd3;
|
|
@@ -259,54 +296,61 @@ var ListSdkCommand = () => {
|
|
|
259
296
|
// src/domains/sdk/index.ts
|
|
260
297
|
var sdkCommands = [
|
|
261
298
|
ListSdkCommand,
|
|
299
|
+
GetSdkCommand,
|
|
262
300
|
CreateSdkCommand,
|
|
263
301
|
UpdateSdkCommand,
|
|
264
302
|
DeleteSdkCommand,
|
|
265
303
|
BuildSdkCommand
|
|
266
304
|
];
|
|
267
|
-
var sdkDomain = new
|
|
305
|
+
var sdkDomain = new Command13("sdk");
|
|
268
306
|
sdkDomain.description("Manage your Scalar SDKs (Enterprise Only)");
|
|
269
|
-
sdkCommands.forEach((command) =>
|
|
307
|
+
sdkCommands.forEach((command) => {
|
|
308
|
+
sdkDomain.addCommand(command());
|
|
309
|
+
});
|
|
270
310
|
var sdk_default = sdkDomain;
|
|
271
311
|
|
|
272
312
|
// src/domains/access-group/index.ts
|
|
273
|
-
import { Command as
|
|
313
|
+
import { Command as Command14 } from "commander";
|
|
274
314
|
function createAccessGroupCommand() {
|
|
275
|
-
const command = new
|
|
315
|
+
const command = new Command14("access-group").description(
|
|
276
316
|
"Manage access groups and allowed email domains for the current team"
|
|
277
317
|
);
|
|
318
|
+
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-3SAMH7A5.js");
|
|
320
|
+
await runAction({ operation: "list", ...options });
|
|
321
|
+
});
|
|
278
322
|
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(
|
|
279
323
|
async (slug, options) => {
|
|
280
|
-
const { runAction } = await import("./chunks/actions-
|
|
324
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
281
325
|
await runAction({ operation: "create", slug, ...options });
|
|
282
326
|
}
|
|
283
327
|
);
|
|
284
328
|
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) => {
|
|
285
|
-
const { runAction } = await import("./chunks/actions-
|
|
329
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
286
330
|
await runAction({ operation: "get", slug, ...options });
|
|
287
331
|
});
|
|
288
332
|
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(
|
|
289
333
|
async (slug, options) => {
|
|
290
|
-
const { runAction } = await import("./chunks/actions-
|
|
334
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
291
335
|
await runAction({ operation: "update", slug, ...options });
|
|
292
336
|
}
|
|
293
337
|
);
|
|
294
338
|
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(
|
|
295
339
|
async (slug, options) => {
|
|
296
|
-
const { runAction } = await import("./chunks/actions-
|
|
340
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
297
341
|
await runAction({ operation: "delete", slug, ...options });
|
|
298
342
|
}
|
|
299
343
|
);
|
|
300
344
|
const domain = command.command("domain").description("Manage allowed email domains");
|
|
301
345
|
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(
|
|
302
346
|
async (slug, domain2, options) => {
|
|
303
|
-
const { runAction } = await import("./chunks/actions-
|
|
347
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
304
348
|
await runAction({ operation: "add-domain", slug, domain: domain2, ...options });
|
|
305
349
|
}
|
|
306
350
|
);
|
|
307
351
|
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(
|
|
308
352
|
async (slug, domain2, options) => {
|
|
309
|
-
const { runAction } = await import("./chunks/actions-
|
|
353
|
+
const { runAction } = await import("./chunks/actions-3SAMH7A5.js");
|
|
310
354
|
await runAction({
|
|
311
355
|
operation: "remove-domain",
|
|
312
356
|
slug,
|
|
@@ -320,30 +364,30 @@ function createAccessGroupCommand() {
|
|
|
320
364
|
var access_group_default = createAccessGroupCommand();
|
|
321
365
|
|
|
322
366
|
// src/domains/auth/index.ts
|
|
323
|
-
import { Command as
|
|
367
|
+
import { Command as Command18 } from "commander";
|
|
324
368
|
|
|
325
369
|
// src/domains/auth/login/index.ts
|
|
326
|
-
import { Command as
|
|
370
|
+
import { Command as Command15, Option as Option5 } from "commander";
|
|
327
371
|
var LoginCommand = () => {
|
|
328
|
-
const cmd3 = new
|
|
372
|
+
const cmd3 = new Command15("login");
|
|
329
373
|
cmd3.description("Login to scalar");
|
|
330
|
-
cmd3.option("--email <email>", "Email");
|
|
331
|
-
cmd3.option("--password <password>", "Password");
|
|
332
374
|
cmd3.option("--token <token>", "Personal token");
|
|
375
|
+
cmd3.addOption(new Option5("--email <email>").hideHelp());
|
|
376
|
+
cmd3.addOption(new Option5("--password <password>").hideHelp());
|
|
333
377
|
cmd3.action(async (...args) => {
|
|
334
|
-
const { loginAction } = await import("./chunks/action-
|
|
378
|
+
const { loginAction } = await import("./chunks/action-JEYDBB3P.js");
|
|
335
379
|
return loginAction(...args);
|
|
336
380
|
});
|
|
337
381
|
return cmd3;
|
|
338
382
|
};
|
|
339
383
|
|
|
340
384
|
// src/domains/auth/logout/index.ts
|
|
341
|
-
import { Command as
|
|
385
|
+
import { Command as Command16 } from "commander";
|
|
342
386
|
var LogoutCommand = () => {
|
|
343
|
-
const cmd3 = new
|
|
387
|
+
const cmd3 = new Command16("logout");
|
|
344
388
|
cmd3.description("Logout from scalar");
|
|
345
389
|
cmd3.action(async () => {
|
|
346
|
-
await
|
|
390
|
+
await logout();
|
|
347
391
|
output.info().message("Successfully logged out.").print();
|
|
348
392
|
});
|
|
349
393
|
return cmd3;
|
|
@@ -351,9 +395,9 @@ var LogoutCommand = () => {
|
|
|
351
395
|
|
|
352
396
|
// src/domains/auth/whoami/index.ts
|
|
353
397
|
import as from "ansis";
|
|
354
|
-
import { Command as
|
|
398
|
+
import { Command as Command17 } from "commander";
|
|
355
399
|
var WhoAmICommand = () => {
|
|
356
|
-
const cmd3 = new
|
|
400
|
+
const cmd3 = new Command17("whoami");
|
|
357
401
|
cmd3.description("Display the current user");
|
|
358
402
|
cmd3.action(async () => {
|
|
359
403
|
const auth = await getAuthData();
|
|
@@ -366,14 +410,47 @@ var WhoAmICommand = () => {
|
|
|
366
410
|
|
|
367
411
|
// src/domains/auth/index.ts
|
|
368
412
|
var authCommands = [LoginCommand, WhoAmICommand, LogoutCommand];
|
|
369
|
-
var authDomain = new
|
|
413
|
+
var authDomain = new Command18("auth");
|
|
370
414
|
authDomain.description("Manage authorization on scalar platform");
|
|
371
415
|
authCommands.forEach((command) => authDomain.addCommand(command()));
|
|
372
416
|
var auth_default = authDomain;
|
|
373
417
|
|
|
418
|
+
// src/domains/completion/index.ts
|
|
419
|
+
import { Argument, Command as Command19 } from "commander";
|
|
420
|
+
|
|
421
|
+
// src/helpers/completion/shells.ts
|
|
422
|
+
var COMPLETION_SHELLS = ["bash", "zsh", "fish"];
|
|
423
|
+
|
|
424
|
+
// src/domains/completion/index.ts
|
|
425
|
+
var createCompletionCommand = () => new Command19("completion").description("Generate shell completion definitions").addArgument(
|
|
426
|
+
new Argument("<shell>", "Shell to configure").choices([
|
|
427
|
+
...COMPLETION_SHELLS
|
|
428
|
+
])
|
|
429
|
+
).action(async (shell) => {
|
|
430
|
+
const { renderCompletionScript } = await import("./chunks/scripts-VIBLGKYG.js");
|
|
431
|
+
process.stdout.write(renderCompletionScript(shell));
|
|
432
|
+
});
|
|
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(
|
|
434
|
+
async (cursor, words, _options, command) => {
|
|
435
|
+
const { queryCompletion } = await import("./chunks/query-WKATAJJ6.js");
|
|
436
|
+
const index = Number(cursor);
|
|
437
|
+
if (!command.parent || !Number.isSafeInteger(index) || index < 1 || index > words.length) {
|
|
438
|
+
process.stdout.write("none\n-\n");
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const result = queryCompletion(command.parent, words, index);
|
|
442
|
+
process.stdout.write(
|
|
443
|
+
`${result.mode}
|
|
444
|
+
${result.prefix ?? "-"}
|
|
445
|
+
${result.candidates.map((candidate) => `${candidate}
|
|
446
|
+
`).join("")}`
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
);
|
|
450
|
+
|
|
374
451
|
// src/domains/context/index.ts
|
|
375
|
-
import { Command as
|
|
376
|
-
var cmd = new
|
|
452
|
+
import { Command as Command20 } from "commander";
|
|
453
|
+
var cmd = new Command20("context");
|
|
377
454
|
cmd.description(
|
|
378
455
|
"Print every command, argument, and option as JSON for AI agents"
|
|
379
456
|
);
|
|
@@ -384,32 +461,33 @@ cmd.action(async () => {
|
|
|
384
461
|
var context_default = cmd;
|
|
385
462
|
|
|
386
463
|
// src/domains/document/index.ts
|
|
387
|
-
import { Command as
|
|
464
|
+
import { Command as Command33 } from "commander";
|
|
388
465
|
|
|
389
466
|
// src/domains/document/join/index.ts
|
|
390
|
-
import { Command as
|
|
467
|
+
import { Command as Command21 } from "commander";
|
|
391
468
|
function JoinCommand() {
|
|
392
|
-
const cmd3 = new
|
|
469
|
+
const cmd3 = new Command21("join");
|
|
393
470
|
cmd3.description(
|
|
394
471
|
"Merge multiple OpenAPI or AsyncAPI documents into a single unified document"
|
|
395
472
|
);
|
|
396
473
|
cmd3.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
|
|
397
|
-
cmd3.option("--output
|
|
474
|
+
cmd3.option("-o, --output <file>", "Path to save the merged output file");
|
|
398
475
|
cmd3.option(
|
|
399
|
-
"--prefix-components-with-path-value
|
|
476
|
+
"-p, --prefix-components-with-path-value <path>",
|
|
400
477
|
"Dot-separated path to extract a prefix value from each input file for component names"
|
|
401
478
|
);
|
|
479
|
+
completeFiles(cmd3, ["files"], ["--output"]);
|
|
402
480
|
cmd3.action(async (...args) => {
|
|
403
|
-
const { joinAction } = await import("./chunks/action-
|
|
481
|
+
const { joinAction } = await import("./chunks/action-DTEO4YNX.js");
|
|
404
482
|
return joinAction(...args);
|
|
405
483
|
});
|
|
406
484
|
return cmd3;
|
|
407
485
|
}
|
|
408
486
|
|
|
409
487
|
// src/domains/document/split/index.ts
|
|
410
|
-
import { Command as
|
|
488
|
+
import { Command as Command22 } from "commander";
|
|
411
489
|
function SplitCommand() {
|
|
412
|
-
const cmd3 = new
|
|
490
|
+
const cmd3 = new Command22("split");
|
|
413
491
|
cmd3.description("Split OpenAPI or AsyncAPI documents into small chunks");
|
|
414
492
|
cmd3.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
|
|
415
493
|
cmd3.option("-o, --output <path>", "Path to save the chunks");
|
|
@@ -417,59 +495,101 @@ function SplitCommand() {
|
|
|
417
495
|
"after",
|
|
418
496
|
"\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
|
|
419
497
|
);
|
|
498
|
+
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
420
499
|
cmd3.action(async (...args) => {
|
|
421
|
-
const { splitAction } = await import("./chunks/action-
|
|
500
|
+
const { splitAction } = await import("./chunks/action-ZFI77WA5.js");
|
|
422
501
|
return splitAction(...args);
|
|
423
502
|
});
|
|
424
503
|
return cmd3;
|
|
425
504
|
}
|
|
426
505
|
|
|
427
506
|
// src/domains/document/format/index.ts
|
|
428
|
-
import { Command as
|
|
507
|
+
import { Command as Command23 } from "commander";
|
|
429
508
|
function FormatCommand() {
|
|
430
|
-
const cmd3 = new
|
|
509
|
+
const cmd3 = new Command23("format");
|
|
431
510
|
cmd3.description("Format an OpenAPI or AsyncAPI file");
|
|
432
511
|
cmd3.argument("[file|url]", "File or URL to format");
|
|
433
512
|
cmd3.option("-o, --output <file>", "Output file");
|
|
513
|
+
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
434
514
|
cmd3.action(async (...args) => {
|
|
435
|
-
const { formatAction } = await import("./chunks/action-
|
|
515
|
+
const { formatAction } = await import("./chunks/action-UUL6SWV4.js");
|
|
436
516
|
return formatAction(...args);
|
|
437
517
|
});
|
|
438
518
|
return cmd3;
|
|
439
519
|
}
|
|
440
520
|
|
|
441
521
|
// src/domains/document/lint/index.ts
|
|
442
|
-
import { Command as
|
|
522
|
+
import { Command as Command24, InvalidArgumentError, Option as Option6 } from "commander";
|
|
523
|
+
|
|
524
|
+
// src/domains/document/lint/formats.ts
|
|
525
|
+
var reportFormats = [
|
|
526
|
+
"text",
|
|
527
|
+
"codeframe",
|
|
528
|
+
"markdown",
|
|
529
|
+
"summary",
|
|
530
|
+
"json",
|
|
531
|
+
"github-actions",
|
|
532
|
+
"junit"
|
|
533
|
+
];
|
|
534
|
+
|
|
535
|
+
// src/domains/document/lint/index.ts
|
|
443
536
|
function LintCommand() {
|
|
444
|
-
const cmd3 = new
|
|
537
|
+
const cmd3 = new Command24("lint");
|
|
445
538
|
cmd3.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
|
|
446
539
|
cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
|
|
447
540
|
cmd3.option("-r, --rule <file|url>", "Rule path or url");
|
|
541
|
+
cmd3.addOption(
|
|
542
|
+
new Option6("--format <format>", "Report format").choices([...reportFormats]).default("codeframe")
|
|
543
|
+
);
|
|
544
|
+
cmd3.option(
|
|
545
|
+
"--max-problems <number>",
|
|
546
|
+
"Maximum displayed findings (totals and exit status include all findings)",
|
|
547
|
+
(value) => {
|
|
548
|
+
if (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
549
|
+
throw new InvalidArgumentError("Expected a nonnegative integer");
|
|
550
|
+
return Number(value);
|
|
551
|
+
},
|
|
552
|
+
100
|
|
553
|
+
);
|
|
554
|
+
cmd3.option(
|
|
555
|
+
"-o, --output <file>",
|
|
556
|
+
"Write the report to a file instead of stdout"
|
|
557
|
+
);
|
|
558
|
+
cmd3.option(
|
|
559
|
+
"--generate-ignore-file",
|
|
560
|
+
"Record current findings in the ignore baseline"
|
|
561
|
+
);
|
|
562
|
+
cmd3.option(
|
|
563
|
+
"--ignore-file <file>",
|
|
564
|
+
"Ignore baseline path (Scalar file takes priority over Redocly fallback in the current directory)"
|
|
565
|
+
);
|
|
566
|
+
completeFiles(cmd3, ["file|url"], ["--rule", "--output", "--ignore-file"]);
|
|
448
567
|
cmd3.action(async (...args) => {
|
|
449
|
-
const { lintAction } = await import("./chunks/action-
|
|
568
|
+
const { lintAction } = await import("./chunks/action-PPTFYZWD.js");
|
|
450
569
|
return lintAction(...args);
|
|
451
570
|
});
|
|
452
571
|
return cmd3;
|
|
453
572
|
}
|
|
454
573
|
|
|
455
574
|
// src/domains/document/markdown/index.ts
|
|
456
|
-
import { Command as
|
|
575
|
+
import { Command as Command25 } from "commander";
|
|
457
576
|
function MarkdownCommand() {
|
|
458
|
-
const cmd3 = new
|
|
577
|
+
const cmd3 = new Command25("markdown");
|
|
459
578
|
cmd3.description("Generate Markdown from an OpenAPI file");
|
|
460
579
|
cmd3.argument("[file|url]", "OpenAPI file path or URL to convert");
|
|
461
580
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
581
|
+
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
462
582
|
cmd3.action(async (...args) => {
|
|
463
|
-
const { markdownAction } = await import("./chunks/action-
|
|
583
|
+
const { markdownAction } = await import("./chunks/action-GFLRD7LO.js");
|
|
464
584
|
return markdownAction(...args);
|
|
465
585
|
});
|
|
466
586
|
return cmd3;
|
|
467
587
|
}
|
|
468
588
|
|
|
469
589
|
// src/domains/document/mock/index.ts
|
|
470
|
-
import { Command as
|
|
590
|
+
import { Command as Command26 } from "commander";
|
|
471
591
|
function MockCommand() {
|
|
472
|
-
const cmd3 = new
|
|
592
|
+
const cmd3 = new Command26("mock");
|
|
473
593
|
cmd3.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
|
|
474
594
|
cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
|
|
475
595
|
cmd3.option("-w, --watch", "watch the file for changes");
|
|
@@ -479,17 +599,18 @@ function MockCommand() {
|
|
|
479
599
|
"set the HTTP port for the mock server",
|
|
480
600
|
parsePort
|
|
481
601
|
);
|
|
602
|
+
completeFiles(cmd3, ["file|url"], []);
|
|
482
603
|
cmd3.action(async (...args) => {
|
|
483
|
-
const { mockAction } = await import("./chunks/action-
|
|
604
|
+
const { mockAction } = await import("./chunks/action-ZKA3RR3S.js");
|
|
484
605
|
return mockAction(...args);
|
|
485
606
|
});
|
|
486
607
|
return cmd3;
|
|
487
608
|
}
|
|
488
609
|
|
|
489
610
|
// src/domains/document/postman/index.ts
|
|
490
|
-
import { Command as
|
|
611
|
+
import { Command as Command27 } from "commander";
|
|
491
612
|
function ConvertCommand() {
|
|
492
|
-
const cmd3 = new
|
|
613
|
+
const cmd3 = new Command27("convert");
|
|
493
614
|
cmd3.description("Convert a Postman collection to an OpenAPI document");
|
|
494
615
|
cmd3.argument("[file|url]", "Postman collection file path or URL to convert");
|
|
495
616
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
@@ -497,17 +618,18 @@ function ConvertCommand() {
|
|
|
497
618
|
"--merge-operations",
|
|
498
619
|
"Merge operations with shared path+method combinations"
|
|
499
620
|
);
|
|
621
|
+
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
500
622
|
cmd3.action(async (...args) => {
|
|
501
|
-
const { convertAction } = await import("./chunks/action-
|
|
623
|
+
const { convertAction } = await import("./chunks/action-CB55NWAU.js");
|
|
502
624
|
return convertAction(...args);
|
|
503
625
|
});
|
|
504
626
|
return cmd3;
|
|
505
627
|
}
|
|
506
628
|
|
|
507
629
|
// src/domains/document/serve/index.ts
|
|
508
|
-
import { Command as
|
|
630
|
+
import { Command as Command28 } from "commander";
|
|
509
631
|
function ServeCommand() {
|
|
510
|
-
const cmd3 = new
|
|
632
|
+
const cmd3 = new Command28("serve");
|
|
511
633
|
cmd3.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
|
|
512
634
|
cmd3.argument(
|
|
513
635
|
"[file|url]",
|
|
@@ -524,61 +646,65 @@ function ServeCommand() {
|
|
|
524
646
|
"set the HTTP port for the API reference server",
|
|
525
647
|
parsePort
|
|
526
648
|
);
|
|
649
|
+
completeFiles(cmd3, ["file|url"], ["--config"]);
|
|
527
650
|
cmd3.action(async (...args) => {
|
|
528
|
-
const { serveAction } = await import("./chunks/action-
|
|
651
|
+
const { serveAction } = await import("./chunks/action-XOADBXSX.js");
|
|
529
652
|
return serveAction(...args);
|
|
530
653
|
});
|
|
531
654
|
return cmd3;
|
|
532
655
|
}
|
|
533
656
|
|
|
534
657
|
// src/domains/document/share/index.ts
|
|
535
|
-
import { Command as
|
|
658
|
+
import { Command as Command29 } from "commander";
|
|
536
659
|
function ShareCommand() {
|
|
537
|
-
const cmd3 = new
|
|
660
|
+
const cmd3 = new Command29("share");
|
|
538
661
|
cmd3.description("Share an OpenAPI or AsyncAPI file");
|
|
539
662
|
cmd3.argument("[file]", "file to share");
|
|
540
663
|
cmd3.option(
|
|
541
664
|
"-t, --token <token>",
|
|
542
665
|
"pass a token to update an existing sandbox"
|
|
543
666
|
);
|
|
667
|
+
completeFiles(cmd3, ["file"], []);
|
|
544
668
|
cmd3.action(async (...args) => {
|
|
545
|
-
const { shareAction } = await import("./chunks/action-
|
|
669
|
+
const { shareAction } = await import("./chunks/action-5LF4XYHX.js");
|
|
546
670
|
return shareAction(...args);
|
|
547
671
|
});
|
|
548
672
|
return cmd3;
|
|
549
673
|
}
|
|
550
674
|
|
|
551
675
|
// src/domains/document/upgrade/index.ts
|
|
552
|
-
import { Command as
|
|
676
|
+
import { Command as Command30 } from "commander";
|
|
553
677
|
function UpgradeCommand() {
|
|
554
|
-
const cmd3 = new
|
|
678
|
+
const cmd3 = new Command30("upgrade");
|
|
555
679
|
cmd3.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
|
|
556
680
|
cmd3.argument("[file|url]", "File or URL to upgrade");
|
|
557
681
|
cmd3.option("-o, --output <file>", "Path to save the upgraded output file");
|
|
682
|
+
completeFiles(cmd3, ["file|url"], ["--output"]);
|
|
558
683
|
cmd3.action(async (...args) => {
|
|
559
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
684
|
+
const { upgradeAction } = await import("./chunks/action-DKDRAIKV.js");
|
|
560
685
|
return upgradeAction(...args);
|
|
561
686
|
});
|
|
562
687
|
return cmd3;
|
|
563
688
|
}
|
|
564
689
|
|
|
565
690
|
// src/domains/document/validate/index.ts
|
|
566
|
-
import { Command as
|
|
691
|
+
import { Command as Command31 } from "commander";
|
|
567
692
|
function ValidateCommand() {
|
|
568
|
-
const cmd3 = new
|
|
693
|
+
const cmd3 = new Command31("validate");
|
|
569
694
|
cmd3.description("Validate an OpenAPI or AsyncAPI file");
|
|
570
695
|
cmd3.argument("[file|url]", "File or URL to validate");
|
|
696
|
+
completeFiles(cmd3, ["file|url"], []);
|
|
571
697
|
cmd3.action(async (...args) => {
|
|
572
|
-
const { validateAction } = await import("./chunks/action-
|
|
698
|
+
const { validateAction } = await import("./chunks/action-CABLS46Q.js");
|
|
573
699
|
return validateAction(...args);
|
|
574
700
|
});
|
|
575
701
|
return cmd3;
|
|
576
702
|
}
|
|
577
703
|
|
|
578
704
|
// src/domains/document/void/index.ts
|
|
579
|
-
import { Command as
|
|
705
|
+
import { Command as Command32 } from "commander";
|
|
580
706
|
function VoidCommand() {
|
|
581
|
-
const cmd3 = new
|
|
707
|
+
const cmd3 = new Command32("void");
|
|
582
708
|
cmd3.description("Boot a server to mirror HTTP requests");
|
|
583
709
|
cmd3.option("-o, --once", "run the server only once and exit after that");
|
|
584
710
|
cmd3.option(
|
|
@@ -609,18 +735,18 @@ var documentCommands = [
|
|
|
609
735
|
LintCommand,
|
|
610
736
|
UpgradeCommand
|
|
611
737
|
];
|
|
612
|
-
var documentDomain = new
|
|
738
|
+
var documentDomain = new Command33("document");
|
|
613
739
|
documentDomain.description("Manage local openapi file");
|
|
614
740
|
documentCommands.forEach((command) => documentDomain.addCommand(command()));
|
|
615
741
|
var document_default = documentDomain;
|
|
616
742
|
|
|
617
743
|
// src/domains/project/index.ts
|
|
618
|
-
import { Command as
|
|
744
|
+
import { Command as Command45 } from "commander";
|
|
619
745
|
|
|
620
746
|
// src/domains/project/preview/index.ts
|
|
621
|
-
import { Command as
|
|
747
|
+
import { Command as Command34, Option as Option7 } from "commander";
|
|
622
748
|
var PreviewCommand = () => {
|
|
623
|
-
const cmd3 = new
|
|
749
|
+
const cmd3 = new Command34("preview");
|
|
624
750
|
cmd3.description("Preview scalar guides");
|
|
625
751
|
cmd3.argument(
|
|
626
752
|
"[config]",
|
|
@@ -636,56 +762,58 @@ var PreviewCommand = () => {
|
|
|
636
762
|
"Specify which IP addresses the server should listen on."
|
|
637
763
|
);
|
|
638
764
|
cmd3.addOption(
|
|
639
|
-
new
|
|
765
|
+
new Option7("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
|
|
640
766
|
);
|
|
641
767
|
cmd3.option("-N, --no-open", "Do not open the browser automatically", true);
|
|
768
|
+
completeFiles(cmd3, ["config"], []);
|
|
642
769
|
cmd3.action(async (...args) => {
|
|
643
|
-
const { previewAction } = await import("./chunks/action-
|
|
770
|
+
const { previewAction } = await import("./chunks/action-KDUFU7TZ.js");
|
|
644
771
|
return previewAction(...args);
|
|
645
772
|
});
|
|
646
773
|
return cmd3;
|
|
647
774
|
};
|
|
648
775
|
|
|
649
776
|
// src/domains/project/check-config/index.ts
|
|
650
|
-
import { Command as
|
|
777
|
+
import { Command as Command35 } from "commander";
|
|
651
778
|
function CheckConfigCommand() {
|
|
652
|
-
const cmd3 = new
|
|
779
|
+
const cmd3 = new Command35("check-config");
|
|
653
780
|
cmd3.description("Check a Scalar Configuration file");
|
|
654
781
|
cmd3.argument("[file]", "File to check");
|
|
782
|
+
completeFiles(cmd3, ["file"], []);
|
|
655
783
|
cmd3.action(async (...args) => {
|
|
656
|
-
const { checkConfigAction } = await import("./chunks/action-
|
|
784
|
+
const { checkConfigAction } = await import("./chunks/action-PAM2EZ22.js");
|
|
657
785
|
return checkConfigAction(...args);
|
|
658
786
|
});
|
|
659
787
|
return cmd3;
|
|
660
788
|
}
|
|
661
789
|
|
|
662
790
|
// src/domains/project/create/index.ts
|
|
663
|
-
import { Command as
|
|
791
|
+
import { Command as Command36 } from "commander";
|
|
664
792
|
var CreateCommand = () => {
|
|
665
|
-
const cmd3 = new
|
|
793
|
+
const cmd3 = new Command36("create");
|
|
666
794
|
cmd3.description(
|
|
667
795
|
"Create a new project that is not linked to a github project."
|
|
668
796
|
);
|
|
669
797
|
cmd3.option("-n, --name <name>", "name of your project");
|
|
670
798
|
cmd3.option("-s, --slug <slug>", "project slug");
|
|
671
799
|
cmd3.action(async (...args) => {
|
|
672
|
-
const { createAction } = await import("./chunks/action-
|
|
800
|
+
const { createAction } = await import("./chunks/action-XLE37MZL.js");
|
|
673
801
|
return createAction(...args);
|
|
674
802
|
});
|
|
675
803
|
return cmd3;
|
|
676
804
|
};
|
|
677
805
|
|
|
678
806
|
// src/domains/project/deployments/index.ts
|
|
679
|
-
import { Command as
|
|
807
|
+
import { Command as Command38 } from "commander";
|
|
680
808
|
|
|
681
809
|
// src/domains/project/deployments/list/index.ts
|
|
682
|
-
import { Command as
|
|
810
|
+
import { Command as Command37 } from "commander";
|
|
683
811
|
var ListCommand = () => {
|
|
684
|
-
const cmd3 = new
|
|
812
|
+
const cmd3 = new Command37("list");
|
|
685
813
|
cmd3.description("List the production deployment history for a project.");
|
|
686
|
-
cmd3.option("-s, --slug [slug]", "Project slug
|
|
814
|
+
cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
|
|
687
815
|
cmd3.action(async (...args) => {
|
|
688
|
-
const { listAction } = await import("./chunks/action-
|
|
816
|
+
const { listAction } = await import("./chunks/action-TOBU74JH.js");
|
|
689
817
|
return listAction(...args);
|
|
690
818
|
});
|
|
691
819
|
return cmd3;
|
|
@@ -693,78 +821,104 @@ var ListCommand = () => {
|
|
|
693
821
|
|
|
694
822
|
// src/domains/project/deployments/index.ts
|
|
695
823
|
var DeploymentsCommand = () => {
|
|
696
|
-
const cmd3 = new
|
|
824
|
+
const cmd3 = new Command38("deployments");
|
|
697
825
|
cmd3.description("Inspect a project deployment history.");
|
|
698
826
|
cmd3.addCommand(ListCommand());
|
|
699
827
|
return cmd3;
|
|
700
828
|
};
|
|
701
829
|
|
|
830
|
+
// src/domains/project/get/index.ts
|
|
831
|
+
import { Command as Command39 } from "commander";
|
|
832
|
+
function GetCommand() {
|
|
833
|
+
const command = new Command39("get").description("Get project details for the current team.").argument("<slug>", "Project slug from scalar project list").option("--json", "Print project details as JSON");
|
|
834
|
+
command.action(
|
|
835
|
+
async (slug, options) => {
|
|
836
|
+
const { getAction } = await import("./chunks/action-4W5GUGEG.js");
|
|
837
|
+
await getAction(slug, options);
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
return command;
|
|
841
|
+
}
|
|
842
|
+
|
|
702
843
|
// src/domains/project/init/index.ts
|
|
703
|
-
import { Command as
|
|
844
|
+
import { Command as Command40 } from "commander";
|
|
704
845
|
var InitCommand = () => {
|
|
705
|
-
const cmd3 = new
|
|
846
|
+
const cmd3 = new Command40("init");
|
|
706
847
|
cmd3.description("Create a new Scalar Docs project.");
|
|
707
848
|
cmd3.option("-s, --subdomain [url]", "subdomain to publish on");
|
|
708
849
|
cmd3.option("--force", "override existing configuration");
|
|
709
850
|
cmd3.action(async (...args) => {
|
|
710
|
-
const { initAction } = await import("./chunks/action-
|
|
851
|
+
const { initAction } = await import("./chunks/action-5RL4NWUZ.js");
|
|
711
852
|
return initAction(...args);
|
|
712
853
|
});
|
|
713
854
|
return cmd3;
|
|
714
855
|
};
|
|
715
856
|
|
|
857
|
+
// src/domains/project/list/index.ts
|
|
858
|
+
import { Command as Command41 } from "commander";
|
|
859
|
+
function ListCommand2() {
|
|
860
|
+
const command = new Command41("list").description("List projects and their slugs for the current team.").option("--json", "Print project details as JSON");
|
|
861
|
+
command.action(async (options) => {
|
|
862
|
+
const { listAction } = await import("./chunks/action-U2L5DCFG.js");
|
|
863
|
+
await listAction(options);
|
|
864
|
+
});
|
|
865
|
+
return command;
|
|
866
|
+
}
|
|
867
|
+
|
|
716
868
|
// src/domains/project/publish/index.ts
|
|
717
|
-
import { Command as
|
|
869
|
+
import { Command as Command42 } from "commander";
|
|
718
870
|
var PublishCommand = () => {
|
|
719
|
-
const cmd3 = new
|
|
871
|
+
const cmd3 = new Command42("publish");
|
|
720
872
|
cmd3.description(
|
|
721
873
|
"Publish new build for a github sync project that is not linked."
|
|
722
874
|
);
|
|
723
|
-
cmd3.option("-s, --slug [slug]", "Project slug
|
|
875
|
+
cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
|
|
724
876
|
cmd3.option("-c, --config [config]", "Your config file of the project");
|
|
725
877
|
cmd3.option("-p, --preview", "Publish in preview mode");
|
|
726
878
|
cmd3.option(
|
|
727
879
|
"-g, --github",
|
|
728
880
|
"Publish from your linked remote GitHub repository"
|
|
729
881
|
);
|
|
882
|
+
completeFiles(cmd3, [], ["--config"]);
|
|
730
883
|
cmd3.action(async (...args) => {
|
|
731
|
-
const { publishAction } = await import("./chunks/action-
|
|
884
|
+
const { publishAction } = await import("./chunks/action-R4PGILN4.js");
|
|
732
885
|
return publishAction(...args);
|
|
733
886
|
});
|
|
734
887
|
return cmd3;
|
|
735
888
|
};
|
|
736
889
|
|
|
737
890
|
// src/domains/project/rollback/index.ts
|
|
738
|
-
import { Command as
|
|
891
|
+
import { Command as Command43 } from "commander";
|
|
739
892
|
var RollbackCommand = () => {
|
|
740
|
-
const cmd3 = new
|
|
893
|
+
const cmd3 = new Command43("rollback");
|
|
741
894
|
cmd3.description(
|
|
742
895
|
"Roll the live deployment back to a previously deployed build."
|
|
743
896
|
);
|
|
744
|
-
cmd3.option("-s, --slug [slug]", "Project slug
|
|
897
|
+
cmd3.option("-s, --slug [slug]", "Project slug from scalar project list");
|
|
745
898
|
cmd3.option(
|
|
746
899
|
"-t, --to <publishUid>",
|
|
747
900
|
"Roll back to a specific build id (defaults to the next older deployed build)"
|
|
748
901
|
);
|
|
749
902
|
cmd3.option("-y, --yes", "Skip the confirmation prompt");
|
|
750
903
|
cmd3.action(async (...args) => {
|
|
751
|
-
const { rollbackAction } = await import("./chunks/action-
|
|
904
|
+
const { rollbackAction } = await import("./chunks/action-EAUTQ77U.js");
|
|
752
905
|
return rollbackAction(...args);
|
|
753
906
|
});
|
|
754
907
|
return cmd3;
|
|
755
908
|
};
|
|
756
909
|
|
|
757
910
|
// src/domains/project/upgrade/index.ts
|
|
758
|
-
import { Command as
|
|
911
|
+
import { Command as Command44 } from "commander";
|
|
759
912
|
var UpgradeCommand2 = () => {
|
|
760
|
-
const cmd3 = new
|
|
913
|
+
const cmd3 = new Command44("upgrade");
|
|
761
914
|
cmd3.description("Upgrade scalar project");
|
|
762
915
|
cmd3.argument(
|
|
763
916
|
"[config]",
|
|
764
917
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
765
918
|
);
|
|
919
|
+
completeFiles(cmd3, ["config"], []);
|
|
766
920
|
cmd3.action(async (...args) => {
|
|
767
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
921
|
+
const { upgradeAction } = await import("./chunks/action-OJ2NK25F.js");
|
|
768
922
|
return upgradeAction(...args);
|
|
769
923
|
});
|
|
770
924
|
return cmd3;
|
|
@@ -772,6 +926,8 @@ var UpgradeCommand2 = () => {
|
|
|
772
926
|
|
|
773
927
|
// src/domains/project/index.ts
|
|
774
928
|
var projectCommands = [
|
|
929
|
+
ListCommand2,
|
|
930
|
+
GetCommand,
|
|
775
931
|
InitCommand,
|
|
776
932
|
CheckConfigCommand,
|
|
777
933
|
CreateCommand,
|
|
@@ -781,19 +937,21 @@ var projectCommands = [
|
|
|
781
937
|
DeploymentsCommand,
|
|
782
938
|
UpgradeCommand2
|
|
783
939
|
];
|
|
784
|
-
var projectDomain = new
|
|
940
|
+
var projectDomain = new Command45("project");
|
|
785
941
|
projectDomain.description("Manage scalar project");
|
|
786
|
-
|
|
942
|
+
for (const command of projectCommands) {
|
|
943
|
+
projectDomain.addCommand(command());
|
|
944
|
+
}
|
|
787
945
|
projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
|
|
788
946
|
var project_default = projectDomain;
|
|
789
947
|
|
|
790
948
|
// src/domains/readme/index.ts
|
|
791
|
-
import { Command as
|
|
949
|
+
import { Command as Command47 } from "commander";
|
|
792
950
|
|
|
793
951
|
// src/domains/readme/generate.ts
|
|
794
952
|
import { text } from "@clack/prompts";
|
|
795
953
|
import as2 from "ansis";
|
|
796
|
-
import { Command as
|
|
954
|
+
import { Command as Command46 } from "commander";
|
|
797
955
|
|
|
798
956
|
// src/helpers/documentation/index.ts
|
|
799
957
|
import fs from "node:fs/promises";
|
|
@@ -840,12 +998,13 @@ var generateDocumentationFile = async (outputPath) => {
|
|
|
840
998
|
|
|
841
999
|
// src/domains/readme/generate.ts
|
|
842
1000
|
function GenerateReadmeCommand() {
|
|
843
|
-
const cmd3 = new
|
|
1001
|
+
const cmd3 = new Command46("generate");
|
|
844
1002
|
cmd3.description("Self generate documentation for the cli");
|
|
845
1003
|
cmd3.option(
|
|
846
1004
|
"-o, --output [file]",
|
|
847
1005
|
"Path where the documentation file will be written"
|
|
848
1006
|
);
|
|
1007
|
+
completeFiles(cmd3, [], ["--output"]);
|
|
849
1008
|
cmd3.action(async ({ output: __outputPath }) => {
|
|
850
1009
|
const getOutputPath = async () => {
|
|
851
1010
|
if (__outputPath !== void 0 && typeof __outputPath === "string") {
|
|
@@ -906,18 +1065,18 @@ function ServeReadmeCommand(cmd3) {
|
|
|
906
1065
|
}
|
|
907
1066
|
|
|
908
1067
|
// src/domains/readme/index.ts
|
|
909
|
-
var readmeDomain = new
|
|
1068
|
+
var readmeDomain = new Command47("readme");
|
|
910
1069
|
readmeDomain.addCommand(GenerateReadmeCommand());
|
|
911
1070
|
ServeReadmeCommand(readmeDomain);
|
|
912
1071
|
var readme_default = readmeDomain;
|
|
913
1072
|
|
|
914
1073
|
// src/domains/registry/index.ts
|
|
915
|
-
import { Command as
|
|
1074
|
+
import { Command as Command53 } from "commander";
|
|
916
1075
|
|
|
917
1076
|
// src/domains/registry/publish/index.ts
|
|
918
|
-
import { Command as
|
|
1077
|
+
import { Command as Command48 } from "commander";
|
|
919
1078
|
var PublishCommand2 = () => {
|
|
920
|
-
const cmd3 = new
|
|
1079
|
+
const cmd3 = new Command48("publish");
|
|
921
1080
|
cmd3.description("Publish an OpenAPI document to the Scalar registry");
|
|
922
1081
|
cmd3.argument("[file]", "OpenAPI file to upload");
|
|
923
1082
|
cmd3.option(
|
|
@@ -943,68 +1102,73 @@ var PublishCommand2 = () => {
|
|
|
943
1102
|
"Maximum number of concurrent URLs to fetch when bundling the document",
|
|
944
1103
|
parseFetchLimit
|
|
945
1104
|
);
|
|
1105
|
+
completeFiles(cmd3, ["file"], []);
|
|
946
1106
|
cmd3.action(async (...args) => {
|
|
947
|
-
const { publishAction } = await import("./chunks/action-
|
|
1107
|
+
const { publishAction } = await import("./chunks/action-HT42NUUX.js");
|
|
948
1108
|
return publishAction(...args);
|
|
949
1109
|
});
|
|
950
1110
|
return cmd3;
|
|
951
1111
|
};
|
|
952
1112
|
|
|
953
1113
|
// src/domains/registry/delete/index.ts
|
|
954
|
-
import { Command as
|
|
1114
|
+
import { Command as Command49 } from "commander";
|
|
955
1115
|
var DeleteCommand = () => {
|
|
956
|
-
const cmd3 = new
|
|
1116
|
+
const cmd3 = new Command49("delete");
|
|
957
1117
|
cmd3.description("Delete a document from scalar registry");
|
|
958
1118
|
cmd3.argument("[namespace]", "Team namespace");
|
|
959
1119
|
cmd3.argument("[slug]", "Managed doc slug");
|
|
960
1120
|
cmd3.action(async (...args) => {
|
|
961
|
-
const { deleteAction } = await import("./chunks/action-
|
|
1121
|
+
const { deleteAction } = await import("./chunks/action-FBRY5JKU.js");
|
|
962
1122
|
return deleteAction(...args);
|
|
963
1123
|
});
|
|
964
1124
|
return cmd3;
|
|
965
1125
|
};
|
|
966
1126
|
|
|
967
1127
|
// src/domains/registry/get/index.ts
|
|
968
|
-
import { Command as
|
|
969
|
-
var
|
|
970
|
-
const cmd3 = new
|
|
1128
|
+
import { Command as Command50, Option as Option8 } from "commander";
|
|
1129
|
+
var GetCommand2 = () => {
|
|
1130
|
+
const cmd3 = new Command50("get");
|
|
971
1131
|
cmd3.description("Get a document version from scalar registry");
|
|
972
1132
|
cmd3.argument("[namespace]", "Team namespace");
|
|
973
1133
|
cmd3.argument("[slug]", "Managed doc slug");
|
|
974
1134
|
cmd3.option("--version <version>", "Document version (defaults to latest)");
|
|
975
|
-
cmd3.
|
|
1135
|
+
cmd3.addOption(
|
|
1136
|
+
new Option8("--format <format>", "Output format (json or yaml)").choices([...DOCUMENT_FORMATS]).default("json")
|
|
1137
|
+
);
|
|
976
1138
|
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
1139
|
+
completeFiles(cmd3, [], ["--output"]);
|
|
977
1140
|
cmd3.action(async (...args) => {
|
|
978
|
-
const { getAction } = await import("./chunks/action-
|
|
1141
|
+
const { getAction } = await import("./chunks/action-5N3P43MD.js");
|
|
979
1142
|
return getAction(...args);
|
|
980
1143
|
});
|
|
981
1144
|
return cmd3;
|
|
982
1145
|
};
|
|
983
1146
|
|
|
984
1147
|
// src/domains/registry/list/index.ts
|
|
985
|
-
import { Command as
|
|
986
|
-
var
|
|
987
|
-
const cmd3 = new
|
|
1148
|
+
import { Command as Command51 } from "commander";
|
|
1149
|
+
var ListCommand3 = () => {
|
|
1150
|
+
const cmd3 = new Command51("list");
|
|
988
1151
|
cmd3.description("List all registry APIs for a team namespace");
|
|
989
1152
|
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
1153
|
+
cmd3.option("--json", "Output registry API metadata as JSON");
|
|
990
1154
|
cmd3.action(async (...args) => {
|
|
991
|
-
const { listAction } = await import("./chunks/action-
|
|
1155
|
+
const { listAction } = await import("./chunks/action-YSVTZVKV.js");
|
|
992
1156
|
return listAction(...args);
|
|
993
1157
|
});
|
|
994
1158
|
return cmd3;
|
|
995
1159
|
};
|
|
996
1160
|
|
|
997
1161
|
// src/domains/registry/update/index.ts
|
|
998
|
-
import { Command as
|
|
1162
|
+
import { Command as Command52 } from "commander";
|
|
999
1163
|
var UpdateCommand = () => {
|
|
1000
|
-
const cmd3 = new
|
|
1164
|
+
const cmd3 = new Command52("update");
|
|
1001
1165
|
cmd3.description("Update document metadata on scalar registry");
|
|
1002
1166
|
cmd3.argument("[namespace]", "namespace of document you want to update");
|
|
1003
1167
|
cmd3.argument("[slug]", "slug of document you want to update");
|
|
1004
1168
|
cmd3.option("--title <title>", "Document title");
|
|
1005
1169
|
cmd3.option("--description <description>", "Document description");
|
|
1006
1170
|
cmd3.action(async (...args) => {
|
|
1007
|
-
const { updateAction } = await import("./chunks/action-
|
|
1171
|
+
const { updateAction } = await import("./chunks/action-657A4K2D.js");
|
|
1008
1172
|
return updateAction(...args);
|
|
1009
1173
|
});
|
|
1010
1174
|
return cmd3;
|
|
@@ -1015,53 +1179,69 @@ var registryCommands = [
|
|
|
1015
1179
|
PublishCommand2,
|
|
1016
1180
|
UpdateCommand,
|
|
1017
1181
|
DeleteCommand,
|
|
1018
|
-
|
|
1019
|
-
|
|
1182
|
+
ListCommand3,
|
|
1183
|
+
GetCommand2
|
|
1020
1184
|
];
|
|
1021
|
-
var registryDomain = new
|
|
1185
|
+
var registryDomain = new Command53("registry");
|
|
1022
1186
|
registryDomain.description("Manage your scalar registry");
|
|
1023
1187
|
registryCommands.forEach((command) => registryDomain.addCommand(command()));
|
|
1024
1188
|
var registry_default = registryDomain;
|
|
1025
1189
|
|
|
1026
1190
|
// src/domains/team/index.ts
|
|
1027
|
-
import { Command as
|
|
1191
|
+
import { Command as Command57 } from "commander";
|
|
1192
|
+
|
|
1193
|
+
// src/domains/team/get/index.ts
|
|
1194
|
+
import { Command as Command54 } from "commander";
|
|
1195
|
+
var GetCommand3 = () => {
|
|
1196
|
+
const cmd3 = new Command54("get");
|
|
1197
|
+
cmd3.description("Get the current team and its namespaces");
|
|
1198
|
+
cmd3.option("--json", "Output the current team as JSON");
|
|
1199
|
+
cmd3.action(async (...args) => {
|
|
1200
|
+
const { getAction } = await import("./chunks/action-4GZI2M5B.js");
|
|
1201
|
+
return getAction(...args);
|
|
1202
|
+
});
|
|
1203
|
+
return cmd3;
|
|
1204
|
+
};
|
|
1028
1205
|
|
|
1029
1206
|
// src/domains/team/list/index.ts
|
|
1030
|
-
import { Command as
|
|
1031
|
-
var
|
|
1032
|
-
const cmd3 = new
|
|
1207
|
+
import { Command as Command55 } from "commander";
|
|
1208
|
+
var ListCommand4 = () => {
|
|
1209
|
+
const cmd3 = new Command55("list");
|
|
1033
1210
|
cmd3.description("List all teams current user is part of");
|
|
1211
|
+
cmd3.option("--json", "Output teams as JSON");
|
|
1034
1212
|
cmd3.action(async (...args) => {
|
|
1035
|
-
const { listAction } = await import("./chunks/action-
|
|
1213
|
+
const { listAction } = await import("./chunks/action-LYCNT3KA.js");
|
|
1036
1214
|
return listAction(...args);
|
|
1037
1215
|
});
|
|
1038
1216
|
return cmd3;
|
|
1039
1217
|
};
|
|
1040
1218
|
|
|
1041
1219
|
// src/domains/team/set/index.ts
|
|
1042
|
-
import { Command as
|
|
1220
|
+
import { Command as Command56 } from "commander";
|
|
1043
1221
|
var SetCommand = () => {
|
|
1044
|
-
const cmd3 = new
|
|
1222
|
+
const cmd3 = new Command56("set");
|
|
1045
1223
|
cmd3.description("Set current active team for the user");
|
|
1046
1224
|
cmd3.option("--team <team>", "Team uid");
|
|
1047
1225
|
cmd3.action(async (...args) => {
|
|
1048
|
-
const { setAction } = await import("./chunks/action-
|
|
1226
|
+
const { setAction } = await import("./chunks/action-X7BA7PQQ.js");
|
|
1049
1227
|
return setAction(...args);
|
|
1050
1228
|
});
|
|
1051
1229
|
return cmd3;
|
|
1052
1230
|
};
|
|
1053
1231
|
|
|
1054
1232
|
// src/domains/team/index.ts
|
|
1055
|
-
var teamCommands = [
|
|
1056
|
-
var teamDomain = new
|
|
1233
|
+
var teamCommands = [ListCommand4, GetCommand3, SetCommand];
|
|
1234
|
+
var teamDomain = new Command57("team");
|
|
1057
1235
|
teamDomain.description("Manage user teams");
|
|
1058
|
-
teamCommands.forEach((command) =>
|
|
1236
|
+
teamCommands.forEach((command) => {
|
|
1237
|
+
teamDomain.addCommand(command());
|
|
1238
|
+
});
|
|
1059
1239
|
var team_default = teamDomain;
|
|
1060
1240
|
|
|
1061
1241
|
// src/domains/upgrade/index.ts
|
|
1062
1242
|
import { execSync } from "node:child_process";
|
|
1063
1243
|
import as5 from "ansis";
|
|
1064
|
-
import { Command as
|
|
1244
|
+
import { Command as Command58 } from "commander";
|
|
1065
1245
|
|
|
1066
1246
|
// src/helpers/upgrade.ts
|
|
1067
1247
|
import as4 from "ansis";
|
|
@@ -1100,10 +1280,18 @@ async function getUpgradeInformation(timeoutMs = USER_INITIATED_TIMEOUT_MS) {
|
|
|
1100
1280
|
latestVersion
|
|
1101
1281
|
};
|
|
1102
1282
|
}
|
|
1103
|
-
async function checkUpgrade() {
|
|
1104
|
-
const emitOutput = () =>
|
|
1105
|
-
|
|
1106
|
-
|
|
1283
|
+
async function checkUpgrade(stream = "stdout") {
|
|
1284
|
+
const emitOutput = () => {
|
|
1285
|
+
if (stream === "stderr") {
|
|
1286
|
+
process.stderr.write(
|
|
1287
|
+
"New version available! Run `scalar upgrade` to install the latest version\n"
|
|
1288
|
+
);
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
return output.info().message(
|
|
1292
|
+
`New version available! Run ${as4.cyan("`scalar upgrade`")} to install the latest version`
|
|
1293
|
+
).print();
|
|
1294
|
+
};
|
|
1107
1295
|
const now = Date.now();
|
|
1108
1296
|
const delay = 1 * 60 * 60 * 1e3;
|
|
1109
1297
|
const {
|
|
@@ -1128,7 +1316,7 @@ async function checkUpgrade() {
|
|
|
1128
1316
|
}
|
|
1129
1317
|
|
|
1130
1318
|
// src/domains/upgrade/index.ts
|
|
1131
|
-
var cmd2 = new
|
|
1319
|
+
var cmd2 = new Command58("upgrade");
|
|
1132
1320
|
cmd2.description("Upgrade current version of your cli");
|
|
1133
1321
|
cmd2.action(async () => {
|
|
1134
1322
|
if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
|
|
@@ -1161,6 +1349,7 @@ var domains = [
|
|
|
1161
1349
|
readme_default,
|
|
1162
1350
|
upgrade_default,
|
|
1163
1351
|
context_default,
|
|
1352
|
+
createCompletionCommand(),
|
|
1164
1353
|
auth_default,
|
|
1165
1354
|
access_group_default,
|
|
1166
1355
|
document_default,
|
|
@@ -1174,10 +1363,11 @@ var domains_default = domains;
|
|
|
1174
1363
|
|
|
1175
1364
|
// src/program.ts
|
|
1176
1365
|
var getProgram = () => {
|
|
1177
|
-
const program2 = new
|
|
1366
|
+
const program2 = new Command59();
|
|
1178
1367
|
program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
|
|
1179
1368
|
program2.showHelpAfterError();
|
|
1180
1369
|
domains_default.forEach((domain) => program2.addCommand(domain));
|
|
1370
|
+
program2.addCommand(createCompletionQueryCommand(), { hidden: true });
|
|
1181
1371
|
return program2;
|
|
1182
1372
|
};
|
|
1183
1373
|
|
|
@@ -1192,8 +1382,10 @@ var program = getProgram();
|
|
|
1192
1382
|
if (process.argv.length === 2) {
|
|
1193
1383
|
program.help();
|
|
1194
1384
|
}
|
|
1195
|
-
if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" &&
|
|
1196
|
-
checkUpgrade(
|
|
1385
|
+
if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" && process.argv[2] !== "completion" && process.argv[2] !== "__complete" && !process.argv.includes("--json") && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
|
|
1386
|
+
checkUpgrade(
|
|
1387
|
+
process.argv[2] === "document" && process.argv[3] === "lint" ? "stderr" : "stdout"
|
|
1388
|
+
).catch(() => {
|
|
1197
1389
|
});
|
|
1198
1390
|
}
|
|
1199
1391
|
program.parse();
|