Skip to content
Sarj Workspace Sync

execution/reviewed-name-plan

@sarj-ai/workspace-sync/execution/reviewed-name-plan ยท Source

import { z } from "zod";
import { LinearProfileActionSchema } from "../workspace-directory/linear-profile-sync.ts";
import { SlackNameActionSchema } from "../workspace-directory/slack-name-sync.ts";
export declare const ReviewedSlackNameActionSchema: z.ZodObject<{
expectedPlanHash: z.ZodString;
sourceFingerprint: z.ZodString;
action: z.ZodObject<{
beforeRealName: z.ZodString;
desiredName: z.ZodString;
email: z.ZodEmail;
type: z.ZodLiteral<"repair-default-name">;
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
slackUserId: z.ZodString;
}, z.core.$strict>;
branchId: z.ZodLiteral<"slack-names">;
}, z.core.$strict>;
export declare const ReviewedLinearProfileActionSchema: z.ZodObject<{
expectedPlanHash: z.ZodString;
sourceFingerprint: z.ZodString;
action: z.ZodObject<{
beforeFullName: z.ZodString;
desiredFullName: z.ZodString;
email: z.ZodEmail;
linearUserId: z.ZodString;
type: z.ZodLiteral<"repair-default-full-name">;
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
}, z.core.$strict>;
branchId: z.ZodLiteral<"linear-profiles">;
}, z.core.$strict>;
export declare const ReviewedNameActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
expectedPlanHash: z.ZodString;
sourceFingerprint: z.ZodString;
action: z.ZodObject<{
beforeRealName: z.ZodString;
desiredName: z.ZodString;
email: z.ZodEmail;
type: z.ZodLiteral<"repair-default-name">;
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
slackUserId: z.ZodString;
}, z.core.$strict>;
branchId: z.ZodLiteral<"slack-names">;
}, z.core.$strict>, z.ZodObject<{
expectedPlanHash: z.ZodString;
sourceFingerprint: z.ZodString;
action: z.ZodObject<{
beforeFullName: z.ZodString;
desiredFullName: z.ZodString;
email: z.ZodEmail;
linearUserId: z.ZodString;
type: z.ZodLiteral<"repair-default-full-name">;
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
}, z.core.$strict>;
branchId: z.ZodLiteral<"linear-profiles">;
}, z.core.$strict>], "branchId">;
export type ReviewedNameAction = z.output<typeof ReviewedNameActionSchema>;
type NameSelection<Reviewed> = {
kind: "no-eligible-action";
} | {
kind: "selected";
reviewed: Reviewed;
} | {
kind: "service-identity-deferred";
};
interface NameCapture<Action> {
eligibleActions: readonly Action[];
plan: {
actions: readonly Action[];
planHash: string;
};
sourceFingerprint: string;
}
export declare function selectReviewedSlackName(capture: NameCapture<z.input<typeof SlackNameActionSchema>>, serviceGoogleUserId?: string): NameSelection<z.output<typeof ReviewedSlackNameActionSchema>>;
export declare function selectReviewedLinearProfile(capture: NameCapture<z.input<typeof LinearProfileActionSchema>>, serviceGoogleUserId?: string): NameSelection<z.output<typeof ReviewedLinearProfileActionSchema>>;
export declare function reviewedNameSourceIdentity(raw: ReviewedNameAction): {
kind: "identity";
googleUserId: string & z.$brand<"GoogleUserId">;
providerAccountId: string;
systemId: "linear" | "slack";
};
export declare function reviewedNameManagedSlice(raw: ReviewedNameAction, state: "converged" | "pending"): z.JSONType;
export {};