execution/reviewed-google-group-cleanup-adapter
@sarj-ai/workspace-sync/execution/reviewed-google-group-cleanup-adapter ยท Source
import { JsonValueSchema } from "../operations/schemas.ts";import type { GoogleGroupCleanupAction } from "../workspace-directory/google-group-cleanup-sync.ts";import { GoogleGroupCleanupBranchPlanSchema, type WorkspaceDirectoryPlan } from "./contracts.ts";import type { GoogleGroupCleanupServiceContract } from "./google-group-cleanup-service.ts";import type { ReviewedActionContext } from "./reviewed-action-context.ts";import { type ReviewedGoogleGroupCleanupIntent } from "./reviewed-google-group-cleanup.ts";export type GoogleGroupCleanupParentContext = Extract<ReviewedActionContext<GoogleGroupCleanupAction>, { mode: "parent";}> & { readonly deadlineAtMs?: number;};interface CleanupAdapterDependencies { assertGoogleAuthority(plan: WorkspaceDirectoryPlan, deadlineAt?: number): Promise<unknown>; parentContext?: (plan: WorkspaceDirectoryPlan) => GoogleGroupCleanupParentContext; service(): Pick<GoogleGroupCleanupServiceContract, "applyReviewed" | "auditPlan" | "readReviewed">;}export interface IGoogleCleanupParentReader { capture(plan: WorkspaceDirectoryPlan, execution: "audit-only" | "disabled" | "managed", reviewed?: ReviewedGoogleGroupCleanupIntent): Promise<ReturnType<typeof GoogleGroupCleanupBranchPlanSchema.parse>>; readSlice(plan: WorkspaceDirectoryPlan): Promise<ReturnType<typeof JsonValueSchema.parse>>;}export interface IGoogleCleanupParentWriter { apply(plan: WorkspaceDirectoryPlan): Promise<string>;}export declare class ReviewedGoogleGroupCleanupAdapter implements IGoogleCleanupParentReader, IGoogleCleanupParentWriter { #private; constructor(dependencies: CleanupAdapterDependencies); capture(plan: WorkspaceDirectoryPlan, execution: "audit-only" | "disabled" | "managed", rawReviewed?: ReviewedGoogleGroupCleanupIntent): Promise<{ diagnostics: { code: string; context?: { error_code: "linear_organization_id_mismatch" | "linear_organization_id_unpinned" | "linear_organization_url_key_mismatch"; kind: "linear_tenant"; observed_organization_id: string; observed_url_key: string; } | undefined; message: string; scope?: { kind: "authority"; } | { kind: "audit"; provider: "ashby" | "attio" | "github" | "linear" | "pagerduty" | "slack"; } | { actionId: "workspace-directory.drive-org-chart" | "workspace-directory.fanout" | "workspace-directory.github-access" | "workspace-directory.google-group-cleanup" | "workspace-directory.linear-profiles" | "workspace-directory.linear-suspensions" | "workspace-directory.pagerduty-teams" | "workspace-directory.posthog-memberships" | "workspace-directory.sentry-memberships" | "workspace-directory.slack-groups-channels" | "workspace-directory.slack-names" | "workspace-directory.slack-profiles" | "workspace-directory.trycomp-people"; kind: "action"; } | undefined; severity: "blocker" | "info" | "warning"; }[]; killSwitchEngaged: boolean; branchId: "google-group-cleanup"; execution: "audit-only" | "disabled" | "managed"; reviewed: { action: { authorityEmail?: string | undefined; googleGroupEmail: string; googleGroupId: string; googleUserId: string & import("zod").$brand<"GoogleDirectoryUserId">; lifecycle: "archived" | "deleted" | "suspended"; memberEmail: string; memberId: string & import("zod").$brand<"GoogleDirectoryUserId">; role?: "MANAGER" | "OWNER" | undefined; type: "remove-inactive-google-group-member"; }; expectedPlanHash: string; } | null; sourceFingerprint: string; }>; readSlice(plan: WorkspaceDirectoryPlan): Promise<import("zod").JSONType>; apply(plan: WorkspaceDirectoryPlan): Promise<string>;}export {};