identity-sync/github-identity-seed-planner
@sarj-ai/workspace-sync/identity-sync/github-identity-seed-planner ยท Source
import { z } from "zod";import { GitHubLoginSchema, GitHubUserIdSchema, GoogleUserIdSchema } from "../catalog/identity-authority.ts";export declare const GitHubIdentitySeedInputSchema: z.ZodReadonly<z.ZodObject<{ githubMembers: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{ email: z.ZodOptional<z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">>; githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; name: z.ZodOptional<z.ZodString>; }, z.core.$strict>>>>; googleUsers: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; githubEvidence: z.ZodOptional<z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; source: z.ZodEnum<{ "github-enterprise-saml": "github-enterprise-saml"; "identity-admin": "identity-admin"; }>; verifiedAt: z.ZodISODateTime; }, z.core.$strict>>>; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; lifecycle: z.ZodEnum<{ active: "active"; archived: "archived"; deleted: "deleted"; suspended: "suspended"; }>; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>>>; sourceRevision: z.ZodString;}, z.core.$strict>>;export declare const GitHubIdentitySeedEntrySchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{ evidence: z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; source: z.ZodEnum<{ "github-enterprise-saml": "github-enterprise-saml"; "identity-admin": "identity-admin"; }>; verifiedAt: z.ZodISODateTime; }, z.core.$strict>>; kind: z.ZodLiteral<"exact-match">; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>; target: z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>;}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ candidates: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>>>; kind: z.ZodLiteral<"unresolved">; reason: z.ZodEnum<{ "github-member-not-found": "github-member-not-found"; "missing-verified-evidence": "missing-verified-evidence"; "unverified-heuristic": "unverified-heuristic"; }>; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>;}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ candidates: z.ZodReadonly<z.ZodTuple<[z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>], z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>>>; kind: z.ZodLiteral<"conflict">; reason: z.ZodEnum<{ "ambiguous-heuristic": "ambiguous-heuristic"; "evidence-id-login-mismatch": "evidence-id-login-mismatch"; }>; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>;}, z.core.$strict>>], "kind">;export declare const GitHubIdentitySeedArtifactSchema: z.ZodReadonly<z.ZodObject<{ entries: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{ evidence: z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; source: z.ZodEnum<{ "github-enterprise-saml": "github-enterprise-saml"; "identity-admin": "identity-admin"; }>; verifiedAt: z.ZodISODateTime; }, z.core.$strict>>; kind: z.ZodLiteral<"exact-match">; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>; target: z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>; }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ candidates: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>>>; kind: z.ZodLiteral<"unresolved">; reason: z.ZodEnum<{ "github-member-not-found": "github-member-not-found"; "missing-verified-evidence": "missing-verified-evidence"; "unverified-heuristic": "unverified-heuristic"; }>; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>; }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ candidates: z.ZodReadonly<z.ZodTuple<[z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>], z.ZodReadonly<z.ZodObject<{ githubLogin: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "GitHubLogin", "out">; githubUserId: z.core.$ZodBranded<z.ZodString, "GitHubUserId", "out">; }, z.core.$strict>>>>; kind: z.ZodLiteral<"conflict">; reason: z.ZodEnum<{ "ambiguous-heuristic": "ambiguous-heuristic"; "evidence-id-login-mismatch": "evidence-id-login-mismatch"; }>; subject: z.ZodReadonly<z.ZodObject<{ displayName: z.ZodString; googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">; primaryEmail: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodEmail>, "PrimaryEmail", "out">; }, z.core.$strict>>; }, z.core.$strict>>], "kind">>>; schemaVersion: z.ZodLiteral<"github-identity-seed-plan/v1">; sourceRevision: z.ZodString; summary: z.ZodReadonly<z.ZodObject<{ conflicts: z.ZodNumber; exactMatches: z.ZodNumber; unresolved: z.ZodNumber; }, z.core.$strict>>; contentHash: z.core.$ZodBranded<z.ZodString, "GitHubIdentitySeedContentHash", "out">;}, z.core.$strict>>;export type GitHubIdentitySeedInput = z.output<typeof GitHubIdentitySeedInputSchema>;export type GitHubIdentitySeedEntry = z.output<typeof GitHubIdentitySeedEntrySchema>;export type GitHubIdentitySeedArtifact = z.output<typeof GitHubIdentitySeedArtifactSchema>;export interface GoogleIdentitySeedSource { listIdentitySeedUsers(): Promise<unknown>;}export interface GitHubOrganizationMemberSource { listOrganizationMembers(): Promise<unknown>;}export interface GitHubIdentitySeedSources { readonly github: GitHubOrganizationMemberSource; readonly google: GoogleIdentitySeedSource; sourceRevision(): Promise<string>;}export interface IGitHubIdentitySeedPlanningService { plan(): Promise<GitHubIdentitySeedArtifact>;}export interface GoogleGithubIdentitySeedUpdate { readonly desired: { readonly githubLogin: z.output<typeof GitHubLoginSchema>; readonly githubUserId: z.output<typeof GitHubUserIdSchema>; }; readonly userId: z.output<typeof GoogleUserIdSchema>;}export declare class GitHubIdentitySeedInputError extends Error { readonly issues: readonly string[]; constructor(issues: readonly string[], options?: ErrorOptions);}export declare class GitHubIdentitySeedPlanningService implements IGitHubIdentitySeedPlanningService { #private; constructor(sources: GitHubIdentitySeedSources); plan(): Promise<GitHubIdentitySeedArtifact>;}export declare function planGitHubIdentitySeed(input: unknown): Promise<GitHubIdentitySeedArtifact>;export declare function googleIdentityUpdatesFromSeedPlan(artifact: unknown): Promise<readonly GoogleGithubIdentitySeedUpdate[]>;export declare function verifyGitHubIdentitySeedArtifact(artifact: unknown): Promise<GitHubIdentitySeedArtifact>;