@scalar/cli 2.12.3 → 2.13.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 +221 -2
- package/chunks/{action-JXCU2JKC.js → action-27BJMHFD.js} +38 -6
- package/chunks/{action-5BJL72JE.js → action-2BZ3AFBR.js} +10 -7
- package/chunks/{action-RPTLQBMK.js → action-3DBOUHKS.js} +8 -6
- package/chunks/{action-6I2PWENU.js → action-3R3MVTP3.js} +67 -88
- package/chunks/{action-T4MM4OUS.js → action-5HWPNWVU.js} +52 -29
- package/chunks/{action-EWZLVN45.js → action-5JTBIUPZ.js} +47 -27
- package/chunks/{action-4ESHWOAM.js → action-5QDBZTBF.js} +9 -8
- package/chunks/{action-D7L757PX.js → action-7HHTD65O.js} +13 -12
- package/chunks/{action-Y7EBKCUU.js → action-ASBFLTOA.js} +1 -1
- package/chunks/{action-H4GW3KAI.js → action-CXQ3HLVC.js} +15 -15
- package/chunks/{action-EPGS3U3T.js → action-EGF7LXVA.js} +63 -48
- package/chunks/{action-7CUPRYNA.js → action-F5LSDVJA.js} +36 -23
- package/chunks/{action-6A4NM5WS.js → action-FR6UPGZP.js} +9 -8
- package/chunks/{action-KIOYSVKX.js → action-FZZ2VLNA.js} +23 -6
- package/chunks/{action-ZOYQBWGD.js → action-GIKW67JB.js} +13 -13
- package/chunks/{action-ED4TSPRZ.js → action-GLC54N3F.js} +11 -11
- package/chunks/{action-FBOTIFVC.js → action-GRAMP3QD.js} +12 -10
- package/chunks/{action-BYYKW4S6.js → action-IUG6MPST.js} +25 -10
- package/chunks/{action-ZBEOLJJR.js → action-JCBTINNL.js} +9 -6
- package/chunks/{action-VVKMUOKR.js → action-JEI24ZNE.js} +13 -5
- package/chunks/{action-EWDQOX5B.js → action-JFNK5UCV.js} +6 -4
- package/chunks/action-JRPGHJGA.js +48 -0
- package/chunks/{action-Q3DI54OW.js → action-KRXJWRCE.js} +15 -15
- package/chunks/{action-B74PPGKB.js → action-PBJFNJMY.js} +34 -16
- package/chunks/{action-O7ROX6NF.js → action-PDOW5JS2.js} +12 -11
- package/chunks/{action-GMJJMZXY.js → action-RYLO75IN.js} +11 -11
- package/chunks/{action-HAKFAXTQ.js → action-VEXFHEQR.js} +6 -6
- package/chunks/{action-YXRCGKCK.js → action-W3AGGZ42.js} +6 -4
- package/chunks/action-W5VD63XO.js +55 -0
- package/chunks/{action-M5OUEDV2.js → action-WEDLKGDY.js} +4 -4
- package/chunks/{action-FBQAU5LV.js → action-WI6UW2AL.js} +12 -12
- package/chunks/{action-AYKKHH7A.js → action-WQPMJZXL.js} +51 -24
- package/chunks/{action-GJHOZ6Q5.js → action-WY4GOD2Y.js} +10 -8
- package/chunks/{action-I2IV4VLL.js → action-XXIRB2F6.js} +32 -16
- package/chunks/{actions-EXQNVV4T.js → actions-I4HS6ASR.js} +20 -18
- package/chunks/{agent-XAHNA4MB.js → agent-E6PYTXAU.js} +3 -3
- package/chunks/{asyncapi-FNOWXSKB.js → asyncapi-VQ7CCUCY.js} +9 -7
- package/chunks/{build.action-TIKRZPQ5.js → build.action-LIAREWUF.js} +36 -19
- package/chunks/chunk-2XWUFFEZ.js +133 -0
- package/chunks/{chunk-2GKXAGSH.js → chunk-6VAEDMCP.js} +7 -7
- package/chunks/{chunk-EUFK4MVX.js → chunk-6YDIOXF7.js} +2 -2
- package/chunks/{chunk-EBNFCIKS.js → chunk-APX65SRT.js} +2 -1
- package/chunks/{chunk-WKW5W2ZP.js → chunk-DWN6JOF2.js} +1 -1
- package/chunks/{chunk-EXJUFF6G.js → chunk-FXELV3AW.js} +8 -3
- package/chunks/{chunk-IOW726L2.js → chunk-GARUDDWI.js} +1 -1
- package/chunks/{chunk-JWNWOK2M.js → chunk-HZ4UKLOE.js} +12 -5
- package/chunks/{chunk-2AK5O3NQ.js → chunk-IDWF5L45.js} +28 -28
- package/chunks/chunk-IRQJDPZE.js +34 -0
- package/chunks/{chunk-TYNF7ROW.js → chunk-JHJDLZSM.js} +1 -1
- package/chunks/{chunk-TI4NDKQC.js → chunk-KTI65ZVY.js} +5 -5
- package/chunks/chunk-LK2ZIDHH.js +32 -0
- package/chunks/{chunk-I7ZVWF57.js → chunk-LUR7BA3W.js} +15 -9
- package/chunks/{chunk-AOZQPCWI.js → chunk-M4QTWCJ7.js} +2 -0
- package/chunks/{chunk-7S34K2P3.js → chunk-NOD4CBF7.js} +1 -1
- package/chunks/{chunk-KPLWZIOV.js → chunk-P4EPNS46.js} +3 -3
- package/chunks/{chunk-CUHVXHIV.js → chunk-PWFA23M2.js} +1 -1
- package/chunks/{chunk-KWIY2QZY.js → chunk-QRYMQPFT.js} +2 -2
- package/chunks/{chunk-FI7UKPRF.js → chunk-QS2T7JAK.js} +1 -1
- package/chunks/{chunk-OZQPMMTA.js → chunk-QUUBUPAW.js} +5 -5
- package/chunks/{chunk-FYMDIB7J.js → chunk-R3NDJICA.js} +1 -1
- package/chunks/{chunk-V7RTDFHK.js → chunk-RAJM56L7.js} +5 -1
- package/chunks/{chunk-Y2OQOAY7.js → chunk-RQNLEGMQ.js} +1 -1
- package/chunks/chunk-RZDLPTXV.js +167 -0
- package/chunks/chunk-SIPBGEVT.js +16 -0
- package/chunks/chunk-SNQFFEYH.js +11 -0
- package/chunks/{chunk-62OOT7FY.js → chunk-SNSJW2JT.js} +2 -2
- package/chunks/{chunk-LEECPQZN.js → chunk-UNV7BZD3.js} +2 -2
- package/chunks/{chunk-IRA5BW2J.js → chunk-X62ZTOQF.js} +31 -4
- package/chunks/{chunk-UN2AAVO5.js → chunk-XFBCZL7J.js} +2 -2
- package/chunks/chunk-XUX6JXU5.js +58 -0
- package/chunks/{create.action-K7GTWYST.js → create.action-PZMCTYGS.js} +31 -22
- package/chunks/{delete.action-JKLXBYRD.js → delete.action-J57JIFG3.js} +35 -21
- package/chunks/{delete.action-E4XRGKQW.js → delete.action-VDSTPSWG.js} +37 -21
- package/chunks/{get.action-IY7WSJMX.js → get.action-KUP32QJT.js} +13 -13
- package/chunks/{get.action-2AKMD4W3.js → get.action-ZOSML6XG.js} +12 -10
- package/chunks/{list.action-NRL2DDL5.js → list.action-Q5MPDR42.js} +15 -15
- package/chunks/{list.action-44YVCWKN.js → list.action-VYENIC5L.js} +13 -13
- package/chunks/{publish.action-E76MHLCN.js → publish.action-MBAZHQ2J.js} +48 -28
- package/chunks/{update.action-LZCAHAWW.js → update.action-BWMCXWQ5.js} +35 -21
- package/chunks/{update.action-FTTVWVAB.js → update.action-IEXVMUKG.js} +46 -26
- package/index.js +212 -127
- package/package.json +1 -1
- package/skills/scalar-cli/SKILL.md +4 -2
- package/template.md +220 -1
- package/chunks/action-BDDXF4YV.js +0 -38
- package/chunks/chunk-BOPEAS7H.js +0 -38
- package/chunks/chunk-EGOXR5FB.js +0 -15
- package/chunks/{action-UHXBY3RD.js → action-3P66ZSL3.js} +1 -1
package/package.json
CHANGED
|
@@ -5,14 +5,15 @@ description: "Operate the Scalar CLI (`scalar`, or `npx @scalar/cli`) to validat
|
|
|
5
5
|
|
|
6
6
|
# Scalar CLI
|
|
7
7
|
|
|
8
|
-
Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar (`@scalar/cli` 2.
|
|
8
|
+
Validate, lint, bundle, mock, and preview OpenAPI and AsyncAPI descriptions, and publish them to Scalar (`@scalar/cli` 2.13.1).
|
|
9
9
|
|
|
10
10
|
## Operating notes
|
|
11
11
|
|
|
12
12
|
- Run `scalar <command>` when the CLI is installed, or `npx @scalar/cli <command>` when it is not.
|
|
13
13
|
- Run `scalar context` for this command tree as JSON, or `scalar <command> --help` for a single command.
|
|
14
14
|
- Log in with a personal token: `scalar auth login --token <token>`, or set `SCALAR_API_KEY` and run `scalar auth login`. Both store the session on disk for later commands. Without a token, `scalar auth login` opens a browser and waits for a person to log in, so do not run it that way. Check the session with `scalar auth whoami`.
|
|
15
|
-
-
|
|
15
|
+
- Use --no-input before or after subcommands to disable prompts and browser launches, including under a PTY. Supply required values explicitly; missing inputs fail with exit code 1 and guidance. Piped input is never a confirmation. Cancelled prompts and EOF exit with code 1. The flag does not imply --yes or --force and neither option chooses an unspecified target.
|
|
16
|
+
- Many commands prompt when a value is left out, such as a slug, a team, or a confirmation before overwriting a file, and missing values fail when interaction is disabled. Pass every value as an argument or flag: for example `--output` on `document bundle` and `document upgrade`, `--yes` on `project rollback`, and `--force` on `project init`.
|
|
16
17
|
- Results go to stdout. Errors go to stderr, prefixed with `[ERROR]`.
|
|
17
18
|
|
|
18
19
|
## Exit codes
|
|
@@ -61,6 +62,7 @@ Run `scalar context` for the arguments, options, defaults, and choices of each c
|
|
|
61
62
|
- `scalar project publish [options]`: Publish a new build of a Scalar project
|
|
62
63
|
- `scalar project rollback [options]`: Roll the live deployment back to a previously deployed build.
|
|
63
64
|
- `scalar project deployments list [options]`: List production deployments for a project
|
|
65
|
+
- `scalar project deployments get [options] <build-id>`: Inspect an existing build in the selected team without resubmitting
|
|
64
66
|
- `scalar project upgrade [options] [config]`: Upgrade a Scalar Docs configuration
|
|
65
67
|
- `scalar registry publish [options] [file]`: Publish an OpenAPI description to the Scalar Registry
|
|
66
68
|
- `scalar registry update [options] [namespace] [slug]`: Update API description metadata in the Scalar Registry
|
package/template.md
CHANGED
|
@@ -38,7 +38,19 @@ scalar document bundle openapi.yaml --output - > openapi.bundled.yaml
|
|
|
38
38
|
|
|
39
39
|
Pulls every external `$ref` into a single file. `--treeShake` drops components nothing uses. The input can be a URL.
|
|
40
40
|
|
|
41
|
-
Use `--output -` (or `-o -`) to write
|
|
41
|
+
Use `--output -` (or `-o -`) to write to stdout for piping, preserving the root document’s JSON or YAML format. The format is detected from the document contents, including for URLs. Timings, diagnostics, and upgrade notices go to stderr. Without `--output`, local input requires an interactive overwrite confirmation; URL and non-interactive input require an explicit output destination.
|
|
42
|
+
|
|
43
|
+
### Format files or piped input
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
scalar document format openapi.yaml
|
|
47
|
+
scalar document format openapi.json --output -
|
|
48
|
+
cat openapi.yaml | scalar document format - --output openapi.json
|
|
49
|
+
cat openapi.json | scalar document format -
|
|
50
|
+
cat openapi.json | scalar document format - --output -
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use `-` to read JSON or YAML from stdin and `--output -` to write only document content to stdout in the input’s JSON or YAML format, with diagnostics and timings on stderr. Without `--output`, stdin is formatted to stdout in its original JSON or YAML format. JSON input produces two-space JSON; YAML input produces YAML. URL inputs require an explicit output destination. Named output files use YAML for `.yaml` or `.yml` extensions (case-insensitive), and two-space JSON otherwise. Without `--output`, a local input file is overwritten in place. Use `./-` to refer to a file literally named `-`.
|
|
42
54
|
|
|
43
55
|
### Preview the API reference
|
|
44
56
|
|
|
@@ -115,6 +127,22 @@ mkdir -p .claude/skills
|
|
|
115
127
|
cp -r "$(npm root -g)/@scalar/cli/skills/scalar-cli" .claude/skills/
|
|
116
128
|
```
|
|
117
129
|
|
|
130
|
+
## Noninteractive execution
|
|
131
|
+
|
|
132
|
+
Pass `--no-input` in scripts and agent commands, including when a pseudo-terminal (PTY) is attached:
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
scalar --no-input project create --name "My docs"
|
|
136
|
+
scalar project rollback --slug my-docs --yes --no-input
|
|
137
|
+
scalar document bundle openapi.yaml --output - --no-input
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The flag works before or after subcommands. It disables prompts and browser launches. Supply required arguments or options; missing input exits with code 1 and explains what to provide. Optional values retain their defaults, including the generated project slug. Piped data is never read as confirmation.
|
|
141
|
+
|
|
142
|
+
`--no-input` does not imply `--yes` (confirm an action) or `--force` (override a specific protection). Neither flag chooses an unspecified target. Prompt cancellation, Ctrl-C during a prompt, and EOF exit with code 1 and “Operation cancelled.”
|
|
143
|
+
|
|
144
|
+
For `auth login`, supply a personal token using the existing `SCALAR_API_KEY` source or `--token`; without one, noninteractive login fails before starting a browser or callback server. `project preview` still runs the requested preview server but never opens its browser under `--no-input`, even with an opening option. `readme` prints the documentation URL without launching a browser.
|
|
145
|
+
|
|
118
146
|
## Use in CI
|
|
119
147
|
|
|
120
148
|
```yml
|
|
@@ -150,3 +178,194 @@ authentication method (browser session or personal token). Use
|
|
|
150
178
|
`personal_token`). If the team name cannot be loaded, the team ID remains
|
|
151
179
|
available and JSON returns `null` for the name. Missing email or role values
|
|
152
180
|
also return `null`. Credentials are never included.
|
|
181
|
+
|
|
182
|
+
### Recover a project publish
|
|
183
|
+
|
|
184
|
+
`scalar project publish --slug my-docs` prints the accepted Build ID before waiting up to 600 seconds for deployment. Use `--timeout <seconds>` to change the wait (positive seconds, at most 2147483), or `--no-wait` to return immediately after acceptance. Do not combine `--no-wait` with `--timeout`.
|
|
185
|
+
|
|
186
|
+
Inspect the same production or preview build with the original team selected, without publishing again:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
scalar project deployments get BUILD_ID
|
|
190
|
+
scalar project deployments get BUILD_ID --wait --timeout 600
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
A one-shot inspection waits at most 30 seconds for its request unless overridden. It exits zero when the record was read, even if that record reports a failed build. With `--wait`, zero means deployed; a failed build, unavailable status, or expired deadline exits nonzero. `publish --no-wait` exits zero for acceptance, not completed deployment.
|
|
194
|
+
|
|
195
|
+
A status-query error or timeout means the outcome is unknown. Stopping local waiting, including Ctrl-C, does not cancel the remote build. Use the printed Build ID to inspect it later instead of resubmitting.
|
|
196
|
+
|
|
197
|
+
With `publish --json`, successful waiting returns one deployment result. With `--json --no-wait`, acceptance returns `{uid: string, status: "accepted"}`. JSON mode writes no progress to stdout; failures and recovery instructions go to stderr.
|
|
198
|
+
|
|
199
|
+
### Structured command results
|
|
200
|
+
|
|
201
|
+
Pass `--json` explicitly for machine output. Human output remains the default,
|
|
202
|
+
including when redirected. Success writes one newline-terminated JSON value to
|
|
203
|
+
stdout with exit code 0. Empty lists write `[]`. Failures write human-readable
|
|
204
|
+
diagnostics to stderr, exit nonzero, and do not write a success result to stdout.
|
|
205
|
+
JSON output contains no progress, colors, links, or upgrade notices. In JSON
|
|
206
|
+
mutation mode, missing inputs fail with the required flag instead of prompting,
|
|
207
|
+
even in a terminal.
|
|
208
|
+
|
|
209
|
+
#### List contracts
|
|
210
|
+
|
|
211
|
+
| Command | JSON value |
|
|
212
|
+
| ------------------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
213
|
+
| `team list --json` | Array of `{uid: string, name: string, current: boolean}` |
|
|
214
|
+
| `registry list --json` | Array of `{namespace: string, slug: string, title: string, version: string, isPrivate: boolean}` |
|
|
215
|
+
| `schema list --json` | Array of `{namespace: string, slug: string, title: string, version: string \| null, isPrivate: boolean}` |
|
|
216
|
+
| `sdk list --json` | Array of SDK metadata objects described below |
|
|
217
|
+
| `sdk get --slug <slug> --json` | One SDK metadata object |
|
|
218
|
+
|
|
219
|
+
Schema `version` is the greatest version by semantic-version comparison, or
|
|
220
|
+
`null` when no version exists. Registry `version` is the current version.
|
|
221
|
+
List order is unspecified. These list commands have no pagination flags,
|
|
222
|
+
continuation tokens, or incremental output: each invocation returns a single
|
|
223
|
+
array from the selected team or namespace. Do not interpret an empty array as
|
|
224
|
+
an authentication failure; authentication failures exit nonzero.
|
|
225
|
+
|
|
226
|
+
SDK metadata fields:
|
|
227
|
+
|
|
228
|
+
| Field | Type |
|
|
229
|
+
| -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
230
|
+
| `uid`, `namespace`, `slug`, `title`, `description`, `currentVersion` | string |
|
|
231
|
+
| `isPrivate` | boolean |
|
|
232
|
+
| `createdAt`, `updatedAt` | number, Unix seconds |
|
|
233
|
+
| `api` | `null` or `{uid: string, trackedVersion: string \| null, namespace: string \| null, slug: string \| null}` |
|
|
234
|
+
| `targets` | Array of `{language: string, slug?: string}` |
|
|
235
|
+
| `versions` | Array of version objects below |
|
|
236
|
+
| `latestBuild` | Latest build by creation time, or `null` when no build exists |
|
|
237
|
+
|
|
238
|
+
Each version has `version: string`, `apiVersion: string`, `status: string`,
|
|
239
|
+
`languages: string[]`, `createdAt: number | null`,
|
|
240
|
+
`publishedAt: number | null`, and `targets`, an array of
|
|
241
|
+
`{language: string, activeBuild: string | null, builtAt: number | null}`.
|
|
242
|
+
Each latest build has `uid: string`, `version: string`, `createdAt: number`,
|
|
243
|
+
`api: {uid: string, namespace: string, slug: string, version: string}`, and
|
|
244
|
+
`targets`, an array of
|
|
245
|
+
`{language: string, slug?: string, buildStatus: string, gitStatus: string | null}`.
|
|
246
|
+
All timestamps are Unix seconds. Optional target slugs are omitted when absent;
|
|
247
|
+
nullable fields are emitted as `null`. Source API coordinates are `null` when
|
|
248
|
+
the linked API no longer exists. SDK JSON fails if required build or source
|
|
249
|
+
metadata cannot be loaded. It excludes configuration, credentials, repository
|
|
250
|
+
authentication bindings, and build log messages.
|
|
251
|
+
|
|
252
|
+
#### Mutation contracts
|
|
253
|
+
|
|
254
|
+
| Command with `--json` | Success object |
|
|
255
|
+
| ------------------------------------ | ---------------------------------------------------- |
|
|
256
|
+
| `registry publish`, `schema publish` | `{uid, namespace, slug, version}` |
|
|
257
|
+
| `registry update` | `{namespace, slug, status: "updated"}` |
|
|
258
|
+
| `registry delete` | `{namespace, slug, deleted: true}` |
|
|
259
|
+
| `schema update`, `sdk update` | `{uid, namespace, slug, status: "updated"}` |
|
|
260
|
+
| `schema delete`, `sdk delete` | `{uid, namespace, slug, deleted: true}` |
|
|
261
|
+
| `sdk create` | `{uid}` |
|
|
262
|
+
| `sdk build` | `{uid, namespace, slug, version, status: "started"}` |
|
|
263
|
+
|
|
264
|
+
All identifiers, coordinates, versions and status values are strings, except
|
|
265
|
+
SDK build `version`, which can be `null` if the server does not return its
|
|
266
|
+
resolved version. `deleted` is a boolean. Fields shown in each success object
|
|
267
|
+
are always present. A build receipt means the server accepted the build request,
|
|
268
|
+
not that generation finished; no build ID is returned by that endpoint.
|
|
269
|
+
SDK create returns the new SDK UID without an additional metadata request.
|
|
270
|
+
Updates and deletes acknowledge the resolved target; they are not resource
|
|
271
|
+
snapshots. A transport failure can leave a mutation's outcome unknown, so inspect
|
|
272
|
+
the resource before retrying a write.
|
|
273
|
+
|
|
274
|
+
Supply the existing targeting flags and arguments, for example:
|
|
275
|
+
|
|
276
|
+
```sh
|
|
277
|
+
scalar registry list --namespace acme --json
|
|
278
|
+
scalar registry update acme widgets --title "Widgets API" --json
|
|
279
|
+
scalar schema publish schema.json --namespace acme --slug widget --title Widget --version 1.0.0 --json
|
|
280
|
+
scalar sdk create --namespace acme --api widgets --language typescript --json
|
|
281
|
+
scalar sdk build --namespace acme --slug widgets --json
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Team list UIDs can be passed directly to `scalar team set --team <uid>` when
|
|
285
|
+
using browser-session authentication. Personal tokens belong to one team and
|
|
286
|
+
cannot switch teams. Registry/schema list coordinates and SDK list slugs can
|
|
287
|
+
likewise be passed to their mutation commands.
|
|
288
|
+
|
|
289
|
+
#### Team and project results
|
|
290
|
+
|
|
291
|
+
The same explicit JSON mode, stdout/stderr separation, and noninteractive input
|
|
292
|
+
rules apply to the following commands. Existing team and project list/get output
|
|
293
|
+
is preserved.
|
|
294
|
+
|
|
295
|
+
| Command with `--json` | Result |
|
|
296
|
+
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
297
|
+
| `team set --team <uid>` | `{uid: string, name: string, current: true}` after switching the session |
|
|
298
|
+
| `project create --name <name>` | `{uid: string, slug: string, name: string}`; an omitted slug is generated by the server |
|
|
299
|
+
| `project init --subdomain <name>` | `{configPath: string, subdomain: string, files: string[], availabilityChecked: boolean}` |
|
|
300
|
+
| `project upgrade [config]` | `{configPath: string, changed: boolean, files: string[], dropped: string[]}` |
|
|
301
|
+
| `project publish --slug <slug>` | `{uid: string, status: "deployed", url: string \| null, preview: boolean, hasWarnings: boolean}` |
|
|
302
|
+
| `project rollback --slug <slug> --yes` | `{uid: string, projectUid: string, slug: string, status: "redeployed" \| "already-live"}` |
|
|
303
|
+
| `project deployments list --slug <slug>` | Array of `{uid: string, status: string, current: boolean, createdAt: number, deployedAt: number \| null, commitSha: string \| null}` |
|
|
304
|
+
|
|
305
|
+
Project init and upgrade return absolute paths. `files` lists the files written.
|
|
306
|
+
Initialization's `availabilityChecked: false` means no authenticated subdomain
|
|
307
|
+
availability check was performed, not that the subdomain was reserved.
|
|
308
|
+
Initialization still requires `--force` to overwrite an existing configuration.
|
|
309
|
+
An already-current config upgrade returns `changed: false`, `files: []`, and
|
|
310
|
+
`dropped: []`. A completed upgrade reports settings without a v2 equivalent in
|
|
311
|
+
`dropped`.
|
|
312
|
+
|
|
313
|
+
By default, project publish waits for the deployment to finish in both output modes.
|
|
314
|
+
With `--no-wait`, it returns after acceptance; JSON output is `{uid: string, status: "accepted"}`.
|
|
315
|
+
Its `uid` is the build ID. `url` is null when no public URL can be resolved.
|
|
316
|
+
Warnings about local configuration are sent to stderr; build warnings are
|
|
317
|
+
reported by `hasWarnings`. Failed or cancelled builds exit nonzero without a
|
|
318
|
+
success object. The behavior also applies to `--github` and `--preview`.
|
|
319
|
+
|
|
320
|
+
Rollback requires `--yes` before changing the live deployment. JSON does not
|
|
321
|
+
supply confirmation. `already-live` is a successful no-op and performs no
|
|
322
|
+
redeploy request; `redeployed` acknowledges a successful redeploy request.
|
|
323
|
+
Deployment history includes production builds only, newest creation time first,
|
|
324
|
+
with no pagination flags or continuation tokens. Empty history is `[]`.
|
|
325
|
+
Timestamps are Unix seconds; older records without a deployment timestamp use
|
|
326
|
+
`deployedAt: null`. The full `uid` can be passed to rollback's `--to`:
|
|
327
|
+
|
|
328
|
+
```sh
|
|
329
|
+
scalar project deployments list --slug docs --json
|
|
330
|
+
scalar project rollback --slug docs --to <build-id> --yes --json
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Existing `project list --json` returns an array sorted by slug, while
|
|
334
|
+
`project get <slug> --json` returns one object. Each object contains
|
|
335
|
+
`uid`, `name`, and `slug` (strings), `isPrivate` (boolean), `provider`
|
|
336
|
+
(`github`, `forgejo`, `bitbucket`, or `unlinked`), `repository` (null or
|
|
337
|
+
`{name: string, branch: string, configPath: string}`), and `activeDeployment`
|
|
338
|
+
(null or `{uid: string, domain: string, publishedAt: number}`, with Unix seconds).
|
|
339
|
+
Project listing follows service continuation cursors internally and prints no
|
|
340
|
+
partial list if a cursor or fetch fails. It merges legacy projects, preferring
|
|
341
|
+
unified projects with the same UID or slug.
|
|
342
|
+
|
|
343
|
+
#### Existing access-group contracts
|
|
344
|
+
|
|
345
|
+
Access-group JSON formats remain unchanged:
|
|
346
|
+
|
|
347
|
+
| Command with `--json` | Result |
|
|
348
|
+
| -------------------------------------------- | ----------------------------------------------------------------------- |
|
|
349
|
+
| `access-group list` | Array of group metadata objects; empty `[]` |
|
|
350
|
+
| `access-group get <slug>` | One group metadata object |
|
|
351
|
+
| `access-group create <slug>` | Group metadata plus `createdAt` and `updatedAt` (numbers, Unix seconds) |
|
|
352
|
+
| `access-group update <slug>` | `null` after success |
|
|
353
|
+
| `access-group delete <slug> --yes` | `null` after success |
|
|
354
|
+
| `access-group domain add <slug> <domain>` | `null` after success |
|
|
355
|
+
| `access-group domain remove <slug> <domain>` | `null` after success |
|
|
356
|
+
|
|
357
|
+
Group metadata is `{uid: string, name: string, slug: string,
|
|
358
|
+
allowedDomains: string[], allowedEmails: string[]}`. Ordering is unspecified;
|
|
359
|
+
no pagination flags or continuation tokens are exposed. Deletion requires
|
|
360
|
+
`--yes` in JSON mode even in a terminal. A successful `null` response is an
|
|
361
|
+
acknowledgement, not an empty list or a failed lookup; failures use stderr and a
|
|
362
|
+
nonzero exit status.
|
|
363
|
+
|
|
364
|
+
Long-running project preview, configuration validation, and raw file downloads
|
|
365
|
+
are not mutation-result streams and do not gain `--json` from this feature.
|
|
366
|
+
|
|
367
|
+
## File and download failures
|
|
368
|
+
|
|
369
|
+
URL input for `document format`, `upgrade`, `markdown`, `mock`, `serve`, `postman`, and `share`, plus Registry and schema publish input, has a 10-second download deadline. `registry get` and `schema get` use the same deadline. It includes reading the response body, but is not a total command runtime limit. Downloads are not automatically retried.
|
|
370
|
+
|
|
371
|
+
File and download failures report the input, a known cause when available, and a recovery step on stderr, with exit code 1. Diagnostic URLs omit credentials, query strings, and fragments. Remote error bodies are not echoed because they may contain credentials; HTTP status remains available. Successful document output is unchanged.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
apiService
|
|
4
|
-
} from "./chunk-2GKXAGSH.js";
|
|
5
|
-
import "./chunk-2AK5O3NQ.js";
|
|
6
|
-
import "./chunk-KPLWZIOV.js";
|
|
7
|
-
import "./chunk-YTTDYTVB.js";
|
|
8
|
-
import "./chunk-Y2OQOAY7.js";
|
|
9
|
-
import "./chunk-5ENKYZA4.js";
|
|
10
|
-
import "./chunk-IRA5BW2J.js";
|
|
11
|
-
import "./chunk-EXJUFF6G.js";
|
|
12
|
-
import "./chunk-FI7UKPRF.js";
|
|
13
|
-
import "./chunk-FYMDIB7J.js";
|
|
14
|
-
import "./chunk-IOW726L2.js";
|
|
15
|
-
import "./chunk-F3TQHNSQ.js";
|
|
16
|
-
import "./chunk-VRZSDUZK.js";
|
|
17
|
-
import "./chunk-TYNF7ROW.js";
|
|
18
|
-
import {
|
|
19
|
-
output
|
|
20
|
-
} from "./chunk-T5HJUAWB.js";
|
|
21
|
-
import "./chunk-AOZQPCWI.js";
|
|
22
|
-
import "./chunk-Q26DFKTY.js";
|
|
23
|
-
import "./chunk-I57ID5K7.js";
|
|
24
|
-
import "./chunk-3MZYUBJ6.js";
|
|
25
|
-
|
|
26
|
-
// src/domains/registry/delete/action.ts
|
|
27
|
-
async function deleteAction(namespace, slug) {
|
|
28
|
-
const client = await apiService();
|
|
29
|
-
const logger = output.info().line().loader("Deleting the API description\u2026");
|
|
30
|
-
const deleteDocument = await client.managedDocs.delete(namespace, slug);
|
|
31
|
-
if (deleteDocument.error) {
|
|
32
|
-
return output.error().title(deleteDocument.message).exit("error");
|
|
33
|
-
}
|
|
34
|
-
logger.update("loader", 0, { content: "API description deleted." }).print();
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
deleteAction
|
|
38
|
-
};
|
package/chunks/chunk-BOPEAS7H.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
registryUrl
|
|
4
|
-
} from "./chunk-LEECPQZN.js";
|
|
5
|
-
|
|
6
|
-
// src/domains/registry/helpers/fetch.ts
|
|
7
|
-
async function fetchFromRegistry(path, accessToken) {
|
|
8
|
-
let response;
|
|
9
|
-
try {
|
|
10
|
-
response = await fetch(registryUrl(path), {
|
|
11
|
-
headers: {
|
|
12
|
-
"x-scalar-auth": accessToken
|
|
13
|
-
},
|
|
14
|
-
// Should always error on redirect
|
|
15
|
-
redirect: "error"
|
|
16
|
-
});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
return {
|
|
19
|
-
error: true,
|
|
20
|
-
message: error instanceof Error && error.message.length > 0 ? error.message : "Registry request failed before a response was received."
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
if (!response.ok) {
|
|
24
|
-
const message = await response.text();
|
|
25
|
-
return {
|
|
26
|
-
error: true,
|
|
27
|
-
message: message.length ? message : `Registry request failed with status ${response.status}.`
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
error: false,
|
|
32
|
-
data: await response.text()
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
fetchFromRegistry
|
|
38
|
-
};
|
package/chunks/chunk-EGOXR5FB.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRequire as $$cR } from "node:module"; const require = $$cR(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
output
|
|
4
|
-
} from "./chunk-T5HJUAWB.js";
|
|
5
|
-
|
|
6
|
-
// src/helpers/interactive.ts
|
|
7
|
-
function requireInteractive(message) {
|
|
8
|
-
if (!process.stdin.isTTY) {
|
|
9
|
-
output.error().title("Missing input").message(message).exit("error");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
requireInteractive
|
|
15
|
-
};
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
renderConfigError
|
|
5
5
|
} from "./chunk-4YQVGOHX.js";
|
|
6
6
|
import "./chunk-MQ65WBVF.js";
|
|
7
|
-
import "./chunk-5ENKYZA4.js";
|
|
8
7
|
import "./chunk-VRZSDUZK.js";
|
|
9
8
|
import {
|
|
10
9
|
output
|
|
11
10
|
} from "./chunk-T5HJUAWB.js";
|
|
11
|
+
import "./chunk-5ENKYZA4.js";
|
|
12
12
|
import "./chunk-I57ID5K7.js";
|
|
13
13
|
import "./chunk-3MZYUBJ6.js";
|
|
14
14
|
|