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

Description

Provides direct access to the COLNEO BCF 3.0 API.

Entry point of a resource-oriented client for the BCF 3.0 API: projects and project(projectId) return scoped resource objects (topics, comments, viewpoints, documents, ...) instead of exposing one flat method per endpoint. Every request resolves to an ApiResponse; transport and parsing failures are returned with status 500 instead of being thrown.

const bcf = new BcfServices(ctx);
const projects = await bcf.projects.list();
const project = bcf.project(projectId);
await project.get();
await project.update({ name: "New name" });
const topics = await project.topics.list();
const topic = project.topic(topicId);
await topic.update({ topic_status: "Closed" });
await topic.comments.create({ comment: "Resolved" });
await topic.viewpoints.list();
await topic.snippet.replace(binaryData);
await topic.relatedTopics.replace(relations);
Provides direct access to the COLNEO BCF 3.0 API.
Definition BcfServices.js:1079
get projects()
Gets the collection of BCF projects visible to the authenticated user.
Definition BcfServices.js:1093
project(projectId)
Selects one BCF project.
Definition BcfServices.js:1100

The methods above are only the entry points. Every other endpoint is a method or getter on one of the resource classes below, reached by chaining off projects/project() - open one to see its full method list:

See also
BcfProjectsResource
BcfProjectResource
BcfTopicsResource
BcfTopicResource
BcfCommentsResource
BcfCommentResource
BcfViewpointsResource
BcfViewpointResource
BcfDocumentReferencesResource
BcfDocumentReferenceResource
BcfDocumentsResource
BcfProjectDocumentResource
BcfProjectDocumentsResource
Context
https://github.com/buildingSMART/BCF-API

Public Member Functions

 constructor (ctx)
 project (projectId)
get projects ()

Function Documentation

◆ constructor()

constructor ( ctx)

Creates a BCF client bound to an infohub context.

Parameters
{Context}ctx - Configured context that supplies the BCF service URL and access token.

◆ project()

project ( projectId)

Selects one BCF project.

Parameters
{string}projectId - BCF project identifier.
Returns
{BcfProjectResource} The project resource.

◆ projects()

get projects ( )

Gets the collection of BCF projects visible to the authenticated user.

Returns
{BcfProjectsResource} The project collection resource.