@fluidframework/driver-utils Package
Packages > @fluidframework/driver-utils
Classes
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
Enumeration | Description |
---|---|
OnlineStatus |
Functions
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
Variable | Description |
---|---|
canRetryOnError | Check if a connection error can be retried. Unless explicitly disallowed, retry is allowed. |
createWriteError | |
isFluidResolvedUrl |
Enumerations
OnlineStatus enum
Signature:
export declare enum OnlineStatus
Enumeration Members
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>): ISnapshotTree;
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:
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
Parameter | Type | Description |
---|---|---|
appSummary | ISummaryTree | Summary of the app. |
protocolSummary | ISummaryTree | Summary of the protocol. |
Returns:
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
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
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
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
Parameter | Type | Description |
---|---|---|
protocolSummary | ISummaryTree | protocol summary from which the values are to be extracted. |
Returns:
getQuorumValuesFromProtocolSummary
Extract quorum values from the protocol summary.
Signature:
export declare function getQuorumValuesFromProtocolSummary(protocolSummary: ISummaryTree): [string, ICommittedProposal][];
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:
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
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
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
canRetryOnError
Check if a connection error can be retried. Unless explicitly disallowed, retry is allowed.
Signature:
canRetryOnError: (error: any) => boolean
createWriteError
Signature:
createWriteError: (errorMessage: string) => NonRetryableError<DriverErrorType>
isFluidResolvedUrl
Signature:
isFluidResolvedUrl: (resolved: import("@fluidframework/driver-definitions").IWebResolvedUrl | IFluidResolvedUrl | undefined) => resolved is IFluidResolvedUrl