@buildinternet/uploads 0.16.1 → 0.18.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 +7 -0
- package/dist/commands.js +14 -2
- package/dist/github.js +5 -0
- package/package.json +1 -1
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/dist/github.js
CHANGED
|
@@ -99,6 +99,11 @@ export function ghMetadataForBranch(repo, branch, now = new Date()) {
|
|
|
99
99
|
"gh.kind": "branch",
|
|
100
100
|
"gh.branch": branchLower,
|
|
101
101
|
"gh.staged-at": now.toISOString().replace(/\.\d{3}Z$/, "Z"),
|
|
102
|
+
// Lifecycle tag (issue #339): flipped to "promoted" by server-side
|
|
103
|
+
// promotion, so "in-flight staged media" is a plain equality query
|
|
104
|
+
// (`meta.gh.status=staged`) — the metadata filter API can't express
|
|
105
|
+
// "gh.promoted-at absent".
|
|
106
|
+
"gh.status": "staged",
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
109
|
/**
|