chofex-cli 0.1.39 → 0.1.41

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 +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -59518,7 +59518,7 @@ ${details}`;
59518
59518
  Details:
59519
59519
  ${JSON.stringify(details, null, 2)}`;
59520
59520
  };
59521
- var execute = (mode, operation, human) => operation.pipe(exports_Effect.flatMap((response) => {
59521
+ var execute = (mode, operation, human, humanError) => operation.pipe(exports_Effect.flatMap((response) => {
59522
59522
  if (mode === "json")
59523
59523
  return printJson(response);
59524
59524
  return exports_Console.log(human(response.data));
@@ -59537,10 +59537,21 @@ var execute = (mode, operation, human) => operation.pipe(exports_Effect.flatMap(
59537
59537
  }
59538
59538
  });
59539
59539
  }
59540
+ const customMessage = humanError?.(error2);
59541
+ if (customMessage !== undefined) {
59542
+ return exports_Console.error(`${customMessage}
59543
+ Request ID: ${error2.requestId}`);
59544
+ }
59540
59545
  const details = humanErrorDetails(error2.details);
59541
59546
  return exports_Console.error(`Error [${error2.code}]: ${error2.message}${details}
59542
59547
  Request ID: ${error2.requestId}`);
59543
59548
  }));
59549
+ var registrationLookupErrorText = (error2) => {
59550
+ if (error2.code !== "REGISTRATION_NOT_FOUND")
59551
+ return;
59552
+ return `No registration found.
59553
+ Next command: chofex register`;
59554
+ };
59544
59555
  var requirementsText = (result3) => {
59545
59556
  const { registration, requirements } = result3;
59546
59557
  if (registration.status === "withdrawn") {
@@ -61305,7 +61316,7 @@ var statusCommand = exports_Command.make("status", {}, exports_Effect.fn("status
61305
61316
  const token = exports_Option.getOrUndefined(options.token);
61306
61317
  return yield* getRegistration({ apiUrl: options.apiUrl, token });
61307
61318
  });
61308
- yield* execute(options.output, operation, registrationText);
61319
+ yield* execute(options.output, operation, registrationText, registrationLookupErrorText);
61309
61320
  })).pipe(exports_Command.withDescription("Show your latest application and next steps"));
61310
61321
  var requirementsCommand = exports_Command.make("requirements", {}, exports_Effect.fn("requirementsCommand")(function* () {
61311
61322
  const options = yield* root;
@@ -61313,7 +61324,7 @@ var requirementsCommand = exports_Command.make("requirements", {}, exports_Effec
61313
61324
  const token = exports_Option.getOrUndefined(options.token);
61314
61325
  return yield* getRegistration({ apiUrl: options.apiUrl, token });
61315
61326
  });
61316
- yield* execute(options.output, operation, requirementsOnlyText);
61327
+ yield* execute(options.output, operation, requirementsOnlyText, registrationLookupErrorText);
61317
61328
  })).pipe(exports_Command.withDescription("Show information you still need to provide"));
61318
61329
  var badgeCommand = exports_Command.make("badge", {}, exports_Effect.fn("badgeCommand")(function* () {
61319
61330
  const options = yield* root;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chofex-cli",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "description": "Command-line client for the Chofex Hackathon",
5
5
  "type": "module",
6
6
  "bin": {