@scalar/cli 2.1.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -24
- package/chunks/{action-CYP4VDK3.js → action-37EV4UHW.js} +12 -35
- package/chunks/{action-MENXFJH3.js → action-4XI7XJR4.js} +9 -9
- package/chunks/{action-H5OHT2GV.js → action-5IU77OII.js} +7 -3
- package/chunks/{action-STIEAXOE.js → action-B3KKREWQ.js} +16 -5
- package/chunks/{action-BYZUBXVB.js → action-CH24QGTE.js} +8 -4
- package/chunks/action-F3UX5E3M.js +522 -0
- package/chunks/{action-GB6DM53B.js → action-FDB7NEOK.js} +21 -10
- package/chunks/action-FIXBOJEW.js +244 -0
- package/chunks/{action-DFKHSDFV.js → action-G26LSVZ7.js} +7 -3
- package/chunks/{action-Q5UJ32D6.js → action-H3RTILLM.js} +1 -1
- package/chunks/{action-GEBRPNRT.js → action-HGBBV353.js} +15 -16
- package/chunks/{action-5R5FDF6S.js → action-IUE4IOWO.js} +67 -22
- package/chunks/{action-TPBKPHNS.js → action-JZLZ7ZAD.js} +22 -22
- package/chunks/action-LA6KVAXQ.js +374 -0
- package/chunks/{action-PVDDRIM6.js → action-M7RQKBSB.js} +65 -26
- package/chunks/{action-F4Y6Q2VB.js → action-MSLBC2SO.js} +21 -21
- package/chunks/{action-BNEGJBUH.js → action-NVSZT2ZD.js} +8 -9
- package/chunks/{action-ANU5HGC4.js → action-OGQSTRMX.js} +17 -14
- package/chunks/{action-CLSD7O2R.js → action-PAGJ5PWC.js} +10 -10
- package/chunks/action-QE2ZQQX7.js +250 -0
- package/chunks/{action-HD2T6BFJ.js → action-QPUSPD5M.js} +10 -10
- package/chunks/{action-45OGQB2M.js → action-R7IMFHQ5.js} +17 -8
- package/chunks/{action-UDZUUJSI.js → action-SH4UUXPL.js} +18 -7
- package/chunks/action-SNLCIBQC.js +84 -0
- package/chunks/{action-C5VB4ITT.js → action-SQG3JAII.js} +36 -18
- package/chunks/action-UZQJNYK4.js +18 -0
- package/chunks/{action-HNKM3Q65.js → action-VC4DCVST.js} +17 -14
- package/chunks/{action-BMFXENMX.js → action-VTVFY2MP.js} +39 -34
- package/chunks/{action-TZ5KGAQT.js → action-WFWYGY7O.js} +17 -14
- package/chunks/{action-W5BATF4Q.js → action-XMNX5ZYT.js} +24 -24
- package/chunks/{agent-XGLOHXNA.js → agent-HCQRMHQ5.js} +25 -5
- package/chunks/asyncapi-QM76O55R.js +105 -0
- package/chunks/{build.action-LKOILPA6.js → build.action-P7FCIMYU.js} +22 -22
- package/chunks/{chunk-23I5PKZZ.js → chunk-24WAOKGG.js} +32 -5
- package/chunks/chunk-3L6DLIXJ.js +25530 -0
- package/chunks/chunk-3ZJYGGAA.js +30 -0
- package/chunks/{chunk-ZTVWAKNJ.js → chunk-4NHMAG6F.js} +1 -1
- package/chunks/{chunk-IX7LJ3AD.js → chunk-4ORL4MST.js} +2 -3
- package/chunks/{chunk-OAXFCOJV.js → chunk-4ZDQXWBT.js} +2 -1
- package/chunks/{chunk-ASMHW5AY.js → chunk-6ZMT63IV.js} +1 -1
- package/chunks/{chunk-P2VH7DOC.js → chunk-7AGLC7WV.js} +6 -6
- package/chunks/{chunk-SXYALPYK.js → chunk-AO3F5XWR.js} +498 -60
- package/chunks/{chunk-B6QZJWCQ.js → chunk-B2MHTD3R.js} +4 -6
- package/chunks/{chunk-4QS7SJTG.js → chunk-CISTON3A.js} +51 -36
- package/chunks/chunk-COBPBRQF.js +25 -0
- package/chunks/{chunk-2BSG2QHO.js → chunk-F467BYYR.js} +133 -20
- package/chunks/{chunk-TLFMATXR.js → chunk-GSGZHE26.js} +33 -25
- package/chunks/{chunk-UPUTMFD4.js → chunk-HCPN3KNF.js} +185 -13
- package/chunks/{chunk-P646T2WH.js → chunk-HPL3ZZ2P.js} +131 -13
- package/chunks/{chunk-H2WRMLYY.js → chunk-IKT5F47M.js} +3571 -7
- package/chunks/{chunk-AHWWJ3MD.js → chunk-K4DTP5TV.js} +1 -1
- package/chunks/{chunk-TQ5XC2E3.js → chunk-LFU5ZUAP.js} +77 -11
- package/chunks/{chunk-5BISXQX4.js → chunk-M37TP6U2.js} +11 -13
- package/chunks/chunk-OQKDBLOZ.js +741 -0
- package/chunks/chunk-P7H7GY5A.js +14 -0
- package/chunks/{chunk-47Y4L5IT.js → chunk-PBXZN65A.js} +1031 -481
- package/chunks/{chunk-HQKBZOYU.js → chunk-PT5TI77I.js} +3 -3
- package/chunks/chunk-Q7DOQHZN.js +404 -0
- package/chunks/{chunk-X4QLDBB5.js → chunk-T5HJUAWB.js} +24 -3
- package/chunks/{chunk-NUXPNUSS.js → chunk-UGGNHILG.js} +1 -1
- package/chunks/{chunk-4DGQIAJX.js → chunk-VNYE4R7N.js} +154 -14
- package/chunks/{chunk-KWOL7A6J.js → chunk-X5T526CE.js} +2 -2
- package/chunks/chunk-XCSR4RIT.js +210 -0
- package/chunks/{chunk-SHSHFGA7.js → chunk-Z2KMGFE6.js} +4 -6
- package/chunks/{create.action-FFQLBSJH.js → create.action-HDD2WUON.js} +22 -22
- package/chunks/{delete.action-STHQHP4F.js → delete.action-7GOZY7ID.js} +22 -22
- package/chunks/{delete.action-QNN3LC2F.js → delete.action-VE66JFDS.js} +22 -22
- package/chunks/{get.action-OTKYOP3Z.js → get.action-2745EB4N.js} +15 -16
- package/chunks/{list.action-KDM5RHEH.js → list.action-3VTXQJRA.js} +19 -19
- package/chunks/{list.action-6I5EZAVB.js → list.action-4QDCZLSZ.js} +22 -22
- package/chunks/{publish.action-PODTVRXS.js → publish.action-ULQLZKWU.js} +44 -36
- package/chunks/{update.action-KMD4ZM75.js → update.action-6QEFP7NA.js} +22 -22
- package/chunks/{update.action-4F6STTEQ.js → update.action-OROQSP2S.js} +22 -22
- package/docs.html +104 -103
- package/index.js +84 -68
- package/package.json +16 -12
- package/chunks/action-CCW66QJN.js +0 -72
- package/chunks/action-CQ56FVES.js +0 -65
- package/chunks/action-JOSVV6YA.js +0 -71
- package/chunks/action-P7LN6FGY.js +0 -13
- package/chunks/action-R6ZZO26F.js +0 -299
- package/chunks/action-TWFJNQ2R.js +0 -95
- package/chunks/chunk-5BPPGTUU.js +0 -463
- package/chunks/chunk-DOVIWNKQ.js +0 -108
- package/chunks/chunk-ISGLWBXZ.js +0 -4265
- package/chunks/chunk-T7MDADON.js +0 -17
- package/chunks/chunk-VTYTPSXO.js +0 -161
package/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-X5T526CE.js";
|
|
6
6
|
import {
|
|
7
7
|
openBrowser
|
|
8
8
|
} from "./chunks/chunk-JFIXNSPP.js";
|
|
@@ -11,29 +11,31 @@ import {
|
|
|
11
11
|
} from "./chunks/chunk-KHDYYVYF.js";
|
|
12
12
|
import {
|
|
13
13
|
BundleCommand
|
|
14
|
-
} from "./chunks/chunk-
|
|
14
|
+
} from "./chunks/chunk-K4DTP5TV.js";
|
|
15
15
|
import {
|
|
16
16
|
SdkLanguage
|
|
17
|
-
} from "./chunks/chunk-
|
|
18
|
-
import "./chunks/chunk-
|
|
17
|
+
} from "./chunks/chunk-3L6DLIXJ.js";
|
|
18
|
+
import "./chunks/chunk-P7H7GY5A.js";
|
|
19
19
|
import {
|
|
20
20
|
checkNodeVersion,
|
|
21
21
|
clearAuthData,
|
|
22
22
|
getAuthData,
|
|
23
23
|
getMetadata,
|
|
24
24
|
setMetadata
|
|
25
|
-
} from "./chunks/chunk-
|
|
26
|
-
import "./chunks/chunk-
|
|
27
|
-
import "./chunks/chunk-
|
|
28
|
-
import "./chunks/chunk-
|
|
29
|
-
import {
|
|
30
|
-
external_exports
|
|
31
|
-
} from "./chunks/chunk-H2WRMLYY.js";
|
|
25
|
+
} from "./chunks/chunk-M37TP6U2.js";
|
|
26
|
+
import "./chunks/chunk-4ZDQXWBT.js";
|
|
27
|
+
import "./chunks/chunk-VNYE4R7N.js";
|
|
28
|
+
import "./chunks/chunk-OQKDBLOZ.js";
|
|
32
29
|
import "./chunks/chunk-K74E42RV.js";
|
|
33
|
-
import "./chunks/chunk-
|
|
30
|
+
import "./chunks/chunk-Q7DOQHZN.js";
|
|
31
|
+
import "./chunks/chunk-4ORL4MST.js";
|
|
34
32
|
import {
|
|
35
33
|
output
|
|
36
|
-
} from "./chunks/chunk-
|
|
34
|
+
} from "./chunks/chunk-T5HJUAWB.js";
|
|
35
|
+
import "./chunks/chunk-GSGZHE26.js";
|
|
36
|
+
import {
|
|
37
|
+
external_exports
|
|
38
|
+
} from "./chunks/chunk-IKT5F47M.js";
|
|
37
39
|
import "./chunks/chunk-3MZYUBJ6.js";
|
|
38
40
|
|
|
39
41
|
// src/index.ts
|
|
@@ -44,7 +46,7 @@ import { Command as Command52 } from "commander";
|
|
|
44
46
|
|
|
45
47
|
// package.json
|
|
46
48
|
var name = "@scalar/cli";
|
|
47
|
-
var version = "2.1
|
|
49
|
+
var version = "2.5.1";
|
|
48
50
|
var bin = {
|
|
49
51
|
scalar: "./dist/index.js",
|
|
50
52
|
"scalar-cli": "./dist/index.js"
|
|
@@ -61,7 +63,7 @@ var DeleteSchemaCommand = () => {
|
|
|
61
63
|
cmd2.option("-s, --slug <slug>", "Schema slug");
|
|
62
64
|
cmd2.option("-n, --namespace <namespace>", "Team namespace");
|
|
63
65
|
cmd2.action(async (...args) => {
|
|
64
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
66
|
+
const { deleteAction } = await import("./chunks/delete.action-7GOZY7ID.js");
|
|
65
67
|
return deleteAction(...args);
|
|
66
68
|
});
|
|
67
69
|
return cmd2;
|
|
@@ -78,7 +80,7 @@ var GetSchemaCommand = () => {
|
|
|
78
80
|
cmd2.option("--format <format>", "Output format (json or yaml)", "json");
|
|
79
81
|
cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
80
82
|
cmd2.action(async (...args) => {
|
|
81
|
-
const { getAction } = await import("./chunks/get.action-
|
|
83
|
+
const { getAction } = await import("./chunks/get.action-2745EB4N.js");
|
|
82
84
|
return getAction(...args);
|
|
83
85
|
});
|
|
84
86
|
return cmd2;
|
|
@@ -91,7 +93,7 @@ var ListSchemaCommand = () => {
|
|
|
91
93
|
cmd2.description("List all schemas for a team namespace");
|
|
92
94
|
cmd2.option("--namespace <namespace>", "Team namespace");
|
|
93
95
|
cmd2.action(async (...args) => {
|
|
94
|
-
const { listAction } = await import("./chunks/list.action-
|
|
96
|
+
const { listAction } = await import("./chunks/list.action-4QDCZLSZ.js");
|
|
95
97
|
return listAction(...args);
|
|
96
98
|
});
|
|
97
99
|
return cmd2;
|
|
@@ -111,6 +113,7 @@ var PublishSchemaCommand = () => {
|
|
|
111
113
|
cmd2.option("--namespace <namespace>", "Scalar team namespace");
|
|
112
114
|
cmd2.option("--version <version>", "API version (e.g. 0.1.0)");
|
|
113
115
|
cmd2.option("--private", "Make API private", false);
|
|
116
|
+
cmd2.option("--force", "Force override an existing version", false);
|
|
114
117
|
cmd2.option("--bundle", "Bundle all external references before uploading");
|
|
115
118
|
cmd2.option(
|
|
116
119
|
"--treeShake",
|
|
@@ -125,7 +128,7 @@ var PublishSchemaCommand = () => {
|
|
|
125
128
|
"Maximum number of concurrent URLs to fetch when bundling the document"
|
|
126
129
|
);
|
|
127
130
|
cmd2.action(async (...args) => {
|
|
128
|
-
const { publishAction } = await import("./chunks/publish.action-
|
|
131
|
+
const { publishAction } = await import("./chunks/publish.action-ULQLZKWU.js");
|
|
129
132
|
return publishAction(...args);
|
|
130
133
|
});
|
|
131
134
|
return cmd2;
|
|
@@ -142,7 +145,7 @@ var UpdateSchemaCommand = () => {
|
|
|
142
145
|
cmd2.option("--description <description>", "Description");
|
|
143
146
|
cmd2.option("--isPrivate <isPrivate>", "Privacy (public/private)");
|
|
144
147
|
cmd2.action(async (...args) => {
|
|
145
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
148
|
+
const { updateAction } = await import("./chunks/update.action-6QEFP7NA.js");
|
|
146
149
|
return updateAction(...args);
|
|
147
150
|
});
|
|
148
151
|
return cmd2;
|
|
@@ -173,7 +176,7 @@ var BuildSdkCommand = () => {
|
|
|
173
176
|
cmd2.option("-n, --namespace <namespace>", "Team namespace");
|
|
174
177
|
cmd2.option("-v, --version <version>", "SDK Version");
|
|
175
178
|
cmd2.action(async (...args) => {
|
|
176
|
-
const { buildAction } = await import("./chunks/build.action-
|
|
179
|
+
const { buildAction } = await import("./chunks/build.action-P7FCIMYU.js");
|
|
177
180
|
return buildAction(...args);
|
|
178
181
|
});
|
|
179
182
|
return cmd2;
|
|
@@ -192,7 +195,7 @@ var CreateSdkCommand = () => {
|
|
|
192
195
|
)
|
|
193
196
|
);
|
|
194
197
|
cmd2.action(async (...args) => {
|
|
195
|
-
const { createAction } = await import("./chunks/create.action-
|
|
198
|
+
const { createAction } = await import("./chunks/create.action-HDD2WUON.js");
|
|
196
199
|
return createAction(...args);
|
|
197
200
|
});
|
|
198
201
|
return cmd2;
|
|
@@ -206,7 +209,7 @@ var DeleteSdkCommand = () => {
|
|
|
206
209
|
cmd2.option("-s, --slug <slug>", "SDK slug");
|
|
207
210
|
cmd2.option("-n, --namespace <namespace>", "Team namespace");
|
|
208
211
|
cmd2.action(async (...args) => {
|
|
209
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
212
|
+
const { deleteAction } = await import("./chunks/delete.action-VE66JFDS.js");
|
|
210
213
|
return deleteAction(...args);
|
|
211
214
|
});
|
|
212
215
|
return cmd2;
|
|
@@ -222,7 +225,7 @@ var UpdateSdkCommand = () => {
|
|
|
222
225
|
cmd2.option("--title <title>", "Title");
|
|
223
226
|
cmd2.option("--isPrivate <isPrivate>", "Privacy (public/private)");
|
|
224
227
|
cmd2.action(async (...args) => {
|
|
225
|
-
const { updateAction } = await import("./chunks/update.action-
|
|
228
|
+
const { updateAction } = await import("./chunks/update.action-OROQSP2S.js");
|
|
226
229
|
return updateAction(...args);
|
|
227
230
|
});
|
|
228
231
|
return cmd2;
|
|
@@ -235,7 +238,7 @@ var ListSdkCommand = () => {
|
|
|
235
238
|
cmd2.description("List all SDKs for a team namespace");
|
|
236
239
|
cmd2.option("--namespace <namespace>", "Team namespace");
|
|
237
240
|
cmd2.action(async (...args) => {
|
|
238
|
-
const { listAction } = await import("./chunks/list.action-
|
|
241
|
+
const { listAction } = await import("./chunks/list.action-3VTXQJRA.js");
|
|
239
242
|
return listAction(...args);
|
|
240
243
|
});
|
|
241
244
|
return cmd2;
|
|
@@ -266,7 +269,7 @@ var LoginCommand = () => {
|
|
|
266
269
|
cmd2.option("--password <password>", "Password");
|
|
267
270
|
cmd2.option("--token <token>", "Personal token");
|
|
268
271
|
cmd2.action(async (...args) => {
|
|
269
|
-
const { loginAction } = await import("./chunks/action-
|
|
272
|
+
const { loginAction } = await import("./chunks/action-4XI7XJR4.js");
|
|
270
273
|
return loginAction(...args);
|
|
271
274
|
});
|
|
272
275
|
return cmd2;
|
|
@@ -314,16 +317,16 @@ import { Command as Command17 } from "commander";
|
|
|
314
317
|
function JoinCommand() {
|
|
315
318
|
const cmd2 = new Command17("join");
|
|
316
319
|
cmd2.description(
|
|
317
|
-
"Merge multiple OpenAPI documents into a single unified document"
|
|
320
|
+
"Merge multiple OpenAPI or AsyncAPI documents into a single unified document"
|
|
318
321
|
);
|
|
319
|
-
cmd2.argument("<files...>", "Paths to the OpenAPI files to merge");
|
|
322
|
+
cmd2.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
|
|
320
323
|
cmd2.option("--output -o <file>", "Path to save the merged output file");
|
|
321
324
|
cmd2.option(
|
|
322
325
|
"--prefix-components-with-path-value -p <path>",
|
|
323
326
|
"Dot-separated path to extract a prefix value from each input file for component names"
|
|
324
327
|
);
|
|
325
328
|
cmd2.action(async (...args) => {
|
|
326
|
-
const { joinAction } = await import("./chunks/action-
|
|
329
|
+
const { joinAction } = await import("./chunks/action-QE2ZQQX7.js");
|
|
327
330
|
return joinAction(...args);
|
|
328
331
|
});
|
|
329
332
|
return cmd2;
|
|
@@ -333,11 +336,15 @@ function JoinCommand() {
|
|
|
333
336
|
import { Command as Command18 } from "commander";
|
|
334
337
|
function SplitCommand() {
|
|
335
338
|
const cmd2 = new Command18("split");
|
|
336
|
-
cmd2.description("Split
|
|
337
|
-
cmd2.argument("[file|url]", "Path to OpenAPI file or URL to split");
|
|
339
|
+
cmd2.description("Split OpenAPI or AsyncAPI documents into small chunks");
|
|
340
|
+
cmd2.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
|
|
338
341
|
cmd2.option("-o, --output <path>", "Path to save the chunks");
|
|
342
|
+
cmd2.addHelpText(
|
|
343
|
+
"after",
|
|
344
|
+
"\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
|
|
345
|
+
);
|
|
339
346
|
cmd2.action(async (...args) => {
|
|
340
|
-
const { splitAction } = await import("./chunks/action-
|
|
347
|
+
const { splitAction } = await import("./chunks/action-FIXBOJEW.js");
|
|
341
348
|
return splitAction(...args);
|
|
342
349
|
});
|
|
343
350
|
return cmd2;
|
|
@@ -347,11 +354,11 @@ function SplitCommand() {
|
|
|
347
354
|
import { Command as Command19 } from "commander";
|
|
348
355
|
function FormatCommand() {
|
|
349
356
|
const cmd2 = new Command19("format");
|
|
350
|
-
cmd2.description("Format an OpenAPI file");
|
|
357
|
+
cmd2.description("Format an OpenAPI or AsyncAPI file");
|
|
351
358
|
cmd2.argument("[file|url]", "File or URL to format");
|
|
352
359
|
cmd2.option("-o, --output <file>", "Output file");
|
|
353
360
|
cmd2.action(async (...args) => {
|
|
354
|
-
const { formatAction } = await import("./chunks/action-
|
|
361
|
+
const { formatAction } = await import("./chunks/action-SH4UUXPL.js");
|
|
355
362
|
return formatAction(...args);
|
|
356
363
|
});
|
|
357
364
|
return cmd2;
|
|
@@ -361,11 +368,11 @@ function FormatCommand() {
|
|
|
361
368
|
import { Command as Command20 } from "commander";
|
|
362
369
|
function LintCommand() {
|
|
363
370
|
const cmd2 = new Command20("lint");
|
|
364
|
-
cmd2.description("Lint your OpenAPI file using spectral rules");
|
|
365
|
-
cmd2.argument("[file|url]", "OpenAPI file path or url");
|
|
371
|
+
cmd2.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
|
|
372
|
+
cmd2.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
|
|
366
373
|
cmd2.option("-r, --rule <file|url>", "Rule path or url");
|
|
367
374
|
cmd2.action(async (...args) => {
|
|
368
|
-
const { lintAction } = await import("./chunks/action-
|
|
375
|
+
const { lintAction } = await import("./chunks/action-LA6KVAXQ.js");
|
|
369
376
|
return lintAction(...args);
|
|
370
377
|
});
|
|
371
378
|
return cmd2;
|
|
@@ -379,7 +386,7 @@ function MarkdownCommand() {
|
|
|
379
386
|
cmd2.argument("[file|url]", "OpenAPI file path or URL to convert");
|
|
380
387
|
cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
381
388
|
cmd2.action(async (...args) => {
|
|
382
|
-
const { markdownAction } = await import("./chunks/action-
|
|
389
|
+
const { markdownAction } = await import("./chunks/action-G26LSVZ7.js");
|
|
383
390
|
return markdownAction(...args);
|
|
384
391
|
});
|
|
385
392
|
return cmd2;
|
|
@@ -389,13 +396,13 @@ function MarkdownCommand() {
|
|
|
389
396
|
import { Command as Command22 } from "commander";
|
|
390
397
|
function MockCommand() {
|
|
391
398
|
const cmd2 = new Command22("mock");
|
|
392
|
-
cmd2.description("Mock an API
|
|
393
|
-
cmd2.argument("[file|url]", "OpenAPI file or URL to mock
|
|
399
|
+
cmd2.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
|
|
400
|
+
cmd2.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
|
|
394
401
|
cmd2.option("-w, --watch", "watch the file for changes");
|
|
395
402
|
cmd2.option("-o, --once", "run the server only once and exit after that");
|
|
396
403
|
cmd2.option("-p, --port <port>", "set the HTTP port for the mock server");
|
|
397
404
|
cmd2.action(async (...args) => {
|
|
398
|
-
const { mockAction } = await import("./chunks/action-
|
|
405
|
+
const { mockAction } = await import("./chunks/action-R7IMFHQ5.js");
|
|
399
406
|
return mockAction(...args);
|
|
400
407
|
});
|
|
401
408
|
return cmd2;
|
|
@@ -413,7 +420,7 @@ function ConvertCommand() {
|
|
|
413
420
|
"Merge operations with shared path+method combinations"
|
|
414
421
|
);
|
|
415
422
|
cmd2.action(async (...args) => {
|
|
416
|
-
const { convertAction } = await import("./chunks/action-
|
|
423
|
+
const { convertAction } = await import("./chunks/action-5IU77OII.js");
|
|
417
424
|
return convertAction(...args);
|
|
418
425
|
});
|
|
419
426
|
return cmd2;
|
|
@@ -423,8 +430,11 @@ function ConvertCommand() {
|
|
|
423
430
|
import { Command as Command24 } from "commander";
|
|
424
431
|
function ServeCommand() {
|
|
425
432
|
const cmd2 = new Command24("serve");
|
|
426
|
-
cmd2.description("Serve an API Reference from an OpenAPI file");
|
|
427
|
-
cmd2.argument(
|
|
433
|
+
cmd2.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
|
|
434
|
+
cmd2.argument(
|
|
435
|
+
"[file|url]",
|
|
436
|
+
"OpenAPI or AsyncAPI file or URL to show the reference for"
|
|
437
|
+
);
|
|
428
438
|
cmd2.option("-w, --watch", "watch the file for changes");
|
|
429
439
|
cmd2.option("-o, --once", "run the server only once and exit after that");
|
|
430
440
|
cmd2.option(
|
|
@@ -432,7 +442,7 @@ function ServeCommand() {
|
|
|
432
442
|
"set the HTTP port for the API reference server"
|
|
433
443
|
);
|
|
434
444
|
cmd2.action(async (...args) => {
|
|
435
|
-
const { serveAction } = await import("./chunks/action-
|
|
445
|
+
const { serveAction } = await import("./chunks/action-M7RQKBSB.js");
|
|
436
446
|
return serveAction(...args);
|
|
437
447
|
});
|
|
438
448
|
return cmd2;
|
|
@@ -442,14 +452,14 @@ function ServeCommand() {
|
|
|
442
452
|
import { Command as Command25 } from "commander";
|
|
443
453
|
function ShareCommand() {
|
|
444
454
|
const cmd2 = new Command25("share");
|
|
445
|
-
cmd2.description("Share an OpenAPI file");
|
|
455
|
+
cmd2.description("Share an OpenAPI or AsyncAPI file");
|
|
446
456
|
cmd2.argument("[file]", "file to share");
|
|
447
457
|
cmd2.option(
|
|
448
458
|
"-t, --token <token>",
|
|
449
459
|
"pass a token to update an existing sandbox"
|
|
450
460
|
);
|
|
451
461
|
cmd2.action(async (...args) => {
|
|
452
|
-
const { shareAction } = await import("./chunks/action-
|
|
462
|
+
const { shareAction } = await import("./chunks/action-SNLCIBQC.js");
|
|
453
463
|
return shareAction(...args);
|
|
454
464
|
});
|
|
455
465
|
return cmd2;
|
|
@@ -459,11 +469,11 @@ function ShareCommand() {
|
|
|
459
469
|
import { Command as Command26 } from "commander";
|
|
460
470
|
function UpgradeCommand() {
|
|
461
471
|
const cmd2 = new Command26("upgrade");
|
|
462
|
-
cmd2.description("Upgrade OpenAPI document to version 3.1");
|
|
463
|
-
cmd2.argument("[file|url]", "File or URL to
|
|
472
|
+
cmd2.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
|
|
473
|
+
cmd2.argument("[file|url]", "File or URL to upgrade");
|
|
464
474
|
cmd2.option("-o, --output <file>", "Path to save the upgraded output file");
|
|
465
475
|
cmd2.action(async (...args) => {
|
|
466
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
476
|
+
const { upgradeAction } = await import("./chunks/action-FDB7NEOK.js");
|
|
467
477
|
return upgradeAction(...args);
|
|
468
478
|
});
|
|
469
479
|
return cmd2;
|
|
@@ -473,10 +483,10 @@ function UpgradeCommand() {
|
|
|
473
483
|
import { Command as Command27 } from "commander";
|
|
474
484
|
function ValidateCommand() {
|
|
475
485
|
const cmd2 = new Command27("validate");
|
|
476
|
-
cmd2.description("Validate an OpenAPI file");
|
|
486
|
+
cmd2.description("Validate an OpenAPI or AsyncAPI file");
|
|
477
487
|
cmd2.argument("[file|url]", "File or URL to validate");
|
|
478
488
|
cmd2.action(async (...args) => {
|
|
479
|
-
const { validateAction } = await import("./chunks/action-
|
|
489
|
+
const { validateAction } = await import("./chunks/action-B3KKREWQ.js");
|
|
480
490
|
return validateAction(...args);
|
|
481
491
|
});
|
|
482
492
|
return cmd2;
|
|
@@ -490,7 +500,7 @@ function VoidCommand() {
|
|
|
490
500
|
cmd2.option("-o, --once", "run the server only once and exit after that");
|
|
491
501
|
cmd2.option("-p, --port <port>", "set the HTTP port for the mock server");
|
|
492
502
|
cmd2.action(async (...args) => {
|
|
493
|
-
const { voidAction } = await import("./chunks/action-
|
|
503
|
+
const { voidAction } = await import("./chunks/action-H3RTILLM.js");
|
|
494
504
|
return voidAction(...args);
|
|
495
505
|
});
|
|
496
506
|
return cmd2;
|
|
@@ -550,7 +560,7 @@ var PreviewCommand = () => {
|
|
|
550
560
|
);
|
|
551
561
|
cmd2.option("-N, --no-open", "Do not open the browser automatically", true);
|
|
552
562
|
cmd2.action(async (...args) => {
|
|
553
|
-
const { previewAction } = await import("./chunks/action-
|
|
563
|
+
const { previewAction } = await import("./chunks/action-SQG3JAII.js");
|
|
554
564
|
return previewAction(...args);
|
|
555
565
|
});
|
|
556
566
|
return cmd2;
|
|
@@ -563,7 +573,7 @@ function CheckConfigCommand() {
|
|
|
563
573
|
cmd2.description("Check a Scalar Configuration file");
|
|
564
574
|
cmd2.argument("[file]", "File to check");
|
|
565
575
|
cmd2.action(async (...args) => {
|
|
566
|
-
const { checkConfigAction } = await import("./chunks/action-
|
|
576
|
+
const { checkConfigAction } = await import("./chunks/action-NVSZT2ZD.js");
|
|
567
577
|
return checkConfigAction(...args);
|
|
568
578
|
});
|
|
569
579
|
return cmd2;
|
|
@@ -579,7 +589,7 @@ var CreateCommand = () => {
|
|
|
579
589
|
cmd2.option("-n, --name [name]", "name of your project");
|
|
580
590
|
cmd2.option("-s, --slug [slug]", "project slug");
|
|
581
591
|
cmd2.action(async (...args) => {
|
|
582
|
-
const { createAction } = await import("./chunks/action-
|
|
592
|
+
const { createAction } = await import("./chunks/action-VC4DCVST.js");
|
|
583
593
|
return createAction(...args);
|
|
584
594
|
});
|
|
585
595
|
return cmd2;
|
|
@@ -595,7 +605,7 @@ var ListCommand = () => {
|
|
|
595
605
|
cmd2.description("List the production deployment history for a project.");
|
|
596
606
|
cmd2.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
|
|
597
607
|
cmd2.action(async (...args) => {
|
|
598
|
-
const { listAction } = await import("./chunks/action-
|
|
608
|
+
const { listAction } = await import("./chunks/action-JZLZ7ZAD.js");
|
|
599
609
|
return listAction(...args);
|
|
600
610
|
});
|
|
601
611
|
return cmd2;
|
|
@@ -617,7 +627,7 @@ var InitCommand = () => {
|
|
|
617
627
|
cmd2.option("-s, --subdomain [url]", "subdomain to publish on");
|
|
618
628
|
cmd2.option("--force", "override existing configuration");
|
|
619
629
|
cmd2.action(async (...args) => {
|
|
620
|
-
const { initAction } = await import("./chunks/action-
|
|
630
|
+
const { initAction } = await import("./chunks/action-IUE4IOWO.js");
|
|
621
631
|
return initAction(...args);
|
|
622
632
|
});
|
|
623
633
|
return cmd2;
|
|
@@ -638,7 +648,7 @@ var PublishCommand = () => {
|
|
|
638
648
|
"Publish from your linked remote GitHub repository"
|
|
639
649
|
);
|
|
640
650
|
cmd2.action(async (...args) => {
|
|
641
|
-
const { publishAction } = await import("./chunks/action-
|
|
651
|
+
const { publishAction } = await import("./chunks/action-F3UX5E3M.js");
|
|
642
652
|
return publishAction(...args);
|
|
643
653
|
});
|
|
644
654
|
return cmd2;
|
|
@@ -658,7 +668,7 @@ var RollbackCommand = () => {
|
|
|
658
668
|
);
|
|
659
669
|
cmd2.option("-y, --yes", "Skip the confirmation prompt");
|
|
660
670
|
cmd2.action(async (...args) => {
|
|
661
|
-
const { rollbackAction } = await import("./chunks/action-
|
|
671
|
+
const { rollbackAction } = await import("./chunks/action-XMNX5ZYT.js");
|
|
662
672
|
return rollbackAction(...args);
|
|
663
673
|
});
|
|
664
674
|
return cmd2;
|
|
@@ -674,7 +684,7 @@ var UpgradeCommand2 = () => {
|
|
|
674
684
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
675
685
|
);
|
|
676
686
|
cmd2.action(async (...args) => {
|
|
677
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
687
|
+
const { upgradeAction } = await import("./chunks/action-37EV4UHW.js");
|
|
678
688
|
return upgradeAction(...args);
|
|
679
689
|
});
|
|
680
690
|
return cmd2;
|
|
@@ -850,7 +860,7 @@ var PublishCommand2 = () => {
|
|
|
850
860
|
"Maximum number of concurrent URLs to fetch when bundling the document"
|
|
851
861
|
);
|
|
852
862
|
cmd2.action(async (...args) => {
|
|
853
|
-
const { publishAction } = await import("./chunks/action-
|
|
863
|
+
const { publishAction } = await import("./chunks/action-VTVFY2MP.js");
|
|
854
864
|
return publishAction(...args);
|
|
855
865
|
});
|
|
856
866
|
return cmd2;
|
|
@@ -864,7 +874,7 @@ var DeleteCommand = () => {
|
|
|
864
874
|
cmd2.argument("[namespace]", "Team namespace");
|
|
865
875
|
cmd2.argument("[slug]", "Managed doc slug");
|
|
866
876
|
cmd2.action(async (...args) => {
|
|
867
|
-
const { deleteAction } = await import("./chunks/action-
|
|
877
|
+
const { deleteAction } = await import("./chunks/action-OGQSTRMX.js");
|
|
868
878
|
return deleteAction(...args);
|
|
869
879
|
});
|
|
870
880
|
return cmd2;
|
|
@@ -881,7 +891,7 @@ var GetCommand = () => {
|
|
|
881
891
|
cmd2.option("--format <format>", "Output format (json or yaml)", "json");
|
|
882
892
|
cmd2.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
883
893
|
cmd2.action(async (...args) => {
|
|
884
|
-
const { getAction } = await import("./chunks/action-
|
|
894
|
+
const { getAction } = await import("./chunks/action-HGBBV353.js");
|
|
885
895
|
return getAction(...args);
|
|
886
896
|
});
|
|
887
897
|
return cmd2;
|
|
@@ -894,7 +904,7 @@ var ListCommand2 = () => {
|
|
|
894
904
|
cmd2.description("List all registry APIs for a team namespace");
|
|
895
905
|
cmd2.option("--namespace <namespace>", "Team namespace");
|
|
896
906
|
cmd2.action(async (...args) => {
|
|
897
|
-
const { listAction } = await import("./chunks/action-
|
|
907
|
+
const { listAction } = await import("./chunks/action-MSLBC2SO.js");
|
|
898
908
|
return listAction(...args);
|
|
899
909
|
});
|
|
900
910
|
return cmd2;
|
|
@@ -910,7 +920,7 @@ var UpdateCommand = () => {
|
|
|
910
920
|
cmd2.option("--title <title>", "Document title");
|
|
911
921
|
cmd2.option("--description <description>", "Document description");
|
|
912
922
|
cmd2.action(async (...args) => {
|
|
913
|
-
const { updateAction } = await import("./chunks/action-
|
|
923
|
+
const { updateAction } = await import("./chunks/action-WFWYGY7O.js");
|
|
914
924
|
return updateAction(...args);
|
|
915
925
|
});
|
|
916
926
|
return cmd2;
|
|
@@ -938,7 +948,7 @@ var ListCommand3 = () => {
|
|
|
938
948
|
const cmd2 = new Command48("list");
|
|
939
949
|
cmd2.description("List all teams current user is part of");
|
|
940
950
|
cmd2.action(async (...args) => {
|
|
941
|
-
const { listAction } = await import("./chunks/action-
|
|
951
|
+
const { listAction } = await import("./chunks/action-QPUSPD5M.js");
|
|
942
952
|
return listAction(...args);
|
|
943
953
|
});
|
|
944
954
|
return cmd2;
|
|
@@ -951,7 +961,7 @@ var SetCommand = () => {
|
|
|
951
961
|
cmd2.description("Set current active team for the user");
|
|
952
962
|
cmd2.option("--team <team>", "Team uid");
|
|
953
963
|
cmd2.action(async (...args) => {
|
|
954
|
-
const { setAction } = await import("./chunks/action-
|
|
964
|
+
const { setAction } = await import("./chunks/action-PAGJ5PWC.js");
|
|
955
965
|
return setAction(...args);
|
|
956
966
|
});
|
|
957
967
|
return cmd2;
|
|
@@ -1037,6 +1047,12 @@ async function checkUpgrade() {
|
|
|
1037
1047
|
var cmd = new Command51("upgrade");
|
|
1038
1048
|
cmd.description("Upgrade current version of your cli");
|
|
1039
1049
|
cmd.action(async () => {
|
|
1050
|
+
if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
|
|
1051
|
+
output.info().message(
|
|
1052
|
+
"To upgrade this portable installation, download and extract the newer Scalar archive, then replace the installation directory."
|
|
1053
|
+
).print();
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1040
1056
|
const upgradeStatus = await getUpgradeInformation();
|
|
1041
1057
|
if (!upgradeStatus.upgrade) {
|
|
1042
1058
|
output.info().message("You are already up to date").print();
|
|
@@ -1090,7 +1106,7 @@ var program = getProgram();
|
|
|
1090
1106
|
if (process.argv.length === 2) {
|
|
1091
1107
|
program.help();
|
|
1092
1108
|
}
|
|
1093
|
-
if (process.argv[2] !== "upgrade") {
|
|
1109
|
+
if (process.argv[2] !== "upgrade" && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
|
|
1094
1110
|
checkUpgrade().catch(() => {
|
|
1095
1111
|
});
|
|
1096
1112
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.1
|
|
8
|
+
"version": "2.5.1",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"scalar",
|
|
11
11
|
"openapi",
|
|
@@ -22,17 +22,21 @@
|
|
|
22
22
|
"@clack/prompts": "0.7.0",
|
|
23
23
|
"@fastify/static": "9.1.3",
|
|
24
24
|
"@hono/node-server": "2.0.1",
|
|
25
|
-
"@
|
|
26
|
-
"@scalar/
|
|
27
|
-
"@scalar/
|
|
28
|
-
"@scalar/
|
|
29
|
-
"@scalar/
|
|
30
|
-
"@scalar/
|
|
31
|
-
"@scalar/openapi-
|
|
32
|
-
"@scalar/
|
|
33
|
-
"@scalar/
|
|
34
|
-
"@scalar/
|
|
35
|
-
"@scalar/
|
|
25
|
+
"@quobix/vacuum": "0.30.1",
|
|
26
|
+
"@scalar/asyncapi-upgrader": "0.1.9",
|
|
27
|
+
"@scalar/asyncapi-validator": "0.1.0",
|
|
28
|
+
"@scalar/json-magic": "0.13.4",
|
|
29
|
+
"@scalar/mock-server": "0.14.0",
|
|
30
|
+
"@scalar/oas-utils": "0.19.16",
|
|
31
|
+
"@scalar/openapi-parser": "0.29.1",
|
|
32
|
+
"@scalar/openapi-to-markdown": "0.5.44",
|
|
33
|
+
"@scalar/openapi-types": "0.9.5",
|
|
34
|
+
"@scalar/openapi-upgrader": "0.2.15",
|
|
35
|
+
"@scalar/openapi-validator": "0.1.0",
|
|
36
|
+
"@scalar/postman-to-openapi": "0.7.19",
|
|
37
|
+
"@scalar/themes": "0.17.4",
|
|
38
|
+
"@scalar/void-server": "2.5.9",
|
|
39
|
+
"@scalar/workspace-store": "0.60.0",
|
|
36
40
|
"@stoplight/spectral-core": "1.22.0",
|
|
37
41
|
"@stoplight/spectral-ruleset-bundler": "1.7.0",
|
|
38
42
|
"@stoplight/spectral-rulesets": "1.22.1",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
measureTime
|
|
4
|
-
} from "./chunk-KHDYYVYF.js";
|
|
5
|
-
import {
|
|
6
|
-
getFileOrUrl
|
|
7
|
-
} from "./chunk-23I5PKZZ.js";
|
|
8
|
-
import "./chunk-IX7LJ3AD.js";
|
|
9
|
-
import {
|
|
10
|
-
output
|
|
11
|
-
} from "./chunk-X4QLDBB5.js";
|
|
12
|
-
import "./chunk-3MZYUBJ6.js";
|
|
13
|
-
|
|
14
|
-
// src/domains/document/split/action.ts
|
|
15
|
-
import fs from "node:fs/promises";
|
|
16
|
-
import path from "node:path";
|
|
17
|
-
import { text } from "@clack/prompts";
|
|
18
|
-
import as from "ansis";
|
|
19
|
-
import { normalize } from "@scalar/openapi-parser";
|
|
20
|
-
import {
|
|
21
|
-
createServerWorkspaceStore,
|
|
22
|
-
WORKSPACE_FILE_NAME
|
|
23
|
-
} from "@scalar/workspace-store/server";
|
|
24
|
-
async function splitAction(input, { output: __outputPath }) {
|
|
25
|
-
if (!input) {
|
|
26
|
-
return output.error().title("Missing input").message("Please provide a file path or URL to split").exit("error");
|
|
27
|
-
}
|
|
28
|
-
const getOutputPath = async () => {
|
|
29
|
-
if (__outputPath !== void 0 && typeof __outputPath === "string") {
|
|
30
|
-
return __outputPath;
|
|
31
|
-
}
|
|
32
|
-
const outputPath2 = await text({
|
|
33
|
-
message: "Where should the chunks be written?",
|
|
34
|
-
defaultValue: "./assets",
|
|
35
|
-
placeholder: "./assets"
|
|
36
|
-
});
|
|
37
|
-
if (typeof outputPath2 !== "string") {
|
|
38
|
-
return output.error().message("Operation cancelled by user").exit("error");
|
|
39
|
-
}
|
|
40
|
-
return outputPath2;
|
|
41
|
-
};
|
|
42
|
-
const outputPath = await getOutputPath();
|
|
43
|
-
const fileContents = await getFileOrUrl(input);
|
|
44
|
-
const documentName = "default";
|
|
45
|
-
const store = await createServerWorkspaceStore({
|
|
46
|
-
mode: "static",
|
|
47
|
-
documents: [
|
|
48
|
-
{
|
|
49
|
-
name: documentName,
|
|
50
|
-
// Todo: remove the type casting
|
|
51
|
-
document: normalize(fileContents)
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
directory: outputPath
|
|
55
|
-
});
|
|
56
|
-
const { executionTimeMs } = await measureTime(async () => {
|
|
57
|
-
await store.generateWorkspaceChunks();
|
|
58
|
-
const workspaceFilePath = path.join(outputPath, WORKSPACE_FILE_NAME);
|
|
59
|
-
const sparseDocument = JSON.parse(
|
|
60
|
-
await fs.readFile(workspaceFilePath, { encoding: "utf-8" })
|
|
61
|
-
);
|
|
62
|
-
await fs.writeFile(
|
|
63
|
-
path.join(outputPath, "out.json"),
|
|
64
|
-
JSON.stringify(sparseDocument.documents[documentName])
|
|
65
|
-
);
|
|
66
|
-
await fs.rm(workspaceFilePath);
|
|
67
|
-
});
|
|
68
|
-
output.info().line().title(as.green("Document Split Successfully! \u{1F389}")).line().message(`\u2728 Chunks have been generated at: ${as.blue(outputPath)}`).line(`\u23F1\uFE0F Split completed in ${as.yellow(executionTimeMs.toFixed(2))}ms`).line("").print();
|
|
69
|
-
}
|
|
70
|
-
export {
|
|
71
|
-
splitAction
|
|
72
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
getFileOrUrl
|
|
4
|
-
} from "./chunk-23I5PKZZ.js";
|
|
5
|
-
import {
|
|
6
|
-
config
|
|
7
|
-
} from "./chunk-OAXFCOJV.js";
|
|
8
|
-
import "./chunk-IX7LJ3AD.js";
|
|
9
|
-
import {
|
|
10
|
-
output
|
|
11
|
-
} from "./chunk-X4QLDBB5.js";
|
|
12
|
-
import "./chunk-3MZYUBJ6.js";
|
|
13
|
-
|
|
14
|
-
// src/domains/document/share/action.ts
|
|
15
|
-
import as from "ansis";
|
|
16
|
-
async function shareAction(fileArgument, { token }) {
|
|
17
|
-
if (!fileArgument) {
|
|
18
|
-
return output.error().title("Invalid argument").message("Please provide a file path").exit("error");
|
|
19
|
-
}
|
|
20
|
-
const url = new URL(config.projects.sandbox);
|
|
21
|
-
url.pathname = "/api/share";
|
|
22
|
-
if (token) {
|
|
23
|
-
url.searchParams.append("token", token);
|
|
24
|
-
}
|
|
25
|
-
fetch(url.toString(), {
|
|
26
|
-
method: "POST",
|
|
27
|
-
headers: {
|
|
28
|
-
"Content-Type": "application/json"
|
|
29
|
-
},
|
|
30
|
-
body: JSON.stringify({
|
|
31
|
-
content: await getFileOrUrl(fileArgument)
|
|
32
|
-
})
|
|
33
|
-
}).then((response) => response.json()).then((data) => {
|
|
34
|
-
const { id, token: newToken } = data;
|
|
35
|
-
output.info().line(as.green.bold("Your OpenAPI file is public.")).line().table(
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
`${as.green("\u279C")} ${as.white.bold("API Reference:")}`,
|
|
39
|
-
as.cyan(`https://sandbox.scalar.com/p/${id}`)
|
|
40
|
-
],
|
|
41
|
-
[
|
|
42
|
-
`${as.grey("\u279C")} ${as.grey.bold("Editor:")}`,
|
|
43
|
-
as.cyan(`https://sandbox.scalar.com/e/${id}`)
|
|
44
|
-
],
|
|
45
|
-
[],
|
|
46
|
-
[
|
|
47
|
-
`${as.grey("\u279C")} ${as.grey.bold("OpenAPI JSON:")}`,
|
|
48
|
-
as.cyan(`https://sandbox.scalar.com/files/${id}/openapi.json`)
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
`${as.grey("\u279C")} ${as.grey.bold("OpenAPI YAML:")}`,
|
|
52
|
-
as.cyan(`https://sandbox.scalar.com/files/${id}/openapi.yaml`)
|
|
53
|
-
]
|
|
54
|
-
],
|
|
55
|
-
{ padding: 1 }
|
|
56
|
-
).line().line("Use the token to update the existing sandbox:").line().line(
|
|
57
|
-
`${as.grey("$")} ${as.white.bold("scalar document share --token=")}${as.cyan.bold(`${newToken}`)} `
|
|
58
|
-
).line().print();
|
|
59
|
-
}).catch((error) => {
|
|
60
|
-
output.error().title("Failed to share the file.").message(`Details: ${error}`).exit("error");
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
export {
|
|
64
|
-
shareAction
|
|
65
|
-
};
|