/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { ISummaryTree } from "@fluidframework/driver-definitions"; import type { IGitBlob, IGitCommitDetails, IGitCreateBlobParams, IGitCreateBlobResponse, IGitCreateTreeParams, IGitTree, } from "@fluidframework/driver-definitions/internal"; import type { IWholeSummaryPayload, IWholeSummaryPayloadType, IWriteSummaryResponse, } from "@fluidframework/server-services-client"; import type { IWholeFlatSnapshot } from "./contracts.js"; import type { IR11sResponse } from "./restWrapper.js"; /** * Interface to a generic Git provider */ export interface IHistorian { getBlob(sha: string): Promise>; createBlob(blob: IGitCreateBlobParams): Promise>; getCommits(sha: string, count: number): Promise>; createTree(tree: IGitCreateTreeParams): Promise>; getTree(sha: string, recursive: boolean): Promise>; createSummary( summary: IWholeSummaryPayload, initial?: boolean, ): Promise>; getSnapshot(sha: string): Promise>; } export interface IGitManager { getCommits(sha: string, count: number): Promise>; getTree(root: string, recursive: boolean): Promise>; getBlob(sha: string): Promise>; createBlob( content: string, encoding: string, ): Promise>; createGitTree(params: IGitCreateTreeParams): Promise>; createSummary( summary: IWholeSummaryPayload, initial?: boolean, ): Promise>; getSnapshot(sha: string): Promise>; } /** * Uploads a summary to storage. */ export interface ISummaryUploadManager { /** * Writes summary tree to storage. * @param summaryTree - Summary tree to write to storage * @param parentHandle - Parent summary acked handle (if available from summary ack) * @param summaryType - type of summary being uploaded * @param sequenceNumber - optional reference sequence number of the summary * @returns Id of created tree as a string. */ writeSummaryTree( summaryTree: ISummaryTree, parentHandle: string, summaryType: IWholeSummaryPayloadType, sequenceNumber?: number, ): Promise; }