@inweb/client
    Preparing search index...

    Class Project

    Provides properties and methods for obtaining information about a project on the Open Cloud Server and managing its roles, members and models.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • data: any

        Raw project data received from the server. For more information, see Open Cloud Projects API.

      • httpClient: IHttpClient

        HTTP client instance used to send requests to the REST API server.

      Returns Project

    Properties

    headers: HeadersInit

    Endpoint-specific HTTP headers for the GET, POST, PUT and DELETE requests. You can add custom headers at any time.

    path: string

    Endpoint API path relative to the REST API server URL.

    Accessors

    • get authorization(): { project_actions: string[] }

      Project features the user has access to.

      Returns { project_actions: string[] }

      • project_actions: string[]

        Actions are allowed to be performed:

        • update - The ability to update the project details.
        • createTopic - The ability to create a new topic.
        • createDocument - The ability to create a new document.
    • get createdAt(): string

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

      Returns string

    • get customFields(): any

      Project custom fields object, to store custom data.

      Returns any

    • get data(): any

      Raw project data received from the server. For more information, see Open Cloud Projects API.

      Returns any

    • get description(): string

      Project description.

      Returns string

    • get endDate(): string

      Project end date in the format specified in ISO 8601.

      Returns string

    • get id(): string

      Unique project ID.

      Returns string

    • get memberCount(): number

      The number of members in the project.

      Returns number

    • get modelCount(): number

      The number of models in the project.

      Returns number

    • get name(): string

      Project name.

      Returns string

    • get previewUrl(): string

      Project preview image URL or empty string if the project does not have a preview. Use setPreview() to change preview image.

      This URL does not change when the underlying image content is updated. Because of this, browsers may cache the image, which can prevent the preview from updating visually in web applications (such as React, Angular, etc.).

      To avoid caching issues, append a dynamic query parameter to the URL, such as the project's last modification date. Since this date changes whenever the preview is updated, the browser will correctly reload the new image when required.

      Returns string

      function ProjectPreview({ project }) {
      // 'updatedAt' is a timestamp representing when the project was last modified.
      const cacheBuster = project.updatedAt;

      // Use a default image if the project does not have a preview
      const imageSrc = project.previewUrl
      ? `${project.previewUrl}?t=${cacheBuster}`
      : "/assets/default-preview.png";

      return <img src={imageSrc} alt="Project preview" />;
      }
    • get public(): boolean

      true if project is shared project.

      Returns boolean

    • get startDate(): string

      Project start date in the format specified in ISO 8601.

      Returns string

    • get topicCount(): number

      The number of topics in the project.

      Returns number

    • get updatedAt(): string

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

      Returns string

    Methods

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

      Parameters

      • userId: string

        User ID.

      • role: string

        Role name from the list of project roles.

      Returns Promise<Member>

    • Adds a file to the project with specified permissions.

      To change file permissions for the project use Permission.actions.

      Parameters

      • fileId: string

        File ID.

      • actions: string | string[]

        Actions are allowed to be performed on a file:

        • read - The ability to read file description, geometry data and properties.
        • readSourceFile - The ability to download source file.
        • write - The ability to modify file name, description and references.
        • readViewpoint - The ability to read file viewpoints.
        • createViewpoint - The ability to create file viewpoints.
        • deleteViewpoint - The ability to delete file viewpoints.

      Returns Promise<File>

      Returns a file instance added to the project.

    • Reloads project data from the server.

      Returns Promise<Project>

    • Creates a new project role.

      Parameters

      • name: string

        Role name.

      • description: string

        Role description.

      • permissions: IRoleActions

        Actions are allowed to be performed for the role.

      Returns Promise<Role>

    • Deletes a project from the server.

      Returns Promise<any>

      Returns the raw data of a deleted project. For more information, see Open Cloud Projects API.

    • Removes the project preview.

      Returns Promise<Project>

    • Deletes the specified project role.

      Parameters

      • name: string

        Role name.

      Returns Promise<any>

      Returns the raw data of a deleted role. For more information, see Open Cloud Projects API.

    • Returns a list of project files. For more information, see Open Cloud BCF3 API.

      This list contains all files that the project has access to. To add a file to this list, create a project permission on the file using File.createPermission().

      Returns Promise<any[]>

    • Returns information about the specified project member.

      Parameters

      • memberId: string

        Member ID.

      Returns Promise<Member>

    • Returns a list of project members.

      Returns Promise<Member[]>

    • Returns a list of project files.

      Returns Promise<File[]>

    • Returns information about the specified project role.

      Parameters

      • name: string

        Role name.

      Returns Promise<Role>

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

      Returns Promise<Role[]>

    • Removes the specified member from a project.

      Parameters

      • memberId: string

        Member ID.

      Returns Promise<any>

      Returns the raw data of a deleted member. For more information, see Open Cloud Projects API.

    • Removes the specified file from a project.

      Parameters

      • fileId: string

        File ID.

      Returns Promise<File>

      Returns a file instance removed from the project.

    • Saves project properties changes to the server. Call this method to update project data on the server after any property changes.

      Returns Promise<Project>

    • Sets or removes the project preview.

      Parameters

      Returns Promise<Project>