///
/** @packageDocumentation
* @module OtherServices
*/
import { ClientRequestContext } from "@bentley/bentleyjs-core";
import { WsgInstance } from "./ECJsonTypeMap";
import { WsgClient } from "./WsgClient";
import { URL } from "url";
import { RequestQueryOptions } from "./Request";
import { AuthorizedClientRequestContext } from "./AuthorizedClientRequestContext";
import { Range2d } from "@bentley/geometry-core";
/** RealityData
* This class implements a Reality Data stored in ProjectWise Context Share (Reality Data Service)
* Data is accessed directly through methods of the reality data instance.
* Access to the data required a properly entitled token though the access to the blob is controlled through
* an Azure blob URL, the token may be required to obtain this Azure blob URL or refresh it.
* The Azure blob URL is considered valid for an hour and is refreshed after 50 minutes.
* In addition to the reality data properties, and Azure blob URL and internal states, a reality data also contains
* the identification of the CONNECT project to identify the context(used for access permissions resolution) and
* may contain a RealityDataClient to obtain the WSG client specialization to communicate with ProjectWise Context Share (to obtain the Azure blob URL).
* @internal
*/
export declare class RealityData extends WsgInstance {
id?: string;
organizationId?: string;
ultimateId?: string;
ultimateSite?: string;
/** This is typically the iModelId */
containerName?: string;
dataLocationGuid?: string;
name?: string;
dataSet?: string;
group?: string;
description?: string;
rootDocument?: string;
size?: string;
sizeUpToDate?: boolean;
classification?: string;
streamed?: boolean;
type?: string;
referenceElevation?: number;
footprint?: string;
approximateFootprint?: boolean;
thumbnailDocument?: string;
metadataUrl?: string;
copyright?: string;
termsOfUse?: string;
accuracyInMeters?: string;
resolutionInMeters?: string;
dataAcquisitionDate?: string;
dataAcquirer?: string;
visibility?: string;
listable?: boolean;
modifiedTimestamp?: string;
lastAccessedTimestamp?: string;
createdTimestamp?: string;
ownedBy?: string;
ownerId?: string;
creatorId?: string;
version?: string;
hidden?: boolean;
private _blobUrl;
private _blobTimeStamp;
private _blobRooDocumentPath;
client: undefined | RealityDataServicesClient;
projectId: undefined | string;
/**
* Gets string url to fetch blob data from. Access is read-only.
* @param requestContext The client request context.
* @param name name or path of tile
* @param nameRelativeToRootDocumentPath (optional default is false) Indicates if the given name is relative to the root document path.
* @returns string url for blob data
*/
getBlobStringUrl(requestContext: AuthorizedClientRequestContext, name: string, nameRelativeToRootDocumentPath?: boolean): Promise;
/**
* Gets a tileset's tile data
* @param requestContext The client request context.
* @param name name or path of tile
* @param nameRelativeToRootDocumentPath (optional default is false) Indicates if the given name is relative to the root document path.
* @returns tile data json
*/
getModelData(requestContext: AuthorizedClientRequestContext, name: string, nameRelativeToRootDocumentPath?: boolean): Promise;
/**
* Gets a tile access url URL object
* @param requestContext The client request context.
* @param writeAccess Optional boolean indicating if write access is requested. Default is false for read-only access.
* @returns app URL object for blob url
*/
getBlobUrl(requestContext: AuthorizedClientRequestContext, writeAccess?: boolean): Promise;
/**
* Gets a tileset's app data json
* @param requestContext The client request context.
* @param name name or path of tile
* @param nameRelativeToRootDocumentPath (optional default is false) Indicates if the given name is relative to the root document path.
* @returns app data json object
*/
getTileJson(requestContext: AuthorizedClientRequestContext, name: string, nameRelativeToRootDocumentPath?: boolean): Promise;
/**
* Gets tile content
* @param requestContext The client request context.
* @param name name or path of tile
* @param nameRelativeToRootDocumentPath (optional default is false) Indicates if the given name is relative to the root document path.
* @returns array buffer of tile content
*/
getTileContent(requestContext: AuthorizedClientRequestContext, name: string, nameRelativeToRootDocumentPath?: boolean): Promise;
/**
* Gets a reality data root document json
* @param requestContext The client request context.
* @returns tile data json
*/
getRootDocumentJson(requestContext: AuthorizedClientRequestContext): Promise;
}
/** File Access Key
* This class is used by the RealityDataServicesClient to extract an Azure blob URL
* @internal
*/
export declare class FileAccessKey extends WsgInstance {
url?: string;
type?: string;
permissions?: string;
requiresConfirmation?: string;
}
/** RealityDataRelationship
* This class is used to represent relationships with a Reality Data and CONNECT Context (CONNECT Project or CONNECT Asset)
* @internal
*/
export declare class RealityDataRelationship extends WsgInstance {
realityDataId?: string;
relationType?: string;
relatedId?: string;
modifiedTimestamp?: string;
createdTimestamp?: string;
}
/** Query options for RealityDataServiceRequest
* @Internal
*/
export interface RealityDataServicesRequestQueryOptions extends RequestQueryOptions {
/** Set to limit result to a single project */
project?: string;
/** Set a polygon string to query for overlap */
polygon?: string;
/** Set an action for the Query. Either ALL, USE or ASSIGN */
action?: string;
}
/**
* Client wrapper to Reality Data Service.
* An instance of this class is used to extract reality data from the ProjectWise Context Share (Reality Data Service)
* Most important methods enable to obtain a specific reality data, fetch all reality data associated to a project and
* all reality data of a project within a provided spatial extent.
* This class also implements extraction of the Azure blob address.
* @internal
*/
export declare class RealityDataServicesClient extends WsgClient {
static readonly searchKey: string;
static readonly configRelyingPartyUri = "imjs_reality_data_service_relying_party_uri";
/**
* Creates an instance of RealityDataServicesClient.
*/
constructor();
/**
* Gets name/key to query the service URLs from the URL Discovery Service ("Buddi")
* @returns Search key for the URL.
*/
protected getUrlSearchKey(): string;
/**
* Gets theRelyingPartyUrl for the service.
* @returns RelyingPartyUrl for the service.
*/
protected getRelyingPartyUrl(): string;
/**
* This method returns the URL to obtain the Reality Data details from PW Context Share.
* Technically it should never be required as the RealityData object returned should have all the information to obtain the
* data.
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param tilesId realityDataInstance id, called tilesId when returned from tile generator job
* @returns string containing the URL to reality data for indicated tile.
*/
getRealityDataUrl(requestContext: ClientRequestContext, projectId: string | undefined, tilesId: string): Promise;
/**
* Gets reality data with all of its properties
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param tilesId realityDataInstance id, called tilesId when returned from tile generator job
* @returns The requested reality data.
*/
getRealityData(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, tilesId: string): Promise;
/**
* Gets all reality data associated to the project. Consider using getRealityDataInProjectOverlapping() if spatial extent is known.
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @returns an array of RealityData that are associated to the project.
*/
getRealityDataInProject(requestContext: AuthorizedClientRequestContext, projectId: string, type?: string): Promise;
/**
* Gets all reality data that has a footprint defined that overlaps the given area and that are associated with the project. Reality Data returned must be accessible by user
* as public, enterprise data, private or accessible through context RBAC rights attributed to user.
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param range The range to search for given as a range 2d where X represents the longitude in radians and Y the latitude in radians
* longitude can be in the range -2P to 2PI but the minimum value must be smaller numerically to the maximum.
* Note that the longitudes are usually by convention in the range of -PI to PI except
* for ranges that overlap the -PI/+PI frontier in which case either representation is acceptable.
* @returns an array of RealityData
*/
getRealityDataInProjectOverlapping(requestContext: AuthorizedClientRequestContext, projectId: string, range: Range2d, type?: string): Promise;
/**
* Gets reality datas with all of its properties
* @param requestContext The client request context.
* @param projectId id of associated connect project.
* @param queryOptions RealityDataServicesRequestQueryOptions of the request.
* @returns The requested reality data.
*/
getRealityDatas(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, queryOptions: RealityDataServicesRequestQueryOptions): Promise;
/**
* Creates a reality data with given properties
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param realityData The reality data to create. The Id of the reality data is usually left empty indicating for the service to assign
* one. If set then the reality id must not exist on the server.
* realityDataInstance id, called tilesId when returned from tile generator job
* @returns The new reality data with all read-only properties set.
*/
createRealityData(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, realityData: RealityData): Promise;
/**
* Updates a reality data with given properties
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param realityData The reality data to update. The Id must contain the identifier of the reality data to update.
* NOTE: As a probable known defect some specific read-only attributes must be undefined prior to passing the reality data.
* These are: organizationId, sizeUpToDate, ownedBy, ownerId
* @returns The newly modified reality data.
*/
updateRealityData(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, realityData: RealityData): Promise;
/**
* Deletes a reality data.
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param realityDataId The identifier of the reality data to delete.
* @returns a void Promise.
*/
deleteRealityData(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, realityDataId: string): Promise;
/**
* Gets all reality data relationships associated to the given reality id, not only the relationship for given project.
* @param requestContext The client request context.
* @param projectId id of associated connect project in which to make to call for permission reason
* @param realityDataId realityDataInstance id to obtain the relationships for.
* @returns All relationships associated to reality data. The requested reality data.
*/
getRealityDataRelationships(requestContext: AuthorizedClientRequestContext, projectId: string, realityDataId: string): Promise;
/**
* Gets all reality data relationships associated to the given reality id, not only the relationship for given project.
* @param requestContext The client request context.
* @param projectId id of associated connect project in which to make to call for permission reason
* @param realityDataId realityDataInstance id to obtain the relationships for.
* @returns All relationships associated to reality data. The requested reality data.
*/
createRealityDataRelationship(requestContext: AuthorizedClientRequestContext, projectId: string, relationship: RealityDataRelationship): Promise;
/**
* Gets all reality data relationships associated to the given reality id, not only the relationship for given project.
* @param requestContext The client request context.
* @param projectId id of associated connect project in which to make to call for permission reason
* @param realityDataId realityDataInstance id to obtain the relationships for.
* @returns All relationships associated to reality data. The requested reality data.
*/
deleteRealityDataRelationship(requestContext: AuthorizedClientRequestContext, projectId: string, relationshipId: string): Promise;
/**
* Gets a tile file access key
* @param requestContext The client request context.
* @param projectId id of associated connect project
* @param tilesId realityDataInstance id, called tilesId when returned from tile generator job.
* @param writeAccess Optional boolean indicating if write access is requested. Default is false for read-only access.
* @returns a FileAccessKey object containing the Azure blob address.
*/
getFileAccessKey(requestContext: AuthorizedClientRequestContext, projectId: string | undefined, tilesId: string, writeAccess?: boolean): Promise;
/**
* This is the method that determines if the url refers to Reality Data stored on PW Context Share. If not then undefined is returned.
* @param url A fully formed URL to a reality data or a reality data folder or document of the form:
* https://{Host}/{version}/Repositories/S3MXECPlugin--{ProjectId}/S3MX/RealityData/{RealityDataId}
* https://{Host}/{version}/Repositories/S3MXECPlugin--{ProjectId}/S3MX/Folder/{RealityDataId}~2F{Folder}
* https://{Host}/{version}/Repositories/S3MXECPlugin--{ProjectId}/S3MX/Document/{RealityDataId}~2F{Full Document Path and name}'
* Where {Host} represents the Reality Data Service server (ex: connect-realitydataservices.bentley.com). This value is ignored since the
* actual host server name depends on the environment or can be changed in the future.
* Where {version} is the Bentley Web Service Gateway protocol version. This value is ignored but the version must be supported by Reality Data Service.
* Where {Folder} and {Document} are the full folder or document path relative to the Reality Data root.
* {RealityDataId} is extracted after validation of the URL and returned.
* {ProjectId} is ignored.
* @returns A string containing the Reality Data Identifier (otherwise named tile id). If the URL is not a reality data service URL then undefined is returned.
*/
getRealityDataIdFromUrl(url: string): string | undefined;
}
//# sourceMappingURL=RealityDataServicesClient.d.ts.map