execution/reviewed-pager-duty-team-adapter
@sarj-ai/workspace-sync/execution/reviewed-pager-duty-team-adapter ยท Source
import { JsonValueSchema } from "../operations/schemas.ts";import type { PagerDutyTeamWritableAction } from "../workspace-directory/pagerduty-team-sync.ts";import { PagerDutyTeamsBranchPlanSchema, type WorkspaceDirectoryPlan } from "./contracts.ts";import type { PagerDutyTeamExecutionPort } from "./pager-duty-team-service.ts";import type { ReviewedActionContext } from "./reviewed-action-context.ts";export type PagerDutyTeamParentContext = Extract<ReviewedActionContext<PagerDutyTeamWritableAction>, { mode: "parent";}>;interface Dependencies { assertGoogleAuthority(plan: WorkspaceDirectoryPlan): Promise<unknown>; parentContext?: (plan: WorkspaceDirectoryPlan) => PagerDutyTeamParentContext; service(): PagerDutyTeamExecutionPort;}export interface IPagerDutyTeamParentReader { capture(plan: WorkspaceDirectoryPlan, execution: "disabled" | "managed"): Promise<ReturnType<typeof PagerDutyTeamsBranchPlanSchema.parse>>; readSlice(plan: WorkspaceDirectoryPlan): Promise<ReturnType<typeof JsonValueSchema.parse>>;}export interface IPagerDutyTeamParentWriter { apply(plan: WorkspaceDirectoryPlan): Promise<string>;}export declare class ReviewedPagerDutyTeamAdapter implements IPagerDutyTeamParentReader, IPagerDutyTeamParentWriter { #private; constructor(dependencies: Dependencies); capture(plan: WorkspaceDirectoryPlan, execution: "disabled" | "managed"): 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: "pagerduty-teams"; execution: "audit-only" | "disabled" | "managed"; reviewed: { action: Readonly<{ email: string; pagerDutyTeamId: string; pagerDutyUserId: string; googleGroupId: string; googleUserId: string; desiredPagerDutyRole: "manager" | "observer" | "responder"; type: "add"; }> | Readonly<{ email: string; pagerDutyTeamId: string; pagerDutyUserId: string; googleGroupId: string; googleUserId: string; currentPagerDutyRole: "manager" | "observer" | "responder"; desiredPagerDutyRole: "manager" | "observer" | "responder"; type: "set-role"; }>; expectedPlanHash: string; reviewId: string; } | null; sourceFingerprint: string; }>; readSlice(plan: WorkspaceDirectoryPlan): Promise<import("zod").JSONType>; apply(plan: WorkspaceDirectoryPlan): Promise<string>;}export {};