BimTwinfinityApiClient
Implements
Index
Constructors
publicconstructor
Constructor
Parameters
baseUrl: URL | URL[]
Url to twinfinity. Example: https://bim.demo.projektstruktur.se or https://bim.demo.projektstruktur.se/sites/portal/projects/projectA
optionaloptions: TwinfinityApiSession
Returns BimTwinfinityApiClient
Properties
publicreadonlybaseUrl
publicreadonlylayers
Access to layer operations.
publicreadonlymapBox
Access to MapBox operations.
publicreadonlymessages
Access to message operations.
publicreadonlysettings
Access to settings operations.
publicreadonlyupload
Access to upload operations.
Accessors
publicid
Hostname of baseUrl.
Returns string
Methods
publiccanDelete
Determines whether a change can be deleted by calling deleteChanges.
Parameters
__namedParameters: BimChange
Change to check.
Returns boolean
``true``if it is possible to delete the change. Otherwise``false``.
publicdeleteChanges
Parameters
changesToDelete: BimChange[]
Returns Promise<TypedResponse<number>[]>
publicget
Issues an HTTP GET specified url.
Type parameters
- T
The type of data the specified converter will convert the HTTP response body to.
Parameters
absoluteUrl: string | URL
Url to issue HTTP GET to.
converter: (r: Response) => TypedResponse<T>
Converter for response. See HttpResponseType for predefined converters.
optionalinit: RequestInit
Optional settings for to HTTP GET (fetch).
Returns Promise<TypedResponse<T>>
a TypedResponse containing the status code and the response value that resulted from using the specified converter.
- T
publicgetChanges
Retrieves all changes in and below a specified parent change and that matches a specific query. Use typescript type inference cast directly to a specific BimChange type if you know exactly which types the query will return
Type parameters
Parameters
parentOrUrl: URL | BimChange | BimContainer
Parent to get changes from.
options: { id: string } | { query: string } | { query: all }
example:
ifc.status=processed,dwg.status=processedor_system.layers.format=sensorsid: string
query: string
query: all
Returns Promise<TypedResponse<T[]>>
Changes in container that matched the filterQuery.
publicgetContainerInfo
Parameters
optionalcontainerOrUrl: URL | BimContainer
Returns Promise<TypedResponse<BimContainerInfo>>
publicgetContainers
Gets all containers (and workspaces) or just a specific one.
Parameters
optionalid: string
If given, only container with specific id is returned. Otherwise all containers are returned.
Returns Promise<BimContainer[]>
List of containers. May be empty if no containers were found or matched the specified id.
publicgetIfcChanges
Retrieves all (successfully processed) IFC changes located in and below a specified parent.
Parameters
parentOrUrl: URL | BimChange | BimContainer
Parent change to get IFC changes from.
Returns Promise<BimChangeIfc[]>
All successfully processed IFC changes in the specified container.
publicgetInfo
Returns Promise<TwinfinityInfo>
publicstaticcreate
Creates a new instance of
BimTwinfinityApiClientby detecting available root URLs for the current user.Parameters
hostnameOrUrl: string | URL
Hostname of the Twinfinity installation. If the hostname does not start with
bim.it will be added automatically. Its ok to pass a full URL too, but only the hostname is used. Scheme is always set tohttps.optionaloptions: TwinfinityApiSession
Optional session used to get authorization header for requests.
Returns Promise<undefined | BimTwinfinityApiClient>
A promise that resolves to a new instance of
BimTwinfinityApiClient. If no root URLs are detected, the promise resolves toundefined.undefinedindicates that the user is not authorized or does not have access to any Twinfinity resources.
publicstaticdetectRootUrls
Detects the root URLs available for the current user given a base URL. The result depends on type of Twinfinity installation, how its configured and which resources the user has access to. The method will test the following root URLs:
- {protocol}://{host}/sites/portal/
- {protocol}://{host}/sites/archive/
- {protocol}://{host}/workspaces/
Where {protocol} and {host} is taken from the provided
baseUrl.
Parameters
baseUrl: URL
The base URL to detect root URLs for.
optionaloptions: TwinfinityApiSession
Optional session used to get authorization header for requests.
Returns Promise<URL[]>
A promise that resolves to an array of detected root URLs.
Loads container and IFC data from the Twinfinity backend.