IDocumentStorageService Interface
Interface to provide access to snapshots saved for a shared object
Signature
export interface IDocumentStorageService extends Partial<IDisposable>
Extends: Partial<IDisposable
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
policies | optional |
IDocumentStorageServicePolicies | Policies implemented/instructed by driver. |
repositoryUrl | string |
Methods
Method | Return Type | Description |
---|---|---|
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
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.
Signature
downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
Parameters
Parameter | Type | Description |
---|---|---|
handle | ISummaryHandle |
Returns
Return type: Promise<ISummaryTree>
getSnapshotTree
Returns the snapshot tree.
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
Signature
getVersions(versionId: string | null, count: number, scenarioName?: string): 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. |
Returns
Return type: Promise<IVersion[]>
readBlob
Reads the object with the given ID, returns content in arrayBufferLike
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.
Signature
uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
Parameters
Parameter | Type | Description |
---|---|---|
summary | ISummaryTree | |
context | ISummaryContext |
Returns
Return type: Promise<string>