Infohub JS API
Loading...
Searching...
No Matches
BcfProjectResource Class Reference

Description

Represents one project-scoped BCF API resource.

const project = bcf.project(projectId);
await project.get();
await project.update({ name: "New name" });

Public Member Functions

get commentEvents ()
 document (documentId)
get documents ()
get extensions ()
get filesInformation ()
 get ()
 topic (topicId)
get topicEvents ()
get topics ()
 update (projectData)

Function Documentation

◆ commentEvents()

get commentEvents ( )

Gets the project-wide comment-event collection.

Returns
{BcfListResource} A listable resource.
// Output of commentEvents.list():
[{
"comment_guid": "C4215F4D-AC45-A43A-D615-AA456BEF832B",
"topic_guid": "A211FCC2-3A3B-EAA4-C321-DE22ABC8414",
"date": "2014-11-19T14:24:11.316Z",
"author": "Architect@example.com",
"events": [{ "type": "comment_created", "value": null }]
}]

◆ document()

document ( documentId)

Selects a document stored at project level (documents are uploaded/downloaded here, not under a topic - see BcfTopicResource#documents).

Parameters
{string}documentId - BCF document identifier.
Returns
{BcfProjectDocumentResource} The document resource.

◆ documents()

get documents ( )

Gets the project's document collection, fetched straight from the infohub Hub instead of through BCF's topic-nested listing endpoint - see BcfProjectDocumentsResource.

Returns
{BcfProjectDocumentsResource} The document collection resource.

◆ extensions()

get extensions ( )

Gets the project's extension value lists (topic types, statuses, labels, users, ...).

Returns
{BcfReadableResource} A readable resource whose get() returns the extensions object.
// Output of extensions.get():
{
"topic_type": ["Information", "Error"],
"topic_status": ["Open", "Closed", "ReOpened"],
"topic_label": ["Architecture", "Structural", "MEP"],
"snippet_type": [".ifc", ".csv"],
"priority": ["Low", "Medium", "High"],
"users": ["Architect@example.com", "BIM-Manager@example.com"],
"stage": ["Preliminary Planning End", "Construction Start", "Construction End"],
"project_actions": ["update", "createTopic", "createDocument"],
"topic_actions": ["update", "updateBimSnippet", "createComment", "createViewpoint"],
"comment_actions": ["update"]
}

◆ filesInformation()

get filesInformation ( )

Gets the file information of the project - the IFC files topics can refer to.

Returns
{BcfListResource} A listable resource.
// Output of filesInformation.list():
[{
"display_information": [{ "field_display_name": "Model Name", "field_value": "ARCH-Z100-051" }],
"file": {
"ifc_project": "0J$yPqHBD12v72y4qF6XcD",
"file_name": "OfficeBuilding_Architecture_0001.ifc",
"reference": "https://example.com/files/0J$yPqHBD12v72y4qF6XcD_0001.ifc"
}
}]

◆ get()

get ( )
Returns
{Promise<ApiResponse>} The response containing the project.
// Output:
{
"project_id": "B724AAC3-5B2A-234A-D143-AE33CC18414",
"name": "Example project 3",
"authorization": { "project_actions": ["update"] }
}

◆ topic()

topic ( topicId)

Selects a topic in this project.

Parameters
{string}topicId - BCF topic identifier.
Returns
{BcfTopicResource} The topic resource.

◆ topicEvents()

get topicEvents ( )

Gets the project-wide topic-event collection (audit trail of all topic changes).

Returns
{BcfListResource} A listable resource.
// Output of topicEvents.list():
[{
"topic_guid": "A211FCC2-3A3B-EAA4-C321-DE22ABC8414",
"date": "2014-11-19T14:24:11.316Z",
"author": "Architect@example.com",
"events": [{ "type": "status_updated", "value": "Closed" }]
}]

◆ topics()

get topics ( )

Gets the project's topic collection.

Returns
{BcfTopicsResource} The topic collection resource.

◆ update()

update ( projectData)

Updates the project.

The current server applies only the name field.

Parameters
{{namestring}} projectData - Replacement project name.
Returns
{Promise<ApiResponse>} The response containing the updated project.
// Input:
{ "name": "Example project 3 - Second Section" }
// Output:
{
"project_id": "B724AAC3-5B2A-234A-D143-AE33CC18414",
"name": "Example project 3 - Second Section",
"authorization": { "project_actions": ["update"] }
}