Skip to main content

IDocumentStorageService Interface

Interface to provide access to snapshots saved for a shared object

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/driver-definitions/legacy.

For more information about our API support guarantees, see here.

Signature​

export interface IDocumentStorageService extends Partial<IDisposable>

Extends: Partial<IDisposable>

Properties​

PropertyAlertsModifiersTypeDescription
policiesBetaoptional, readonlyIDocumentStorageServicePolicies | undefinedPolicies implemented/instructed by driver.

Methods​

MethodAlertsModifiersReturn TypeDescription
createBlob(file)BetaPromise<ICreateBlobResponse>Creates a blob out of the given buffer
downloadSummary(handle)BetaPromise<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.
getSnapshot(snapshotFetchOptions)BetaoptionalPromise<ISnapshot>Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from getSnapshotTree api in that, that API only returns the snapshot tree from the snapshot.
getSnapshotTree(version, scenarioName)BetaPromise<ISnapshotTree | null>Returns the snapshot tree.
getVersions(versionId, count, scenarioName, fetchSource)BetaPromise<IVersion[]>Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id)BetaPromise<ArrayBufferLike>Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context)BetaPromise<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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

readonly policies?: IDocumentStorageServicePolicies | undefined;

Type: IDocumentStorageServicePolicies | undefined

Method Details​

createBlob​

Creates a blob out of the given buffer

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

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

Parameters​

ParameterTypeDescription
handleISummaryHandle

Returns​

Return type: Promise<ISummaryTree>

getSnapshot​

Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from getSnapshotTree api in that, that API only returns the snapshot tree from the snapshot.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;

Parameters​

ParameterModifiersTypeDescription
snapshotFetchOptionsoptionalISnapshotFetchOptionsOptions specified by the caller to specify and want certain behavior from the driver when fetching the snapshot.

Returns​

Return type: Promise<ISnapshot>

getSnapshotTree​

Returns the snapshot tree.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

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

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): 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.
fetchSourceoptionalFetchSourceCallers can specify the source of the response. For ex. Driver may choose to cache requests and serve data from cache. That will result in stale info returned. Callers can disable this functionality by passing fetchSource = noCache and ensuring that driver will return latest information from storage.

Returns​

Return type: Promise<IVersion[]>

readBlob​

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

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature​

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

Parameters​

ParameterTypeDescription
summaryISummaryTree
contextISummaryContext

Returns​

Return type: Promise<string>