Options
All
  • Public
  • Public/Protected
  • All
Menu

@foxitsoftware/web-collab-server - v1.3.0

Index

Type Aliases

DatabaseConfig: { database: string; host: string; log?: (PrismaLogLevel | PrismaLogDefinition)[]; password: string; port: number; type: "postgres" | "mysql" | "sqlserver"; user: string }

This DatabaseConfig is used by the underlying database driver to create a database connection. Please make sure that the specified database is available for use

Type declaration

  • database: string

    The name of the database.

  • host: string

    The hostname of the DBMS.

  • Optional log?: (PrismaLogLevel | PrismaLogDefinition)[]

    Log config for underlying database driver.

    Prisma is used as the database driver. The log config is defined in https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#log. It will be passed to the underlying prisma client.

    For example, { log: ['query', 'info', 'warn', 'error'] } will output query, info, warn and error logs to stdout.

  • password: string

    The user password of the database.

  • port: number

    The port of the DBMS.

  • type: "postgres" | "mysql" | "sqlserver"

    The database type.

    Currently supported database are: Postgres, MySQL, SQL Server.

  • user: string

    The username of the database.

MemberId: string

The type of collaboration member id.

Message: { meta: MsgMetaData; payload: any; type: MsgType }

All collaboration-related operations are wrapped as Message and sent to MessageQueue, and can be consumed by subscribing to MessageQueue.

Type declaration

  • meta: MsgMetaData

    Metadata of the message.

  • payload: any

    Payload of the message.

  • type: MsgType

    Type of the message.

MessageHandler: ((msg: Message) => any)

Type declaration

    • A message handler is called when any collaboration operation is performed.

      You can implement your own operation log or do anything you want based on the message received.

      Parameters

      • msg: Message

        The message will be passed to the handler.

      Returns any

      Any non-false value that can be serialized by JSON.stringify() will be stored by the default logging implementation.

MsgMetaData: { collaborationId: string; serverId: string; userId: UserId }

The Metadata of Message which contains some common properties.

Type declaration

  • collaborationId: string

    The id of collaboration associated with this message.

  • serverId: string

    The id of the server from which this message originated.

  • userId: UserId

    The id of user associated with this message.

MsgType: "COLLAB_BEGIN" | "COLLAB_END" | "COLLAB_CREATED" | "COLLAB_UPDATED" | "COLLAB_REMOVED" | "COLLAB_ANNOT_ADDED" | "COLLAB_ANNOT_UPDATED" | "COLLAB_ANNOT_REMOVED" | "MEMBER_ONLINE" | "MEMBER_OFFLINE" | "MEMBER_ADDED" | "MEMBER_UPDATED" | "MEMBER_REMOVED"

MsgType defines message type for the Message

The following message types are supported:

  • COLLAB_BEGIN : Collaboration has begun.
  • COLLAB_END : Collaboration has ended.
  • COLLAB_CREATED : Collaboration has been created.
  • COLLAB_UPDATED : Collaboration has been updated.
  • COLLAB_REMOVED : Collaboration has been removed.
  • COLLAB_ANNOT_ADDED : A annotation has been added.
  • COLLAB_ANNOT_UPDATED : A annotation has been updated.
  • COLLAB_ANNOT_REMOVED : A annotation has been removed.
  • MEMBER_ONLINE : A collaboration member is online.
  • MEMBER_OFFLINE : A collaboration member is offline.
  • MEMBER_ADDED : A collaboration member has been added.
  • MEMBER_UPDATED : A collaboration member has been updated.
  • MEMBER_REMOVED : A collaboration member has been removed.
UserId: string

Type of user id.

UserInfo: { id: UserId; username: string }

The user information retrieved from the UserService.

Type declaration

  • [key: string]: any

    Any other user related properties you may like to include, like Email, Phone, Address, etc.

  • id: UserId

    Identifier of user. This will be used to identify a collaboration member.

  • username: string

    Name of user. This will be used as collaboration member name.

Generated using TypeDoc