@tryarcanist/cli 0.1.169 → 0.1.171
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 +3 -0
- package/dist/index.js +30 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -363,6 +363,9 @@ arcanist tokens create --scope read --expires-in-days 30 --json
|
|
|
363
363
|
arcanist tokens create --scope read --idempotency-key 1f0e6f1a-...
|
|
364
364
|
```
|
|
365
365
|
|
|
366
|
+
JSON mode returns `{ok, token, id, scope}`.
|
|
367
|
+
The plaintext token is shown only once.
|
|
368
|
+
Use `--idempotency-key <uuid>` when manually retrying a token create whose first response may have been lost; duplicate keys return `duplicate_request` rather than replaying the raw token.
|
|
366
369
|
Read-scoped tokens cannot create write-scoped tokens; the server enforces that and returns 403.
|
|
367
370
|
|
|
368
371
|
### `arcanist tokens revoke <id>`
|
package/dist/index.js
CHANGED
|
@@ -4191,7 +4191,7 @@ async function waitForBuild(config, businessId, buildId, options) {
|
|
|
4191
4191
|
if (options.follow) {
|
|
4192
4192
|
const logs = await apiFetch(config, buildLogsPath(businessId, buildId, { afterSequence }));
|
|
4193
4193
|
if (logs.logs.length > 0) {
|
|
4194
|
-
if (options.json) writeJson({
|
|
4194
|
+
if (options.json) writeJson({ type: "logs", logs: logs.logs });
|
|
4195
4195
|
else printLogs(logs.logs);
|
|
4196
4196
|
afterSequence = logs.logs[logs.logs.length - 1].sequence;
|
|
4197
4197
|
}
|
|
@@ -4341,15 +4341,18 @@ async function sandboxBuildCommand(sourceRepoArg, options = {}, command) {
|
|
|
4341
4341
|
}
|
|
4342
4342
|
throw err;
|
|
4343
4343
|
}
|
|
4344
|
-
emit(command, options, payload, (buildPayload) => printBuildRequest(buildPayload.buildRequest));
|
|
4345
|
-
if (!options.wait && !options.follow) return;
|
|
4346
4344
|
const json = isJson(command, options);
|
|
4345
|
+
if (!(json && options.follow)) {
|
|
4346
|
+
emit(command, options, payload, (buildPayload) => printBuildRequest(buildPayload.buildRequest));
|
|
4347
|
+
}
|
|
4348
|
+
if (!options.wait && !options.follow) return;
|
|
4347
4349
|
const finalBuild = await waitForBuild(config, businessId, payload.buildRequest.id, {
|
|
4348
4350
|
follow: options.follow,
|
|
4349
4351
|
pollIntervalMs: parsePollInterval2(options.pollInterval),
|
|
4350
4352
|
json
|
|
4351
4353
|
});
|
|
4352
|
-
if (json)
|
|
4354
|
+
if (json)
|
|
4355
|
+
writeJson(options.follow ? { type: "build", buildRequest: finalBuild } : { ok: true, buildRequest: finalBuild });
|
|
4353
4356
|
else printTerminalBuildSummary(finalBuild);
|
|
4354
4357
|
if (finalBuild.status !== "completed") {
|
|
4355
4358
|
process.exitCode = 1;
|
|
@@ -4461,8 +4464,10 @@ async function sandboxLogsCommand(buildId, options = {}, command) {
|
|
|
4461
4464
|
config,
|
|
4462
4465
|
buildLogsPath(businessId, buildId, { afterSequence, limit })
|
|
4463
4466
|
);
|
|
4464
|
-
if (
|
|
4465
|
-
|
|
4467
|
+
if (payload.logs.length > 0 || !options.follow) {
|
|
4468
|
+
if (isJson(command, options)) writeJson(options.follow ? { type: "logs", logs: payload.logs } : payload);
|
|
4469
|
+
else printLogs(payload.logs);
|
|
4470
|
+
}
|
|
4466
4471
|
if (!options.follow) return;
|
|
4467
4472
|
if (payload.logs.length > 0) afterSequence = payload.logs[payload.logs.length - 1].sequence;
|
|
4468
4473
|
await sleep(parsePollInterval2(options.pollInterval));
|
|
@@ -5096,10 +5101,27 @@ Examples:
|
|
|
5096
5101
|
var sandbox = program.command("sandbox").description("Sandbox layer commands");
|
|
5097
5102
|
sandbox.command("init").description("Create sandbox layer source files").action((options, command) => sandboxInitCommand(options, command));
|
|
5098
5103
|
sandbox.command("validate").description("Validate local sandbox layer source files").option("--manifest <path>", "Manifest path", ".arcanist/sandbox.yaml").action((options, command) => sandboxValidateCommand(options, command));
|
|
5099
|
-
sandbox.command("build").description("Build a repo-sourced sandbox layer").argument("[source-repo]", "Source repository owner/name; defaults to current git remote").option("--manifest <path>", "Manifest path", ".arcanist/sandbox.yaml").option("--ref <ref>", "Git ref to build").option("--target-repo <repo>", "Target repository owner/name for resource-profile coverage").option("--business <id>", "Business ID; defaults to authenticated user's business").option("--wait", "Wait for the build to finish").option("--follow", "Follow logs while waiting").option("--poll-interval <ms>", "Polling interval in milliseconds").option("--idempotency-key <uuid>", "Request idempotency key for safe manual retries").
|
|
5104
|
+
sandbox.command("build").description("Build a repo-sourced sandbox layer").argument("[source-repo]", "Source repository owner/name; defaults to current git remote").option("--manifest <path>", "Manifest path", ".arcanist/sandbox.yaml").option("--ref <ref>", "Git ref to build").option("--target-repo <repo>", "Target repository owner/name for resource-profile coverage").option("--business <id>", "Business ID; defaults to authenticated user's business").option("--wait", "Wait for the build to finish").option("--follow", "Follow logs while waiting").option("--poll-interval <ms>", "Polling interval in milliseconds").option("--idempotency-key <uuid>", "Request idempotency key for safe manual retries").addHelpText(
|
|
5105
|
+
"after",
|
|
5106
|
+
`
|
|
5107
|
+
JSON:
|
|
5108
|
+
Without --wait and --follow, --json prints one object: {ok, buildRequest}
|
|
5109
|
+
With --wait and without --follow, --json prints two objects: initial {ok, buildRequest} then terminal {ok, buildRequest}
|
|
5110
|
+
With --follow, --json emits NDJSON:
|
|
5111
|
+
{type:"logs", logs:[...]}
|
|
5112
|
+
{type:"build", buildRequest:{...}}
|
|
5113
|
+
`
|
|
5114
|
+
).action((sourceRepo, options, command) => sandboxBuildCommand(sourceRepo, options, command));
|
|
5100
5115
|
sandbox.command("status").description("Show sandbox layer status").argument("[repo]", "Repository owner/name; defaults to current git remote").option("--business <id>", "Business ID; defaults to authenticated user's business").action((repo, options, command) => sandboxStatusCommand(repo, options, command));
|
|
5101
5116
|
sandbox.command("history").description("Show sandbox layer build history").argument("[source-repo]", "Source repository owner/name; defaults to current git remote").option("--business <id>", "Business ID; defaults to authenticated user's business").option("--target-repo <repo>", "Target repository owner/name for resource-profile coverage").option("--status <status>", "Filter by build status").option("--limit <n>", "Maximum builds to return").action((sourceRepo, options, command) => sandboxHistoryCommand(sourceRepo, options, command));
|
|
5102
|
-
sandbox.command("logs").description("Print sandbox layer build logs").argument("<build-id>", "Build ID").option("--business <id>", "Business ID; defaults to authenticated user's business").option("--follow", "Follow logs").option("--after-sequence <n>", "Return logs after this sequence").option("--limit <n>", "Maximum log chunks to return").option("--poll-interval <ms>", "Polling interval in milliseconds").
|
|
5117
|
+
sandbox.command("logs").description("Print sandbox layer build logs").argument("<build-id>", "Build ID").option("--business <id>", "Business ID; defaults to authenticated user's business").option("--follow", "Follow logs").option("--after-sequence <n>", "Return logs after this sequence").option("--limit <n>", "Maximum log chunks to return").option("--poll-interval <ms>", "Polling interval in milliseconds").addHelpText(
|
|
5118
|
+
"after",
|
|
5119
|
+
`
|
|
5120
|
+
JSON:
|
|
5121
|
+
Without --follow, --json prints one object: {ok, logs}
|
|
5122
|
+
With --follow, --json emits NDJSON lines for non-empty batches: {type:"logs", logs:[...]}
|
|
5123
|
+
`
|
|
5124
|
+
).action((buildId, options, command) => sandboxLogsCommand(buildId, options, command));
|
|
5103
5125
|
sandbox.command("rebuild-stale").description("Create stale sandbox template rebuild campaigns").option("--business <id>", "Business ID to scan; defaults to authenticated user's business").option("--all", "Scan all businesses").option("--dry-run", "Preview stale rebuilds without queueing provider builds").option("--yes", "Start a rebuild campaign").option("--follow", "Follow campaign progress").action((options, command) => sandboxRebuildStaleCommand(options, command));
|
|
5104
5126
|
var sandboxAssign = sandbox.command("assign").description("Assign sandbox layer sources");
|
|
5105
5127
|
sandboxAssign.command("default").description("Set the business default sandbox layer source").argument("<source-repo>", "Source repository owner/name").option("--manifest <path>", "Manifest path", ".arcanist/sandbox.yaml").option("--business <id>", "Business ID; defaults to authenticated user's business").action((sourceRepo, options, command) => sandboxAssignDefaultCommand(sourceRepo, options, command));
|