chapa-cli 0.2.5 → 0.2.6

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 +11 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -332,13 +332,17 @@ function restoreTls(insecure, original) {
332
332
  }
333
333
  }
334
334
  var TLS_ERROR_PATTERNS = [
335
+ // Node.js error codes (uppercase)
335
336
  "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
336
337
  "CERT_HAS_EXPIRED",
337
338
  "DEPTH_ZERO_SELF_SIGNED_CERT",
338
339
  "SELF_SIGNED_CERT_IN_CHAIN",
339
340
  "ERR_TLS_CERT_ALTNAME_INVALID",
340
341
  "CERTIFICATE_VERIFY_FAILED",
341
- "SSL"
342
+ // Human-readable messages (lowercase, as returned by Node.js fetch)
343
+ "self-signed certificate",
344
+ "unable to verify",
345
+ "certificate has expired"
342
346
  ];
343
347
  function isTlsError(message) {
344
348
  return TLS_ERROR_PATTERNS.some((p) => message.includes(p));
@@ -353,13 +357,15 @@ function getRootErrorMessage(err) {
353
357
  return message;
354
358
  }
355
359
  function getFullErrorChain(err) {
356
- const messages = [];
360
+ const parts = [];
357
361
  let current = err;
358
362
  while (current instanceof Error) {
359
- messages.push(current.message);
363
+ parts.push(current.message);
364
+ const code = current.code;
365
+ if (code) parts.push(code);
360
366
  current = current.cause;
361
367
  }
362
- return messages.join(" | ");
368
+ return parts.join(" | ");
363
369
  }
364
370
  async function login(serverUrl, opts = {}) {
365
371
  const { verbose = false, insecure = false } = opts;
@@ -442,7 +448,7 @@ Logged in as ${data.handle}!`);
442
448
  }
443
449
 
444
450
  // src/index.ts
445
- var VERSION = true ? "0.2.5" : "0.0.0-dev";
451
+ var VERSION = true ? "0.2.6" : "0.0.0-dev";
446
452
  var HELP_TEXT = `chapa-cli v${VERSION}
447
453
 
448
454
  Merge GitHub EMU (Enterprise Managed User) contributions into your Chapa badge.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chapa-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Merge GitHub EMU contributions into your Chapa developer impact badge",
5
5
  "type": "module",
6
6
  "bin": {