Skip to content
Sarj Workspace Sync

identity-provisioning/git-hub-organization-snapshot-port

@sarj-ai/workspace-sync/identity-provisioning/github-organization-snapshot-port ยท Source

import { z } from "zod";
import { GitHubLoginSchema, GitHubUserIdSchema } from "../catalog/identity-authority.ts";
import type { GitHubAccessSnapshot } from "../github-access-audit/git-hub-access-audit-client.ts";
import { type ReadOnlyGitHubOrganizationPort } from "./github-organization-connector.ts";
/** Adapts one complete organization inventory to O(1) per-account planning reads. */
export declare class GitHubOrganizationSnapshotPort implements ReadOnlyGitHubOrganizationPort {
#private;
readonly capability = "read-only";
constructor(snapshot: GitHubAccessSnapshot, rawConfig: {
readonly managedTeamPins?: Readonly<Record<string, number>>;
readonly managedTeamSlugs: readonly string[];
readonly organizationId: string;
readonly organizationLogin: string;
});
observeAccount(rawIdentity: {
readonly githubLogin: z.output<typeof GitHubLoginSchema>;
readonly githubUserId: z.output<typeof GitHubUserIdSchema>;
readonly primaryEmail: string;
}): Promise<Readonly<{
complete: true;
directRepositoryGrants: readonly Readonly<{
githubLogin: string & z.$brand<"GitHubLogin">;
githubUserId: string & z.$brand<"GitHubUserId">;
customRoleName?: string | undefined;
unresolvedDirectRole?: true | undefined;
permission: "admin" | "maintain" | "pull" | "push" | "triage";
repositoryId: number & z.$brand<"GitHubRepositoryId">;
repositoryName: string & z.$brand<"GitHubRepositoryName">;
}>[];
identity: Readonly<{
githubLogin: string & z.$brand<"GitHubLogin">;
githubUserId: string & z.$brand<"GitHubUserId">;
}>;
membership: Readonly<{
githubLogin: string & z.$brand<"GitHubLogin">;
githubUserId: string & z.$brand<"GitHubUserId">;
role: "member" | "owner";
}> | null;
observedAt: string;
outsideCollaborator: boolean;
pendingInvitations: readonly Readonly<{
githubLogin: string & z.$brand<"GitHubLogin">;
githubUserId: string & z.$brand<"GitHubUserId">;
invitationId: number & z.$brand<"GitHubInvitationId">;
role: "admin" | "billing_manager" | "direct_member";
}>[];
unresolvedInvitations?: "identity-or-privilege" | "opaque-direct" | undefined;
repositoryInventoryComplete: boolean;
samlLinked: boolean;
teamMemberships: readonly Readonly<{
githubLogin: string & z.$brand<"GitHubLogin">;
githubUserId: string & z.$brand<"GitHubUserId">;
inherited: boolean;
role: "maintainer" | "member";
state: "active" | "pending";
teamId: number & z.$brand<"GitHubTeamId">;
teamSlug: string & z.$brand<"GitHubTeamSlug">;
}>[];
}>>;
}