Skip to content
Sarj Workspace Sync

org-sync/google-org-chart-drive-client

@sarj-ai/workspace-sync/org-sync/google-drive-client ยท Source

import { type ResourceLeaseRepository } from "../identity-sync/resource-lease.ts";
import { type RetryOptions } from "./http.ts";
export interface OrgChartDriveResult {
action: "unchanged" | "updated";
fileId: string;
webViewLink: string;
}
export interface GoogleOrgChartDriveClientOptions extends Pick<RetryOptions, "fetchImpl" | "random" | "sleep"> {
driveId: string;
fileId: string;
leaseRepository?: ResourceLeaseRepository | undefined;
privateKey: string;
serviceAccountEmail: string;
userProject: string;
}
export interface GoogleOrgChartDriveUpsertRequest {
deadlineAt?: number;
expectedCurrentSha256: string;
expectedFileId?: string | undefined;
html: string;
runId: string;
}
export interface OrgChartDriveClient {
readonly fileId: string;
readContentSha256(runId: string, deadlineAt?: number): Promise<string>;
upsert(request: GoogleOrgChartDriveUpsertRequest): Promise<OrgChartDriveResult>;
}
export declare class GoogleOrgChartDriveClient implements OrgChartDriveClient {
#private;
constructor(options: GoogleOrgChartDriveClientOptions);
get fileId(): string;
upsert(request: GoogleOrgChartDriveUpsertRequest): Promise<OrgChartDriveResult>;
readContentSha256(runId: string, deadlineAt?: number): Promise<string>;
}