@nolto/cli 0.13.0 → 0.13.2

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -60,6 +60,15 @@ function mapHttpStatusToCliError(status, opts = {}) {
60
60
  status
61
61
  );
62
62
  }
63
+ if (status === 409 && opts.serverError === "roadmap_conflict") {
64
+ const stored = opts.storedUpdatedAt ? ` (server updatedAt: ${opts.storedUpdatedAt})` : "";
65
+ return new CliError(
66
+ (opts.serverMessage ?? "The roadmap on the server is newer than this checkout.") + stored,
67
+ 2,
68
+ "Run `nolto diff` to see what differs. To take the server version: `nolto pull`. To keep this checkout as the source of truth: set `updatedAt` in the roadmap JSON to the current time and run `nolto sync` again.",
69
+ status
70
+ );
71
+ }
63
72
  if (status === 409 && opts.serverError === "project_archived") {
64
73
  return new CliError(
65
74
  opts.serverMessage ?? "This project is archived.",
@@ -112,7 +121,8 @@ function mapHttpStatusToCliError(status, opts = {}) {
112
121
  const waitMsg = opts.retryAfter ? ` Retry-After: ${opts.retryAfter}s` : "";
113
122
  return new CliError(`${opts.serverMessage ?? "Rate limit exceeded."}${waitMsg}`, 4, void 0, status);
114
123
  }
115
- return new CliError(`Server returned HTTP ${status}`, 5, void 0, status);
124
+ const reason = opts.serverMessage ?? opts.serverError;
125
+ return new CliError(reason ? `Server returned HTTP ${status}: ${reason}` : `Server returned HTTP ${status}`, 5, void 0, status);
116
126
  }
117
127
  function isNetworkError(err) {
118
128
  if (!(err instanceof Error)) {
@@ -383,6 +393,7 @@ function createHttpClient(opts) {
383
393
  wwwAuthenticate,
384
394
  serverError: typeof errorBody?.["error"] === "string" ? errorBody["error"] : void 0,
385
395
  serverMessage: typeof errorBody?.["message"] === "string" ? errorBody["message"] : void 0,
396
+ storedUpdatedAt: typeof errorBody?.["storedUpdatedAt"] === "string" ? errorBody["storedUpdatedAt"] : void 0,
386
397
  upgradeUrl: typeof errorBody?.["upgradeUrl"] === "string" ? errorBody["upgradeUrl"] : void 0
387
398
  });
388
399
  }
@@ -3667,6 +3678,9 @@ function buildProgram(deps) {
3667
3678
  register9(program, deps);
3668
3679
  register10(program, deps);
3669
3680
  register11(program);
3681
+ program.action(() => {
3682
+ program.help();
3683
+ });
3670
3684
  program.hook("preAction", (_thisCommand, actionCommand) => {
3671
3685
  const bindingError = deps.repoBinding?.error;
3672
3686
  const bindingExemptCommands = ["init", "link", "update", "merge-file"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolto/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "CLI for syncing repository roadmaps with Nolto.",
5
5
  "license": "MIT",
6
6
  "type": "module",