@buildinternet/uploads 0.16.1 → 0.17.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/client.d.ts CHANGED
@@ -236,6 +236,13 @@ export interface GithubHealthResult {
236
236
  events: string[] | null;
237
237
  missingEvents: string[];
238
238
  requiredEvents: string[];
239
+ /**
240
+ * Recommended-but-non-gating events, e.g. `issue_comment` (issue #333).
241
+ * Optional: older servers' health payload predates this field — treat a
242
+ * missing field as "no recommendations", not an error.
243
+ */
244
+ recommendedEvents?: string[];
245
+ missingRecommendedEvents?: string[];
239
246
  hint?: string;
240
247
  }
241
248
  export interface UsageResult {
package/dist/commands.js CHANGED
@@ -1755,6 +1755,16 @@ Examples:
1755
1755
  uploads github unlink --repo buildinternet/uploads
1756
1756
  uploads github doctor
1757
1757
  `;
1758
+ /** Older servers' health payload predates recommendedEvents/missingRecommendedEvents — treat as no recommendations rather than crashing. */
1759
+ function missingRecommendedEventsOf(result) {
1760
+ return Array.isArray(result.missingRecommendedEvents) ? result.missingRecommendedEvents : [];
1761
+ }
1762
+ function recommendedNoteLine(result) {
1763
+ const missing = missingRecommendedEventsOf(result);
1764
+ if (missing.length === 0)
1765
+ return "";
1766
+ return `note: not subscribed to ${missing.join(", ")} (recommended) — enables bot-comment self-healing; subscribe under the App's Permissions & events\n`;
1767
+ }
1758
1768
  function formatGithubDoctor(result) {
1759
1769
  if (!result.configured) {
1760
1770
  return `github app: not configured on this server${result.hint ? ` — ${result.hint}` : ""}\n`;
@@ -1763,10 +1773,12 @@ function formatGithubDoctor(result) {
1763
1773
  return `github app: configured, but health check failed${result.hint ? ` — ${result.hint}` : ""}\n`;
1764
1774
  }
1765
1775
  if (result.ok) {
1766
- return `github app: ok — subscribed to ${result.requiredEvents.join(", ")}\n`;
1776
+ return (`github app: ok — subscribed to ${result.requiredEvents.join(", ")}\n` +
1777
+ recommendedNoteLine(result));
1767
1778
  }
1768
1779
  return (`github app: missing webhook event subscription(s): ${result.missingEvents.join(", ")}\n` +
1769
- (result.hint ? ` ${result.hint}\n` : ""));
1780
+ (result.hint ? ` ${result.hint}\n` : "") +
1781
+ recommendedNoteLine(result));
1770
1782
  }
1771
1783
  function formatGithubLink(repo, result) {
1772
1784
  return result.workspace
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/uploads",
3
- "version": "0.16.1",
3
+ "version": "0.17.0",
4
4
  "description": "CLI and client for uploads.sh — workspace-scoped image hosting for GitHub embeds",
5
5
  "type": "module",
6
6
  "sideEffects": false,