@scalar/cli 2.5.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +319 -55
- package/chunks/{action-XUQ7TKKJ.js → action-354TUG4H.js} +11 -7
- package/chunks/{action-PHLOE27S.js → action-43YBNBDR.js} +33 -26
- package/chunks/{action-DGD6Q6Y5.js → action-5SK5NE7E.js} +10 -4
- package/chunks/{action-Y6CEKYEK.js → action-6BYGBXRC.js} +40 -23
- package/chunks/{action-LUVBQEIQ.js → action-7PEQXDWT.js} +4 -4
- package/chunks/action-AQRPFQKI.js +231 -0
- package/chunks/{action-RBVPKCRI.js → action-CA4QYPI6.js} +6 -6
- package/chunks/{action-7H3XARJP.js → action-EOAVVL52.js} +11 -5
- package/chunks/action-F2ZJNURT.js +72 -0
- package/chunks/{action-AMNYOA4B.js → action-F7A2K74G.js} +4 -4
- package/chunks/{action-HIL5ZFNB.js → action-FCAYFPVR.js} +5 -5
- package/chunks/{action-42D2C47G.js → action-GWXLHL2Z.js} +3 -3
- package/chunks/{action-ZWQLQENM.js → action-H6OUJWWM.js} +4 -4
- package/chunks/{action-TWHLZW4V.js → action-HT2DJ34Z.js} +49 -26
- package/chunks/{action-PAA4NWUJ.js → action-JAHFRYWZ.js} +58 -9
- package/chunks/{action-HXHBU7XC.js → action-KTYOCA2V.js} +37 -12
- package/chunks/{action-LFL3ZZKN.js → action-LEUD5P2U.js} +17 -17
- package/chunks/{action-FF2OMGAS.js → action-LLH4QPXM.js} +34 -20
- package/chunks/{action-OILGZAMK.js → action-LXGXKXZZ.js} +20 -15
- package/chunks/{action-W62AIEBN.js → action-NVI5DWFP.js} +6 -6
- package/chunks/{action-EPNE5XCM.js → action-QQZLPI42.js} +17 -17
- package/chunks/{action-ZLTUMRO2.js → action-UIKH4SZX.js} +25 -21
- package/chunks/{action-6FAJNP6C.js → action-VOFDW3U2.js} +4 -4
- package/chunks/{action-OK55BFGM.js → action-W3C53GPH.js} +7 -7
- package/chunks/{action-P7RFXIC7.js → action-WFDNRA7D.js} +32 -23
- package/chunks/{action-V5KYG7XD.js → action-XIUO64C7.js} +10 -10
- package/chunks/{action-X7TZA3RE.js → action-Y6NXJQ4H.js} +89 -14
- package/chunks/{action-6MZZHPVQ.js → action-Y7OUGD56.js} +27 -14
- package/chunks/{action-DCINFQ57.js → action-YLF2G4G5.js} +13 -13
- package/chunks/{action-SJYAMXYI.js → action-YRX6SN5F.js} +10 -4
- package/chunks/actions-OGIVBQC7.js +158 -0
- package/chunks/{agent-JAXLLDPE.js → agent-ASPV3R5U.js} +4 -4
- package/chunks/{asyncapi-P6Y3L7RG.js → asyncapi-QNFKXHEI.js} +10 -11
- package/chunks/{build.action-AZ5ECU4B.js → build.action-NM6CAE5F.js} +37 -33
- package/chunks/{chunk-FOKFF4EP.js → chunk-22HYZ7LE.js} +3 -3
- package/chunks/{chunk-KEOCJ3NJ.js → chunk-2OCWX42S.js} +38 -87
- package/chunks/{chunk-RPVHJMQT.js → chunk-5DEU2DVL.js} +2 -2
- package/chunks/{chunk-OQKDBLOZ.js → chunk-5JLVQVKO.js} +8 -0
- package/chunks/{chunk-VNYE4R7N.js → chunk-5UHLAJQD.js} +2 -1
- package/chunks/{chunk-CX7ZRMTC.js → chunk-6XWCMJDB.js} +1 -1
- package/chunks/{chunk-6ZMT63IV.js → chunk-6YPQGVF4.js} +1 -1
- package/chunks/{chunk-HXIDUCSZ.js → chunk-BPGFSSUH.js} +1 -1
- package/chunks/{chunk-M622VXRQ.js → chunk-C2KAWRIX.js} +1 -1
- package/chunks/chunk-EGOXR5FB.js +15 -0
- package/chunks/{chunk-UB3XGOUW.js → chunk-EXY3ZTV4.js} +262 -9
- package/chunks/{chunk-3BWGTPPT.js → chunk-FDC2IESH.js} +1776 -1113
- package/chunks/{chunk-TYLWJ2UL.js → chunk-GTV2BVXV.js} +2 -2
- package/chunks/{chunk-SWWWYWHC.js → chunk-HGOD6THU.js} +27 -18
- package/chunks/{chunk-3DJ2GKEG.js → chunk-IMG35UXX.js} +1 -1
- package/chunks/{chunk-MNLXYOVF.js → chunk-KCCFN4F7.js} +2 -2
- package/chunks/{chunk-FQVVKQPU.js → chunk-KKRGBXCE.js} +137 -1
- package/chunks/{chunk-UMPODUJO.js → chunk-L3UXDCBI.js} +105 -15
- package/chunks/{chunk-B2MHTD3R.js → chunk-MLSZVVTT.js} +1 -1
- package/chunks/{chunk-LCPFHE4Z.js → chunk-OJ2EWIJH.js} +21 -2
- package/chunks/{chunk-RAO7VUGM.js → chunk-PH3WFNXJ.js} +1 -1
- package/chunks/{chunk-NIXG4KDE.js → chunk-QVQ4PNVL.js} +170 -5
- package/chunks/{chunk-CIFOFSZ3.js → chunk-R5LK6VPY.js} +72 -7
- package/chunks/{chunk-T7B6WNZC.js → chunk-TSURUX4A.js} +12 -3
- package/chunks/{chunk-JV7TUEXQ.js → chunk-UXJ753NV.js} +14 -1
- package/chunks/{chunk-HUCR333E.js → chunk-W24BETFG.js} +2 -2
- package/chunks/{chunk-LQN4S62O.js → chunk-XEDGMZJD.js} +18 -4
- package/chunks/{chunk-NNMSZVAB.js → chunk-XXSQUBXS.js} +82 -6
- package/chunks/{chunk-M6Q3ARBV.js → chunk-YILQODZF.js} +2 -2
- package/chunks/{create.action-34OTO2SB.js → create.action-FUQ2BVJA.js} +29 -17
- package/chunks/{delete.action-ZYXFMIOW.js → delete.action-47E66R3I.js} +26 -17
- package/chunks/{delete.action-6LRT4M3S.js → delete.action-BTDFH7WY.js} +26 -17
- package/chunks/{get.action-XP36SA2J.js → get.action-XC7KC2JO.js} +10 -10
- package/chunks/{list.action-6LF6KSD5.js → list.action-LXKEUYKO.js} +13 -13
- package/chunks/{list.action-WVRVLX5E.js → list.action-OFGLMRE7.js} +17 -17
- package/chunks/{publish.action-AHFUBT5C.js → publish.action-OS27XOX4.js} +50 -24
- package/chunks/{update.action-YQTVUDYE.js → update.action-AEIBLCWD.js} +27 -18
- package/chunks/{update.action-ZREAFJVG.js → update.action-ZMS4CQ3T.js} +27 -18
- package/docs.html +679 -175
- package/index.js +492 -406
- package/package.json +14 -22
- package/skills/scalar-cli/SKILL.md +77 -0
- package/template.md +101 -3
- package/chunks/action-YRWHX2AE.js +0 -64
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-BPGFSSUH.js";
|
|
6
6
|
import {
|
|
7
7
|
openBrowser
|
|
8
8
|
} from "./chunks/chunk-JFIXNSPP.js";
|
|
@@ -10,29 +10,38 @@ import {
|
|
|
10
10
|
measureTime
|
|
11
11
|
} from "./chunks/chunk-KHDYYVYF.js";
|
|
12
12
|
import {
|
|
13
|
-
BundleCommand
|
|
14
|
-
|
|
13
|
+
BundleCommand,
|
|
14
|
+
parseFetchLimit,
|
|
15
|
+
parsePort
|
|
16
|
+
} from "./chunks/chunk-OJ2EWIJH.js";
|
|
15
17
|
import {
|
|
16
18
|
SdkLanguage
|
|
17
|
-
} from "./chunks/chunk-
|
|
18
|
-
import "./chunks/chunk-
|
|
19
|
+
} from "./chunks/chunk-FDC2IESH.js";
|
|
20
|
+
import "./chunks/chunk-C2KAWRIX.js";
|
|
19
21
|
import {
|
|
20
22
|
checkNodeVersion,
|
|
21
23
|
clearAuthData,
|
|
22
24
|
getAuthData,
|
|
23
25
|
getMetadata,
|
|
24
26
|
setMetadata
|
|
25
|
-
} from "./chunks/chunk-
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
} from "./chunks/chunk-QVQ4PNVL.js";
|
|
28
|
+
import {
|
|
29
|
+
bin,
|
|
30
|
+
name,
|
|
31
|
+
version
|
|
32
|
+
} from "./chunks/chunk-UXJ753NV.js";
|
|
33
|
+
import "./chunks/chunk-5UHLAJQD.js";
|
|
34
|
+
import "./chunks/chunk-5JLVQVKO.js";
|
|
35
|
+
import {
|
|
36
|
+
requireInteractive
|
|
37
|
+
} from "./chunks/chunk-EGOXR5FB.js";
|
|
29
38
|
import "./chunks/chunk-K74E42RV.js";
|
|
30
|
-
import "./chunks/chunk-
|
|
39
|
+
import "./chunks/chunk-6XWCMJDB.js";
|
|
31
40
|
import "./chunks/chunk-4ORL4MST.js";
|
|
32
41
|
import {
|
|
33
42
|
output
|
|
34
43
|
} from "./chunks/chunk-T5HJUAWB.js";
|
|
35
|
-
import "./chunks/chunk-
|
|
44
|
+
import "./chunks/chunk-XEDGMZJD.js";
|
|
36
45
|
import {
|
|
37
46
|
external_exports
|
|
38
47
|
} from "./chunks/chunk-IKT5F47M.js";
|
|
@@ -42,15 +51,7 @@ import "./chunks/chunk-3MZYUBJ6.js";
|
|
|
42
51
|
import { Agent, setGlobalDispatcher } from "undici";
|
|
43
52
|
|
|
44
53
|
// src/program.ts
|
|
45
|
-
import { Command as
|
|
46
|
-
|
|
47
|
-
// package.json
|
|
48
|
-
var name = "@scalar/cli";
|
|
49
|
-
var version = "2.5.2";
|
|
50
|
-
var bin = {
|
|
51
|
-
scalar: "./dist/index.js",
|
|
52
|
-
"scalar-cli": "./dist/index.js"
|
|
53
|
-
};
|
|
54
|
+
import { Command as Command54 } from "commander";
|
|
54
55
|
|
|
55
56
|
// src/domains/schema/index.ts
|
|
56
57
|
import { Command as Command6 } from "commander";
|
|
@@ -58,97 +59,101 @@ import { Command as Command6 } from "commander";
|
|
|
58
59
|
// src/domains/schema/delete.ts
|
|
59
60
|
import { Command } from "commander";
|
|
60
61
|
var DeleteSchemaCommand = () => {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
62
|
+
const cmd3 = new Command("delete");
|
|
63
|
+
cmd3.description("Delete a schema.");
|
|
64
|
+
cmd3.option("-s, --slug <slug>", "Schema slug");
|
|
65
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
66
|
+
cmd3.action(async (...args) => {
|
|
67
|
+
const { deleteAction } = await import("./chunks/delete.action-47E66R3I.js");
|
|
67
68
|
return deleteAction(...args);
|
|
68
69
|
});
|
|
69
|
-
return
|
|
70
|
+
return cmd3;
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
// src/domains/schema/get.ts
|
|
73
74
|
import { Command as Command2 } from "commander";
|
|
74
75
|
var GetSchemaCommand = () => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const { getAction } = await import("./chunks/get.action-
|
|
76
|
+
const cmd3 = new Command2("get");
|
|
77
|
+
cmd3.description("Get a schema document version from the Scalar registry");
|
|
78
|
+
cmd3.argument("[namespace]", "Team namespace");
|
|
79
|
+
cmd3.argument("[slug]", "Schema slug");
|
|
80
|
+
cmd3.option("--version <version>", "Schema version (defaults to latest)");
|
|
81
|
+
cmd3.option("--format <format>", "Output format (json or yaml)", "json");
|
|
82
|
+
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
83
|
+
cmd3.action(async (...args) => {
|
|
84
|
+
const { getAction } = await import("./chunks/get.action-XC7KC2JO.js");
|
|
84
85
|
return getAction(...args);
|
|
85
86
|
});
|
|
86
|
-
return
|
|
87
|
+
return cmd3;
|
|
87
88
|
};
|
|
88
89
|
|
|
89
90
|
// src/domains/schema/list.ts
|
|
90
91
|
import { Command as Command3 } from "commander";
|
|
91
92
|
var ListSchemaCommand = () => {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const { listAction } = await import("./chunks/list.action-
|
|
93
|
+
const cmd3 = new Command3("list");
|
|
94
|
+
cmd3.description("List all schemas for a team namespace");
|
|
95
|
+
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
96
|
+
cmd3.action(async (...args) => {
|
|
97
|
+
const { listAction } = await import("./chunks/list.action-OFGLMRE7.js");
|
|
97
98
|
return listAction(...args);
|
|
98
99
|
});
|
|
99
|
-
return
|
|
100
|
+
return cmd3;
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
// src/domains/schema/publish.ts
|
|
103
104
|
import { Command as Command4 } from "commander";
|
|
104
105
|
var PublishSchemaCommand = () => {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
const cmd3 = new Command4("publish");
|
|
107
|
+
cmd3.description("Publish a shared schema to the Scalar registry");
|
|
108
|
+
cmd3.argument("[file]", "OpenAPI file to upload");
|
|
109
|
+
cmd3.option(
|
|
109
110
|
"--slug <slug>",
|
|
110
111
|
"Slug identifier for the registry entry. Defaults to title."
|
|
111
112
|
);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
cmd3.option("--title <title>", "Schema title");
|
|
114
|
+
cmd3.option("--namespace <namespace>", "Scalar team namespace");
|
|
115
|
+
cmd3.option("--version <version>", "API version (e.g. 0.1.0)");
|
|
116
|
+
cmd3.option("--private", "Make API private", false);
|
|
117
|
+
cmd3.option("--force", "Force override an existing version", false);
|
|
118
|
+
cmd3.option("--bundle", "Bundle all external references before uploading");
|
|
119
|
+
cmd3.option(
|
|
119
120
|
"--treeShake",
|
|
120
121
|
"Remove unused components from the bundled document"
|
|
121
122
|
);
|
|
122
|
-
|
|
123
|
+
cmd3.option(
|
|
123
124
|
"--urlMap",
|
|
124
125
|
"Generate a map of resolved URLs when bundling the document"
|
|
125
126
|
);
|
|
126
|
-
|
|
127
|
+
cmd3.option(
|
|
127
128
|
"--fetchLimit <limit>",
|
|
128
|
-
"Maximum number of concurrent URLs to fetch when bundling the document"
|
|
129
|
+
"Maximum number of concurrent URLs to fetch when bundling the document",
|
|
130
|
+
parseFetchLimit
|
|
129
131
|
);
|
|
130
|
-
|
|
131
|
-
const { publishAction } = await import("./chunks/publish.action-
|
|
132
|
+
cmd3.action(async (...args) => {
|
|
133
|
+
const { publishAction } = await import("./chunks/publish.action-OS27XOX4.js");
|
|
132
134
|
return publishAction(...args);
|
|
133
135
|
});
|
|
134
|
-
return
|
|
136
|
+
return cmd3;
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
// src/domains/schema/update.ts
|
|
138
140
|
import { Command as Command5 } from "commander";
|
|
139
141
|
var UpdateSchemaCommand = () => {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
const cmd3 = new Command5("update");
|
|
143
|
+
cmd3.description("Update schema metadata.");
|
|
144
|
+
cmd3.option("-s, --slug <slug>", "Schema slug");
|
|
145
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
146
|
+
cmd3.option("--title <title>", "Title");
|
|
147
|
+
cmd3.option("--description <description>", "Description");
|
|
148
|
+
cmd3.option(
|
|
149
|
+
"--isPrivate <isPrivate>",
|
|
150
|
+
"Privacy (true/false or public/private)"
|
|
151
|
+
);
|
|
152
|
+
cmd3.action(async (...args) => {
|
|
153
|
+
const { updateAction } = await import("./chunks/update.action-AEIBLCWD.js");
|
|
149
154
|
return updateAction(...args);
|
|
150
155
|
});
|
|
151
|
-
return
|
|
156
|
+
return cmd3;
|
|
152
157
|
};
|
|
153
158
|
|
|
154
159
|
// src/domains/schema/index.ts
|
|
@@ -170,78 +175,85 @@ import { Command as Command12 } from "commander";
|
|
|
170
175
|
// src/domains/sdk/build.ts
|
|
171
176
|
import { Command as Command7 } from "commander";
|
|
172
177
|
var BuildSdkCommand = () => {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const { buildAction } = await import("./chunks/build.action-AZ5ECU4B.js");
|
|
178
|
+
const cmd3 = new Command7("build");
|
|
179
|
+
cmd3.description("Build an SDK.");
|
|
180
|
+
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
181
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
182
|
+
cmd3.action(async (...args) => {
|
|
183
|
+
const { buildAction } = await import("./chunks/build.action-NM6CAE5F.js");
|
|
180
184
|
return buildAction(...args);
|
|
181
185
|
});
|
|
182
|
-
return
|
|
186
|
+
return cmd3;
|
|
183
187
|
};
|
|
184
188
|
|
|
185
189
|
// src/domains/sdk/create.ts
|
|
186
190
|
import { Command as Command8, Option } from "commander";
|
|
187
191
|
var CreateSdkCommand = () => {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
const cmd3 = new Command8("create");
|
|
193
|
+
cmd3.description(
|
|
194
|
+
"Create a new SDK. The SDK is created in the namespace of the API it is built from."
|
|
195
|
+
);
|
|
196
|
+
cmd3.option("-a, --api <api>", "Registry API slug");
|
|
197
|
+
cmd3.option(
|
|
198
|
+
"-n, --namespace <namespace>",
|
|
199
|
+
"Team namespace to look the API up in"
|
|
200
|
+
);
|
|
201
|
+
cmd3.addOption(
|
|
193
202
|
new Option("-l, --language <language>", "Language of your SDK").choices(
|
|
194
203
|
Object.values(SdkLanguage)
|
|
195
204
|
)
|
|
196
205
|
);
|
|
197
|
-
|
|
198
|
-
const { createAction } = await import("./chunks/create.action-
|
|
206
|
+
cmd3.action(async (...args) => {
|
|
207
|
+
const { createAction } = await import("./chunks/create.action-FUQ2BVJA.js");
|
|
199
208
|
return createAction(...args);
|
|
200
209
|
});
|
|
201
|
-
return
|
|
210
|
+
return cmd3;
|
|
202
211
|
};
|
|
203
212
|
|
|
204
213
|
// src/domains/sdk/delete.ts
|
|
205
214
|
import { Command as Command9 } from "commander";
|
|
206
215
|
var DeleteSdkCommand = () => {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const { deleteAction } = await import("./chunks/delete.action-
|
|
216
|
+
const cmd3 = new Command9("delete");
|
|
217
|
+
cmd3.description("Delete an SDK.");
|
|
218
|
+
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
219
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
220
|
+
cmd3.action(async (...args) => {
|
|
221
|
+
const { deleteAction } = await import("./chunks/delete.action-BTDFH7WY.js");
|
|
213
222
|
return deleteAction(...args);
|
|
214
223
|
});
|
|
215
|
-
return
|
|
224
|
+
return cmd3;
|
|
216
225
|
};
|
|
217
226
|
|
|
218
227
|
// src/domains/sdk/update.ts
|
|
219
228
|
import { Command as Command10 } from "commander";
|
|
220
229
|
var UpdateSdkCommand = () => {
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
const cmd3 = new Command10("update");
|
|
231
|
+
cmd3.description("Update SDK metadata.");
|
|
232
|
+
cmd3.option("-s, --slug <slug>", "SDK slug");
|
|
233
|
+
cmd3.option("-n, --namespace <namespace>", "Team namespace");
|
|
234
|
+
cmd3.option("--title <title>", "Title");
|
|
235
|
+
cmd3.option(
|
|
236
|
+
"--isPrivate <isPrivate>",
|
|
237
|
+
"Privacy (true/false or public/private)"
|
|
238
|
+
);
|
|
239
|
+
cmd3.action(async (...args) => {
|
|
240
|
+
const { updateAction } = await import("./chunks/update.action-ZMS4CQ3T.js");
|
|
229
241
|
return updateAction(...args);
|
|
230
242
|
});
|
|
231
|
-
return
|
|
243
|
+
return cmd3;
|
|
232
244
|
};
|
|
233
245
|
|
|
234
246
|
// src/domains/sdk/list.ts
|
|
235
247
|
import { Command as Command11 } from "commander";
|
|
236
248
|
var ListSdkCommand = () => {
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const { listAction } = await import("./chunks/list.action-
|
|
249
|
+
const cmd3 = new Command11("list");
|
|
250
|
+
cmd3.description("List all SDKs for a team namespace");
|
|
251
|
+
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
252
|
+
cmd3.action(async (...args) => {
|
|
253
|
+
const { listAction } = await import("./chunks/list.action-LXKEUYKO.js");
|
|
242
254
|
return listAction(...args);
|
|
243
255
|
});
|
|
244
|
-
return
|
|
256
|
+
return cmd3;
|
|
245
257
|
};
|
|
246
258
|
|
|
247
259
|
// src/domains/sdk/index.ts
|
|
@@ -257,253 +269,328 @@ sdkDomain.description("Manage your Scalar SDKs (Enterprise Only)");
|
|
|
257
269
|
sdkCommands.forEach((command) => sdkDomain.addCommand(command()));
|
|
258
270
|
var sdk_default = sdkDomain;
|
|
259
271
|
|
|
272
|
+
// src/domains/access-group/index.ts
|
|
273
|
+
import { Command as Command13 } from "commander";
|
|
274
|
+
function createAccessGroupCommand() {
|
|
275
|
+
const command = new Command13("access-group").description(
|
|
276
|
+
"Manage access groups and allowed email domains for the current team"
|
|
277
|
+
);
|
|
278
|
+
command.command("create").description("Create an access group (Pro or above)").argument("<slug>", "New access group slug").option("--name <name>", "Display name").option("--domain <domains...>", "Allowed email domains").option("--json", "Print the result as JSON").action(
|
|
279
|
+
async (slug, options) => {
|
|
280
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
281
|
+
await runAction({ operation: "create", slug, ...options });
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
command.command("get").description("Get an access group and its allowlists").argument("<slug>", "Access group slug").option("--json", "Print the result as JSON").action(async (slug, options) => {
|
|
285
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
286
|
+
await runAction({ operation: "get", slug, ...options });
|
|
287
|
+
});
|
|
288
|
+
command.command("update").description("Update access group metadata").argument("<slug>", "Current access group slug").option("--name <name>", "New display name").option("--new-slug <slug>", "New access group slug").option("--json", "Print the result as JSON").action(
|
|
289
|
+
async (slug, options) => {
|
|
290
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
291
|
+
await runAction({ operation: "update", slug, ...options });
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
command.command("delete").description("Delete an access group and remove its project assignments").argument("<slug>", "Access group slug").option("-y, --yes", "Confirm deletion without prompting").option("--json", "Print the result as JSON (requires --yes)").action(
|
|
295
|
+
async (slug, options) => {
|
|
296
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
297
|
+
await runAction({ operation: "delete", slug, ...options });
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
const domain = command.command("domain").description("Manage allowed email domains");
|
|
301
|
+
domain.command("add").description("Add an exact email domain to an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
|
|
302
|
+
async (slug, domain2, options) => {
|
|
303
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
304
|
+
await runAction({ operation: "add-domain", slug, domain: domain2, ...options });
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
domain.command("remove").description("Remove an exact email domain from an access group").argument("<slug>", "Access group slug").argument("<domain>", "Email domain, such as example.com").option("--json", "Print the result as JSON").action(
|
|
308
|
+
async (slug, domain2, options) => {
|
|
309
|
+
const { runAction } = await import("./chunks/actions-OGIVBQC7.js");
|
|
310
|
+
await runAction({
|
|
311
|
+
operation: "remove-domain",
|
|
312
|
+
slug,
|
|
313
|
+
domain: domain2,
|
|
314
|
+
...options
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
return command;
|
|
319
|
+
}
|
|
320
|
+
var access_group_default = createAccessGroupCommand();
|
|
321
|
+
|
|
260
322
|
// src/domains/auth/index.ts
|
|
261
|
-
import { Command as
|
|
323
|
+
import { Command as Command17 } from "commander";
|
|
262
324
|
|
|
263
325
|
// src/domains/auth/login/index.ts
|
|
264
|
-
import { Command as
|
|
326
|
+
import { Command as Command14 } from "commander";
|
|
265
327
|
var LoginCommand = () => {
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const { loginAction } = await import("./chunks/action-
|
|
328
|
+
const cmd3 = new Command14("login");
|
|
329
|
+
cmd3.description("Login to scalar");
|
|
330
|
+
cmd3.option("--email <email>", "Email");
|
|
331
|
+
cmd3.option("--password <password>", "Password");
|
|
332
|
+
cmd3.option("--token <token>", "Personal token");
|
|
333
|
+
cmd3.action(async (...args) => {
|
|
334
|
+
const { loginAction } = await import("./chunks/action-KTYOCA2V.js");
|
|
273
335
|
return loginAction(...args);
|
|
274
336
|
});
|
|
275
|
-
return
|
|
337
|
+
return cmd3;
|
|
276
338
|
};
|
|
277
339
|
|
|
278
340
|
// src/domains/auth/logout/index.ts
|
|
279
|
-
import { Command as
|
|
341
|
+
import { Command as Command15 } from "commander";
|
|
280
342
|
var LogoutCommand = () => {
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
343
|
+
const cmd3 = new Command15("logout");
|
|
344
|
+
cmd3.description("Logout from scalar");
|
|
345
|
+
cmd3.action(async () => {
|
|
284
346
|
await clearAuthData();
|
|
285
347
|
output.info().message("Successfully logged out.").print();
|
|
286
348
|
});
|
|
287
|
-
return
|
|
349
|
+
return cmd3;
|
|
288
350
|
};
|
|
289
351
|
|
|
290
352
|
// src/domains/auth/whoami/index.ts
|
|
291
353
|
import as from "ansis";
|
|
292
|
-
import { Command as
|
|
354
|
+
import { Command as Command16 } from "commander";
|
|
293
355
|
var WhoAmICommand = () => {
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
356
|
+
const cmd3 = new Command16("whoami");
|
|
357
|
+
cmd3.description("Display the current user");
|
|
358
|
+
cmd3.action(async () => {
|
|
297
359
|
const auth = await getAuthData();
|
|
298
360
|
output.info().message(
|
|
299
361
|
`You are logged in as ${as.cyan(auth.email ?? "")} (role: ${as.cyan(auth.role ?? "Owner")})`
|
|
300
362
|
).line().print();
|
|
301
363
|
});
|
|
302
|
-
return
|
|
364
|
+
return cmd3;
|
|
303
365
|
};
|
|
304
366
|
|
|
305
367
|
// src/domains/auth/index.ts
|
|
306
368
|
var authCommands = [LoginCommand, WhoAmICommand, LogoutCommand];
|
|
307
|
-
var authDomain = new
|
|
369
|
+
var authDomain = new Command17("auth");
|
|
308
370
|
authDomain.description("Manage authorization on scalar platform");
|
|
309
371
|
authCommands.forEach((command) => authDomain.addCommand(command()));
|
|
310
372
|
var auth_default = authDomain;
|
|
311
373
|
|
|
374
|
+
// src/domains/context/index.ts
|
|
375
|
+
import { Command as Command18 } from "commander";
|
|
376
|
+
var cmd = new Command18("context");
|
|
377
|
+
cmd.description(
|
|
378
|
+
"Print every command, argument, and option as JSON for AI agents"
|
|
379
|
+
);
|
|
380
|
+
cmd.action(async () => {
|
|
381
|
+
const { contextAction } = await import("./chunks/action-F2ZJNURT.js");
|
|
382
|
+
return contextAction(cmd);
|
|
383
|
+
});
|
|
384
|
+
var context_default = cmd;
|
|
385
|
+
|
|
312
386
|
// src/domains/document/index.ts
|
|
313
|
-
import { Command as
|
|
387
|
+
import { Command as Command31 } from "commander";
|
|
314
388
|
|
|
315
389
|
// src/domains/document/join/index.ts
|
|
316
|
-
import { Command as
|
|
390
|
+
import { Command as Command19 } from "commander";
|
|
317
391
|
function JoinCommand() {
|
|
318
|
-
const
|
|
319
|
-
|
|
392
|
+
const cmd3 = new Command19("join");
|
|
393
|
+
cmd3.description(
|
|
320
394
|
"Merge multiple OpenAPI or AsyncAPI documents into a single unified document"
|
|
321
395
|
);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
396
|
+
cmd3.argument("<files...>", "Paths to the OpenAPI or AsyncAPI files to merge");
|
|
397
|
+
cmd3.option("--output -o <file>", "Path to save the merged output file");
|
|
398
|
+
cmd3.option(
|
|
325
399
|
"--prefix-components-with-path-value -p <path>",
|
|
326
400
|
"Dot-separated path to extract a prefix value from each input file for component names"
|
|
327
401
|
);
|
|
328
|
-
|
|
329
|
-
const { joinAction } = await import("./chunks/action-
|
|
402
|
+
cmd3.action(async (...args) => {
|
|
403
|
+
const { joinAction } = await import("./chunks/action-7PEQXDWT.js");
|
|
330
404
|
return joinAction(...args);
|
|
331
405
|
});
|
|
332
|
-
return
|
|
406
|
+
return cmd3;
|
|
333
407
|
}
|
|
334
408
|
|
|
335
409
|
// src/domains/document/split/index.ts
|
|
336
|
-
import { Command as
|
|
410
|
+
import { Command as Command20 } from "commander";
|
|
337
411
|
function SplitCommand() {
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
412
|
+
const cmd3 = new Command20("split");
|
|
413
|
+
cmd3.description("Split OpenAPI or AsyncAPI documents into small chunks");
|
|
414
|
+
cmd3.argument("[file|url]", "Path to OpenAPI or AsyncAPI file or URL to split");
|
|
415
|
+
cmd3.option("-o, --output <path>", "Path to save the chunks");
|
|
416
|
+
cmd3.addHelpText(
|
|
343
417
|
"after",
|
|
344
418
|
"\nAsyncAPI versions are preserved (including 2.6, 3.0, and 3.1). External references are bundled before splitting.\n"
|
|
345
419
|
);
|
|
346
|
-
|
|
347
|
-
const { splitAction } = await import("./chunks/action-
|
|
420
|
+
cmd3.action(async (...args) => {
|
|
421
|
+
const { splitAction } = await import("./chunks/action-YRX6SN5F.js");
|
|
348
422
|
return splitAction(...args);
|
|
349
423
|
});
|
|
350
|
-
return
|
|
424
|
+
return cmd3;
|
|
351
425
|
}
|
|
352
426
|
|
|
353
427
|
// src/domains/document/format/index.ts
|
|
354
|
-
import { Command as
|
|
428
|
+
import { Command as Command21 } from "commander";
|
|
355
429
|
function FormatCommand() {
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
const { formatAction } = await import("./chunks/action-
|
|
430
|
+
const cmd3 = new Command21("format");
|
|
431
|
+
cmd3.description("Format an OpenAPI or AsyncAPI file");
|
|
432
|
+
cmd3.argument("[file|url]", "File or URL to format");
|
|
433
|
+
cmd3.option("-o, --output <file>", "Output file");
|
|
434
|
+
cmd3.action(async (...args) => {
|
|
435
|
+
const { formatAction } = await import("./chunks/action-H6OUJWWM.js");
|
|
362
436
|
return formatAction(...args);
|
|
363
437
|
});
|
|
364
|
-
return
|
|
438
|
+
return cmd3;
|
|
365
439
|
}
|
|
366
440
|
|
|
367
441
|
// src/domains/document/lint/index.ts
|
|
368
|
-
import { Command as
|
|
442
|
+
import { Command as Command22 } from "commander";
|
|
369
443
|
function LintCommand() {
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const { lintAction } = await import("./chunks/action-
|
|
444
|
+
const cmd3 = new Command22("lint");
|
|
445
|
+
cmd3.description("Lint your OpenAPI or AsyncAPI file using spectral rules");
|
|
446
|
+
cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file path or url");
|
|
447
|
+
cmd3.option("-r, --rule <file|url>", "Rule path or url");
|
|
448
|
+
cmd3.action(async (...args) => {
|
|
449
|
+
const { lintAction } = await import("./chunks/action-JAHFRYWZ.js");
|
|
376
450
|
return lintAction(...args);
|
|
377
451
|
});
|
|
378
|
-
return
|
|
452
|
+
return cmd3;
|
|
379
453
|
}
|
|
380
454
|
|
|
381
455
|
// src/domains/document/markdown/index.ts
|
|
382
|
-
import { Command as
|
|
456
|
+
import { Command as Command23 } from "commander";
|
|
383
457
|
function MarkdownCommand() {
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
const { markdownAction } = await import("./chunks/action-
|
|
458
|
+
const cmd3 = new Command23("markdown");
|
|
459
|
+
cmd3.description("Generate Markdown from an OpenAPI file");
|
|
460
|
+
cmd3.argument("[file|url]", "OpenAPI file path or URL to convert");
|
|
461
|
+
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
462
|
+
cmd3.action(async (...args) => {
|
|
463
|
+
const { markdownAction } = await import("./chunks/action-VOFDW3U2.js");
|
|
390
464
|
return markdownAction(...args);
|
|
391
465
|
});
|
|
392
|
-
return
|
|
466
|
+
return cmd3;
|
|
393
467
|
}
|
|
394
468
|
|
|
395
469
|
// src/domains/document/mock/index.ts
|
|
396
|
-
import { Command as
|
|
470
|
+
import { Command as Command24 } from "commander";
|
|
397
471
|
function MockCommand() {
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
472
|
+
const cmd3 = new Command24("mock");
|
|
473
|
+
cmd3.description("Mock an OpenAPI API or AsyncAPI WebSocket and SSE channels");
|
|
474
|
+
cmd3.argument("[file|url]", "OpenAPI or AsyncAPI file or URL to mock");
|
|
475
|
+
cmd3.option("-w, --watch", "watch the file for changes");
|
|
476
|
+
cmd3.option("-o, --once", "run the server only once and exit after that");
|
|
477
|
+
cmd3.option(
|
|
478
|
+
"-p, --port <port>",
|
|
479
|
+
"set the HTTP port for the mock server",
|
|
480
|
+
parsePort
|
|
481
|
+
);
|
|
482
|
+
cmd3.action(async (...args) => {
|
|
483
|
+
const { mockAction } = await import("./chunks/action-HT2DJ34Z.js");
|
|
406
484
|
return mockAction(...args);
|
|
407
485
|
});
|
|
408
|
-
return
|
|
486
|
+
return cmd3;
|
|
409
487
|
}
|
|
410
488
|
|
|
411
489
|
// src/domains/document/postman/index.ts
|
|
412
|
-
import { Command as
|
|
490
|
+
import { Command as Command25 } from "commander";
|
|
413
491
|
function ConvertCommand() {
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
492
|
+
const cmd3 = new Command25("convert");
|
|
493
|
+
cmd3.description("Convert a Postman collection to an OpenAPI document");
|
|
494
|
+
cmd3.argument("[file|url]", "Postman collection file path or URL to convert");
|
|
495
|
+
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
496
|
+
cmd3.option(
|
|
419
497
|
"--merge-operations",
|
|
420
498
|
"Merge operations with shared path+method combinations"
|
|
421
499
|
);
|
|
422
|
-
|
|
423
|
-
const { convertAction } = await import("./chunks/action-
|
|
500
|
+
cmd3.action(async (...args) => {
|
|
501
|
+
const { convertAction } = await import("./chunks/action-F7A2K74G.js");
|
|
424
502
|
return convertAction(...args);
|
|
425
503
|
});
|
|
426
|
-
return
|
|
504
|
+
return cmd3;
|
|
427
505
|
}
|
|
428
506
|
|
|
429
507
|
// src/domains/document/serve/index.ts
|
|
430
|
-
import { Command as
|
|
508
|
+
import { Command as Command26 } from "commander";
|
|
431
509
|
function ServeCommand() {
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
510
|
+
const cmd3 = new Command26("serve");
|
|
511
|
+
cmd3.description("Serve an API Reference from an OpenAPI or AsyncAPI file");
|
|
512
|
+
cmd3.argument(
|
|
435
513
|
"[file|url]",
|
|
436
514
|
"OpenAPI or AsyncAPI file or URL to show the reference for"
|
|
437
515
|
);
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
516
|
+
cmd3.option(
|
|
517
|
+
"-c, --config <file>",
|
|
518
|
+
"JSON file with API Reference configuration"
|
|
519
|
+
);
|
|
520
|
+
cmd3.option("-w, --watch", "watch the file for changes");
|
|
521
|
+
cmd3.option("-o, --once", "run the server only once and exit after that");
|
|
522
|
+
cmd3.option(
|
|
441
523
|
"-p, --port <port>",
|
|
442
|
-
"set the HTTP port for the API reference server"
|
|
524
|
+
"set the HTTP port for the API reference server",
|
|
525
|
+
parsePort
|
|
443
526
|
);
|
|
444
|
-
|
|
445
|
-
const { serveAction } = await import("./chunks/action-
|
|
527
|
+
cmd3.action(async (...args) => {
|
|
528
|
+
const { serveAction } = await import("./chunks/action-Y6NXJQ4H.js");
|
|
446
529
|
return serveAction(...args);
|
|
447
530
|
});
|
|
448
|
-
return
|
|
531
|
+
return cmd3;
|
|
449
532
|
}
|
|
450
533
|
|
|
451
534
|
// src/domains/document/share/index.ts
|
|
452
|
-
import { Command as
|
|
535
|
+
import { Command as Command27 } from "commander";
|
|
453
536
|
function ShareCommand() {
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
537
|
+
const cmd3 = new Command27("share");
|
|
538
|
+
cmd3.description("Share an OpenAPI or AsyncAPI file");
|
|
539
|
+
cmd3.argument("[file]", "file to share");
|
|
540
|
+
cmd3.option(
|
|
458
541
|
"-t, --token <token>",
|
|
459
542
|
"pass a token to update an existing sandbox"
|
|
460
543
|
);
|
|
461
|
-
|
|
462
|
-
const { shareAction } = await import("./chunks/action-
|
|
544
|
+
cmd3.action(async (...args) => {
|
|
545
|
+
const { shareAction } = await import("./chunks/action-FCAYFPVR.js");
|
|
463
546
|
return shareAction(...args);
|
|
464
547
|
});
|
|
465
|
-
return
|
|
548
|
+
return cmd3;
|
|
466
549
|
}
|
|
467
550
|
|
|
468
551
|
// src/domains/document/upgrade/index.ts
|
|
469
|
-
import { Command as
|
|
552
|
+
import { Command as Command28 } from "commander";
|
|
470
553
|
function UpgradeCommand() {
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
554
|
+
const cmd3 = new Command28("upgrade");
|
|
555
|
+
cmd3.description("Upgrade an OpenAPI or AsyncAPI document to version 3.1");
|
|
556
|
+
cmd3.argument("[file|url]", "File or URL to upgrade");
|
|
557
|
+
cmd3.option("-o, --output <file>", "Path to save the upgraded output file");
|
|
558
|
+
cmd3.action(async (...args) => {
|
|
559
|
+
const { upgradeAction } = await import("./chunks/action-5SK5NE7E.js");
|
|
477
560
|
return upgradeAction(...args);
|
|
478
561
|
});
|
|
479
|
-
return
|
|
562
|
+
return cmd3;
|
|
480
563
|
}
|
|
481
564
|
|
|
482
565
|
// src/domains/document/validate/index.ts
|
|
483
|
-
import { Command as
|
|
566
|
+
import { Command as Command29 } from "commander";
|
|
484
567
|
function ValidateCommand() {
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const { validateAction } = await import("./chunks/action-
|
|
568
|
+
const cmd3 = new Command29("validate");
|
|
569
|
+
cmd3.description("Validate an OpenAPI or AsyncAPI file");
|
|
570
|
+
cmd3.argument("[file|url]", "File or URL to validate");
|
|
571
|
+
cmd3.action(async (...args) => {
|
|
572
|
+
const { validateAction } = await import("./chunks/action-AQRPFQKI.js");
|
|
490
573
|
return validateAction(...args);
|
|
491
574
|
});
|
|
492
|
-
return
|
|
575
|
+
return cmd3;
|
|
493
576
|
}
|
|
494
577
|
|
|
495
578
|
// src/domains/document/void/index.ts
|
|
496
|
-
import { Command as
|
|
579
|
+
import { Command as Command30 } from "commander";
|
|
497
580
|
function VoidCommand() {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
581
|
+
const cmd3 = new Command30("void");
|
|
582
|
+
cmd3.description("Boot a server to mirror HTTP requests");
|
|
583
|
+
cmd3.option("-o, --once", "run the server only once and exit after that");
|
|
584
|
+
cmd3.option(
|
|
585
|
+
"-p, --port <port>",
|
|
586
|
+
"set the HTTP port for the mock server",
|
|
587
|
+
parsePort
|
|
588
|
+
);
|
|
589
|
+
cmd3.action(async (...args) => {
|
|
503
590
|
const { voidAction } = await import("./chunks/action-H3RTILLM.js");
|
|
504
591
|
return voidAction(...args);
|
|
505
592
|
});
|
|
506
|
-
return
|
|
593
|
+
return cmd3;
|
|
507
594
|
}
|
|
508
595
|
|
|
509
596
|
// src/domains/document/index.ts
|
|
@@ -522,172 +609,165 @@ var documentCommands = [
|
|
|
522
609
|
LintCommand,
|
|
523
610
|
UpgradeCommand
|
|
524
611
|
];
|
|
525
|
-
var documentDomain = new
|
|
612
|
+
var documentDomain = new Command31("document");
|
|
526
613
|
documentDomain.description("Manage local openapi file");
|
|
527
614
|
documentCommands.forEach((command) => documentDomain.addCommand(command()));
|
|
528
615
|
var document_default = documentDomain;
|
|
529
616
|
|
|
530
617
|
// src/domains/project/index.ts
|
|
531
|
-
import { Command as
|
|
618
|
+
import { Command as Command41 } from "commander";
|
|
532
619
|
|
|
533
620
|
// src/domains/project/preview/index.ts
|
|
534
|
-
import { Command as
|
|
621
|
+
import { Command as Command32, Option as Option2 } from "commander";
|
|
535
622
|
var PreviewCommand = () => {
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
623
|
+
const cmd3 = new Command32("preview");
|
|
624
|
+
cmd3.description("Preview scalar guides");
|
|
625
|
+
cmd3.argument(
|
|
539
626
|
"[config]",
|
|
540
627
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
541
628
|
);
|
|
542
|
-
|
|
629
|
+
cmd3.option(
|
|
543
630
|
"-p, --port [port]",
|
|
544
631
|
"port to run the server on. If the port is not available, it will select another one.",
|
|
545
632
|
"7970"
|
|
546
633
|
);
|
|
547
|
-
|
|
548
|
-
"-
|
|
634
|
+
cmd3.option(
|
|
635
|
+
"-H, --host [host]",
|
|
549
636
|
"Specify which IP addresses the server should listen on."
|
|
550
637
|
);
|
|
551
|
-
|
|
552
|
-
"-L, --log-level <level>",
|
|
553
|
-
"Set the log level (debug, info, warn, error, trace)",
|
|
554
|
-
"info"
|
|
638
|
+
cmd3.addOption(
|
|
639
|
+
new Option2("-L, --log-level <level>", "Set the log level").choices(["debug", "info"]).default("info")
|
|
555
640
|
);
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
"pretty"
|
|
560
|
-
);
|
|
561
|
-
cmd2.option("-N, --no-open", "Do not open the browser automatically", true);
|
|
562
|
-
cmd2.action(async (...args) => {
|
|
563
|
-
const { previewAction } = await import("./chunks/action-FF2OMGAS.js");
|
|
641
|
+
cmd3.option("-N, --no-open", "Do not open the browser automatically", true);
|
|
642
|
+
cmd3.action(async (...args) => {
|
|
643
|
+
const { previewAction } = await import("./chunks/action-LLH4QPXM.js");
|
|
564
644
|
return previewAction(...args);
|
|
565
645
|
});
|
|
566
|
-
return
|
|
646
|
+
return cmd3;
|
|
567
647
|
};
|
|
568
648
|
|
|
569
649
|
// src/domains/project/check-config/index.ts
|
|
570
|
-
import { Command as
|
|
650
|
+
import { Command as Command33 } from "commander";
|
|
571
651
|
function CheckConfigCommand() {
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const { checkConfigAction } = await import("./chunks/action-
|
|
652
|
+
const cmd3 = new Command33("check-config");
|
|
653
|
+
cmd3.description("Check a Scalar Configuration file");
|
|
654
|
+
cmd3.argument("[file]", "File to check");
|
|
655
|
+
cmd3.action(async (...args) => {
|
|
656
|
+
const { checkConfigAction } = await import("./chunks/action-NVI5DWFP.js");
|
|
577
657
|
return checkConfigAction(...args);
|
|
578
658
|
});
|
|
579
|
-
return
|
|
659
|
+
return cmd3;
|
|
580
660
|
}
|
|
581
661
|
|
|
582
662
|
// src/domains/project/create/index.ts
|
|
583
|
-
import { Command as
|
|
663
|
+
import { Command as Command34 } from "commander";
|
|
584
664
|
var CreateCommand = () => {
|
|
585
|
-
const
|
|
586
|
-
|
|
665
|
+
const cmd3 = new Command34("create");
|
|
666
|
+
cmd3.description(
|
|
587
667
|
"Create a new project that is not linked to a github project."
|
|
588
668
|
);
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
const { createAction } = await import("./chunks/action-
|
|
669
|
+
cmd3.option("-n, --name <name>", "name of your project");
|
|
670
|
+
cmd3.option("-s, --slug <slug>", "project slug");
|
|
671
|
+
cmd3.action(async (...args) => {
|
|
672
|
+
const { createAction } = await import("./chunks/action-WFDNRA7D.js");
|
|
593
673
|
return createAction(...args);
|
|
594
674
|
});
|
|
595
|
-
return
|
|
675
|
+
return cmd3;
|
|
596
676
|
};
|
|
597
677
|
|
|
598
678
|
// src/domains/project/deployments/index.ts
|
|
599
|
-
import { Command as
|
|
679
|
+
import { Command as Command36 } from "commander";
|
|
600
680
|
|
|
601
681
|
// src/domains/project/deployments/list/index.ts
|
|
602
|
-
import { Command as
|
|
682
|
+
import { Command as Command35 } from "commander";
|
|
603
683
|
var ListCommand = () => {
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
const { listAction } = await import("./chunks/action-
|
|
684
|
+
const cmd3 = new Command35("list");
|
|
685
|
+
cmd3.description("List the production deployment history for a project.");
|
|
686
|
+
cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
|
|
687
|
+
cmd3.action(async (...args) => {
|
|
688
|
+
const { listAction } = await import("./chunks/action-QQZLPI42.js");
|
|
609
689
|
return listAction(...args);
|
|
610
690
|
});
|
|
611
|
-
return
|
|
691
|
+
return cmd3;
|
|
612
692
|
};
|
|
613
693
|
|
|
614
694
|
// src/domains/project/deployments/index.ts
|
|
615
695
|
var DeploymentsCommand = () => {
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
return
|
|
696
|
+
const cmd3 = new Command36("deployments");
|
|
697
|
+
cmd3.description("Inspect a project deployment history.");
|
|
698
|
+
cmd3.addCommand(ListCommand());
|
|
699
|
+
return cmd3;
|
|
620
700
|
};
|
|
621
701
|
|
|
622
702
|
// src/domains/project/init/index.ts
|
|
623
|
-
import { Command as
|
|
703
|
+
import { Command as Command37 } from "commander";
|
|
624
704
|
var InitCommand = () => {
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
const { initAction } = await import("./chunks/action-
|
|
705
|
+
const cmd3 = new Command37("init");
|
|
706
|
+
cmd3.description("Create a new Scalar Docs project.");
|
|
707
|
+
cmd3.option("-s, --subdomain [url]", "subdomain to publish on");
|
|
708
|
+
cmd3.option("--force", "override existing configuration");
|
|
709
|
+
cmd3.action(async (...args) => {
|
|
710
|
+
const { initAction } = await import("./chunks/action-Y7OUGD56.js");
|
|
631
711
|
return initAction(...args);
|
|
632
712
|
});
|
|
633
|
-
return
|
|
713
|
+
return cmd3;
|
|
634
714
|
};
|
|
635
715
|
|
|
636
716
|
// src/domains/project/publish/index.ts
|
|
637
|
-
import { Command as
|
|
717
|
+
import { Command as Command38 } from "commander";
|
|
638
718
|
var PublishCommand = () => {
|
|
639
|
-
const
|
|
640
|
-
|
|
719
|
+
const cmd3 = new Command38("publish");
|
|
720
|
+
cmd3.description(
|
|
641
721
|
"Publish new build for a github sync project that is not linked."
|
|
642
722
|
);
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
723
|
+
cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
|
|
724
|
+
cmd3.option("-c, --config [config]", "Your config file of the project");
|
|
725
|
+
cmd3.option("-p, --preview", "Publish in preview mode");
|
|
726
|
+
cmd3.option(
|
|
647
727
|
"-g, --github",
|
|
648
728
|
"Publish from your linked remote GitHub repository"
|
|
649
729
|
);
|
|
650
|
-
|
|
651
|
-
const { publishAction } = await import("./chunks/action-
|
|
730
|
+
cmd3.action(async (...args) => {
|
|
731
|
+
const { publishAction } = await import("./chunks/action-43YBNBDR.js");
|
|
652
732
|
return publishAction(...args);
|
|
653
733
|
});
|
|
654
|
-
return
|
|
734
|
+
return cmd3;
|
|
655
735
|
};
|
|
656
736
|
|
|
657
737
|
// src/domains/project/rollback/index.ts
|
|
658
|
-
import { Command as
|
|
738
|
+
import { Command as Command39 } from "commander";
|
|
659
739
|
var RollbackCommand = () => {
|
|
660
|
-
const
|
|
661
|
-
|
|
740
|
+
const cmd3 = new Command39("rollback");
|
|
741
|
+
cmd3.description(
|
|
662
742
|
"Roll the live deployment back to a previously deployed build."
|
|
663
743
|
);
|
|
664
|
-
|
|
665
|
-
|
|
744
|
+
cmd3.option("-s, --slug [slug]", "Project slug found in Scalar Dashboard");
|
|
745
|
+
cmd3.option(
|
|
666
746
|
"-t, --to <publishUid>",
|
|
667
747
|
"Roll back to a specific build id (defaults to the next older deployed build)"
|
|
668
748
|
);
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const { rollbackAction } = await import("./chunks/action-
|
|
749
|
+
cmd3.option("-y, --yes", "Skip the confirmation prompt");
|
|
750
|
+
cmd3.action(async (...args) => {
|
|
751
|
+
const { rollbackAction } = await import("./chunks/action-UIKH4SZX.js");
|
|
672
752
|
return rollbackAction(...args);
|
|
673
753
|
});
|
|
674
|
-
return
|
|
754
|
+
return cmd3;
|
|
675
755
|
};
|
|
676
756
|
|
|
677
757
|
// src/domains/project/upgrade/index.ts
|
|
678
|
-
import { Command as
|
|
758
|
+
import { Command as Command40 } from "commander";
|
|
679
759
|
var UpgradeCommand2 = () => {
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
760
|
+
const cmd3 = new Command40("upgrade");
|
|
761
|
+
cmd3.description("Upgrade scalar project");
|
|
762
|
+
cmd3.argument(
|
|
683
763
|
"[config]",
|
|
684
764
|
"Path to the Scalar configuration file (usually `scalar.config.json5` or `scalar.config.json`)"
|
|
685
765
|
);
|
|
686
|
-
|
|
687
|
-
const { upgradeAction } = await import("./chunks/action-
|
|
766
|
+
cmd3.action(async (...args) => {
|
|
767
|
+
const { upgradeAction } = await import("./chunks/action-CA4QYPI6.js");
|
|
688
768
|
return upgradeAction(...args);
|
|
689
769
|
});
|
|
690
|
-
return
|
|
770
|
+
return cmd3;
|
|
691
771
|
};
|
|
692
772
|
|
|
693
773
|
// src/domains/project/index.ts
|
|
@@ -701,19 +781,19 @@ var projectCommands = [
|
|
|
701
781
|
DeploymentsCommand,
|
|
702
782
|
UpgradeCommand2
|
|
703
783
|
];
|
|
704
|
-
var projectDomain = new
|
|
784
|
+
var projectDomain = new Command41("project");
|
|
705
785
|
projectDomain.description("Manage scalar project");
|
|
706
786
|
projectCommands.forEach((command) => projectDomain.addCommand(command()));
|
|
707
787
|
projectDomain.addCommand(DownloadIsolateCommand(), { hidden: true });
|
|
708
788
|
var project_default = projectDomain;
|
|
709
789
|
|
|
710
790
|
// src/domains/readme/index.ts
|
|
711
|
-
import { Command as
|
|
791
|
+
import { Command as Command43 } from "commander";
|
|
712
792
|
|
|
713
793
|
// src/domains/readme/generate.ts
|
|
714
794
|
import { text } from "@clack/prompts";
|
|
715
795
|
import as2 from "ansis";
|
|
716
|
-
import { Command as
|
|
796
|
+
import { Command as Command42 } from "commander";
|
|
717
797
|
|
|
718
798
|
// src/helpers/documentation/index.ts
|
|
719
799
|
import fs from "node:fs/promises";
|
|
@@ -760,17 +840,20 @@ var generateDocumentationFile = async (outputPath) => {
|
|
|
760
840
|
|
|
761
841
|
// src/domains/readme/generate.ts
|
|
762
842
|
function GenerateReadmeCommand() {
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
843
|
+
const cmd3 = new Command42("generate");
|
|
844
|
+
cmd3.description("Self generate documentation for the cli");
|
|
845
|
+
cmd3.option(
|
|
766
846
|
"-o, --output [file]",
|
|
767
847
|
"Path where the documentation file will be written"
|
|
768
848
|
);
|
|
769
|
-
|
|
849
|
+
cmd3.action(async ({ output: __outputPath }) => {
|
|
770
850
|
const getOutputPath = async () => {
|
|
771
851
|
if (__outputPath !== void 0 && typeof __outputPath === "string") {
|
|
772
852
|
return __outputPath;
|
|
773
853
|
}
|
|
854
|
+
requireInteractive(
|
|
855
|
+
"Pass --output <file> to generate documentation without a terminal."
|
|
856
|
+
);
|
|
774
857
|
const outputPath2 = await text({
|
|
775
858
|
message: "Where should the documentation file be written?",
|
|
776
859
|
defaultValue: "./README.md",
|
|
@@ -789,7 +872,7 @@ function GenerateReadmeCommand() {
|
|
|
789
872
|
`\u23F1\uFE0F Generation completed in ${as2.yellow(executionTimeMs.toFixed(2))}ms`
|
|
790
873
|
).line("").exit("success");
|
|
791
874
|
});
|
|
792
|
-
return
|
|
875
|
+
return cmd3;
|
|
793
876
|
}
|
|
794
877
|
|
|
795
878
|
// src/domains/readme/serve.ts
|
|
@@ -804,9 +887,9 @@ var fileExists = async (filePath) => {
|
|
|
804
887
|
return false;
|
|
805
888
|
}
|
|
806
889
|
};
|
|
807
|
-
function ServeReadmeCommand(
|
|
808
|
-
|
|
809
|
-
|
|
890
|
+
function ServeReadmeCommand(cmd3) {
|
|
891
|
+
cmd3.description("Open documentation for the CLI");
|
|
892
|
+
cmd3.action(async () => {
|
|
810
893
|
const docsPath = path2.join(import.meta.dirname, "docs.html");
|
|
811
894
|
if (await fileExists(docsPath) === false) {
|
|
812
895
|
return output.error().title("Documentation not found").message(
|
|
@@ -819,111 +902,112 @@ function ServeReadmeCommand(cmd2) {
|
|
|
819
902
|
"Documentation is being opened in your default browser. If it does not open automatically, please visit the following URL:"
|
|
820
903
|
).line(as3.blue(docsUrl)).line().exit("success");
|
|
821
904
|
});
|
|
822
|
-
return
|
|
905
|
+
return cmd3;
|
|
823
906
|
}
|
|
824
907
|
|
|
825
908
|
// src/domains/readme/index.ts
|
|
826
|
-
var readmeDomain = new
|
|
909
|
+
var readmeDomain = new Command43("readme");
|
|
827
910
|
readmeDomain.addCommand(GenerateReadmeCommand());
|
|
828
911
|
ServeReadmeCommand(readmeDomain);
|
|
829
912
|
var readme_default = readmeDomain;
|
|
830
913
|
|
|
831
914
|
// src/domains/registry/index.ts
|
|
832
|
-
import { Command as
|
|
915
|
+
import { Command as Command49 } from "commander";
|
|
833
916
|
|
|
834
917
|
// src/domains/registry/publish/index.ts
|
|
835
|
-
import { Command as
|
|
918
|
+
import { Command as Command44 } from "commander";
|
|
836
919
|
var PublishCommand2 = () => {
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
920
|
+
const cmd3 = new Command44("publish");
|
|
921
|
+
cmd3.description("Publish an OpenAPI document to the Scalar registry");
|
|
922
|
+
cmd3.argument("[file]", "OpenAPI file to upload");
|
|
923
|
+
cmd3.option(
|
|
841
924
|
"--slug <slug>",
|
|
842
925
|
"Slug identifier for the registry entry. Defaults to title."
|
|
843
926
|
);
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
927
|
+
cmd3.option("--namespace <namespace>", "Scalar team namespace");
|
|
928
|
+
cmd3.option("--version <version>", "API version (e.g. 0.1.0)");
|
|
929
|
+
cmd3.option("--private", "Make API private", false);
|
|
930
|
+
cmd3.option("--no-current", "Do not set as the current version");
|
|
931
|
+
cmd3.option("--force", "Force override an existing version", false);
|
|
932
|
+
cmd3.option("--bundle", "Bundle all external references before uploading");
|
|
933
|
+
cmd3.option(
|
|
851
934
|
"--treeShake",
|
|
852
935
|
"Remove unused components from the bundled document"
|
|
853
936
|
);
|
|
854
|
-
|
|
937
|
+
cmd3.option(
|
|
855
938
|
"--urlMap",
|
|
856
939
|
"Generate a map of resolved URLs when bundling the document"
|
|
857
940
|
);
|
|
858
|
-
|
|
941
|
+
cmd3.option(
|
|
859
942
|
"--fetchLimit <limit>",
|
|
860
|
-
"Maximum number of concurrent URLs to fetch when bundling the document"
|
|
943
|
+
"Maximum number of concurrent URLs to fetch when bundling the document",
|
|
944
|
+
parseFetchLimit
|
|
861
945
|
);
|
|
862
|
-
|
|
863
|
-
const { publishAction } = await import("./chunks/action-
|
|
946
|
+
cmd3.action(async (...args) => {
|
|
947
|
+
const { publishAction } = await import("./chunks/action-6BYGBXRC.js");
|
|
864
948
|
return publishAction(...args);
|
|
865
949
|
});
|
|
866
|
-
return
|
|
950
|
+
return cmd3;
|
|
867
951
|
};
|
|
868
952
|
|
|
869
953
|
// src/domains/registry/delete/index.ts
|
|
870
|
-
import { Command as
|
|
954
|
+
import { Command as Command45 } from "commander";
|
|
871
955
|
var DeleteCommand = () => {
|
|
872
|
-
const
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
const { deleteAction } = await import("./chunks/action-
|
|
956
|
+
const cmd3 = new Command45("delete");
|
|
957
|
+
cmd3.description("Delete a document from scalar registry");
|
|
958
|
+
cmd3.argument("[namespace]", "Team namespace");
|
|
959
|
+
cmd3.argument("[slug]", "Managed doc slug");
|
|
960
|
+
cmd3.action(async (...args) => {
|
|
961
|
+
const { deleteAction } = await import("./chunks/action-YLF2G4G5.js");
|
|
878
962
|
return deleteAction(...args);
|
|
879
963
|
});
|
|
880
|
-
return
|
|
964
|
+
return cmd3;
|
|
881
965
|
};
|
|
882
966
|
|
|
883
967
|
// src/domains/registry/get/index.ts
|
|
884
|
-
import { Command as
|
|
968
|
+
import { Command as Command46 } from "commander";
|
|
885
969
|
var GetCommand = () => {
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
const { getAction } = await import("./chunks/action-
|
|
970
|
+
const cmd3 = new Command46("get");
|
|
971
|
+
cmd3.description("Get a document version from scalar registry");
|
|
972
|
+
cmd3.argument("[namespace]", "Team namespace");
|
|
973
|
+
cmd3.argument("[slug]", "Managed doc slug");
|
|
974
|
+
cmd3.option("--version <version>", "Document version (defaults to latest)");
|
|
975
|
+
cmd3.option("--format <format>", "Output format (json or yaml)", "json");
|
|
976
|
+
cmd3.option("-o, --output <file>", "Output file (defaults to stdout)");
|
|
977
|
+
cmd3.action(async (...args) => {
|
|
978
|
+
const { getAction } = await import("./chunks/action-XIUO64C7.js");
|
|
895
979
|
return getAction(...args);
|
|
896
980
|
});
|
|
897
|
-
return
|
|
981
|
+
return cmd3;
|
|
898
982
|
};
|
|
899
983
|
|
|
900
984
|
// src/domains/registry/list/index.ts
|
|
901
|
-
import { Command as
|
|
985
|
+
import { Command as Command47 } from "commander";
|
|
902
986
|
var ListCommand2 = () => {
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
const { listAction } = await import("./chunks/action-
|
|
987
|
+
const cmd3 = new Command47("list");
|
|
988
|
+
cmd3.description("List all registry APIs for a team namespace");
|
|
989
|
+
cmd3.option("--namespace <namespace>", "Team namespace");
|
|
990
|
+
cmd3.action(async (...args) => {
|
|
991
|
+
const { listAction } = await import("./chunks/action-LEUD5P2U.js");
|
|
908
992
|
return listAction(...args);
|
|
909
993
|
});
|
|
910
|
-
return
|
|
994
|
+
return cmd3;
|
|
911
995
|
};
|
|
912
996
|
|
|
913
997
|
// src/domains/registry/update/index.ts
|
|
914
|
-
import { Command as
|
|
998
|
+
import { Command as Command48 } from "commander";
|
|
915
999
|
var UpdateCommand = () => {
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
const { updateAction } = await import("./chunks/action-
|
|
1000
|
+
const cmd3 = new Command48("update");
|
|
1001
|
+
cmd3.description("Update document metadata on scalar registry");
|
|
1002
|
+
cmd3.argument("[namespace]", "namespace of document you want to update");
|
|
1003
|
+
cmd3.argument("[slug]", "slug of document you want to update");
|
|
1004
|
+
cmd3.option("--title <title>", "Document title");
|
|
1005
|
+
cmd3.option("--description <description>", "Document description");
|
|
1006
|
+
cmd3.action(async (...args) => {
|
|
1007
|
+
const { updateAction } = await import("./chunks/action-LXGXKXZZ.js");
|
|
924
1008
|
return updateAction(...args);
|
|
925
1009
|
});
|
|
926
|
-
return
|
|
1010
|
+
return cmd3;
|
|
927
1011
|
};
|
|
928
1012
|
|
|
929
1013
|
// src/domains/registry/index.ts
|
|
@@ -934,42 +1018,42 @@ var registryCommands = [
|
|
|
934
1018
|
ListCommand2,
|
|
935
1019
|
GetCommand
|
|
936
1020
|
];
|
|
937
|
-
var registryDomain = new
|
|
1021
|
+
var registryDomain = new Command49("registry");
|
|
938
1022
|
registryDomain.description("Manage your scalar registry");
|
|
939
1023
|
registryCommands.forEach((command) => registryDomain.addCommand(command()));
|
|
940
1024
|
var registry_default = registryDomain;
|
|
941
1025
|
|
|
942
1026
|
// src/domains/team/index.ts
|
|
943
|
-
import { Command as
|
|
1027
|
+
import { Command as Command52 } from "commander";
|
|
944
1028
|
|
|
945
1029
|
// src/domains/team/list/index.ts
|
|
946
|
-
import { Command as
|
|
1030
|
+
import { Command as Command50 } from "commander";
|
|
947
1031
|
var ListCommand3 = () => {
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
const { listAction } = await import("./chunks/action-
|
|
1032
|
+
const cmd3 = new Command50("list");
|
|
1033
|
+
cmd3.description("List all teams current user is part of");
|
|
1034
|
+
cmd3.action(async (...args) => {
|
|
1035
|
+
const { listAction } = await import("./chunks/action-W3C53GPH.js");
|
|
952
1036
|
return listAction(...args);
|
|
953
1037
|
});
|
|
954
|
-
return
|
|
1038
|
+
return cmd3;
|
|
955
1039
|
};
|
|
956
1040
|
|
|
957
1041
|
// src/domains/team/set/index.ts
|
|
958
|
-
import { Command as
|
|
1042
|
+
import { Command as Command51 } from "commander";
|
|
959
1043
|
var SetCommand = () => {
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
const { setAction } = await import("./chunks/action-
|
|
1044
|
+
const cmd3 = new Command51("set");
|
|
1045
|
+
cmd3.description("Set current active team for the user");
|
|
1046
|
+
cmd3.option("--team <team>", "Team uid");
|
|
1047
|
+
cmd3.action(async (...args) => {
|
|
1048
|
+
const { setAction } = await import("./chunks/action-354TUG4H.js");
|
|
965
1049
|
return setAction(...args);
|
|
966
1050
|
});
|
|
967
|
-
return
|
|
1051
|
+
return cmd3;
|
|
968
1052
|
};
|
|
969
1053
|
|
|
970
1054
|
// src/domains/team/index.ts
|
|
971
1055
|
var teamCommands = [ListCommand3, SetCommand];
|
|
972
|
-
var teamDomain = new
|
|
1056
|
+
var teamDomain = new Command52("team");
|
|
973
1057
|
teamDomain.description("Manage user teams");
|
|
974
1058
|
teamCommands.forEach((command) => teamDomain.addCommand(command()));
|
|
975
1059
|
var team_default = teamDomain;
|
|
@@ -977,7 +1061,7 @@ var team_default = teamDomain;
|
|
|
977
1061
|
// src/domains/upgrade/index.ts
|
|
978
1062
|
import { execSync } from "node:child_process";
|
|
979
1063
|
import as5 from "ansis";
|
|
980
|
-
import { Command as
|
|
1064
|
+
import { Command as Command53 } from "commander";
|
|
981
1065
|
|
|
982
1066
|
// src/helpers/upgrade.ts
|
|
983
1067
|
import as4 from "ansis";
|
|
@@ -1044,9 +1128,9 @@ async function checkUpgrade() {
|
|
|
1044
1128
|
}
|
|
1045
1129
|
|
|
1046
1130
|
// src/domains/upgrade/index.ts
|
|
1047
|
-
var
|
|
1048
|
-
|
|
1049
|
-
|
|
1131
|
+
var cmd2 = new Command53("upgrade");
|
|
1132
|
+
cmd2.description("Upgrade current version of your cli");
|
|
1133
|
+
cmd2.action(async () => {
|
|
1050
1134
|
if (process.env.SCALAR_CLI_DISTRIBUTION === "portable") {
|
|
1051
1135
|
output.info().message(
|
|
1052
1136
|
"To upgrade this portable installation, download and extract the newer Scalar archive, then replace the installation directory."
|
|
@@ -1070,13 +1154,15 @@ cmd.action(async () => {
|
|
|
1070
1154
|
output.error().title("Upgrade failed").message("Failed to upgrade the CLI. Please try running:").message(as5.cyan(`npm install -g ${upgradeStatus.name}@latest`)).exit("error");
|
|
1071
1155
|
}
|
|
1072
1156
|
});
|
|
1073
|
-
var upgrade_default =
|
|
1157
|
+
var upgrade_default = cmd2;
|
|
1074
1158
|
|
|
1075
1159
|
// src/domains/index.ts
|
|
1076
1160
|
var domains = [
|
|
1077
1161
|
readme_default,
|
|
1078
1162
|
upgrade_default,
|
|
1163
|
+
context_default,
|
|
1079
1164
|
auth_default,
|
|
1165
|
+
access_group_default,
|
|
1080
1166
|
document_default,
|
|
1081
1167
|
project_default,
|
|
1082
1168
|
registry_default,
|
|
@@ -1088,7 +1174,7 @@ var domains_default = domains;
|
|
|
1088
1174
|
|
|
1089
1175
|
// src/program.ts
|
|
1090
1176
|
var getProgram = () => {
|
|
1091
|
-
const program2 = new
|
|
1177
|
+
const program2 = new Command54();
|
|
1092
1178
|
program2.enablePositionalOptions().name(Object.keys(bin)[0]).description("CLI to work with your OpenAPI files").version(version, "-v, --version");
|
|
1093
1179
|
program2.showHelpAfterError();
|
|
1094
1180
|
domains_default.forEach((domain) => program2.addCommand(domain));
|
|
@@ -1106,7 +1192,7 @@ var program = getProgram();
|
|
|
1106
1192
|
if (process.argv.length === 2) {
|
|
1107
1193
|
program.help();
|
|
1108
1194
|
}
|
|
1109
|
-
if (process.argv[2] !== "upgrade" && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
|
|
1195
|
+
if (process.argv[2] !== "upgrade" && process.argv[2] !== "context" && !(process.argv[2] === "access-group" && process.argv.includes("--json")) && process.env.SCALAR_CLI_DISTRIBUTION !== "portable") {
|
|
1110
1196
|
checkUpgrade().catch(() => {
|
|
1111
1197
|
});
|
|
1112
1198
|
}
|