Skip to main content

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.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/odsp-driver/legacy.

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

export declare class OdspDriverUrlResolverForShareLink implements IUrlResolver

Implements: IUrlResolver

Constructors

ConstructorAlertsDescription
(constructor)(shareLinkFetcherProps, logger, appName, getContext, containerPackageInfo)BetaCreates url resolver instance

Static Methods

MethodAlertsReturn TypeDescription
createDocumentUrl(baseUrl, driverInfo)BetastringCrafts a supported document/driver URL

Methods

MethodAlertsReturn TypeDescription
appendDataStorePath(requestUrl, pathToAppend)Betastring | undefinedTakes an already generated data store url (from requestUrl) and appends a path to the existing data store information.
appendLocatorParams(baseUrl, resolvedUrl, dataStorePath, packageInfoSource)BetaPromise<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)BetaPromise<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)BetaPromise<IOdspResolvedUrl>Resolves request URL into driver details

Constructor Details

(constructor)

Creates url resolver instance

This API is provided for existing users, but is not recommended for new users.

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

ParameterModifiersTypeDescription
shareLinkFetcherPropsoptionalShareLinkFetcherProps | undefinedproperties 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.
loggeroptionalITelemetryBaseLoggerlogger object that is used as telemetry sink
appNameoptionalstring | undefinedapplication 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.
getContextoptional((resolvedUrl: IOdspResolvedUrl, dataStorePath: string) => Promise<string | undefined>) | undefinedcallback 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.
containerPackageInfooptionalIContainerPackageInfo | undefinedcontainer 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.

This API is provided for existing users, but is not recommended for new users.

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

Signature

appendDataStorePath(requestUrl: URL, pathToAppend: string): string | undefined;

Parameters

ParameterTypeDescription
requestUrlURL
pathToAppendstring

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.

This API is provided for existing users, but is not recommended for new users.

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

Signature

appendLocatorParams(baseUrl: string, resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;

Parameters

ParameterModifiersTypeDescription
baseUrlstringThe input URL on which the locator params will be appended.
resolvedUrlIResolvedUrlodsp-driver's resolvedURL object.
dataStorePathstringThe 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.
packageInfoSourceoptionalIContainerPackageInfo

Returns

The provided base URL appended with odsp-specific locator information

Return type: Promise<string>

createDocumentUrl

Crafts a supported document/driver URL

This API is provided for existing users, but is not recommended for new users.

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

Signature

static createDocumentUrl(baseUrl: string, driverInfo: OdspFluidDataStoreLocator): string;

Parameters

ParameterTypeDescription
baseUrlstring
driverInfoOdspFluidDataStoreLocator

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.

This API is provided for existing users, but is not recommended for new users.

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

Signature

getAbsoluteUrl(resolvedUrl: IResolvedUrl, dataStorePath: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;

Parameters

ParameterModifiersTypeDescription
resolvedUrlIResolvedUrlThe driver resolved URL
dataStorePathstringThe 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.
packageInfoSourceoptionalIContainerPackageInfooptional, represents container package information to be included in url.

Returns

Return type: Promise<string>

resolve

Resolves request URL into driver details

This API is provided for existing users, but is not recommended for new users.

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

Signature

resolve(request: IRequest): Promise<IOdspResolvedUrl>;

Parameters

ParameterTypeDescription
requestIRequest

Returns

Return type: Promise<IOdspResolvedUrl>