Constructor
Url to twinfinity. Example: https://bim.demo.projektstruktur.se or https://bim.demo.projektstruktur.se/sites/portal/projects/projectA
Optionaloptions: TwinfinityApiOptionsReadonlybaseReadonlylayersAccess to layer operations.
ReadonlymapAccess to MapBox operations.
ReadonlymessagesAccess to message operations.
ReadonlysettingsAccess to settings operations.
ReadonlytwinsAccess to twin operations.
ReadonlyuploadAccess to upload operations.
Hostname of baseUrl.
Determines whether a change can be deleted by calling deleteChanges.
Change to check.
true if it is possible to delete the change. Otherwise false.
Array of changes to delete
A response with TypedResponse.status === 200 and the number of changes that
was deleted. In case of error appropriates TypedResponse.status code's are returned.
Issues an HTTP GET specified url.
The type of data the specified converter will convert the HTTP response body to.
Url to issue HTTP GET to.
Converter for response. See HttpResponseType for predefined converters.
Optionalinit: RequestInitOptional settings for to HTTP GET (fetch).
a TypedResponse containing the status code and the response value that resulted from using the specified converter.
// Gets a JSON object and convert it to the MyObj interface.
const myObjResponse = this.get<MyObj>("http://foo.com/jsonendpoint", HttpResponseType.json)
const myObj = myObjResponse.status === 200 ? (await myObjResponse.value) : undefined;
// Gets a binary ArrayBuffer.
const myArrayBufferResponse = this.get("http://foo.com/jsonendpoint", HttpResponseType.arrayBuffer)
const myArrayBuffer = myArrayBufferResponse.status === 200 ? (await myArrayBufferResponse.value) : undefined;
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
Parent to get changes from.
example: ifc.status=processed, dwg.status=processed or _system.layers.format=sensors
Changes in container that matched the filterQuery.
const dwgChanges: BimChangeDwg[] = api.getChanges(container, {query: "dwg.status=Processed"});
const ifcFailures = api.getChanges(container, PredefinedBimChangeMetadataQuery.ifc(BimChangeStatus.Failed));
It is expensive to get all changes in a container. Use a query to filter out only the changes you are interested in.
Getting everything is discouraged as there can be 100k+ changes in a container. Be specific.
As it is expensive DO NOT use this method to get the changes for many/all containers in the system.
There can be many containers and many changes (like 100k+) in each container.
OptionalcontainerOrUrl: BimContainer | URLIf given returns info specified container. If not given, the root container is returned.
TypedResponse with container information. If container is undefined, a root container
is returned. If there are multiple root containers, only one can be returned using the following
priority order:
First ProjectNetwork and then Archive.
Response will be 404 if no root container does exist.
Resonse will be 401 response if user is not logged in.
Gets all containers (and workspaces) or just a specific one.
Optionalid: stringIf given, only container with specific id is returned. Otherwise all containers are returned.
List of containers. May be empty if no containers were found or matched the specified id.
Retrieves all (successfully processed) IFC changes located in and below a specified parent.
Parent change to get IFC changes from.
All successfully processed IFC changes in the specified container.
TwinfinityInfo instance
StaticcreateCreates a new instance of BimTwinfinityApiClient by detecting available root URLs for the current user.
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 to https.
Optionaloptions: TwinfinityApiOptionsOptional session used to get authorization header for requests.
A promise that resolves to a new instance of BimTwinfinityApiClient. If no root URLs are detected, the promise resolves to undefined.
undefined indicates that the user is not authorized or does not have access to any Twinfinity resources.
StaticdetectDetects 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:
baseUrl.The base URL to detect root URLs for.
Optionaloptions: TwinfinityApiOptionsOptional session used to get authorization header for requests.
A promise that resolves to an array of detected root URLs.
Loads container and IFC data from the Twinfinity backend.