Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ExoPlatformWrapper

Index

Constructors

constructor

  • new ExoPlatformWrapper(exoHostname: string, exoPath?: string, exoSecureProtocol?: undefined | string, exoCiphers?: undefined | string): ExoPlatformWrapper
  • Create a bot instance

    Parameters

    • exoHostname: string

      Hostname of the API (don't include protocol or path)

    • Default value exoPath: string = "/rest"

      Path to the eXo REST API, /rest by default

    • Optional exoSecureProtocol: undefined | string

      SSL protocol to use (don't set if you don't know what it is!!)

    • Optional exoCiphers: undefined | string

      SSL ciphers to use (don't set if you don't know what it is!!)

    Returns ExoPlatformWrapper

Properties

Optional exoCiphers

exoCiphers: undefined | string

SSL ciphers to use (don't set if you don't know what it is!!)

exoHostname

exoHostname: string

Hostname of the API (don't include protocol or path)

exoPath

exoPath: string = "/rest"

Path to the eXo REST API, /rest by default

Optional exoSecureProtocol

exoSecureProtocol: undefined | string

SSL protocol to use (don't set if you don't know what it is!!)

Private password

password: string | null = null

eXo Platform password

Private username

username: string | null = null

eXo Platform username

Methods

login

  • login(username: string, password: string, checkCredentials?: boolean): Promise<void>
  • Set login credentials and check validity.

    throws

    {Error} Invalid credentials (if checkCredentials = true)

    Parameters

    • username: string

      eXo Platform username

    • password: string

      eXo Platform password

    • Default value checkCredentials: boolean = true

      Should the eXo Platform credentials be checked

    Returns Promise<void>

request

  • request<T>(path: string, body?: object | null, method?: "GET" | "POST" | "PUT" | "DELETE", moreOptions?: Partial<RequestOptions>): Promise<T>
  • Make an API call to eXo Platform configured API.

    throws

    {Error} The API returned an error or the response was not JSON-valid

    Type parameters

    • T: __type

    Parameters

    • path: string

      Path to the API endpoint

    • Default value body: object | null = null

      Request body object

    • Default value method: "GET" | "POST" | "PUT" | "DELETE" = body ? 'POST' : 'GET'

      HTTP request method

    • Optional moreOptions: Partial<RequestOptions>

      Any options to inject in the request options

    Returns Promise<T>

    The API's response

requestAuthed

  • requestAuthed<T>(...args: Parameters<request>): Promise<T>
  • Make an authenticated API call to the eXo Platform configured API.

    throws

    {Error} You must be authenticated using this.login

    Type parameters

    • T: __type

    Parameters

    • Rest ...args: Parameters<request>

      Same as this.request

    Returns Promise<T>

    Same as this.request

Object literals

activity

activity: object

Operations related to activities

edit

  • edit(activityId: string, message: string): Promise<Activity>
  • Edit an activity. Must have write-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    • message: string

    Returns Promise<Activity>

    List of publications

read

  • read(activityId: string): Promise<Activity>
  • Get an activity. Must have read-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    Returns Promise<Activity>

    Activity content

readStream

  • readStream(limit?: number, offset?: number): Promise<object & object>
  • Get list of activities.

    Parameters

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    Activities list

remove

  • remove(activityId: string): Promise<Activity>

comment

comment: object

Operations related to an activity's comments

add

  • add(activityId: string, message: string): Promise<Comment>
  • Comment an activity. Must have read-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    • message: string

      Comment to add

    Returns Promise<Comment>

    Comment content

edit

  • edit(commentId: string, message: string): Promise<Comment>
  • Edit a comment. Must have write-access.

    Parameters

    • commentId: string

      Id of the targeted comment

    • message: string

      New comment

    Returns Promise<Comment>

    Comment content

list

  • list(activityId: string, limit?: number, offset?: number): Promise<object & object>
  • Get activity comments. Must have read-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    Activity comments

remove

  • remove(commentId: string): Promise<Comment>
  • Delete a comment. Must have write-access.

    Parameters

    • commentId: string

      Id of the targeted comment

    Returns Promise<Comment>

    Comment content

like

like: object

Operations related to an activity's likes

add

  • add(activityId: string): Promise<Activity>
  • Like an activity. Must have read-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    Returns Promise<Activity>

    Activity content

list

  • list(activityId: string, limit?: number, offset?: number): Promise<object & object>
  • Get activity likers. Must have read-access.

    Parameters

    • activityId: string

      Id of the targeted activity

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    Activity likers

remove

  • remove(activityId: string, username?: string | undefined): Promise<Activity>
  • Remove a like from an activity. Must have permission to delete the targetted like.

    Parameters

    • activityId: string

      Id of the targeted activity

    • Default value username: string | undefined = this.username || undefined

      Id of the user to remove the like from (if you are admin). Defaults to current logged in user

    Returns Promise<Activity>

    Activity content

space

space: object

Operations related to a space's stream activity

create

edit

  • Edit a space data. Must have write-access.

    Parameters

    • spaceId: string

      The targetted space id

    • spaceData: SpacePartial

      New data of the spam

    Returns Promise<Space>

    New space data

getData

  • getData(spaceId: string): Promise<Space>
  • Get a space's data. Must have read-access.

    Parameters

    • spaceId: string

      Id of the targeted space

    Returns Promise<Space>

    Space's data

list

  • list(limit?: number, offset?: number): Promise<object & object>
  • List available spaces.

    Parameters

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

publish

  • publish(spaceId: string, message: string): Promise<Activity>
  • Publish on a spaces's activity stream. Must have write-access.

    Parameters

    • spaceId: string

      Id of the targeted space

    • message: string

      Message to publish

    Returns Promise<Activity>

    Newly created publication

readStream

  • readStream(spaceId: string, limit?: number, offset?: number): Promise<object & object>
  • Read a spaces's activity stream. Must have read-access.

    Parameters

    • spaceId: string

      Id of the targeted space

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    List of publications

remove

  • remove(spaceId: string): Promise<Space>
  • Delete a space. Must have write-access.

    Parameters

    • spaceId: string

      The targetted space id

    Returns Promise<Space>

    Old space data

user

user: object

Operations related to a user's stream activity

list

  • list(limit?: number, offset?: number): Promise<object & object>
  • List users.

    Parameters

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    Users list

publish

  • publish(message: string): Promise<Activity>
  • publish on a user's activity stream. Can only be your own profile.

    Parameters

    • message: string

      Message to publish

    Returns Promise<Activity>

    Newly created publication

readStream

  • readStream(username?: string | null, limit?: number, offset?: number): Promise<object & object>
  • Read a user's activity stream.

    Parameters

    • Default value username: string | null = this.username

      Id of the targeted user. Defaults to current logged in user

    • Default value limit: number = 20

      Amount of content to fetch

    • Default value offset: number = 0

      Offset for the content fetched

    Returns Promise<object & object>

    Activities list

Generated using TypeDoc