Skip to content
Sarj Workspace Sync

trycomp/reviewed-identity

@sarj-ai/workspace-sync/trycomp/reviewed-identity ยท Source

import type { GoogleDirectoryUser } from "../org-sync/model.ts";
import type { TrycompPlan, TrycompReviewedPlan, TrycompSelectedIdentity } from "./model.ts";
export declare function selectedTrycompIdentity(plan: TrycompPlan, users: readonly GoogleDirectoryUser[]): TrycompSelectedIdentity | undefined;
export type PinnedTrycompWritePlan = TrycompReviewedPlan & Required<Pick<TrycompReviewedPlan, "selectedIdentity">>;
export declare function assertTrycompSelectedIdentity(reviewed: TrycompReviewedPlan, users: readonly GoogleDirectoryUser[]): asserts reviewed is PinnedTrycompWritePlan;
export declare function sameReviewedTrycompPlan(reviewed: TrycompReviewedPlan, fresh: TrycompReviewedPlan): boolean;
export declare function trycompManagedSlice(reviewed: TrycompReviewedPlan, state: "converged" | "drifted" | "pending"): {
state: "converged" | "drifted" | "pending";
selectedIdentity?: never;
} | {
state: "converged" | "drifted" | "pending";
selectedIdentity: {
googleUserId: string & import("zod").$brand<"GoogleUserId">;
provider: {
kind: "member";
memberId: string;
email: string;
} | {
kind: "pending-invitation";
email: string;
};
};
};