Skip to content
Sarj Workspace Sync

org-sync/org-chart-service

@sarj-ai/workspace-sync/org-sync/org-chart-service ยท Source

import type { GoogleOrgChartDriveClient, OrgChartDriveResult } from "./google-org-chart-drive-client.ts";
import type { GoogleDirectoryUser } from "./model.ts";
import { type OrgChartPolicy } from "./org-chart.ts";
export interface OrgChartRunReport {
bytes: number;
currentSha256: string;
drive: null | OrgChartDriveResult;
fileId: string;
mode: "audit" | "live";
people: number;
photos: number;
runId: string;
sha256: string;
}
export interface IOrgChartService {
run(request: OrgChartRunRequest): Promise<OrgChartRunReport>;
}
export type OrgChartDrivePort = Pick<GoogleOrgChartDriveClient, "fileId" | "readContentSha256" | "upsert">;
export type OrgChartRunRequest = {
expectedCurrentSha256: string;
expectedFileId?: string | undefined;
expectedSha256: string;
mode: "live";
users: readonly GoogleDirectoryUser[];
} | {
mode: "audit";
users: readonly GoogleDirectoryUser[];
};
export declare class OrgChartService implements IOrgChartService {
#private;
constructor(drive: OrgChartDrivePort, policy: OrgChartPolicy);
run(request: OrgChartRunRequest): Promise<OrgChartRunReport>;
}