Skip to content
Sarj Workspace Sync

execution/reviewed-sentry-workspace-adapter

@sarj-ai/workspace-sync/execution/reviewed-sentry-workspace-adapter ยท Source

import { type JsonValue } from "../operations/schemas.ts";
import type { SentryWorkspaceAction } from "../workspace-directory/sentry-workspace-sync.ts";
import { type WorkspaceDirectoryBranchPlan, type WorkspaceDirectoryPlan } from "./contracts.ts";
import type { ReviewedActionContext } from "./reviewed-action-context.ts";
import type { SentryWorkspaceParentConfig } from "./sentry-workspace-parent-config.ts";
import type { SentryWorkspaceExecutionPort } from "./sentry-workspace-service.ts";
export type SentryWorkspaceParentContext = Extract<ReviewedActionContext<SentryWorkspaceAction>, {
mode: "parent";
}>;
interface Dependencies {
assertGoogleAuthority(plan: WorkspaceDirectoryPlan): Promise<unknown>;
parentContext?: (plan: WorkspaceDirectoryPlan) => SentryWorkspaceParentContext;
service(): SentryWorkspaceExecutionPort;
}
export interface IReviewedSentryWorkspaceAdapter {
apply(plan: WorkspaceDirectoryPlan): Promise<string>;
capture(plan: WorkspaceDirectoryPlan, config: SentryWorkspaceParentConfig): Promise<Extract<WorkspaceDirectoryBranchPlan, {
branchId: "sentry-memberships";
}>>;
readSlice(plan: WorkspaceDirectoryPlan): Promise<JsonValue>;
}
export declare class ReviewedSentryWorkspaceAdapter implements IReviewedSentryWorkspaceAdapter {
#private;
constructor(dependencies: Dependencies);
capture(plan: WorkspaceDirectoryPlan, config: SentryWorkspaceParentConfig): 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: "sentry-memberships";
execution: "audit-only" | "disabled" | "managed";
reviewed: {
action: {
email: string;
memberId: string;
type: "remove-organization-member";
} | {
email: string;
memberId: string;
type: "add-team-member";
} | {
email: string;
type: "invite";
} | {
email: string;
memberId: string;
type: "repair-pending-invite";
} | {
email: string;
memberId: string;
type: "reinvite-expired";
};
authorityPins: {
actor: {
id: string;
orgRole: "admin" | "billing" | "manager" | "member" | "owner";
role: "admin" | "billing" | "manager" | "member" | "owner";
scopes: string[];
teamRole: "admin" | "contributor" | null;
};
organization: {
id: string;
slug: string;
};
project: {
id: string;
slug: string;
};
team: {
id: string;
slug: string;
};
};
expectedPlanHash: string;
googleUserId: string & import("zod").$brand<"GoogleUserId">;
sourceAuthorityFingerprint: string;
} | null;
sourceFingerprint: string;
}>;
readSlice(plan: WorkspaceDirectoryPlan): Promise<import("zod").JSONType>;
apply(plan: WorkspaceDirectoryPlan): Promise<string>;
}
export {};