Skip to main content
Version: v1

IDocumentStorageService Interface

Interface to provide access to snapshots saved for a shared object

Signature

export interface IDocumentStorageService extends Partial<IDisposable>

Extends: Partial<IDisposable

Properties

PropertyModifiersTypeDescription
policiesoptionalIDocumentStorageServicePoliciesPolicies implemented/instructed by driver.
repositoryUrlstring

Methods

MethodReturn TypeDescription
createBlob(file)Promise<ICreateBlobResponse>Creates a blob out of the given buffer
downloadSummary(handle)Promise<ISummaryTree>Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.
getSnapshotTree(version, scenarioName)Promise<ISnapshotTree | null>Returns the snapshot tree.
getVersions(versionId, count, scenarioName)Promise<IVersion[]>Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id)Promise<ArrayBufferLike>Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context)Promise<string>Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.

Property Details

policies

Policies implemented/instructed by driver.

Signature

readonly policies?: IDocumentStorageServicePolicies;

Type: IDocumentStorageServicePolicies

repositoryUrl

Signature

repositoryUrl: string;

Type: string

Method Details

createBlob

Creates a blob out of the given buffer

Signature

createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;

Parameters

ParameterTypeDescription
fileArrayBufferLike

Returns

Return type: Promise<ICreateBlobResponse>

downloadSummary

Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the server has deleted it this call may result in a broken promise.

Signature

downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;

Parameters

ParameterTypeDescription
handleISummaryHandle

Returns

Return type: Promise<ISummaryTree>

getSnapshotTree

Returns the snapshot tree.

Signature

getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;

Parameters

ParameterModifiersTypeDescription
versionoptionalIVersionVersion of the snapshot to be fetched.
scenarioNameoptionalstringscenario in which this api is called. This will be recorded by server and would help in debugging purposes to see why this call was made.

Returns

Return type: Promise<ISnapshotTree | null>

getVersions

Retrieves all versions of the document starting at the specified versionId - or null if from the head

Signature

getVersions(versionId: string | null, count: number, scenarioName?: string): Promise<IVersion[]>;

Parameters

ParameterModifiersTypeDescription
versionIdstring | nullVersion id of the requested version.
countnumberNumber of the versions to be fetched.
scenarioNameoptionalstringscenario in which this api is called. This will be recorded by server and would help in debugging purposes to see why this call was made.

Returns

Return type: Promise<IVersion[]>

readBlob

Reads the object with the given ID, returns content in arrayBufferLike

Signature

readBlob(id: string): Promise<ArrayBufferLike>;

Parameters

ParameterTypeDescription
idstring

Returns

Return type: Promise<ArrayBufferLike>

uploadSummaryWithContext

Uploads a summary tree to storage using the given context for reference of previous summary handle. The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are referencing from the previously acked summary. Returns the uploaded summary handle.

Signature

uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;

Parameters

ParameterTypeDescription
summaryISummaryTree
contextISummaryContext

Returns

Return type: Promise<string>