UNPKG

talentlms

Version:

TalentLMS Node-SDK based on official TalentLMS API documentation

1,176 lines (433 loc) 14.6 kB
# talentlms *1.0.0* ### TalentLMS/branches.js #### getBranches() Get Branches ##### Returns - `Void` #### getBranch(branchId) Get Branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | branchId | `String` | the id of the wanted branch |   | ##### Returns - `Void` #### createBranch(obj) Create Branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.name | | The name of the branch. |   | | obj.description | | The Description of the branch. |   | ##### Returns - `Void` #### deleteBranch(obj) Delete Branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The object. |   | | obj.branch_id | | The id of the branch. |   | | obj.deleted_by_user_id | | Deleted by user id. |   | ##### Returns - `Void` #### branchSetStatus(branchId, status) Change the status (active or inactive) of a branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | branchId | `String` | the id of the wanted branch |   | | status | `String` | [active, inactive] |   | ##### Returns - `Void` #### addUsertoBranch(branchId, userId) Add a user to a branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | branchId | `String` | the id of the wanted branch |   | | userId | `String` | id of the user |   | ##### Returns - `Void` #### addCoursetoBranch(branchId, courseId) Add a course to a branch ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | branchId | `String` | the id of the wanted branch |   | | courseId | `String` | id of the course |   | ##### Returns - `Void` ### TalentLMS/categories.js #### getCategories() Get Categories ##### Returns - `Void` #### getCategory(categoryId) Get Category ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | categoryId | `String` | the id of the wanted category |   | ##### Returns - `Void` #### buyCategoryCourses(obj) Buy Category Course meaning to get paypal link for user to buy category ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.user_id | | The name of the course. |   | | obj.category_id | | The Description of the user. |   | | obj.coupon | | coupon. |   | ##### Returns - `Void` #### categoryLeafsAndCourses(categoryId) Get Category Leafs And Courses ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | categoryId | `String` | |   | ##### Returns - `Void` ### TalentLMS/courses.js #### getCourses() Get Courses ##### Returns - `Void` #### getCourse(courseId) Get Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | courseId | `String` | |   | ##### Returns - `Void` #### getUserStatusInCourse(courseId) Get User Status In Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | courseId | `String` | the id of the wanted course |   | ##### Returns - `Void` #### createCourse(obj) Add User To Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.name | | The name of the course. |   | | obj.description | | The Description of the course. |   | | obj.code | | course code. |   | ##### Returns - `Void` #### deleteCourse(obj) Delete a Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.course_id | | The name of the course. |   | | obj.deleted_by_user_id | | Deleted by user id. |   | ##### Returns - `Void` #### addUserToCourse(obj) Add User To Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.course_id | | The id of the course. |   | | obj.user_id | | The id of the user. |   | | obj.role | `Enumerator` | The role of the user in the course. |   | ##### Returns - `Void` #### removeUserFromCourse(courseId, userId) Remove User From Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | courseId | | The id of the course. |   | | userId | | The id of the user. |   | ##### Returns - `Void` #### goToCourse(courseId, userId) Go With User To Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | courseId | | The id of the course. |   | | userId | | The id of the user. |   | ##### Returns - `Void` #### getCoursesByCustomField() Go User By Custom Field ##### Returns - `Void` #### buyCourse(obj) ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.course_id | | The id of the course. |   | | obj.user_id | | The id of the user. |   | | obj.coupon | | coupon. |   | ##### Returns - `Void` #### getCustomCourseFields() Go Custom Field ##### Returns - `Void` #### getTestAnswers(testId, userId) Get Test Answers For Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | testId | | The id of the test. |   | | userId | | The id of the user. |   | ##### Returns - `Void` #### getSurveyAnswers(surveyId, userId) Get Test Answers For Course ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | surveyId | | The id of the survey. |   | | userId | | The id of the user. |   | ##### Returns - `Void` #### getILTSessions(iltId) Get ILT Sessions ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | iltId | | The id of the ITL |   | ##### Returns - `Void` ### TalentLMS/groups.js #### getGroups() Get Groups ##### Returns - `Void` #### getGroup(groupId) Get Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | groupId | `String` | |   | ##### Returns - `Void` #### createGroup(obj) Add User To Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.name | | The name of the group. |   | | obj.description | | The Description of the group. |   | | obj.key | | group code. |   | | obj.price | | group price |   | | ob.creator_id | | creator id |   | ##### Returns - `Void` #### deleteGroup(obj) Delete a Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.group_id | | The name of the group. |   | | obj.deleted_by_user_id | | Deleted by user id. |   | ##### Returns - `Void` #### addUserToGroup(userId, groupKey) Add User To Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userId | | The id of the user object. |   | | groupKey | | The key of the group. |   | ##### Returns - `Void` #### removeUserFromGroup(groupId, userId) Remove User From Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | groupId | | The id of the group. |   | | userId | | The id of the user. |   | ##### Returns - `Void` #### addCourseToGroup(groupId, courseId) Add Course To Group ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | groupId | | The id of the group. |   | | courseId | | The id of the course. |   | ##### Returns - `Void` ### TalentLMS/system.js #### getSiteInfo() Get System Info ##### Returns - `Void` #### getRateLimit() Get Rate Limit ##### Returns - `Void` #### getTimeLine(obj) Get TimeLine ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The object. |   | | obj.event_type | | Event Type. |   | ##### Returns - `Void` ### TalentLMS/users.js #### getUsers() Get Users ##### Returns - `Void` #### getUser(userId) Get User By Id ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userId | `String` | |   | ##### Returns - `Void` #### getUser(userEmail) Get User By Email ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userEmail | `String` | |   | ##### Returns - `Void` #### setStatus(userId, status) Change the status (active or inactive) of a user ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userId | `String` | user id |   | | status | `status` | (active or inactive) |   | ##### Returns - `Void` #### userSignup(obj) Sign up a user ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.first_name | | User first name. |   | | obj.last_name | | User last name. |   | | obj.email | | User email. |   | | obj.login | | User username |   | | obj.password | | User password |   | ##### Returns - `Void` #### editUser(obj) Edit a user ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.user_id | | User id. |   | | obj.first_name | | User first name. |   | | obj.last_name | | User last name. |   | | obj.email | | User email. |   | | obj.login | | User username |   | | obj.password | | User password |   | | obj.bio | | User bio |   | | obj.timezone | | User timezone |   | ##### Returns - `Void` #### deleteUser(obj) Delet a User ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.user_id | | User id. |   | | obj.deleted_by_user_id | | Deleted by user id |   | ##### Returns - `Void` #### getUsersByCustomField(fieldValue) Get Users By Custom Field ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | fieldValue | | Field Value i.e: test |   | ##### Returns - `Void` #### getUsersProgressInUnits(userId, unitId) Get User Progress in units ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userId | | The id of the user |   | | unitId | | The id of the unit |   | ##### Returns - `Void` #### editUserCustomFields(obj) Edit User Custom Field ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.user_id | | User id. |   | | obj.first_name | | User first name. |   | | obj.last_name | | User last name. |   | | obj.email | | User email. |   | | obj.login | | User username |   | | obj.password | | User password |   | | obj.bio | | User bio |   | | obj.timezone | | User timezone |   | ##### Returns - `Void` #### userLogin(obj) Login a User ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.login | | The name of the user. |   | | obj.password | | password. |   | | obj.logout_redirect | | Logout redirect. |   | ##### Returns - `Void` #### userLogout(obj) Logout a User ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | obj | | The insertion object. |   | | obj.user_id | | The id of the user. |   | | obj.next | | next url example.com. |   | ##### Returns - `Void` #### getCustomRegistrationFields() Get custom registration fields ##### Returns - `Void` #### forgotUsername(userEmail) Forgot username routine and send username to email ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | userEmail | | The email of the user |   | ##### Returns - `Void` #### forgotPassword(username) Forgot password routine and send reset password to email ##### Parameters | Name | Type | Description | | | ---- | ---- | ----------- | -------- | | username | | The username of the user |   | ##### Returns - `Void` *Documentation generated with [doxdox](https://github.com/neogeek/doxdox).*