@app-vitals/agent-lib 1.20.1 → 1.22.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/admin-types.ts +5 -1
- package/admin-types.unit.test.ts +35 -0
- package/package.json +1 -1
package/admin-types.ts
CHANGED
|
@@ -3448,7 +3448,7 @@ export interface paths {
|
|
|
3448
3448
|
put?: never;
|
|
3449
3449
|
/**
|
|
3450
3450
|
* Install an agent's App on an organization
|
|
3451
|
-
* @description Admin-only.
|
|
3451
|
+
* @description Admin-only. Uses the agent's stored GH_APP_CLIENT_ID when set; otherwise resolves the stored GH_APP_SLUG and looks the App up through the public GET /apps/{slug} to get its client id. Installs it on the org with the installer App. 422 for an agent with neither a stored client id nor a slug, and for a private App (not visible to the public lookup) with no stored client id; 409 when the installer App is not configured.
|
|
3452
3452
|
*/
|
|
3453
3453
|
post: {
|
|
3454
3454
|
parameters: {
|
|
@@ -4945,11 +4945,15 @@ export interface components {
|
|
|
4945
4945
|
[key: string]: string;
|
|
4946
4946
|
};
|
|
4947
4947
|
error: string | null;
|
|
4948
|
+
/** @description Advisory, non-failing notes (e.g. missing optional permissions). Never change `ok`. */
|
|
4949
|
+
warnings?: string[];
|
|
4948
4950
|
app: components["schemas"]["GithubEnterpriseApp"];
|
|
4949
4951
|
};
|
|
4950
4952
|
GithubEnterpriseOrgs: {
|
|
4951
4953
|
configured: boolean;
|
|
4952
4954
|
agentAppSlug?: string | null;
|
|
4955
|
+
/** @description Why the agent's App cannot be installed through the enterprise API (private App with no stored GH_APP_CLIENT_ID, or no App at all). Null when it can; present only with agentId. */
|
|
4956
|
+
agentAppReason?: string | null;
|
|
4953
4957
|
orgs: {
|
|
4954
4958
|
id: number;
|
|
4955
4959
|
login: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
|
|
4
|
+
const spec = JSON.parse(
|
|
5
|
+
readFileSync(
|
|
6
|
+
new URL("../admin/openapi.platform.json", import.meta.url),
|
|
7
|
+
"utf8",
|
|
8
|
+
),
|
|
9
|
+
) as { paths: Record<string, unknown> };
|
|
10
|
+
|
|
11
|
+
/** Top-level keys of the generated `paths` interface (4-space-indented quoted keys). */
|
|
12
|
+
function generatedPathKeys(): Set<string> {
|
|
13
|
+
const src = readFileSync(new URL("./admin-types.ts", import.meta.url), "utf8");
|
|
14
|
+
const start = src.indexOf("export interface paths {");
|
|
15
|
+
const end = src.indexOf("\n}\n", start);
|
|
16
|
+
const body = src.slice(start, end);
|
|
17
|
+
return new Set(
|
|
18
|
+
[...body.matchAll(/^ {4}"([^"]+)": \{$/gm)].map((m) => m[1] as string),
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
describe("lib/admin-types.ts", () => {
|
|
23
|
+
it("has every path in admin/openapi.platform.json as a key of the paths interface", () => {
|
|
24
|
+
const generated = generatedPathKeys();
|
|
25
|
+
const missing = Object.keys(spec.paths).filter((p) => !generated.has(p));
|
|
26
|
+
expect(
|
|
27
|
+
missing,
|
|
28
|
+
`paths missing from lib/admin-types.ts: run \`bun run generate:admin-types\``,
|
|
29
|
+
).toEqual([]);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("parses a non-empty set of generated paths", () => {
|
|
33
|
+
expect(generatedPathKeys().size).toBeGreaterThan(0);
|
|
34
|
+
});
|
|
35
|
+
});
|