LinkedData
Class in @bimworks/jssdk.
API catalogue · @bimworks/jssdk · Class
class LinkedDataFiles, URLs, texts and identifiers linked to objects, which follow their objects to later versions. Available through
BimWorksClient.linkedData. Reading needs the scope links:read, changing links:write.
Members#
| Member | Kind | Description |
|---|---|---|
| constructor | Method | |
| addTargets | Method | Links an existing item to more objects; a target it is on already is left as it is |
| confirm | Method | Confirms that a link marked CHECK on the version is on the right object |
| counts | Method | Which objects of a version have linked data: for colouring and markers |
| download | Method | The item's content, as uploaded: a file byte for byte, a URL, identifier or text as text/plain |
| downloadUrl | Method | A URL of the item's content, valid for a few minutes without a token (treat it like the file itself), that supports Range, for a browser tab, a player or a P… |
| end | Method | Ends a link from the version on; the older versions keep it |
| get | Method | One item, its links with their trail across versions, and its replacements |
| link | Method | Links every item to every target; a refused item does not refuse the others |
| list | Method | The linked data on a version, followed up to it first |
| policy | Method | What this server accepts: the file families, the deny list, the limits, the categories |
| reattach | Method | Puts a link on another object from the version on |
| remove | Method | Deletes items from every object and version, restorable for the policy's retention_days |
| replace | Method | Replaces an item from a version on; the older versions keep it |
| restore | Method | |
| unlink | Method | Takes links off their objects on every version; an item that loses its last link is deleted |
| update | Method | Edits what can be edited; a stale rowVersion rejects with VERSION_CONFLICT |
constructor#
constructor()addTargets#
public addTargets(itemUuid: string, versionUuid: string, targets: (LinkTarget)[]): Promise<{ item: LinkedDataItem; links: (LinkedDataLink)[] }>Links an existing item to more objects; a target it is on already is left as it is
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
|
versionUuid |
string |
|
targets |
(LinkTarget)[] |
confirm#
public confirm(linkUuid: string, versionUuid: string): Promise<{ confirmed_anchor_uuid: string; link: LinkedDataLink }>Confirms that a link marked CHECK on the version is on the right object
Parameters#
| Name | Type | Description |
|---|---|---|
linkUuid |
string |
|
versionUuid |
string |
counts#
public counts(versionUuid: string, options?: { includeLater?: boolean }): Promise<LinkedDataCounts>Which objects of a version have linked data: for colouring and markers
Parameters#
| Name | Type | Description |
|---|---|---|
versionUuid |
string |
|
options |
{ includeLater?: boolean } |
download#
public download(itemUuid: string): Promise<ArrayBuffer>The item's content, as uploaded: a file byte for byte, a URL, identifier or text as text/plain
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
downloadUrl#
public downloadUrl(itemUuid: string, options?: { inline?: boolean }): Promise<{ disposition: "attachment" | "inline"; expires: string; path?: string; url: string }>A URL of the item's content, valid for a few minutes without a token (treat it like the file itself), that supports Range, for a browser tab, a player or a PDF viewer. With inline: true it shows the content when the type allows it; disposition says what it will do.
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
|
options |
{ inline?: boolean } |
end#
public end(linkUuid: string, fromVersionUuid: string): Promise<{ link: LinkedDataLink }>Ends a link from the version on; the older versions keep it
Parameters#
| Name | Type | Description |
|---|---|---|
linkUuid |
string |
|
fromVersionUuid |
string |
get#
public get(itemUuid: string, versionUuid?: string): Promise<LinkedDataDetails>One item, its links with their trail across versions, and its replacements
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
|
versionUuid |
string |
link#
public link(versionUuid: string, targets: (LinkTarget)[], items: (LinkedDataItemInput)[], options?: LinkedDataProgressOptions): Promise<LinkDataResult>Links every item to every target; a refused item does not refuse the others
Parameters#
| Name | Type | Description |
|---|---|---|
versionUuid |
string |
|
targets |
(LinkTarget)[] |
|
items |
(LinkedDataItemInput)[] |
|
options |
LinkedDataProgressOptions |
list#
public list(versionUuid: string, options?: ListLinkedDataOptions): Promise<LinkedDataList>The linked data on a version, followed up to it first
Parameters#
| Name | Type | Description |
|---|---|---|
versionUuid |
string |
|
options |
ListLinkedDataOptions |
policy#
public policy(): Promise<LinkedDataPolicy>What this server accepts: the file families, the deny list, the limits, the categories
reattach#
public reattach(linkUuid: string, versionUuid: string, target: LinkTarget): Promise<{ link: LinkedDataLink }>Puts a link on another object from the version on
Parameters#
| Name | Type | Description |
|---|---|---|
linkUuid |
string |
|
versionUuid |
string |
|
target |
LinkTarget |
remove#
public remove(itemUuids: (string)[], reason?: string): Promise<{ deleted: (string)[]; retention_days: number }>Deletes items from every object and version, restorable for the policy's retention_days
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuids |
(string)[] |
|
reason |
string |
replace#
public replace(itemUuid: string, fromVersionUuid: string, item: LinkedDataItemInput, options?: LinkedDataProgressOptions): Promise<{ deleted: boolean; ended: (string)[]; item: LinkedDataItem; links: (LinkedDataLink)[]; unlinked: (string)[] }>Replaces an item from a version on; the older versions keep it
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
|
fromVersionUuid |
string |
|
item |
LinkedDataItemInput | |
options |
LinkedDataProgressOptions |
restore#
public restore(itemUuids: (string)[]): Promise<{ restored: (string)[] }>Parameters#
| Name | Type | Description |
|---|---|---|
itemUuids |
(string)[] |
unlink#
public unlink(linkUuids: (string)[]): Promise<{ items_deleted: (string)[]; unlinked: (string)[] }>Takes links off their objects on every version; an item that loses its last link is deleted
Parameters#
| Name | Type | Description |
|---|---|---|
linkUuids |
(string)[] |
update#
public update(itemUuid: string, rowVersion: number, fields: { category?: string; description?: string; identifier_system?: string; title?: string; valid_until?: string }): Promise<LinkedDataItem>Edits what can be edited; a stale rowVersion rejects with VERSION_CONFLICT
Parameters#
| Name | Type | Description |
|---|---|---|
itemUuid |
string |
|
rowVersion |
number |
|
fields |
{ category?: string; description?: string; identifier_system?: string; title?: string; valid_until?: string } |