Class: Project

Project

Projects are used to collaborate on models and track issues.


new Project(impl)

Parameters:
Name Type Description
impl ProjectImpl

An object that implements project data storage and server requests.

Members


<readonly> authorization :Object

Project features the user has access to.

Type:
  • Object
Properties:
Name Type Description
project_actions Array.<string>

Actions are allowed to be performed: update, createTopic, createDocument.


<readonly> createdAt :string

Project creation time (UTC) in the format specified in ISO 8601.

Type:
  • string

customFields :Object

Project custom fields object, to store custom data.

Type:
  • Object

<readonly> data :Object

Raw project data received from the server.

Type:
  • Object

description :string

Project description.

Type:
  • string

endDate :string

Project end date in the format specified in ISO 8601.

Type:
  • string

<readonly> id :string

Unique project ID.

Type:
  • string

<readonly> memberCount :number

The number of members in the project.

Type:
  • number

<readonly> modelCount :number

The number of models in the project.

Type:
  • number

name :string

Project name.

Type:
  • string

<readonly> owner :Object

Project owner information.

Type:
  • Object
Properties:
Name Type Description
userId string

User ID.

userName string

User name.

name string

First name.

lastName string

Last name.

email string

User email.

avatarUrl string

User avatar image URL.


<readonly> previewUrl :string

Project preview image URL. Use setPreview() to change preview image.

Type:
  • string

public :boolean

true if project is public (shared) project.

Type:
  • boolean

startDate :string

Project start date in the format specified in ISO 8601.

Type:
  • string

<readonly> topicCount :number

The number of topics in the project.

Type:
  • number

<readonly> updatedAt :string

Project last update time (UTC) in the format specified in ISO 8601.

Type:
  • string

Methods


<async> addMember(userId, role)

Add a user to the project to become a member and have permission to perform actions.

Parameters:
Name Type Description
userId string

User ID.

role string

User role from the list of project roles.

Returns:
Type
Promise.<Member>

<async> checkout()

Refresh project data.

Returns:
Type
Promise.<Project>

<async> createRole(name, description, permissions)

Create a new project role.

Parameters:
Name Type Description
name string

Role name.

description string

Role description.

permissions Object

Actions are allowed to be performed. See Role.permissions for more details.

Returns:
Type
Promise.<Role>

<async> delete()

Delete the project from the server.

Returns:
  • Returns the raw data of a deleted project.
Type
Promise.<Object>

<async> deleteRole(name)

Delete project role.

Parameters:
Name Type Description
name string

Role name.

Returns:
  • Returns the raw data of a deleted role.
Type
Promise.<Object>

<async> getFilesInformation()

Returns a list of files that users can refer to in the project topics. To add a file to this list, create a project permission on the file using File.createPermission().

Returns:
Type
Promise.<Array.<FileInformation>>

<async> getMember(memberId)

Returns the member information.

Parameters:
Name Type Description
memberId string

Member ID.

Returns:
Type
Promise.<Member>

<async> getMembers()

Returns a list of project members.

Returns:
Type
Promise.<Array.<Member>>

<async> getRole(name)

Returns the role information.

Parameters:
Name Type Description
name string

Role name.

Returns:
Type
Promise.<Role>

<async> getRoles()

Returns a list of project roles. Project members have different abilities depending on the role they have in a project.

Returns:
Type
Promise.<Array.<Role>>

<async> removeMember(memberId)

Remove a member from a project.

Parameters:
Name Type Description
memberId string

Member ID.

Returns:
  • Returns the raw data of a deleted member.
Type
Promise.<Object>

<async> save()

Save project data changes to the server. Call this method to update project data on the server after any changes.

Returns:
Type
Promise.<Project>

<async> setPreview(image)

Set or remove the project preview.

Parameters:
Name Type Description
image string | ArrayBuffer | Blob | file | null

Preview image. Can be a Data URL string, ArrayBuffer, Blob or Web API File object. Setting the image to null will remove the preview.

Returns:
Type
Promise.<Project>

<async> update(data)

Update project data on the server.

Parameters:
Name Type Description
data Object

Raw project data.

Returns:
Type
Promise.<Project>