Railcontent-Services

Members

(inner, constant) excludeFromGeneratedIndex :Array.<string>

Description:
  • Exported functions that are excluded from index generation.
Source:
Exported functions that are excluded from index generation.
Type:
  • Array.<string>

Methods

(static) assignModeratorToComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) closeComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) createComment(railcontentId, comment) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
railcontentId int
comment string
Returns:
Type
Promise.<(*|null)>

(static) deleteComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) editComment(commentId, comment) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
comment string
Returns:
Type
Promise.<(*|null)>

(static) fetchComment(commentId) → {Promise.<(Object|null)>}

Description:
  • Fetches a single comment by its ID.
Source:
Example
fetchComment(123)
  .then(comment => console.log(comment))
  .catch(error => console.error(error));
Parameters:
Name Type Description
commentId number | string The ID of the comment to fetch.
Returns:
- A promise that resolves to the comment object if found, otherwise null.
Type
Promise.<(Object|null)>

(static) fetchCommentRelies(commentId, page, limit) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
page int
limit int
Returns:
Type
Promise.<(*|null)>

(static) fetchComments(railcontentId, page, limit) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
railcontentId int
page int
limit int
Returns:
Type
Promise.<(*|null)>

(static) fetchContentPageUserData(contentId) → {Promise.<(Object|null)>}

Description:
  • Fetches user context data for a specific piece of content.
Source:
Example
fetchContentPageUserData(406548)
  .then(data => console.log(data))
  .catch(error => console.error(error));
Parameters:
Name Type Description
contentId int The content id.
Returns:
- Returns an object containing user context data if found, otherwise null.
Type
Promise.<(Object|null)>

(static) fetchLiveStreamData(contentId) → {Promise.<{hls_url: (string|null), status: string, vimeo_event_id: (string|null)}>}

Source:
Parameters:
Name Type Description
contentId number
Returns:
Type
Promise.<{hls_url: (string|null), status: string, vimeo_event_id: (string|null)}>

(static) fetchRecentUserActivities(paramsopt) → {Promise.<PaginatedActivities>}

Description:
  • Fetches a paginated list of recent user activities.
Source:
Example
fetchRecentUserActivities({ page: 2, limit: 5 })
  .then(activities => console.log(activities))
  .catch(error => console.error(error));
Parameters:
Name Type Attributes Default Description
params Object <optional>
{} Optional parameters.
Properties
Name Type Attributes Default Description
page number <optional>
1 The page number for pagination.
limit number <optional>
10 The number of results per page.
tabName string | null <optional>
null Optional filter for activity type/tab.
Returns:
- A promise that resolves to a paginated object of user activities.
Type
Promise.<PaginatedActivities>

(static) fetchTopComment(railcontentId) → {Promise.<(Object|null)>}

Description:
  • Fetch the top comment for a given content
Source:
Parameters:
Name Type Description
railcontentId int The railcontent id to fetch.
Returns:
- A promise that resolves to an comment object
Type
Promise.<(Object|null)>

(static) fetchUserPracticeNotes(date) → {Promise.<(Object|null)>}

Description:
  • Fetches user practice notes for a specific date.
Source:
Example
fetchUserPracticeNotes('2025-04-10')
  .then(notes => console.log(notes))
  .catch(error => console.error(error));
Parameters:
Name Type Description
date string The date for which to fetch practice notes (format: YYYY-MM-DD).
Returns:
- A promise that resolves to an object containing the practice notes if found, otherwise null.
Type
Promise.<(Object|null)>

(static) likeComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) openComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) replyToComment(commentId, comment) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
comment string
Returns:
Type
Promise.<(*|null)>

(static) reportComment(commentId, issue) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
issue string
Returns:
Type
Promise.<(*|null)>

(static) restoreComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) setStudentViewForUser(userId, enable) → {Promise.<(any|null)>}

Description:
  • Set a user's StudentView Flag
Source:
Parameters:
Name Type Description
userId int | string id of the user (must be currently authenticated)
enable boolean truthy value to enable student view
Returns:
Type
Promise.<(any|null)>

(static) unassignModeratorToComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

(static) unlikeComment(commentId) → {Promise.<(*|null)>}

Source:
Parameters:
Name Type Description
commentId int
Returns:
Type
Promise.<(*|null)>

Type Definitions

Activity

Source:
Properties:
Name Type Description
id string Unique identifier for the activity.
type string Type of activity (e.g., "lesson_completed").
timestamp string ISO 8601 string of when the activity occurred.
meta Object Additional metadata related to the activity.
Type:
  • Object

PaginatedActivities

Source:
Properties:
Name Type Description
currentPage number
totalPages number
data Array.<Activity>
Type:
  • Object