@scalar/cli 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -13
- package/docs.html +98 -66
- package/index.js +229 -195
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -6866,14 +6866,14 @@ var require_parser = __commonJS({
|
|
|
6866
6866
|
case "scalar":
|
|
6867
6867
|
case "single-quoted-scalar":
|
|
6868
6868
|
case "double-quoted-scalar": {
|
|
6869
|
-
const
|
|
6869
|
+
const fs19 = this.flowScalar(this.type);
|
|
6870
6870
|
if (atNextItem || it.value) {
|
|
6871
|
-
map2.items.push({ start, key:
|
|
6871
|
+
map2.items.push({ start, key: fs19, sep: [] });
|
|
6872
6872
|
this.onKeyLine = true;
|
|
6873
6873
|
} else if (it.sep) {
|
|
6874
|
-
this.stack.push(
|
|
6874
|
+
this.stack.push(fs19);
|
|
6875
6875
|
} else {
|
|
6876
|
-
Object.assign(it, { key:
|
|
6876
|
+
Object.assign(it, { key: fs19, sep: [] });
|
|
6877
6877
|
this.onKeyLine = true;
|
|
6878
6878
|
}
|
|
6879
6879
|
return;
|
|
@@ -6991,13 +6991,13 @@ var require_parser = __commonJS({
|
|
|
6991
6991
|
case "scalar":
|
|
6992
6992
|
case "single-quoted-scalar":
|
|
6993
6993
|
case "double-quoted-scalar": {
|
|
6994
|
-
const
|
|
6994
|
+
const fs19 = this.flowScalar(this.type);
|
|
6995
6995
|
if (!it || it.value)
|
|
6996
|
-
fc.items.push({ start: [], key:
|
|
6996
|
+
fc.items.push({ start: [], key: fs19, sep: [] });
|
|
6997
6997
|
else if (it.sep)
|
|
6998
|
-
this.stack.push(
|
|
6998
|
+
this.stack.push(fs19);
|
|
6999
6999
|
else
|
|
7000
|
-
Object.assign(it, { key:
|
|
7000
|
+
Object.assign(it, { key: fs19, sep: [] });
|
|
7001
7001
|
return;
|
|
7002
7002
|
}
|
|
7003
7003
|
case "flow-map-end":
|
|
@@ -11776,7 +11776,7 @@ var require_parse2 = __commonJS({
|
|
|
11776
11776
|
var require_gray_matter = __commonJS({
|
|
11777
11777
|
"../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js"(exports2, module2) {
|
|
11778
11778
|
"use strict";
|
|
11779
|
-
var
|
|
11779
|
+
var fs19 = __require("fs");
|
|
11780
11780
|
var sections = require_section_matter();
|
|
11781
11781
|
var defaults = require_defaults();
|
|
11782
11782
|
var stringify = require_stringify3();
|
|
@@ -11860,7 +11860,7 @@ var require_gray_matter = __commonJS({
|
|
|
11860
11860
|
return stringify(file2, data, options2);
|
|
11861
11861
|
};
|
|
11862
11862
|
matter2.read = function(filepath, options2) {
|
|
11863
|
-
const str2 =
|
|
11863
|
+
const str2 = fs19.readFileSync(filepath, "utf8");
|
|
11864
11864
|
const file2 = matter2(str2, options2);
|
|
11865
11865
|
file2.path = filepath;
|
|
11866
11866
|
return file2;
|
|
@@ -28609,7 +28609,7 @@ var require_util2 = __commonJS({
|
|
|
28609
28609
|
return result;
|
|
28610
28610
|
};
|
|
28611
28611
|
}
|
|
28612
|
-
var
|
|
28612
|
+
var normalize7 = lruMemoize(function normalize8(aPath) {
|
|
28613
28613
|
var path12 = aPath;
|
|
28614
28614
|
var url2 = urlParse(aPath);
|
|
28615
28615
|
if (url2) {
|
|
@@ -28661,7 +28661,7 @@ var require_util2 = __commonJS({
|
|
|
28661
28661
|
}
|
|
28662
28662
|
return path12;
|
|
28663
28663
|
});
|
|
28664
|
-
exports2.normalize =
|
|
28664
|
+
exports2.normalize = normalize7;
|
|
28665
28665
|
function join2(aRoot, aPath) {
|
|
28666
28666
|
if (aRoot === "") {
|
|
28667
28667
|
aRoot = ".";
|
|
@@ -28687,7 +28687,7 @@ var require_util2 = __commonJS({
|
|
|
28687
28687
|
aRootUrl.host = aPath;
|
|
28688
28688
|
return urlGenerate(aRootUrl);
|
|
28689
28689
|
}
|
|
28690
|
-
var joined = aPath.charAt(0) === "/" ? aPath :
|
|
28690
|
+
var joined = aPath.charAt(0) === "/" ? aPath : normalize7(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
28691
28691
|
if (aRootUrl) {
|
|
28692
28692
|
aRootUrl.path = joined;
|
|
28693
28693
|
return urlGenerate(aRootUrl);
|
|
@@ -28910,7 +28910,7 @@ var require_util2 = __commonJS({
|
|
|
28910
28910
|
}
|
|
28911
28911
|
sourceURL = join2(urlGenerate(parsed), sourceURL);
|
|
28912
28912
|
}
|
|
28913
|
-
return
|
|
28913
|
+
return normalize7(sourceURL);
|
|
28914
28914
|
}
|
|
28915
28915
|
exports2.computeSourceURL = computeSourceURL;
|
|
28916
28916
|
}
|
|
@@ -68689,11 +68689,11 @@ Visit https://nodejs.org to download the latest version.`
|
|
|
68689
68689
|
}
|
|
68690
68690
|
|
|
68691
68691
|
// src/program.ts
|
|
68692
|
-
import { Command as
|
|
68692
|
+
import { Command as Command47 } from "commander";
|
|
68693
68693
|
|
|
68694
68694
|
// package.json
|
|
68695
68695
|
var name = "@scalar/cli";
|
|
68696
|
-
var version = "1.8.
|
|
68696
|
+
var version = "1.8.3";
|
|
68697
68697
|
var bin = {
|
|
68698
68698
|
scalar: "./dist/index.js",
|
|
68699
68699
|
"scalar-cli": "./dist/index.js"
|
|
@@ -90246,7 +90246,7 @@ var config2 = {
|
|
|
90246
90246
|
}
|
|
90247
90247
|
},
|
|
90248
90248
|
cdnUrl: process.env.CDN_URL ?? "https://cdn.scalar.com",
|
|
90249
|
-
ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.3.
|
|
90249
|
+
ssgDocsIsolateVersion: process.env.SSG_DOCS_ISOLATE_VERSION ?? "1.3.3"
|
|
90250
90250
|
};
|
|
90251
90251
|
|
|
90252
90252
|
// src/domains/auth/login/helpers/personal-token-generate-access.ts
|
|
@@ -92022,7 +92022,7 @@ authCommands.forEach((command) => authDomain.addCommand(command()));
|
|
|
92022
92022
|
var auth_default = authDomain;
|
|
92023
92023
|
|
|
92024
92024
|
// src/domains/document/index.ts
|
|
92025
|
-
import { Command as
|
|
92025
|
+
import { Command as Command28 } from "commander";
|
|
92026
92026
|
|
|
92027
92027
|
// src/domains/document/join/index.ts
|
|
92028
92028
|
var import_yaml3 = __toESM(require_dist(), 1);
|
|
@@ -92283,13 +92283,48 @@ function LintCommand() {
|
|
|
92283
92283
|
return cmd2;
|
|
92284
92284
|
}
|
|
92285
92285
|
|
|
92286
|
-
// src/domains/document/
|
|
92287
|
-
import
|
|
92286
|
+
// src/domains/document/markdown/index.ts
|
|
92287
|
+
import fs8 from "node:fs";
|
|
92288
|
+
import as16 from "ansis";
|
|
92288
92289
|
import { Command as Command21 } from "commander";
|
|
92290
|
+
import { normalize as normalize5 } from "@scalar/openapi-parser";
|
|
92291
|
+
import { createMarkdownFromOpenApi } from "@scalar/openapi-to-markdown";
|
|
92292
|
+
function MarkdownCommand() {
|
|
92293
|
+
const cmd2 = new Command21("markdown");
|
|
92294
|
+
cmd2.description("Generate Markdown from an OpenAPI file");
|
|
92295
|
+
cmd2.argument("[file|url]", "OpenAPI file path or URL to convert");
|
|
92296
|
+
cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
92297
|
+
cmd2.action(
|
|
92298
|
+
async (inputArgument, { output: outputPath }) => {
|
|
92299
|
+
const startTime = performance.now();
|
|
92300
|
+
if (!inputArgument) {
|
|
92301
|
+
return output.error().title("Invalid argument").message("Please provide a file path or URL").exit("error");
|
|
92302
|
+
}
|
|
92303
|
+
const specification = await getFileOrUrl(inputArgument);
|
|
92304
|
+
const markdown = await createMarkdownFromOpenApi(normalize5(specification));
|
|
92305
|
+
if (outputPath) {
|
|
92306
|
+
fs8.writeFileSync(outputPath, markdown, "utf8");
|
|
92307
|
+
const endTime = performance.now();
|
|
92308
|
+
output.info().line(
|
|
92309
|
+
`${as16.green("Markdown generated")} ${as16.grey(
|
|
92310
|
+
`in ${as16.white(`${as16.bold(`${Math.round(endTime - startTime)}`)} ms`)}`
|
|
92311
|
+
)}`
|
|
92312
|
+
).line(`Written to ${as16.cyan(outputPath)}`).print();
|
|
92313
|
+
return;
|
|
92314
|
+
}
|
|
92315
|
+
process.stdout.write(markdown);
|
|
92316
|
+
}
|
|
92317
|
+
);
|
|
92318
|
+
return cmd2;
|
|
92319
|
+
}
|
|
92320
|
+
|
|
92321
|
+
// src/domains/document/mock/index.ts
|
|
92322
|
+
import as18 from "ansis";
|
|
92323
|
+
import { Command as Command22 } from "commander";
|
|
92289
92324
|
|
|
92290
92325
|
// src/domains/document/mock/helpers.ts
|
|
92291
92326
|
import { serve } from "@hono/node-server";
|
|
92292
|
-
import
|
|
92327
|
+
import as17 from "ansis";
|
|
92293
92328
|
import { createMockServer } from "@scalar/mock-server";
|
|
92294
92329
|
var bootServer = async ({
|
|
92295
92330
|
specification,
|
|
@@ -92306,17 +92341,17 @@ var bootServer = async ({
|
|
|
92306
92341
|
},
|
|
92307
92342
|
(info) => {
|
|
92308
92343
|
output.info().message(
|
|
92309
|
-
`${
|
|
92344
|
+
`${as17.green.bold("\u279C Mock Server")} ${as17.white(
|
|
92310
92345
|
"listening on"
|
|
92311
|
-
)} ${
|
|
92346
|
+
)} ${as17.cyan(`http://localhost:${info.port}`)}`
|
|
92312
92347
|
).print();
|
|
92313
92348
|
}
|
|
92314
92349
|
);
|
|
92315
92350
|
};
|
|
92316
92351
|
var printAvailablePaths = (specification) => {
|
|
92317
|
-
output.info().message(
|
|
92352
|
+
output.info().message(as17.white.bold("Available Paths")).print();
|
|
92318
92353
|
if (specification?.paths === void 0 || Object.keys(specification?.paths).length === 0) {
|
|
92319
|
-
output.warn().title(
|
|
92354
|
+
output.warn().title(as17.grey("Could not find any paths in the OpenAPI file.")).print();
|
|
92320
92355
|
}
|
|
92321
92356
|
for (const path12 in specification?.paths ?? []) {
|
|
92322
92357
|
if (specification?.paths?.[path12] === void 0) {
|
|
@@ -92327,7 +92362,7 @@ var printAvailablePaths = (specification) => {
|
|
|
92327
92362
|
continue;
|
|
92328
92363
|
}
|
|
92329
92364
|
output.info().line(
|
|
92330
|
-
`${
|
|
92365
|
+
`${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${path12}`)}`
|
|
92331
92366
|
).print();
|
|
92332
92367
|
}
|
|
92333
92368
|
}
|
|
@@ -92339,7 +92374,7 @@ var onRequest = ({
|
|
|
92339
92374
|
}) => {
|
|
92340
92375
|
const { method } = context.req;
|
|
92341
92376
|
output.info().line(
|
|
92342
|
-
`${
|
|
92377
|
+
`${as17[getMethodColor(method)].bold(method.toUpperCase().padEnd(6))} ${as17.grey(`${context.req.path}`)} ${as17.grey("\u2192")} ${operation?.operationId ? as17.white(operation.operationId) : as17.red("[ERROR] 404 Not Found")}`
|
|
92343
92378
|
).print();
|
|
92344
92379
|
};
|
|
92345
92380
|
function getMethodColor(method) {
|
|
@@ -92355,7 +92390,7 @@ function getMethodColor(method) {
|
|
|
92355
92390
|
|
|
92356
92391
|
// src/domains/document/mock/index.ts
|
|
92357
92392
|
function MockCommand() {
|
|
92358
|
-
const cmd2 = new
|
|
92393
|
+
const cmd2 = new Command22("mock");
|
|
92359
92394
|
cmd2.description("Mock an API from an OpenAPI file");
|
|
92360
92395
|
cmd2.argument("[file|url]", "OpenAPI file or URL to mock the server for");
|
|
92361
92396
|
cmd2.option("-w, --watch", "watch the file for changes");
|
|
@@ -92378,7 +92413,7 @@ function MockCommand() {
|
|
|
92378
92413
|
const newResult = await loadOpenApiFile(fileArgument);
|
|
92379
92414
|
const specificationHasChanged = newResult?.specification && JSON.stringify(specification) !== JSON.stringify(newResult.specification);
|
|
92380
92415
|
if (specificationHasChanged) {
|
|
92381
|
-
output.info().title(
|
|
92416
|
+
output.info().title(as18.grey("OpenAPI file modified")).print();
|
|
92382
92417
|
printSpecificationBanner({
|
|
92383
92418
|
version: newResult.version,
|
|
92384
92419
|
schema: newResult.schema
|
|
@@ -92415,12 +92450,12 @@ function MockCommand() {
|
|
|
92415
92450
|
|
|
92416
92451
|
// src/domains/document/serve/index.ts
|
|
92417
92452
|
import { serve as serve2 } from "@hono/node-server";
|
|
92418
|
-
import
|
|
92419
|
-
import { Command as
|
|
92453
|
+
import as19 from "ansis";
|
|
92454
|
+
import { Command as Command23 } from "commander";
|
|
92420
92455
|
import { Hono } from "hono";
|
|
92421
92456
|
import { stream } from "hono/streaming";
|
|
92422
92457
|
function ServeCommand() {
|
|
92423
|
-
const cmd2 = new
|
|
92458
|
+
const cmd2 = new Command23("serve");
|
|
92424
92459
|
cmd2.description("Serve an API Reference from an OpenAPI file");
|
|
92425
92460
|
cmd2.argument("[file|url]", "OpenAPI file or URL to show the reference for");
|
|
92426
92461
|
cmd2.option("-w, --watch", "watch the file for changes");
|
|
@@ -92463,7 +92498,7 @@ function ServeCommand() {
|
|
|
92463
92498
|
const newResult = await loadOpenApiFile(inputArgument);
|
|
92464
92499
|
const specificationHasChanged = newResult?.specification && JSON.stringify(specification) !== JSON.stringify(newResult.specification);
|
|
92465
92500
|
if (specificationHasChanged) {
|
|
92466
|
-
output.info().title(
|
|
92501
|
+
output.info().title(as19.grey("OpenAPI file modified")).print();
|
|
92467
92502
|
printSpecificationBanner({
|
|
92468
92503
|
version: newResult.version,
|
|
92469
92504
|
schema: newResult.schema
|
|
@@ -92488,9 +92523,9 @@ function ServeCommand() {
|
|
|
92488
92523
|
},
|
|
92489
92524
|
(info) => {
|
|
92490
92525
|
output.info().line(
|
|
92491
|
-
`${
|
|
92526
|
+
`${as19.green.bold("\u279C API Reference Server")} ${as19.white(
|
|
92492
92527
|
"listening on"
|
|
92493
|
-
)} ${
|
|
92528
|
+
)} ${as19.cyan(`http://localhost:${info.port}`)}`
|
|
92494
92529
|
).print();
|
|
92495
92530
|
}
|
|
92496
92531
|
);
|
|
@@ -92538,10 +92573,10 @@ var getHtmlDocument = (specification, watch = false) => {
|
|
|
92538
92573
|
};
|
|
92539
92574
|
|
|
92540
92575
|
// src/domains/document/share/index.ts
|
|
92541
|
-
import
|
|
92542
|
-
import { Command as
|
|
92576
|
+
import as20 from "ansis";
|
|
92577
|
+
import { Command as Command24 } from "commander";
|
|
92543
92578
|
function ShareCommand() {
|
|
92544
|
-
const cmd2 = new
|
|
92579
|
+
const cmd2 = new Command24("share");
|
|
92545
92580
|
cmd2.description("Share an OpenAPI file");
|
|
92546
92581
|
cmd2.argument("[file]", "file to share");
|
|
92547
92582
|
cmd2.option(
|
|
@@ -92567,29 +92602,29 @@ function ShareCommand() {
|
|
|
92567
92602
|
})
|
|
92568
92603
|
}).then((response) => response.json()).then((data) => {
|
|
92569
92604
|
const { id, token: newToken } = data;
|
|
92570
|
-
output.info().line(
|
|
92605
|
+
output.info().line(as20.green.bold("Your OpenAPI file is public.")).line().table(
|
|
92571
92606
|
[
|
|
92572
92607
|
[
|
|
92573
|
-
`${
|
|
92574
|
-
|
|
92608
|
+
`${as20.green("\u279C")} ${as20.white.bold("API Reference:")}`,
|
|
92609
|
+
as20.cyan(`https://sandbox.scalar.com/p/${id}`)
|
|
92575
92610
|
],
|
|
92576
92611
|
[
|
|
92577
|
-
`${
|
|
92578
|
-
|
|
92612
|
+
`${as20.grey("\u279C")} ${as20.grey.bold("Editor:")}`,
|
|
92613
|
+
as20.cyan(`https://sandbox.scalar.com/e/${id}`)
|
|
92579
92614
|
],
|
|
92580
92615
|
[],
|
|
92581
92616
|
[
|
|
92582
|
-
`${
|
|
92583
|
-
|
|
92617
|
+
`${as20.grey("\u279C")} ${as20.grey.bold("OpenAPI JSON:")}`,
|
|
92618
|
+
as20.cyan(`https://sandbox.scalar.com/files/${id}/openapi.json`)
|
|
92584
92619
|
],
|
|
92585
92620
|
[
|
|
92586
|
-
`${
|
|
92587
|
-
|
|
92621
|
+
`${as20.grey("\u279C")} ${as20.grey.bold("OpenAPI YAML:")}`,
|
|
92622
|
+
as20.cyan(`https://sandbox.scalar.com/files/${id}/openapi.yaml`)
|
|
92588
92623
|
]
|
|
92589
92624
|
],
|
|
92590
92625
|
{ padding: 1 }
|
|
92591
92626
|
).line().line("Use the token to update the existing sandbox:").line().line(
|
|
92592
|
-
`${
|
|
92627
|
+
`${as20.grey("$")} ${as20.white.bold("scalar document share --token=")}${as20.cyan.bold(`${newToken}`)} `
|
|
92593
92628
|
).line().print();
|
|
92594
92629
|
}).catch((error48) => {
|
|
92595
92630
|
output.error().title("Failed to share the file.").message(`Details: ${error48}`).exit("error");
|
|
@@ -92600,13 +92635,13 @@ function ShareCommand() {
|
|
|
92600
92635
|
|
|
92601
92636
|
// src/domains/document/upgrade/index.ts
|
|
92602
92637
|
var import_yaml4 = __toESM(require_dist(), 1);
|
|
92603
|
-
import
|
|
92638
|
+
import fs9 from "node:fs/promises";
|
|
92604
92639
|
import { confirm as confirm2 } from "@clack/prompts";
|
|
92605
|
-
import
|
|
92606
|
-
import { Command as
|
|
92607
|
-
import { normalize as
|
|
92640
|
+
import as21 from "ansis";
|
|
92641
|
+
import { Command as Command25 } from "commander";
|
|
92642
|
+
import { normalize as normalize6, upgrade } from "@scalar/openapi-parser";
|
|
92608
92643
|
function UpgradeCommand() {
|
|
92609
|
-
const cmd2 = new
|
|
92644
|
+
const cmd2 = new Command25("upgrade");
|
|
92610
92645
|
cmd2.description("Upgrade OpenAPI document to version 3.1");
|
|
92611
92646
|
cmd2.argument("[file|url]", "File or URL to validate");
|
|
92612
92647
|
cmd2.option("-o, --output <file>", "Path to save the upgraded output file");
|
|
@@ -92630,31 +92665,31 @@ function UpgradeCommand() {
|
|
|
92630
92665
|
}
|
|
92631
92666
|
}
|
|
92632
92667
|
const outputFileName = outputFilePath ?? input;
|
|
92633
|
-
const document2 =
|
|
92668
|
+
const document2 = normalize6(await getFileOrUrl(input));
|
|
92634
92669
|
const { result, executionTimeMs } = await measureTime(
|
|
92635
92670
|
() => upgrade(document2)
|
|
92636
92671
|
);
|
|
92637
92672
|
const isYaml = isYamlFileName(outputFileName);
|
|
92638
|
-
await
|
|
92673
|
+
await fs9.writeFile(
|
|
92639
92674
|
outputFileName,
|
|
92640
92675
|
isYaml ? import_yaml4.default.stringify(result.specification) : JSON.stringify(result.specification, null, 2)
|
|
92641
92676
|
);
|
|
92642
92677
|
output.info().message(
|
|
92643
|
-
`${
|
|
92678
|
+
`${as21.green(`\u2728 OpenAPI Schema upgraded to version ${result.version}`)} in ${as21.white(`${as21.bold(`${executionTimeMs.toFixed(2)}`)} ms`)}`
|
|
92644
92679
|
).print();
|
|
92645
92680
|
});
|
|
92646
92681
|
return cmd2;
|
|
92647
92682
|
}
|
|
92648
92683
|
|
|
92649
92684
|
// src/domains/document/validate/index.ts
|
|
92650
|
-
import
|
|
92651
|
-
import { Command as
|
|
92685
|
+
import as22 from "ansis";
|
|
92686
|
+
import { Command as Command26 } from "commander";
|
|
92652
92687
|
import prettyjson from "prettyjson";
|
|
92653
92688
|
import { bundle as bundle3 } from "@scalar/json-magic/bundle";
|
|
92654
92689
|
import { fetchUrls as fetchUrls3, readFiles as readFiles3 } from "@scalar/json-magic/bundle/plugins/node";
|
|
92655
92690
|
import { validate as validate2 } from "@scalar/openapi-parser";
|
|
92656
92691
|
function ValidateCommand() {
|
|
92657
|
-
const cmd2 = new
|
|
92692
|
+
const cmd2 = new Command26("validate");
|
|
92658
92693
|
cmd2.description("Validate an OpenAPI file");
|
|
92659
92694
|
cmd2.argument("[file|url]", "File or URL to validate");
|
|
92660
92695
|
cmd2.action(async (inputArgument) => {
|
|
@@ -92671,24 +92706,24 @@ function ValidateCommand() {
|
|
|
92671
92706
|
if (result.valid && result.version) {
|
|
92672
92707
|
const endTime = performance.now();
|
|
92673
92708
|
output.info().line(
|
|
92674
|
-
|
|
92675
|
-
`Matches the OpenAPI specification${
|
|
92709
|
+
as22.green(
|
|
92710
|
+
`Matches the OpenAPI specification${as22.white(` (OpenAPI ${as22.bold(result.version)})`)}
|
|
92676
92711
|
`
|
|
92677
92712
|
)
|
|
92678
92713
|
).line(
|
|
92679
|
-
`${
|
|
92680
|
-
`in ${
|
|
92714
|
+
`${as22.green("File validated")} ${as22.grey(
|
|
92715
|
+
`in ${as22.white(`${as22.bold(`${Math.round(endTime - startTime)}`)} ms`)}
|
|
92681
92716
|
`
|
|
92682
92717
|
)}`
|
|
92683
92718
|
).print();
|
|
92684
92719
|
} else {
|
|
92685
92720
|
output.error().message(prettyjson.render(result.errors)).message(
|
|
92686
|
-
|
|
92721
|
+
as22.red(
|
|
92687
92722
|
`File does not match the OpenAPI ${result.version ? `${result.version} ` : ""}specification.`
|
|
92688
92723
|
)
|
|
92689
92724
|
).message(
|
|
92690
|
-
|
|
92691
|
-
`${
|
|
92725
|
+
as22.red(
|
|
92726
|
+
`${as22.bold(
|
|
92692
92727
|
`${result.errors?.length} error${result.errors && result.errors.length > 1 ? "s" : ""}`
|
|
92693
92728
|
)} found.`
|
|
92694
92729
|
)
|
|
@@ -92700,11 +92735,11 @@ function ValidateCommand() {
|
|
|
92700
92735
|
|
|
92701
92736
|
// src/domains/document/void/index.ts
|
|
92702
92737
|
import { serve as serve3 } from "@hono/node-server";
|
|
92703
|
-
import
|
|
92704
|
-
import { Command as
|
|
92738
|
+
import as23 from "ansis";
|
|
92739
|
+
import { Command as Command27 } from "commander";
|
|
92705
92740
|
import { createVoidServer } from "@scalar/void-server";
|
|
92706
92741
|
function VoidCommand() {
|
|
92707
|
-
const cmd2 = new
|
|
92742
|
+
const cmd2 = new Command27("void");
|
|
92708
92743
|
cmd2.description("Boot a server to mirror HTTP requests");
|
|
92709
92744
|
cmd2.option("-o, --once", "run the server only once and exit after that");
|
|
92710
92745
|
cmd2.option("-p, --port <port>", "set the HTTP port for the mock server");
|
|
@@ -92736,9 +92771,9 @@ var bootServer2 = async ({
|
|
|
92736
92771
|
},
|
|
92737
92772
|
(info) => {
|
|
92738
92773
|
output.info().line(
|
|
92739
|
-
`${
|
|
92774
|
+
`${as23.green.bold("\u279C Void Server")} ${as23.white(
|
|
92740
92775
|
"listening on"
|
|
92741
|
-
)} ${
|
|
92776
|
+
)} ${as23.cyan(`http://localhost:${info.port}`)}
|
|
92742
92777
|
`
|
|
92743
92778
|
).print();
|
|
92744
92779
|
}
|
|
@@ -92751,6 +92786,7 @@ var documentCommands = [
|
|
|
92751
92786
|
SplitCommand,
|
|
92752
92787
|
JoinCommand,
|
|
92753
92788
|
FormatCommand,
|
|
92789
|
+
MarkdownCommand,
|
|
92754
92790
|
MockCommand,
|
|
92755
92791
|
ServeCommand,
|
|
92756
92792
|
ShareCommand,
|
|
@@ -92759,23 +92795,23 @@ var documentCommands = [
|
|
|
92759
92795
|
LintCommand,
|
|
92760
92796
|
UpgradeCommand
|
|
92761
92797
|
];
|
|
92762
|
-
var documentDomain = new
|
|
92798
|
+
var documentDomain = new Command28("document");
|
|
92763
92799
|
documentDomain.description("Manage local openapi file");
|
|
92764
92800
|
documentCommands.forEach((command) => documentDomain.addCommand(command()));
|
|
92765
92801
|
var document_default = documentDomain;
|
|
92766
92802
|
|
|
92767
92803
|
// src/domains/project/index.ts
|
|
92768
|
-
import { Command as
|
|
92804
|
+
import { Command as Command35 } from "commander";
|
|
92769
92805
|
|
|
92770
92806
|
// src/domains/project/preview/index.ts
|
|
92771
92807
|
import { text as text4 } from "@clack/prompts";
|
|
92772
|
-
import
|
|
92773
|
-
import { Command as
|
|
92808
|
+
import as26 from "ansis";
|
|
92809
|
+
import { Command as Command30 } from "commander";
|
|
92774
92810
|
|
|
92775
92811
|
// src/domains/project/check-config/index.ts
|
|
92776
|
-
import
|
|
92777
|
-
import
|
|
92778
|
-
import { Command as
|
|
92812
|
+
import fs11 from "node:fs";
|
|
92813
|
+
import as24 from "ansis";
|
|
92814
|
+
import { Command as Command29 } from "commander";
|
|
92779
92815
|
|
|
92780
92816
|
// ../../packages/helpers/dist/parse/parse.js
|
|
92781
92817
|
var import_json5 = __toESM(require_lib(), 1);
|
|
@@ -94279,7 +94315,6 @@ function parseConfig(rawConfig) {
|
|
|
94279
94315
|
const version3 = getConfigVersion(jsonConfigResult.data);
|
|
94280
94316
|
const { success: success2, data: config3, error: error48 } = configVersionToSchemaMapping[version3].safeParse(jsonConfigResult.data);
|
|
94281
94317
|
if (!success2) {
|
|
94282
|
-
console.error("Failed to parse config", rawConfig, error48);
|
|
94283
94318
|
return { success: false, error: error48, version: version3 };
|
|
94284
94319
|
}
|
|
94285
94320
|
return {
|
|
@@ -94290,7 +94325,6 @@ function parseConfig(rawConfig) {
|
|
|
94290
94325
|
}
|
|
94291
94326
|
};
|
|
94292
94327
|
} catch (error48) {
|
|
94293
|
-
console.error("Failed to parse config", rawConfig, error48);
|
|
94294
94328
|
return { success: false, error: error48 };
|
|
94295
94329
|
}
|
|
94296
94330
|
}
|
|
@@ -94971,7 +95005,7 @@ var wysiwygProjectToV2 = n.safeFn(({ project, invalidRefs, theme }) => {
|
|
|
94971
95005
|
}, (originalError) => createError("FAILED_TO_CONVERT_WYSIWYG_TO_V2", originalError));
|
|
94972
95006
|
|
|
94973
95007
|
// src/domains/project/helpers.ts
|
|
94974
|
-
import
|
|
95008
|
+
import fs10 from "node:fs";
|
|
94975
95009
|
import path5 from "node:path";
|
|
94976
95010
|
var DEFAULT_MARKDOWN_FILE_NAME = "docs-quickstart.md";
|
|
94977
95011
|
var DEFAULT_OPENAPI_FILE_NAME = "docs-openapi.json";
|
|
@@ -94983,7 +95017,7 @@ function findConfig(searchPath) {
|
|
|
94983
95017
|
return searchInDirectory(process.cwd());
|
|
94984
95018
|
}
|
|
94985
95019
|
const searchPathResolved = path5.resolve(searchPath);
|
|
94986
|
-
const stat =
|
|
95020
|
+
const stat = fs10.statSync(searchPathResolved, { throwIfNoEntry: false });
|
|
94987
95021
|
if (!stat) {
|
|
94988
95022
|
return null;
|
|
94989
95023
|
}
|
|
@@ -95000,7 +95034,7 @@ function getCurrentFolderName() {
|
|
|
95000
95034
|
}
|
|
95001
95035
|
function searchInDirectory(directory) {
|
|
95002
95036
|
try {
|
|
95003
|
-
const entries =
|
|
95037
|
+
const entries = fs10.readdirSync(directory);
|
|
95004
95038
|
for (const entry of entries) {
|
|
95005
95039
|
if (entry === CONFIG_FILE_NAME || entry.startsWith(`${CONFIG_FILE_NAME}.`)) {
|
|
95006
95040
|
return path5.join(directory, entry);
|
|
@@ -95026,7 +95060,7 @@ function readAndParseConfig(configPath) {
|
|
|
95026
95060
|
}
|
|
95027
95061
|
};
|
|
95028
95062
|
}
|
|
95029
|
-
const fileContent =
|
|
95063
|
+
const fileContent = fs11.readFileSync(file2, "utf-8");
|
|
95030
95064
|
const parseConfigResult = parseConfig(fileContent);
|
|
95031
95065
|
if (!parseConfigResult.success) {
|
|
95032
95066
|
return {
|
|
@@ -95046,17 +95080,17 @@ function readAndParseConfig(configPath) {
|
|
|
95046
95080
|
};
|
|
95047
95081
|
}
|
|
95048
95082
|
function CheckConfigCommand() {
|
|
95049
|
-
const cmd2 = new
|
|
95083
|
+
const cmd2 = new Command29("check-config");
|
|
95050
95084
|
cmd2.description("Check a Scalar Configuration file");
|
|
95051
95085
|
cmd2.argument("[file]", "File to check");
|
|
95052
95086
|
cmd2.action(async (inputArgument) => {
|
|
95053
95087
|
const result = readAndParseConfig(inputArgument);
|
|
95054
95088
|
if (result.success) {
|
|
95055
95089
|
output.info().line(
|
|
95056
|
-
`${
|
|
95090
|
+
`${as24.green("[SUCCESS]")} ${as24.green("The Scalar Configuration is valid:")} ${as24.green(result.filePath)}`
|
|
95057
95091
|
).line(
|
|
95058
|
-
`${
|
|
95059
|
-
`in ${
|
|
95092
|
+
`${as24.green("Scalar Configuration validated")} ${as24.grey(
|
|
95093
|
+
`in ${as24.white.bold(`${result.validationTime} ms`)}`
|
|
95060
95094
|
)}
|
|
95061
95095
|
`
|
|
95062
95096
|
).print();
|
|
@@ -95073,7 +95107,7 @@ function CheckConfigCommand() {
|
|
|
95073
95107
|
if (error48.issues) {
|
|
95074
95108
|
output.error().table(
|
|
95075
95109
|
error48.issues.map((issue2) => [
|
|
95076
|
-
|
|
95110
|
+
as24.yellow(`${issue2.path.join("/").trim() || "root"}:`),
|
|
95077
95111
|
issue2.message
|
|
95078
95112
|
]),
|
|
95079
95113
|
{ padding: 2 }
|
|
@@ -95088,7 +95122,7 @@ function CheckConfigCommand() {
|
|
|
95088
95122
|
|
|
95089
95123
|
// src/domains/project/preview/v2.ts
|
|
95090
95124
|
import { execFile, spawn } from "node:child_process";
|
|
95091
|
-
import
|
|
95125
|
+
import fs12 from "node:fs/promises";
|
|
95092
95126
|
import os2 from "node:os";
|
|
95093
95127
|
import path6 from "node:path";
|
|
95094
95128
|
import { Readable } from "node:stream";
|
|
@@ -95097,14 +95131,14 @@ import tar from "tar-fs";
|
|
|
95097
95131
|
|
|
95098
95132
|
// src/helpers/run-command.ts
|
|
95099
95133
|
import { exec as exec2 } from "node:child_process";
|
|
95100
|
-
import
|
|
95134
|
+
import as25 from "ansis";
|
|
95101
95135
|
async function runCommand(command, cwd2) {
|
|
95102
95136
|
return new Promise((resolve, reject) => {
|
|
95103
95137
|
const comm = exec2(command, { cwd: cwd2 });
|
|
95104
95138
|
comm.stdout?.pipe(process.stdout);
|
|
95105
95139
|
comm.stderr?.pipe(process.stderr);
|
|
95106
95140
|
comm.on("error", (err) => {
|
|
95107
|
-
|
|
95141
|
+
as25.redBright(err.message);
|
|
95108
95142
|
reject(err);
|
|
95109
95143
|
});
|
|
95110
95144
|
comm.on("close", (code) => code === 0 ? resolve(true) : reject(code));
|
|
@@ -95116,7 +95150,7 @@ var ISOLATE_EXTRACTION_DIR = path6.join(os2.homedir(), ".scalar");
|
|
|
95116
95150
|
var ISOLATE_DIR = path6.join(ISOLATE_EXTRACTION_DIR, "isolate");
|
|
95117
95151
|
async function getExistingIsolateVersion() {
|
|
95118
95152
|
try {
|
|
95119
|
-
const packageJsonString = await
|
|
95153
|
+
const packageJsonString = await fs12.readFile(
|
|
95120
95154
|
path6.join(ISOLATE_DIR, "package.json"),
|
|
95121
95155
|
"utf8"
|
|
95122
95156
|
);
|
|
@@ -95171,7 +95205,7 @@ Remove-Item $tempFile
|
|
|
95171
95205
|
async function downloadIsolate() {
|
|
95172
95206
|
const existingIsolateVersion = await getExistingIsolateVersion();
|
|
95173
95207
|
if (config2.ssgDocsIsolateVersion === existingIsolateVersion) return;
|
|
95174
|
-
await
|
|
95208
|
+
await fs12.rm(ISOLATE_EXTRACTION_DIR, { force: true, recursive: true });
|
|
95175
95209
|
const logger = output.info({ animate: true }).loader("Downloading docs isolate. This may take a minute...");
|
|
95176
95210
|
const ISOLATE_URL = `${config2.cdnUrl}/isolates/${config2.ssgDocsIsolateVersion}-isolate.tar.gz`;
|
|
95177
95211
|
if (process.platform === "win32") {
|
|
@@ -95236,7 +95270,7 @@ async function previewV2Project({
|
|
|
95236
95270
|
|
|
95237
95271
|
// src/domains/project/preview/index.ts
|
|
95238
95272
|
var PreviewCommand = () => {
|
|
95239
|
-
const cmd2 = new
|
|
95273
|
+
const cmd2 = new Command30("preview");
|
|
95240
95274
|
cmd2.description("Preview scalar guides");
|
|
95241
95275
|
cmd2.argument(
|
|
95242
95276
|
"[config]",
|
|
@@ -95294,7 +95328,7 @@ var PreviewCommand = () => {
|
|
|
95294
95328
|
if (error48.issues) {
|
|
95295
95329
|
output.error().table(
|
|
95296
95330
|
error48.issues.map((issue2) => [
|
|
95297
|
-
|
|
95331
|
+
as26.yellow(`${issue2.path.join("/").trim() || "root"}:`),
|
|
95298
95332
|
issue2.message
|
|
95299
95333
|
]),
|
|
95300
95334
|
{ padding: 2 }
|
|
@@ -95305,7 +95339,7 @@ var PreviewCommand = () => {
|
|
|
95305
95339
|
}
|
|
95306
95340
|
if (parseConfigResult.success) {
|
|
95307
95341
|
output.info().line(
|
|
95308
|
-
`${
|
|
95342
|
+
`${as26.green("[SUCCESS]")} ${as26.green("Configuration is valid:")} ${as26.green(parseConfigResult.filePath)}`
|
|
95309
95343
|
).print();
|
|
95310
95344
|
}
|
|
95311
95345
|
const { config: config3 } = parseConfigResult;
|
|
@@ -95328,10 +95362,10 @@ var PreviewCommand = () => {
|
|
|
95328
95362
|
|
|
95329
95363
|
// src/domains/project/create/index.ts
|
|
95330
95364
|
import { text as text5 } from "@clack/prompts";
|
|
95331
|
-
import
|
|
95332
|
-
import { Command as
|
|
95365
|
+
import as27 from "ansis";
|
|
95366
|
+
import { Command as Command31 } from "commander";
|
|
95333
95367
|
var CreateCommand = () => {
|
|
95334
|
-
const cmd2 = new
|
|
95368
|
+
const cmd2 = new Command31("create");
|
|
95335
95369
|
cmd2.description(
|
|
95336
95370
|
"Create a new project that is not linked to a github project."
|
|
95337
95371
|
);
|
|
@@ -95368,19 +95402,19 @@ var CreateCommand = () => {
|
|
|
95368
95402
|
}
|
|
95369
95403
|
logger.update("loader", 0, { content: "Project created successfully!" });
|
|
95370
95404
|
logger.message(
|
|
95371
|
-
`Project uid: ${
|
|
95372
|
-
Project slug: ${
|
|
95405
|
+
`Project uid: ${as27.cyan(response.data.uid)}
|
|
95406
|
+
Project slug: ${as27.cyan(response.data.slug)}`
|
|
95373
95407
|
).exit("success");
|
|
95374
95408
|
});
|
|
95375
95409
|
return cmd2;
|
|
95376
95410
|
};
|
|
95377
95411
|
|
|
95378
95412
|
// src/domains/project/init/index.ts
|
|
95379
|
-
import
|
|
95413
|
+
import fs13 from "node:fs/promises";
|
|
95380
95414
|
import path7 from "node:path";
|
|
95381
95415
|
import { cancel, confirm as confirm3, isCancel, text as text6 } from "@clack/prompts";
|
|
95382
|
-
import
|
|
95383
|
-
import { Command as
|
|
95416
|
+
import as28 from "ansis";
|
|
95417
|
+
import { Command as Command32 } from "commander";
|
|
95384
95418
|
|
|
95385
95419
|
// ../../node_modules/.pnpm/@scalar+galaxy@0.6.1/node_modules/@scalar/galaxy/dist/3.1.json
|
|
95386
95420
|
var __default = {
|
|
@@ -97333,14 +97367,14 @@ We're here to help:
|
|
|
97333
97367
|
// src/domains/project/init/index.ts
|
|
97334
97368
|
async function fileExists2(path12) {
|
|
97335
97369
|
try {
|
|
97336
|
-
await
|
|
97370
|
+
await fs13.access(path12, fs13.constants.F_OK);
|
|
97337
97371
|
return true;
|
|
97338
97372
|
} catch {
|
|
97339
97373
|
return false;
|
|
97340
97374
|
}
|
|
97341
97375
|
}
|
|
97342
97376
|
var InitCommand = () => {
|
|
97343
|
-
const cmd2 = new
|
|
97377
|
+
const cmd2 = new Command32("init");
|
|
97344
97378
|
cmd2.description("Create a new Scalar Docs project.");
|
|
97345
97379
|
cmd2.option("-s, --subdomain [url]", "subdomain to publish on");
|
|
97346
97380
|
cmd2.option("--force", "override existing configuration");
|
|
@@ -97349,14 +97383,14 @@ var InitCommand = () => {
|
|
|
97349
97383
|
let validInput;
|
|
97350
97384
|
const nextSteps = () => {
|
|
97351
97385
|
output.info().line("What to do next:").line(
|
|
97352
|
-
` ${
|
|
97386
|
+
` ${as28.cyan("scalar project preview")} to preview your project locally`
|
|
97353
97387
|
).line(
|
|
97354
|
-
` ${
|
|
97388
|
+
` ${as28.cyan("scalar project check-config")} to validate your scalar.config.json file`
|
|
97355
97389
|
).line(
|
|
97356
|
-
` ${
|
|
97390
|
+
` ${as28.cyan("scalar project publish --slug")} ${as28.gray("[dashboard-project-slug]")} to publish your project`
|
|
97357
97391
|
).line(
|
|
97358
|
-
|
|
97359
|
-
`Run ${
|
|
97392
|
+
as28.white(
|
|
97393
|
+
`Run ${as28.magenta("scalar --help")} to see all available commands.`
|
|
97360
97394
|
)
|
|
97361
97395
|
).print();
|
|
97362
97396
|
};
|
|
@@ -97367,10 +97401,10 @@ var InitCommand = () => {
|
|
|
97367
97401
|
};
|
|
97368
97402
|
if (await fileExists2(configFile)) {
|
|
97369
97403
|
output.info().line(
|
|
97370
|
-
`${
|
|
97404
|
+
`${as28.green("\u26A0")} Found existing configuration: ${as28.green.bold(`${configFile}`)}`
|
|
97371
97405
|
).print();
|
|
97372
97406
|
if (force) {
|
|
97373
|
-
output.info().line(`${
|
|
97407
|
+
output.info().line(`${as28.green("\u2714")} Overwriting existing file\u2026`).print();
|
|
97374
97408
|
}
|
|
97375
97409
|
const shouldOverwriteExisting = force ?? await confirm3({
|
|
97376
97410
|
message: "Do you want to override the file?",
|
|
@@ -97425,23 +97459,23 @@ var InitCommand = () => {
|
|
|
97425
97459
|
const slug = slugify3(title);
|
|
97426
97460
|
configuration.info = { title, description: `Documentation for ${title}` };
|
|
97427
97461
|
subdomain = slug;
|
|
97428
|
-
output.info().line(`${
|
|
97462
|
+
output.info().line(`${as28.green("\u2714")} Subdomain: ${as28.green(subdomain)}`).print();
|
|
97429
97463
|
}
|
|
97430
97464
|
configuration.siteConfig.subdomain = subdomain.trim();
|
|
97431
97465
|
const content = JSON.stringify(configuration, null, 2);
|
|
97432
|
-
await
|
|
97433
|
-
await
|
|
97466
|
+
await fs13.writeFile(configFile, content);
|
|
97467
|
+
await fs13.writeFile(
|
|
97434
97468
|
path7.join(currentDir, DEFAULT_MARKDOWN_FILE_NAME),
|
|
97435
97469
|
quickstartMarkdown
|
|
97436
97470
|
);
|
|
97437
|
-
await
|
|
97471
|
+
await fs13.writeFile(
|
|
97438
97472
|
path7.join(currentDir, DEFAULT_OPENAPI_FILE_NAME),
|
|
97439
97473
|
JSON.stringify(__default, null, 2)
|
|
97440
97474
|
);
|
|
97441
|
-
output.info().line(`${
|
|
97442
|
-
`).line(`${
|
|
97475
|
+
output.info().line(`${as28.green("\u2714")} Configuration stored.
|
|
97476
|
+
`).line(`${as28.green.bold(`${configFile}`)}
|
|
97443
97477
|
`).line(
|
|
97444
|
-
`${
|
|
97478
|
+
`${as28.grey(
|
|
97445
97479
|
content.split("\n").map((line) => ` ${line}`).join("\n")
|
|
97446
97480
|
)}`
|
|
97447
97481
|
).print();
|
|
@@ -97451,12 +97485,12 @@ var InitCommand = () => {
|
|
|
97451
97485
|
};
|
|
97452
97486
|
|
|
97453
97487
|
// src/domains/project/publish/index.ts
|
|
97454
|
-
import
|
|
97488
|
+
import fs15 from "node:fs";
|
|
97455
97489
|
import { dirname } from "node:path";
|
|
97456
|
-
import { Command as
|
|
97490
|
+
import { Command as Command33 } from "commander";
|
|
97457
97491
|
|
|
97458
97492
|
// src/domains/project/publish/publish.ts
|
|
97459
|
-
import
|
|
97493
|
+
import fs14 from "node:fs";
|
|
97460
97494
|
import path8 from "node:path";
|
|
97461
97495
|
import { Readable as Readable2 } from "node:stream";
|
|
97462
97496
|
import ignore from "ignore";
|
|
@@ -97467,7 +97501,7 @@ function isErrnoException(error48) {
|
|
|
97467
97501
|
}
|
|
97468
97502
|
async function readGitIgnore(configDir) {
|
|
97469
97503
|
try {
|
|
97470
|
-
const gitignore = await
|
|
97504
|
+
const gitignore = await fs14.promises.readFile(
|
|
97471
97505
|
path8.resolve(configDir, ".gitignore"),
|
|
97472
97506
|
"utf8"
|
|
97473
97507
|
);
|
|
@@ -97559,7 +97593,7 @@ var sleep = (ms) => {
|
|
|
97559
97593
|
|
|
97560
97594
|
// src/domains/project/publish/index.ts
|
|
97561
97595
|
var PublishCommand = () => {
|
|
97562
|
-
const cmd2 = new
|
|
97596
|
+
const cmd2 = new Command33("publish");
|
|
97563
97597
|
cmd2.description(
|
|
97564
97598
|
"Publish new build for a github sync project that is not linked."
|
|
97565
97599
|
);
|
|
@@ -97613,10 +97647,10 @@ var PublishCommand = () => {
|
|
|
97613
97647
|
});
|
|
97614
97648
|
}
|
|
97615
97649
|
const configPath = configPathOption ?? findConfig();
|
|
97616
|
-
if (!configPath || !
|
|
97650
|
+
if (!configPath || !fs15.existsSync(configPath)) {
|
|
97617
97651
|
return output.error().title("Invalid configuration file").message("Could not find the Scalar Configuration file:").message(configPath ?? "").exit("error");
|
|
97618
97652
|
}
|
|
97619
|
-
const rawConfig =
|
|
97653
|
+
const rawConfig = fs15.readFileSync(configPath, "utf-8");
|
|
97620
97654
|
const configParseResult = parseConfig(rawConfig);
|
|
97621
97655
|
if (!configParseResult.success) {
|
|
97622
97656
|
return output.error().title("Invalid configuration file").line(
|
|
@@ -97696,11 +97730,11 @@ async function getDeployStatus({
|
|
|
97696
97730
|
}
|
|
97697
97731
|
|
|
97698
97732
|
// src/domains/project/upgrade/index.ts
|
|
97699
|
-
import
|
|
97733
|
+
import fs16 from "node:fs/promises";
|
|
97700
97734
|
import path9 from "node:path";
|
|
97701
97735
|
import { text as text7 } from "@clack/prompts";
|
|
97702
|
-
import
|
|
97703
|
-
import { Command as
|
|
97736
|
+
import as29 from "ansis";
|
|
97737
|
+
import { Command as Command34 } from "commander";
|
|
97704
97738
|
import { n as n2 } from "neverpanic";
|
|
97705
97739
|
|
|
97706
97740
|
// src/errors.ts
|
|
@@ -97729,7 +97763,7 @@ function displayError(error48, fallback = "Unknown error occurred. Please contac
|
|
|
97729
97763
|
|
|
97730
97764
|
// src/domains/project/upgrade/index.ts
|
|
97731
97765
|
var UpgradeCommand2 = () => {
|
|
97732
|
-
const cmd2 = new
|
|
97766
|
+
const cmd2 = new Command34("upgrade");
|
|
97733
97767
|
cmd2.description("Upgrade scalar project");
|
|
97734
97768
|
cmd2.argument(
|
|
97735
97769
|
"[config]",
|
|
@@ -97755,7 +97789,7 @@ var UpgradeCommand2 = () => {
|
|
|
97755
97789
|
if (error48.issues) {
|
|
97756
97790
|
output.error().table(
|
|
97757
97791
|
error48.issues.map((issue2) => [
|
|
97758
|
-
|
|
97792
|
+
as29.yellow(`${issue2.path.join("/").trim() || "root"}:`),
|
|
97759
97793
|
issue2.message
|
|
97760
97794
|
]),
|
|
97761
97795
|
{ padding: 2 }
|
|
@@ -97766,7 +97800,7 @@ var UpgradeCommand2 = () => {
|
|
|
97766
97800
|
}
|
|
97767
97801
|
if (parseConfigResult.success) {
|
|
97768
97802
|
output.info().line(
|
|
97769
|
-
`${
|
|
97803
|
+
`${as29.green("[SUCCESS]")} ${as29.green("Configuration is valid:")} ${as29.green(parseConfigResult.filePath)}`
|
|
97770
97804
|
).print();
|
|
97771
97805
|
}
|
|
97772
97806
|
const { config: config3 } = parseConfigResult;
|
|
@@ -97785,7 +97819,7 @@ var UpgradeCommand2 = () => {
|
|
|
97785
97819
|
const { upgradedConfig, legacyTheme, legacyFooter, legacyScript } = upgradedConfigResult.data;
|
|
97786
97820
|
if (legacyTheme) {
|
|
97787
97821
|
const writeUpgradedThemeResult = await n2.fromUnsafe(
|
|
97788
|
-
() =>
|
|
97822
|
+
() => fs16.writeFile(
|
|
97789
97823
|
path9.resolve(
|
|
97790
97824
|
path9.dirname(parseConfigResult.filePath),
|
|
97791
97825
|
config3.root ?? "./",
|
|
@@ -97801,7 +97835,7 @@ var UpgradeCommand2 = () => {
|
|
|
97801
97835
|
}
|
|
97802
97836
|
if (legacyFooter) {
|
|
97803
97837
|
const writeUpgradedFooterResult = await n2.fromUnsafe(
|
|
97804
|
-
() =>
|
|
97838
|
+
() => fs16.writeFile(
|
|
97805
97839
|
path9.resolve(
|
|
97806
97840
|
path9.dirname(parseConfigResult.filePath),
|
|
97807
97841
|
config3.root ?? "./",
|
|
@@ -97817,7 +97851,7 @@ var UpgradeCommand2 = () => {
|
|
|
97817
97851
|
}
|
|
97818
97852
|
if (legacyScript) {
|
|
97819
97853
|
const writeUpgradedScriptResult = await n2.fromUnsafe(
|
|
97820
|
-
() =>
|
|
97854
|
+
() => fs16.writeFile(
|
|
97821
97855
|
path9.resolve(
|
|
97822
97856
|
path9.dirname(parseConfigResult.filePath),
|
|
97823
97857
|
config3.root ?? "./",
|
|
@@ -97832,7 +97866,7 @@ var UpgradeCommand2 = () => {
|
|
|
97832
97866
|
}
|
|
97833
97867
|
}
|
|
97834
97868
|
const writeUpgradedConfigResult = await n2.fromUnsafe(
|
|
97835
|
-
() =>
|
|
97869
|
+
() => fs16.writeFile(
|
|
97836
97870
|
parseConfigResult.filePath,
|
|
97837
97871
|
JSON.stringify(upgradedConfig, null, 2)
|
|
97838
97872
|
),
|
|
@@ -97855,21 +97889,21 @@ var projectCommands = [
|
|
|
97855
97889
|
PublishCommand,
|
|
97856
97890
|
UpgradeCommand2
|
|
97857
97891
|
];
|
|
97858
|
-
var projectDomain = new
|
|
97892
|
+
var projectDomain = new Command35("project");
|
|
97859
97893
|
projectDomain.description("Manage scalar project");
|
|
97860
97894
|
projectCommands.forEach((command) => projectDomain.addCommand(command()));
|
|
97861
97895
|
var project_default = projectDomain;
|
|
97862
97896
|
|
|
97863
97897
|
// src/domains/readme/index.ts
|
|
97864
|
-
import { Command as
|
|
97898
|
+
import { Command as Command37 } from "commander";
|
|
97865
97899
|
|
|
97866
97900
|
// src/domains/readme/generate.ts
|
|
97867
97901
|
import { text as text8 } from "@clack/prompts";
|
|
97868
|
-
import
|
|
97869
|
-
import { Command as
|
|
97902
|
+
import as30 from "ansis";
|
|
97903
|
+
import { Command as Command36 } from "commander";
|
|
97870
97904
|
|
|
97871
97905
|
// src/helpers/documentation/index.ts
|
|
97872
|
-
import
|
|
97906
|
+
import fs17 from "node:fs/promises";
|
|
97873
97907
|
import path10 from "node:path";
|
|
97874
97908
|
var generateDocs = (command, depth = 0) => {
|
|
97875
97909
|
const documentation = [];
|
|
@@ -97898,13 +97932,13 @@ ${docs.content}${codeBlock}`);
|
|
|
97898
97932
|
};
|
|
97899
97933
|
var generateDocumentationFile = async (outputPath) => {
|
|
97900
97934
|
const commandDocumentation = generateCommandDocumentation(getProgram());
|
|
97901
|
-
const template = await
|
|
97935
|
+
const template = await fs17.readFile(
|
|
97902
97936
|
path10.join(import.meta.dirname, "template.md"),
|
|
97903
97937
|
{
|
|
97904
97938
|
encoding: "utf-8"
|
|
97905
97939
|
}
|
|
97906
97940
|
);
|
|
97907
|
-
await
|
|
97941
|
+
await fs17.writeFile(
|
|
97908
97942
|
outputPath,
|
|
97909
97943
|
template.replace("<COMMANDS>", commandDocumentation)
|
|
97910
97944
|
);
|
|
@@ -97912,7 +97946,7 @@ var generateDocumentationFile = async (outputPath) => {
|
|
|
97912
97946
|
|
|
97913
97947
|
// src/domains/readme/generate.ts
|
|
97914
97948
|
function GenerateReadmeCommand() {
|
|
97915
|
-
const cmd2 = new
|
|
97949
|
+
const cmd2 = new Command36("generate");
|
|
97916
97950
|
cmd2.description("Self generate documentation for the cli");
|
|
97917
97951
|
cmd2.option(
|
|
97918
97952
|
"-o, --output [file]",
|
|
@@ -97937,20 +97971,20 @@ function GenerateReadmeCommand() {
|
|
|
97937
97971
|
const { executionTimeMs } = await measureTime(
|
|
97938
97972
|
() => generateDocumentationFile(outputPath)
|
|
97939
97973
|
);
|
|
97940
|
-
output.info().line().title(
|
|
97941
|
-
`\u23F1\uFE0F Generation completed in ${
|
|
97974
|
+
output.info().line().title(as30.green("Documentation Generated Successfully! \u{1F389}")).line().message(`\u2728 Documentation has been generated at: ${as30.blue(outputPath)}`).line(
|
|
97975
|
+
`\u23F1\uFE0F Generation completed in ${as30.yellow(executionTimeMs.toFixed(2))}ms`
|
|
97942
97976
|
).line("").exit("success");
|
|
97943
97977
|
});
|
|
97944
97978
|
return cmd2;
|
|
97945
97979
|
}
|
|
97946
97980
|
|
|
97947
97981
|
// src/domains/readme/serve.ts
|
|
97948
|
-
import
|
|
97982
|
+
import fs18 from "node:fs/promises";
|
|
97949
97983
|
import path11 from "node:path";
|
|
97950
|
-
import
|
|
97984
|
+
import as31 from "ansis";
|
|
97951
97985
|
var fileExists3 = async (filePath) => {
|
|
97952
97986
|
try {
|
|
97953
|
-
await
|
|
97987
|
+
await fs18.access(filePath);
|
|
97954
97988
|
return true;
|
|
97955
97989
|
} catch {
|
|
97956
97990
|
return false;
|
|
@@ -97969,24 +98003,24 @@ function ServeReadmeCommand(cmd2) {
|
|
|
97969
98003
|
openBrowser(docsUrl);
|
|
97970
98004
|
output.info().message(
|
|
97971
98005
|
"Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
|
|
97972
|
-
).line(
|
|
98006
|
+
).line(as31.blue(docsUrl)).line().exit("success");
|
|
97973
98007
|
});
|
|
97974
98008
|
return cmd2;
|
|
97975
98009
|
}
|
|
97976
98010
|
|
|
97977
98011
|
// src/domains/readme/index.ts
|
|
97978
|
-
var readmeDomain = new
|
|
98012
|
+
var readmeDomain = new Command37("readme");
|
|
97979
98013
|
readmeDomain.addCommand(GenerateReadmeCommand());
|
|
97980
98014
|
ServeReadmeCommand(readmeDomain);
|
|
97981
98015
|
var readme_default = readmeDomain;
|
|
97982
98016
|
|
|
97983
98017
|
// src/domains/registry/index.ts
|
|
97984
|
-
import { Command as
|
|
98018
|
+
import { Command as Command42 } from "commander";
|
|
97985
98019
|
|
|
97986
98020
|
// src/domains/registry/publish/index.ts
|
|
97987
98021
|
import { text as text9 } from "@clack/prompts";
|
|
97988
|
-
import
|
|
97989
|
-
import { Command as
|
|
98022
|
+
import as32 from "ansis";
|
|
98023
|
+
import { Command as Command38 } from "commander";
|
|
97990
98024
|
import { bundle as bundle4 } from "@scalar/json-magic/bundle";
|
|
97991
98025
|
import { fetchUrls as fetchUrls4, readFiles as readFiles4 } from "@scalar/json-magic/bundle/plugins/node";
|
|
97992
98026
|
import { parseJsonOrYaml as parseJsonOrYaml2 } from "@scalar/oas-utils/helpers";
|
|
@@ -97994,12 +98028,12 @@ import { validate as validate3 } from "@scalar/openapi-parser";
|
|
|
97994
98028
|
|
|
97995
98029
|
// src/domains/registry/publish/helpers/links.ts
|
|
97996
98030
|
function apiDashboardUrl(uid) {
|
|
97997
|
-
return `${config2.projects.dashboard}/registry/${uid}`;
|
|
98031
|
+
return `${config2.projects.dashboard}/registry/apis/${uid}`;
|
|
97998
98032
|
}
|
|
97999
98033
|
|
|
98000
98034
|
// src/domains/registry/publish/index.ts
|
|
98001
98035
|
var PublishCommand2 = () => {
|
|
98002
|
-
const cmd2 = new
|
|
98036
|
+
const cmd2 = new Command38("publish");
|
|
98003
98037
|
cmd2.description("Publish an OpenAPI document to the Scalar registry");
|
|
98004
98038
|
cmd2.argument("[file]", "OpenAPI file to upload");
|
|
98005
98039
|
cmd2.option(
|
|
@@ -98138,15 +98172,15 @@ var PublishCommand2 = () => {
|
|
|
98138
98172
|
const dashboardUrl = apiDashboardUrl(
|
|
98139
98173
|
matchingApi?.uid ?? publishRes.data.uid
|
|
98140
98174
|
);
|
|
98141
|
-
output.info().line(`${
|
|
98175
|
+
output.info().line(`${as32.green("\u279C")} ${as32.white.bold("View in dashboard:")}`).line(as32.cyan(dashboardUrl)).line().line(`${as32.green("\u279C")} ${as32.white.bold("Registry Preview:")}`).line(as32.cyan(registryUrl(api.url({ version: version3 })))).line().line(`${as32.green("\u279C")} ${as32.white.bold("Registry YAML:")}`).line(as32.cyan(registryUrl(api.url({ version: version3, format: "yaml" })))).line().line(`${as32.green("\u279C")} ${as32.white.bold("Registry JSON:")}`).line(as32.cyan(registryUrl(api.url({ version: version3, format: "json" })))).print();
|
|
98142
98176
|
});
|
|
98143
98177
|
return cmd2;
|
|
98144
98178
|
};
|
|
98145
98179
|
|
|
98146
98180
|
// src/domains/registry/delete/index.ts
|
|
98147
|
-
import { Command as
|
|
98181
|
+
import { Command as Command39 } from "commander";
|
|
98148
98182
|
var DeleteCommand = () => {
|
|
98149
|
-
const cmd2 = new
|
|
98183
|
+
const cmd2 = new Command39("delete");
|
|
98150
98184
|
cmd2.description("Delete a document from scalar registry");
|
|
98151
98185
|
cmd2.argument("[namespace]", "Team namespace");
|
|
98152
98186
|
cmd2.argument("[slug]", "Managed doc slug");
|
|
@@ -98163,10 +98197,10 @@ var DeleteCommand = () => {
|
|
|
98163
98197
|
};
|
|
98164
98198
|
|
|
98165
98199
|
// src/domains/registry/list/index.ts
|
|
98166
|
-
import
|
|
98167
|
-
import { Command as
|
|
98200
|
+
import as33 from "ansis";
|
|
98201
|
+
import { Command as Command40 } from "commander";
|
|
98168
98202
|
var ListCommand = () => {
|
|
98169
|
-
const cmd2 = new
|
|
98203
|
+
const cmd2 = new Command40("list");
|
|
98170
98204
|
cmd2.description("List all registry APIs for a team namespace");
|
|
98171
98205
|
cmd2.option("--namespace <namespace>", "Team namespace");
|
|
98172
98206
|
cmd2.action(async (args) => {
|
|
@@ -98202,17 +98236,17 @@ var ListCommand = () => {
|
|
|
98202
98236
|
output.info().table(
|
|
98203
98237
|
[
|
|
98204
98238
|
[
|
|
98205
|
-
|
|
98206
|
-
|
|
98207
|
-
|
|
98208
|
-
|
|
98239
|
+
as33.underline.bold("Slug"),
|
|
98240
|
+
as33.underline.bold("Title"),
|
|
98241
|
+
as33.underline.bold("Version"),
|
|
98242
|
+
as33.underline.bold("Privacy")
|
|
98209
98243
|
],
|
|
98210
98244
|
...listApisRes.data.map((api) => {
|
|
98211
98245
|
return [
|
|
98212
|
-
|
|
98213
|
-
|
|
98214
|
-
|
|
98215
|
-
api.isPrivate ?
|
|
98246
|
+
as33.blue(api.slug),
|
|
98247
|
+
as33.blue(api.title),
|
|
98248
|
+
as33.blue(api.version),
|
|
98249
|
+
api.isPrivate ? as33.green("Private") : as33.yellow("Public")
|
|
98216
98250
|
];
|
|
98217
98251
|
})
|
|
98218
98252
|
],
|
|
@@ -98224,10 +98258,10 @@ var ListCommand = () => {
|
|
|
98224
98258
|
|
|
98225
98259
|
// src/domains/registry/update/index.ts
|
|
98226
98260
|
import { text as text10 } from "@clack/prompts";
|
|
98227
|
-
import
|
|
98228
|
-
import { Command as
|
|
98261
|
+
import as34 from "ansis";
|
|
98262
|
+
import { Command as Command41 } from "commander";
|
|
98229
98263
|
var UpdateCommand = () => {
|
|
98230
|
-
const cmd2 = new
|
|
98264
|
+
const cmd2 = new Command41("update");
|
|
98231
98265
|
cmd2.description("Update document metadata on scalar registry");
|
|
98232
98266
|
cmd2.argument("[namespace]", "namespace of document you want to update");
|
|
98233
98267
|
cmd2.argument("[slug]", "slug of document you want to update");
|
|
@@ -98246,12 +98280,12 @@ var UpdateCommand = () => {
|
|
|
98246
98280
|
const shouldPrompt = ![title, description].some((it) => it !== void 0);
|
|
98247
98281
|
if (!titleValue && shouldPrompt) {
|
|
98248
98282
|
titleValue = await text10({
|
|
98249
|
-
message: `What is the new title of your document? ${
|
|
98283
|
+
message: `What is the new title of your document? ${as34.grey("(Optional)")}`
|
|
98250
98284
|
});
|
|
98251
98285
|
}
|
|
98252
98286
|
if (!descriptionValue && shouldPrompt) {
|
|
98253
98287
|
descriptionValue = await text10({
|
|
98254
|
-
message: `What is the new description of your document? ${
|
|
98288
|
+
message: `What is the new description of your document? ${as34.grey("(Optional)")}`
|
|
98255
98289
|
});
|
|
98256
98290
|
}
|
|
98257
98291
|
if (!titleValue && !descriptionValue) {
|
|
@@ -98280,17 +98314,17 @@ var registryCommands = [
|
|
|
98280
98314
|
DeleteCommand,
|
|
98281
98315
|
ListCommand
|
|
98282
98316
|
];
|
|
98283
|
-
var registryDomain = new
|
|
98317
|
+
var registryDomain = new Command42("registry");
|
|
98284
98318
|
registryDomain.description("Manage your scalar registry");
|
|
98285
98319
|
registryCommands.forEach((command) => registryDomain.addCommand(command()));
|
|
98286
98320
|
var registry_default = registryDomain;
|
|
98287
98321
|
|
|
98288
98322
|
// src/domains/team/index.ts
|
|
98289
|
-
import { Command as
|
|
98323
|
+
import { Command as Command45 } from "commander";
|
|
98290
98324
|
|
|
98291
98325
|
// src/domains/team/list/index.ts
|
|
98292
|
-
import
|
|
98293
|
-
import { Command as
|
|
98326
|
+
import as35 from "ansis";
|
|
98327
|
+
import { Command as Command43 } from "commander";
|
|
98294
98328
|
|
|
98295
98329
|
// src/domains/team/helpers.ts
|
|
98296
98330
|
var getUserTeams = async (client, email3) => {
|
|
@@ -98305,7 +98339,7 @@ var getUserTeams = async (client, email3) => {
|
|
|
98305
98339
|
|
|
98306
98340
|
// src/domains/team/list/index.ts
|
|
98307
98341
|
var ListCommand2 = () => {
|
|
98308
|
-
const cmd2 = new
|
|
98342
|
+
const cmd2 = new Command43("list");
|
|
98309
98343
|
cmd2.description("List all teams current user is part of");
|
|
98310
98344
|
cmd2.action(async () => {
|
|
98311
98345
|
const auth = await getAuthData();
|
|
@@ -98318,7 +98352,7 @@ var ListCommand2 = () => {
|
|
|
98318
98352
|
output.info().table(
|
|
98319
98353
|
teams.data.map((it) => {
|
|
98320
98354
|
const isCurrentTeam = it.teamUid === auth.teamUid;
|
|
98321
|
-
const color = isCurrentTeam ?
|
|
98355
|
+
const color = isCurrentTeam ? as35.green : as35.blue;
|
|
98322
98356
|
const teamName = isCurrentTeam ? `${it.teamName} (default)` : it.teamName;
|
|
98323
98357
|
return [isCurrentTeam ? color("\u279C") : " ", color(teamName)];
|
|
98324
98358
|
}),
|
|
@@ -98330,10 +98364,10 @@ var ListCommand2 = () => {
|
|
|
98330
98364
|
|
|
98331
98365
|
// src/domains/team/set/index.ts
|
|
98332
98366
|
import { select as select7 } from "@clack/prompts";
|
|
98333
|
-
import
|
|
98334
|
-
import { Command as
|
|
98367
|
+
import as36 from "ansis";
|
|
98368
|
+
import { Command as Command44 } from "commander";
|
|
98335
98369
|
var SetCommand = () => {
|
|
98336
|
-
const cmd2 = new
|
|
98370
|
+
const cmd2 = new Command44("set");
|
|
98337
98371
|
cmd2.description("Set current active team for the user");
|
|
98338
98372
|
cmd2.option("--team <team>", "Team uid");
|
|
98339
98373
|
cmd2.action(async ({ team }) => {
|
|
@@ -98365,7 +98399,7 @@ var SetCommand = () => {
|
|
|
98365
98399
|
}
|
|
98366
98400
|
await refreshToken(auth.refreshToken, teamValue);
|
|
98367
98401
|
output.info().message(
|
|
98368
|
-
`Operation ${
|
|
98402
|
+
`Operation ${as36.green("successful")}. Selected team: ${as36.cyan(selectedTeam.teamName)}`
|
|
98369
98403
|
).print();
|
|
98370
98404
|
});
|
|
98371
98405
|
return cmd2;
|
|
@@ -98373,18 +98407,18 @@ var SetCommand = () => {
|
|
|
98373
98407
|
|
|
98374
98408
|
// src/domains/team/index.ts
|
|
98375
98409
|
var teamCommands = [ListCommand2, SetCommand];
|
|
98376
|
-
var teamDomain = new
|
|
98410
|
+
var teamDomain = new Command45("team");
|
|
98377
98411
|
teamDomain.description("Manage user teams");
|
|
98378
98412
|
teamCommands.forEach((command) => teamDomain.addCommand(command()));
|
|
98379
98413
|
var team_default = teamDomain;
|
|
98380
98414
|
|
|
98381
98415
|
// src/domains/upgrade/index.ts
|
|
98382
98416
|
import { execSync } from "node:child_process";
|
|
98383
|
-
import
|
|
98384
|
-
import { Command as
|
|
98417
|
+
import as38 from "ansis";
|
|
98418
|
+
import { Command as Command46 } from "commander";
|
|
98385
98419
|
|
|
98386
98420
|
// src/helpers/upgrade.ts
|
|
98387
|
-
import
|
|
98421
|
+
import as37 from "ansis";
|
|
98388
98422
|
import semver3 from "semver";
|
|
98389
98423
|
var packageJsonSchema = external_exports.object({
|
|
98390
98424
|
version: external_exports.string()
|
|
@@ -98412,7 +98446,7 @@ async function getUpgradeInformation() {
|
|
|
98412
98446
|
}
|
|
98413
98447
|
async function checkUpgrade() {
|
|
98414
98448
|
const emitOutput = () => output.info().message(
|
|
98415
|
-
`New version available! Run ${
|
|
98449
|
+
`New version available! Run ${as37.cyan("`scalar upgrade`")} to install the latest version`
|
|
98416
98450
|
).print();
|
|
98417
98451
|
const now = performance.now();
|
|
98418
98452
|
const delay = 1 * 60 * 60 * 1e3;
|
|
@@ -98437,7 +98471,7 @@ async function checkUpgrade() {
|
|
|
98437
98471
|
}
|
|
98438
98472
|
|
|
98439
98473
|
// src/domains/upgrade/index.ts
|
|
98440
|
-
var cmd = new
|
|
98474
|
+
var cmd = new Command46("upgrade");
|
|
98441
98475
|
cmd.description("Upgrade current version of your cli");
|
|
98442
98476
|
cmd.action(async () => {
|
|
98443
98477
|
const upgradeStatus = await getUpgradeInformation();
|
|
@@ -98454,7 +98488,7 @@ cmd.action(async () => {
|
|
|
98454
98488
|
});
|
|
98455
98489
|
output.info().message("Successfully upgraded to the latest version").print();
|
|
98456
98490
|
} catch {
|
|
98457
|
-
output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(
|
|
98491
|
+
output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(as38.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
|
|
98458
98492
|
}
|
|
98459
98493
|
});
|
|
98460
98494
|
var upgrade_default = cmd;
|
|
@@ -98475,7 +98509,7 @@ var domains_default = domains;
|
|
|
98475
98509
|
|
|
98476
98510
|
// src/program.ts
|
|
98477
98511
|
var getProgram = () => {
|
|
98478
|
-
const program2 = new
|
|
98512
|
+
const program2 = new Command47();
|
|
98479
98513
|
program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version);
|
|
98480
98514
|
program2.showHelpAfterError();
|
|
98481
98515
|
domains_default.forEach((domain2) => program2.addCommand(domain2));
|