OdspDriverUrlResolverForShareLink Class
Resolver to resolve urls like the ones created by createOdspUrl which is driver inner url format and the ones which have things like driveId, siteId, itemId etc encoded in nav param. This resolver also handles share links and try to generate one for the use by the app. \
To use, import via @fluidframework/odsp-driver/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare class OdspDriverUrlResolverForShareLink implements IUrlResolver
Implements: IUrlResolver
Constructors
Constructor | Alerts | Description |
---|---|---|
(constructor)(shareLinkFetcherProps, logger, appName, getContext, containerPackageInfo) | Beta |
Creates url resolver instance |
Static Methods
Method | Alerts | Return Type | Description |
---|---|---|---|
createDocumentUrl(baseUrl, driverInfo) | Beta |
string | Crafts a supported document/driver URL |
Methods
Method | Alerts | Return Type | Description |
---|---|---|---|
appendDataStorePath(requestUrl, pathToAppend) | Beta |
string | undefined | Takes an already generated data store url (from requestUrl) and appends a path to the existing data store information. |
appendLocatorParams(baseUrl, resolvedUrl, dataStorePath, packageInfoSource) | Beta |
Promise<string> | Appends the store locator properties to the provided base URL. This function is useful for scenarios where an application has a base URL (for example a sharing link) of the Fluid file, but does not have the locator information that would be used by Fluid to load the file later. |
getAbsoluteUrl(resolvedUrl, dataStorePath, packageInfoSource) | Beta |
Promise<string> | Requests a driver + data store storage URL. Note that this method requires share link to be fetched and it will throw in case share link fetcher props were not specified when instance was created. |
resolve(request) | Beta |
Promise<IOdspResolvedUrl> | Resolves request URL into driver details |
Constructor Details
(constructor)
Creates url resolver instance
For more information about our API support guarantees, see here.
Signature
constructor(shareLinkFetcherProps?: ShareLinkFetcherProps | undefined, logger?: ITelemetryBaseLogger, appName?: string | undefined, getContext?: ((resolvedUrl: IOdspResolvedUrl, dataStorePath: string) => Promise<string | undefined>) | undefined, containerPackageInfo?: IContainerPackageInfo | undefined);
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
shareLinkFetcherProps | optional | ShareLinkFetcherProps | undefined | properties used when fetching share link. Can be set as 'undefined' for cases where share link is not needed. Currently, only getAbsoluteUrl() method requires share link. |
logger | optional | ITelemetryBaseLogger | logger object that is used as telemetry sink |
appName | optional | string | undefined | application name hint that is encoded with url produced by getAbsoluteUrl() method. This hint is used by link handling logic which determines which app to redirect to when user navigates directly to the link. |
getContext | optional | ((resolvedUrl: IOdspResolvedUrl, dataStorePath: string) => Promise<string | undefined>) | undefined | callback function which is used to get context for given resolved url. If context is returned then it will be embedded into url returned by getAbsoluteUrl() method. |
containerPackageInfo | optional | IContainerPackageInfo | undefined | container package information which will be used to extract the container package name. |
Method Details
appendDataStorePath
Takes an already generated data store url (from requestUrl) and appends a path to the existing data store information.
For more information about our API support guarantees, see here.
Signature
appendDataStorePath(requestUrl: URL, pathToAppend: string): string | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
requestUrl | URL | |
pathToAppend | string |
Returns
Return type: string | undefined
appendLocatorParams
Appends the store locator properties to the provided base URL. This function is useful for scenarios where an application has a base URL (for example a sharing link) of the Fluid file, but does not have the locator information that would be used by Fluid to load the file later.
For more information about our API support guarantees, see here.
Signature
appendLocatorParams(baseUrl: string, resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
baseUrl | string | The input URL on which the locator params will be appended. | |
resolvedUrl | IResolvedUrl | odsp-driver's resolvedURL object. | |
dataStorePath | string | The relative data store path URL. For requesting a driver URL, this value should always be '/'. If an empty string is passed, then dataStorePath will be extracted from the resolved url if present. | |
packageInfoSource | optional | IContainerPackageInfo |
Returns
The provided base URL appended with odsp-specific locator information
Return type: Promise<string>
createDocumentUrl
Crafts a supported document/driver URL
For more information about our API support guarantees, see here.
Signature
static createDocumentUrl(baseUrl: string, driverInfo: OdspFluidDataStoreLocator): string;
Parameters
Parameter | Type | Description |
---|---|---|
baseUrl | string | |
driverInfo | OdspFluidDataStoreLocator |
Returns
Return type: string
getAbsoluteUrl
Requests a driver + data store storage URL. Note that this method requires share link to be fetched and it will throw in case share link fetcher props were not specified when instance was created.
For more information about our API support guarantees, see here.
Signature
getAbsoluteUrl(resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
resolvedUrl | IResolvedUrl | The driver resolved URL | |
dataStorePath | string | The relative data store path URL. For requesting a driver URL, this value should always be '/'. If an empty string is passed, then dataStorePath will be extracted from the resolved url if present. | |
packageInfoSource | optional | IContainerPackageInfo | optional, represents container package information to be included in url. |
Returns
Return type: Promise<string>
resolve
Resolves request URL into driver details
For more information about our API support guarantees, see here.
Signature
resolve(request: IRequest): Promise<IOdspResolvedUrl>;
Parameters
Parameter | Type | Description |
---|---|---|
request | IRequest |
Returns
Return type: Promise<IOdspResolvedUrl>