@app-vitals/agent-lib 1.18.0 → 1.20.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.
Files changed (2) hide show
  1. package/admin-types.ts +115 -0
  2. package/package.json +1 -1
package/admin-types.ts CHANGED
@@ -2719,6 +2719,92 @@ export interface paths {
2719
2719
  patch?: never;
2720
2720
  trace?: never;
2721
2721
  };
2722
+ "/agents/{id}/github-access": {
2723
+ parameters: {
2724
+ query?: never;
2725
+ header?: never;
2726
+ path?: never;
2727
+ cookie?: never;
2728
+ };
2729
+ /**
2730
+ * Preview the repos the agent's bound GitHub user can reach
2731
+ * @description Platform-admin only (session members, ops keys and agent keys get 403): the response lists repo names the bound user can reach. Read-only; nothing is stored. 404 for an unknown agent; 422 when no githubUsername is bound. Returns `status: unconfigured` (not an error, no GitHub call) when the enterprise Apps are not configured, and `status: user_not_found` when the user does not exist on GitHub; otherwise `access` is the resolver output (per-org status, repos with level and canPush, unresolved count, complete flag).
2732
+ */
2733
+ get: {
2734
+ parameters: {
2735
+ query?: never;
2736
+ header?: never;
2737
+ path: {
2738
+ id: string;
2739
+ };
2740
+ cookie?: never;
2741
+ };
2742
+ requestBody?: never;
2743
+ responses: {
2744
+ /** @description Access preview */
2745
+ 200: {
2746
+ headers: {
2747
+ [name: string]: unknown;
2748
+ };
2749
+ content: {
2750
+ "application/json": components["schemas"]["GithubAccessPreview"];
2751
+ };
2752
+ };
2753
+ /** @description Unauthorized */
2754
+ 401: {
2755
+ headers: {
2756
+ [name: string]: unknown;
2757
+ };
2758
+ content: {
2759
+ "application/json": components["schemas"]["Error"];
2760
+ };
2761
+ };
2762
+ /** @description Platform admin required */
2763
+ 403: {
2764
+ headers: {
2765
+ [name: string]: unknown;
2766
+ };
2767
+ content: {
2768
+ "application/json": components["schemas"]["Error"];
2769
+ };
2770
+ };
2771
+ /** @description Agent not found */
2772
+ 404: {
2773
+ headers: {
2774
+ [name: string]: unknown;
2775
+ };
2776
+ content: {
2777
+ "application/json": components["schemas"]["Error"];
2778
+ };
2779
+ };
2780
+ /** @description Agent has no githubUsername */
2781
+ 422: {
2782
+ headers: {
2783
+ [name: string]: unknown;
2784
+ };
2785
+ content: {
2786
+ "application/json": components["schemas"]["Error"];
2787
+ };
2788
+ };
2789
+ /** @description GitHub unavailable or refused */
2790
+ 502: {
2791
+ headers: {
2792
+ [name: string]: unknown;
2793
+ };
2794
+ content: {
2795
+ "application/json": components["schemas"]["Error"];
2796
+ };
2797
+ };
2798
+ };
2799
+ };
2800
+ put?: never;
2801
+ post?: never;
2802
+ delete?: never;
2803
+ options?: never;
2804
+ head?: never;
2805
+ patch?: never;
2806
+ trace?: never;
2807
+ };
2722
2808
  "/agents/{id}/config": {
2723
2809
  parameters: {
2724
2810
  query?: never;
@@ -4462,6 +4548,35 @@ export interface components {
4462
4548
  /** @description Per-repo access probe result (COS-44.1). Omit to leave the stored result unchanged; send [] to clear it. */
4463
4549
  repos?: components["schemas"]["RepoAccessEntry"][];
4464
4550
  };
4551
+ GithubAccessPreview: {
4552
+ /**
4553
+ * @description `unconfigured` when the installer or lookup App is not set (no GitHub call was made).
4554
+ * @enum {string}
4555
+ */
4556
+ status: "ok" | "user_not_found" | "unconfigured";
4557
+ /** @description Resolver output; absent when unconfigured. */
4558
+ access?: {
4559
+ username: string;
4560
+ /** @enum {string} */
4561
+ outcome: "ok" | "user_not_found";
4562
+ userVerified: boolean;
4563
+ orgs: {
4564
+ org: string;
4565
+ /** @enum {string} */
4566
+ status: "ok" | "lookup_app_not_installed" | "rate_limited" | "partial" | "error";
4567
+ repos: {
4568
+ fullName: string;
4569
+ /** @enum {string} */
4570
+ level: "admin" | "maintain" | "write" | "triage" | "read" | "none";
4571
+ canPush: boolean;
4572
+ }[];
4573
+ unresolved: number;
4574
+ }[];
4575
+ unresolved: number;
4576
+ complete: boolean;
4577
+ checkedAt: string;
4578
+ };
4579
+ };
4465
4580
  AgentConfigResponse: {
4466
4581
  /**
4467
4582
  * @example {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-lib",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",