@dropthis/cli 0.24.1 → 0.26.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 CHANGED
@@ -333,7 +333,7 @@ Reports CLI version, auth source (`env`, `flag`, `storage`, or `missing`), and c
333
333
 
334
334
  Connecting a custom domain (`dropthis domains connect`) requires the Pro plan (1 hostname). Domains already connected keep working regardless of plan.
335
335
 
336
- `dropthis account` shows your active tier and its limits.
336
+ `dropthis account` shows your active tier, its limits, and the workspace your key is bound to. If the workspace `kind` is `team`, your publishes land under the team's shared custom domain automatically — no extra flags needed.
337
337
 
338
338
  ## Agent skills
339
339
 
package/dist/cli.cjs CHANGED
@@ -159,6 +159,18 @@ __export(cli_exports, {
159
159
  module.exports = __toCommonJS(cli_exports);
160
160
 
161
161
  // src/output.ts
162
+ function failuresFromApiError(error2) {
163
+ const body = error2.body;
164
+ const raw = body && typeof body === "object" ? body.failures : void 0;
165
+ if (!Array.isArray(raw)) return [];
166
+ return raw.filter(
167
+ (f) => !!f && typeof f === "object" && typeof f.path === "string" && f.path.length > 0
168
+ ).map((f) => ({
169
+ path: String(f.path),
170
+ reason: String(f.reason ?? "unknown"),
171
+ ...typeof f.source_url === "string" ? { sourceUrl: f.source_url } : {}
172
+ }));
173
+ }
162
174
  var UPLOAD_NEXT_ACTIONS = {
163
175
  upload_expired: "Create a new upload session and retry the publish.",
164
176
  upload_already_used: "Create a new upload session; upload sessions are single-use.",
@@ -181,6 +193,7 @@ function errorEnvelope(code, message, nextAction) {
181
193
  };
182
194
  }
183
195
  function apiErrorEnvelope(error2) {
196
+ const failures = failuresFromApiError(error2);
184
197
  return {
185
198
  ok: false,
186
199
  error: {
@@ -193,6 +206,7 @@ function apiErrorEnvelope(error2) {
193
206
  ...error2.requestId ? { request_id: error2.requestId } : {},
194
207
  ...error2.suggestion ? { suggestion: error2.suggestion } : {},
195
208
  ...error2.retryable !== void 0 && error2.retryable !== null ? { retryable: error2.retryable } : {},
209
+ ...failures.length ? { failures } : {},
196
210
  next_action: nextActionForApiError(error2)
197
211
  }
198
212
  };
@@ -423,6 +437,11 @@ function writeApiError(deps, details) {
423
437
  if (deps.outputMode === "human") {
424
438
  deps.stderr(`${error(details.message)}
425
439
  `);
440
+ const failures = failuresFromApiError(details);
441
+ for (const f of failures) {
442
+ deps.stderr(` ${f.path}: ${f.reason}
443
+ `);
444
+ }
426
445
  const nextAction = nextActionForApiError(details, "human");
427
446
  if (nextAction) deps.stderr(`${hint(nextAction)}
428
447
  `);
@@ -490,6 +509,11 @@ async function runAccountGet(_input, deps) {
490
509
  if (data?.status) pairs.push(["Status", String(data.status)]);
491
510
  if (data?.createdAt)
492
511
  pairs.push(["Created", String(data.createdAt).split("T")[0]]);
512
+ const ws = data?.workspace;
513
+ if (ws?.name) {
514
+ const role = ws.role ? ` \xB7 your role: ${String(ws.role)}` : "";
515
+ pairs.push(["Workspace", `${String(ws.name)} (${String(ws.kind)})${role}`]);
516
+ }
493
517
  const usage = data?.usage;
494
518
  const limits = data?.limits;
495
519
  if (typeof usage?.storageUsedBytes === "number") {
@@ -918,13 +942,13 @@ async function runDoctor(_input, deps) {
918
942
  const authSource = credential?.source ?? "missing";
919
943
  const storageBackend = stored?.storage ?? "none";
920
944
  const pairs = [
921
- ["Version", "0.24.1"],
945
+ ["Version", "0.26.0"],
922
946
  ["Auth", authSource],
923
947
  ["Storage", storageBackend]
924
948
  ];
925
949
  writeKv(deps, pairs, {
926
950
  ok: true,
927
- version: "0.24.1",
951
+ version: "0.26.0",
928
952
  auth: { source: authSource },
929
953
  storage: { backend: storageBackend }
930
954
  });
@@ -2777,7 +2801,7 @@ function buildProgram(options = {}) {
2777
2801
  ` ${import_picocolors6.default.cyan("dropthis login")}`,
2778
2802
  ` ${import_picocolors6.default.cyan("dropthis publish ./dist")}`
2779
2803
  ].join("\n")
2780
- ).version("0.24.1").configureHelp({
2804
+ ).version("0.26.0").configureHelp({
2781
2805
  subcommandTerm(cmd) {
2782
2806
  const args = cmd.registeredArguments.map((a) => {
2783
2807
  const name = a.name();
@@ -3379,7 +3403,7 @@ ${import_picocolors6.default.bold("Canonical vs raw URLs:")}`,
3379
3403
  );
3380
3404
  const result = await runUpgrade(commandOptions, {
3381
3405
  ...deps,
3382
- currentVersion: "0.24.1"
3406
+ currentVersion: "0.26.0"
3383
3407
  });
3384
3408
  process.exitCode = result.exitCode;
3385
3409
  });
@@ -3633,7 +3657,7 @@ var showNotice = shouldShowNotice({
3633
3657
  if (showNotice) {
3634
3658
  const notice = noticeFromCache({
3635
3659
  cache: updateCache,
3636
- currentVersion: "0.24.1"
3660
+ currentVersion: "0.26.0"
3637
3661
  });
3638
3662
  if (notice) {
3639
3663
  process.stderr.write(`