Skip to content
Sarj Workspace Sync

workspace-directory/pagerduty-team-sync

@sarj-ai/workspace-sync/workspace-directory/pagerduty-team-sync ยท Source

import { z } from "zod";
import { type EmployeeEntitlementAuthority } from "../identity-provisioning/employee-entitlement-policy.ts";
import type { GoogleGroupSnapshot } from "../org-sync/channel-model.ts";
import { type GoogleDirectoryUser } from "../org-sync/model.ts";
import { type PagerDutyMissingUser } from "./pagerduty-readiness-contracts.ts";
import type { PagerDutyTeamSnapshot } from "./pagerduty-team-client.ts";
import { type PagerDutyTeamMapping, PagerDutyTeamRoleSchema } from "./pagerduty-team-config.ts";
export declare const PagerDutyTeamActionSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"add">;
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
currentPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"set-role">;
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
currentPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"remove">;
}, z.core.$strict>>], "type">;
export declare const PagerDutyTeamWritableActionSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"add">;
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
currentPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"set-role">;
}, z.core.$strict>>], "type">;
export declare const AuditedPagerDutyTeamPlanSchema: z.ZodReadonly<z.ZodObject<{
actions: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"add">;
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
googleGroupId: z.ZodString;
googleUserId: z.ZodString;
currentPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
desiredPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"set-role">;
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
email: z.ZodEmail;
pagerDutyTeamId: z.ZodString;
pagerDutyUserId: z.ZodString;
currentPagerDutyRole: z.ZodEnum<{
manager: "manager";
observer: "observer";
responder: "responder";
}>;
type: z.ZodLiteral<"remove">;
}, z.core.$strict>>], "type">>>;
diagnostics: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
code: z.ZodEnum<{
"contractor-membership-preserved": "contractor-membership-preserved";
"credential-missing": "credential-missing";
"evidence-incomplete": "evidence-incomplete";
"google-group-member-ineligible": "google-group-member-ineligible";
"google-group-pin-mismatch": "google-group-pin-mismatch";
"mapping-configuration-empty": "mapping-configuration-empty";
"pagerduty-team-pin-mismatch": "pagerduty-team-pin-mismatch";
"pagerduty-user-email-ambiguous": "pagerduty-user-email-ambiguous";
"pagerduty-user-missing": "pagerduty-user-missing";
"protected-identity": "protected-identity";
}>;
detail: z.ZodString;
severity: z.ZodEnum<{
error: "error";
warning: "warning";
}>;
}, z.core.$strict>>>>;
evidenceHash: z.ZodString;
mappingCount: z.ZodNumber;
mutationsDisabled: z.ZodBoolean;
pagerDutyTeamCount: z.ZodNullable<z.ZodNumber>;
pagerDutyUserCount: z.ZodNullable<z.ZodNumber>;
reviewId: z.ZodUUID;
status: z.ZodEnum<{
blocked: "blocked";
ready: "ready";
}>;
planHash: z.ZodString;
}, z.core.$strict>>;
export type AuditedPagerDutyTeamPlan = z.output<typeof AuditedPagerDutyTeamPlanSchema>;
export interface PagerDutyTeamAuditInput {
credentialConfigured: boolean;
employeeEntitlementAuthority?: EmployeeEntitlementAuthority;
googleGroups?: readonly GoogleGroupSnapshot[];
googleUsers?: readonly GoogleDirectoryUser[];
mappings: readonly PagerDutyTeamMapping[];
mutationsDisabled: boolean;
pagerDuty?: PagerDutyTeamSnapshot;
reviewId: string;
}
export type CompletePagerDutyTeamAuditInput = PagerDutyTeamAuditInput & Required<Pick<PagerDutyTeamAuditInput, "employeeEntitlementAuthority" | "googleGroups" | "googleUsers" | "pagerDuty">>;
export type PagerDutyTeamAction = z.output<typeof PagerDutyTeamActionSchema>;
export type PagerDutyTeamWritableAction = z.output<typeof PagerDutyTeamWritableActionSchema>;
export declare function planPagerDutyTeamSync(input: PagerDutyTeamAuditInput): Promise<AuditedPagerDutyTeamPlan>;
export declare function pagerDutyTeamActionsEqual(left: PagerDutyTeamAction, right: PagerDutyTeamAction): boolean;
export declare function pagerDutyMissingUsers(input: CompletePagerDutyTeamAuditInput): PagerDutyMissingUser[];
export declare function pagerDutyTeamActionPreconditionMatches(action: PagerDutyTeamWritableAction, membership: {
readonly role: z.output<typeof PagerDutyTeamRoleSchema>;
} | null): boolean;
export declare function pagerDutyTeamActionIsConverged(action: PagerDutyTeamWritableAction, membership: {
readonly role: z.output<typeof PagerDutyTeamRoleSchema>;
} | null): boolean;
export declare function pagerDutyTeamActionIsRecoverable(input: CompletePagerDutyTeamAuditInput, action: PagerDutyTeamWritableAction, expectedPlanHash: string): Promise<boolean>;