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

Property Alerts Modifiers Type Description
policies Alpha optional, readonly IDocumentStorageServicePolicies | undefined Policies implemented/instructed by driver.

Methods

Method Alerts Modifiers Return Type Description
createBlob(file) Alpha Promise<ICreateBlobResponse> Creates a blob out of the given buffer
downloadSummary(handle) Alpha 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.
getSnapshot(snapshotFetchOptions) Alpha optional Promise<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) Alpha Promise<ISnapshotTree | null> Returns the snapshot tree.
getVersions(versionId, count, scenarioName, fetchSource) Alpha Promise<IVersion[]> Retrieves all versions of the document starting at the specified versionId - or null if from the head
readBlob(id) Alpha Promise<ArrayBufferLike> Reads the object with the given ID, returns content in arrayBufferLike
uploadSummaryWithContext(summary, context) Alpha 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.

This API is provided as an alpha preview and may change without notice.

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

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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Type Description
file ArrayBufferLike

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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Type Description
handle ISummaryHandle

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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Modifiers Type Description
snapshotFetchOptions optional ISnapshotFetchOptions Options 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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Modifiers Type Description
version optional IVersion Version of the snapshot to be fetched.
scenarioName optional string scenario 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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Modifiers Type Description
versionId string | null Version id of the requested version.
count number Number of the versions to be fetched.
scenarioName optional string scenario 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.
fetchSource optional FetchSource Callers 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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Type Description
id string

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 as an alpha preview and may change without notice.

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

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

Signature

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

Parameters

Parameter Type Description
summary ISummaryTree
context ISummaryContext

Returns

Return type: Promise<string>