TwinfinityApiClientWithTwin
Hierarchy
- BimTwinfinityApiClient
- TwinfinityApiClientWithTwin
Index
Constructors
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 TwinfinityApiClientWithTwin
Properties
readonlybaseUrl
readonlylayers
Access to layer operations.
readonlymapBox
Access to MapBox operations.
readonlymessages
Access to message operations.
readonlysettings
Access to settings operations.
readonlyupload
Access to upload operations.
Accessors
id
Hostname of baseUrl.
Returns string
Methods
canDelete
Parameters
__namedParameters: BimChange
Returns boolean
deleteChanges
Parameters
changesToDelete: BimChange[]
Returns Promise<TypedResponse<number>[]>
get
Type parameters
- T
Parameters
absoluteUrl: string | URL
converter: (r: Response) => TypedResponse<T>
optionalinit: RequestInit
Returns Promise<TypedResponse<T>>
getChanges
Type parameters
- T: BimChange = BimChange
Parameters
parentOrUrl: URL | BimChange | BimContainer
options: { id: string } | { query: string } | { query: all }
id: string
query: string
query: all
Returns Promise<TypedResponse<T[]>>
getContainerInfo
Parameters
optionalcontainerOrUrl: URL | BimContainer
Returns Promise<TypedResponse<BimContainerInfo>>
getContainers
Parameters
optionalid: string
Returns Promise<BimContainer[]>
getIfcChanges
Parameters
parentOrUrl: URL | BimChange | BimContainer
Returns Promise<BimChangeIfc[]>
getInfo
Returns Promise<TwinfinityInfo>
publicgetTwinIfcChanges
Parameters
twin: Twin
Returns Promise<BimChangeIfc[]>
publicgetTwins
Returns Promise<Twin[]>
staticcreate
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.
staticdetectRootUrls
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.
Constructor