@dropthis/cli 0.3.5 → 0.4.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/dist/cli.cjs CHANGED
@@ -93,11 +93,14 @@ function apiErrorEnvelope(error2) {
93
93
  ...error2.param ? { param: error2.param } : {},
94
94
  ...error2.currentRevision !== void 0 ? { current_revision: error2.currentRevision } : {},
95
95
  ...error2.requestId ? { request_id: error2.requestId } : {},
96
+ ...error2.suggestion ? { suggestion: error2.suggestion } : {},
97
+ ...error2.retryable !== void 0 && error2.retryable !== null ? { retryable: error2.retryable } : {},
96
98
  next_action: nextActionForApiError(error2)
97
99
  }
98
100
  };
99
101
  }
100
102
  function nextActionForApiError(error2) {
103
+ if (error2.suggestion) return error2.suggestion;
101
104
  const uploadNextAction = error2.code ? UPLOAD_NEXT_ACTIONS[error2.code] : void 0;
102
105
  if (uploadNextAction) return uploadNextAction;
103
106
  if (error2.code === "revision_conflict") {
@@ -221,8 +224,11 @@ function writeApiError(deps, details) {
221
224
  if (deps.outputMode === "human") {
222
225
  deps.stderr(`${error(details.message)}
223
226
  `);
224
- const nextAction = details.requestId ? `Request ID: ${details.requestId}` : void 0;
227
+ const nextAction = nextActionForApiError(details);
225
228
  if (nextAction) deps.stderr(`${hint(nextAction)}
229
+ `);
230
+ if (details.requestId)
231
+ deps.stderr(`${import_picocolors2.default.dim(`Request ID: ${details.requestId}`)}
226
232
  `);
227
233
  } else {
228
234
  deps.stderr(`${JSON.stringify(apiErrorEnvelope(details))}
@@ -555,13 +561,13 @@ async function runDoctor(_input, deps) {
555
561
  const authSource = credential?.source ?? "missing";
556
562
  const storageBackend = stored?.storage ?? "none";
557
563
  const pairs = [
558
- ["Version", "0.3.5"],
564
+ ["Version", "0.4.0"],
559
565
  ["Auth", authSource],
560
566
  ["Storage", storageBackend]
561
567
  ];
562
568
  writeKv(deps, pairs, {
563
569
  ok: true,
564
- version: "0.3.5",
570
+ version: "0.4.0",
565
571
  auth: { source: authSource },
566
572
  storage: { backend: storageBackend }
567
573
  });
@@ -1415,7 +1421,7 @@ function buildProgram(options = {}) {
1415
1421
  ` ${import_picocolors4.default.cyan("dropthis login")}`,
1416
1422
  ` ${import_picocolors4.default.cyan("dropthis publish ./dist")}`
1417
1423
  ].join("\n")
1418
- ).version("0.3.5").configureHelp({
1424
+ ).version("0.4.0").configureHelp({
1419
1425
  subcommandTerm(cmd) {
1420
1426
  const args = cmd.registeredArguments.map((a) => {
1421
1427
  const name = a.name();