Skip to content 

@fluidframework/driver-utils Package

Packages > @fluidframework/driver-utils

Classes

List of classes contained in this package or namespace
Class Description
AuthorizationError
BlobCacheStorageService IDocumentStorageService adapter with pre-cached blobs.
DocumentStorageServiceProxy
GenericNetworkError Generic network error class.
MultiDocumentServiceFactory
MultiUrlResolver
NetworkErrorBasic
NonRetryableError
ThrottlingError Throttling error class - used to communicate all throttling errors

Enumerations

List of enums contained in this package or namespace
Enumeration Description
OnlineStatus

Functions

List of functions contained in this package or namespace
Function Description
buildSnapshotTree(entries, blobMap) Build a tree hierarchy base on an array of ITreeEntry
combineAppAndProtocolSummary(appSummary, protocolSummary) Combine the app summary and protocol summary in 1 tree.
configurableUrlResolver(resolversList, request) Resolver that takes a list of url resolvers and then try each of them to resolve the url.
createGenericNetworkError(errorMessage, canRetry, retryAfterSeconds, statusCode)
ensureFluidResolvedUrl(resolved)
getDocAttributesFromProtocolSummary(protocolSummary) Extract the attributes from the protocol summary.
getQuorumValuesFromProtocolSummary(protocolSummary) Extract quorum values from the protocol summary.
isOnline()
readAndParse(storage, id) Read a blob from IDocumentStorageService, decode it (from "base64") and JSON.parse it into object of type T
readAndParseFromBlobs(blobs, id) Read a blob from map, decode it (from "base64") and JSON.parse it into object of type T

Variables

List of variables contained in this package or namespace
Variable Description
createWriteError
isFluidResolvedUrl

Enumerations

OnlineStatus enum

Signature:

export declare enum OnlineStatus 

Enumeration Members

List of members in use in this enum
Member Value Description
Offline 0
Online 1
Unknown 2

Functions

buildSnapshotTree

Build a tree hierarchy base on an array of ITreeEntry

Signature:

export declare function buildSnapshotTree(entries: ITreeEntry[], blobMap: Map<string, string>): Promise<ISnapshotTree>;

Parameters

List of parameters
Parameter Type Description
entries ITreeEntry[] an array of ITreeEntry to flatten
blobMap Map a map of blob's sha1 to content that gets filled with content from entries NOTE: blobMap's validity is contingent on the returned promise's resolution

Returns:

Promise<ISnapshotTree>

the hierarchical tree

combineAppAndProtocolSummary

Combine the app summary and protocol summary in 1 tree.

Signature:

export declare function combineAppAndProtocolSummary(appSummary: ISummaryTree, protocolSummary: ISummaryTree): ISummaryTree;

Parameters

List of parameters
Parameter Type Description
appSummary ISummaryTree Summary of the app.
protocolSummary ISummaryTree Summary of the protocol.

Returns:

ISummaryTree

configurableUrlResolver

Resolver that takes a list of url resolvers and then try each of them to resolve the url.

Signature:

export declare function configurableUrlResolver(resolversList: IUrlResolver[], request: IRequest): Promise<IResolvedUrl | undefined>;

Parameters

List of parameters
Parameter Type Description
resolversList IUrlResolver[] List of url resolvers to be used to resolve the request.
request IRequest Request to be resolved.

Returns:

Promise<IResolvedUrl | undefined>

createGenericNetworkError

Signature:

export declare function createGenericNetworkError(errorMessage: string, canRetry: boolean, retryAfterSeconds?: number, statusCode?: number): GenericNetworkError | ThrottlingError;

Parameters

List of parameters
Parameter Type Description
errorMessage string
canRetry boolean
retryAfterSeconds number
statusCode number

Returns:

GenericNetworkError | ThrottlingError

ensureFluidResolvedUrl

Signature:

export declare function ensureFluidResolvedUrl(resolved: IResolvedUrl | undefined): asserts resolved is IFluidResolvedUrl;

Parameters

List of parameters
Parameter Type Description
resolved IResolvedUrl | undefined

Returns:

asserts resolved is IFluidResolvedUrl

getDocAttributesFromProtocolSummary

Extract the attributes from the protocol summary.

Signature:

export declare function getDocAttributesFromProtocolSummary(protocolSummary: ISummaryTree): IDocumentAttributes;

Parameters

List of parameters
Parameter Type Description
protocolSummary ISummaryTree protocol summary from which the values are to be extracted.

Returns:

IDocumentAttributes

getQuorumValuesFromProtocolSummary

Extract quorum values from the protocol summary.

Signature:

export declare function getQuorumValuesFromProtocolSummary(protocolSummary: ISummaryTree): [string, ICommittedProposal][];

Parameters

List of parameters
Parameter Type Description
protocolSummary ISummaryTree protocol summary from which the values are to be extracted.

Returns:

[string, ICommittedProposal][]

isOnline

Signature:

export declare function isOnline(): OnlineStatus;

Returns:

OnlineStatus

readAndParse

Read a blob from IDocumentStorageService, decode it (from “base64”) and JSON.parse it into object of type T

Signature:

export declare function readAndParse<T>(storage: Pick<IDocumentStorageService, "read">, id: string): Promise<T>;

Parameters

List of parameters
Parameter Type Description
storage Pick<IDocumentStorageService, "read"> the IDocumentStorageService to read from
id string the id of the blob to read and parse

Returns:

Promise<T>

the object that we decoded and JSON.parse

readAndParseFromBlobs

Read a blob from map, decode it (from “base64”) and JSON.parse it into object of type T

Signature:

export declare function readAndParseFromBlobs<T>(blobs: {
    [index: string]: string;
}, id: string): T;

Parameters

List of parameters
Parameter Type Description
blobs { [index: string]: string; } the blob map to read from
id string the id of the blob to read and parse

Returns:

T

the object that we decoded and JSON.parse

Variables

createWriteError

Signature:

createWriteError: (errorMessage: string) => NonRetryableError<DriverErrorType>

isFluidResolvedUrl

Signature:

isFluidResolvedUrl: (resolved: import("@fluidframework/driver-definitions").IWebResolvedUrl | IFluidResolvedUrl | undefined) => resolved is IFluidResolvedUrl