@kyso/client v4.4.1
@kyso/api
Kyso API client javascript library
Installation
yarn add @kyso/apior
npm install @kyso/apiUsage
const kyso = require('@kyso/api')
// example
const studies = await kyso.getStudies({ token: user.sessionToken })Set the auth token for each call using token: user.sessionToken
Auth & Profile
loginReturns a response object!const response = await kyso.login({ email, password, apiUrl })getMeReturns a response object!const response = await kyso.getMe({ token, apiUrl })signupReturns a response object!const response = await kyso.signup({ userData, apiUrl })userDatamust include email, username and passwordcheckNameUniquenessChecks if a nickname is already takenconst { exists } = await kyso.checkNameUniqueness({ name, apiUrl })Exists will be true or false
getAuth0User- not in use anymorelinkAuth0Accounts- not in use anymoresetNicknameawait kyso.setNickname({ token, nickname, apiUrl })Sets the nickname of a user
uploadProfilePicture!!! needs testing and exampleawait kyso.uploadProfilePicture({ token, data, apiUrl })data must be the buffer or base64 content of the image file.
Studies
createVersionUse the library @kyso/publish to create a versioncreateStudyUse the library @kyso/publish to create a studyaddTagsawait kyso.addTags({ token, studyId, tags, apiUrl })getTagSuggestions
await kyso.getTagSuggestions({ apiUrl })checkVersionExistsconst { exists } = await kyso.checkVersionExists({ token, name, versionSha, apiUrl })deleteStudyawait kyso.deleteStudy({ token, studyId, apiUrl })getExploreStudiesconst studies = await kyso.getExploreStudies({ page, limit, apiUrl })Returns a list of featured explore studies, limit the amount of studies with limit (default 12), and set the page for which page of studies
getRecentStudies
Returns a list of recent studies, limit the amount of studies with limit (default 12), and set the page for which page of studies, and filter by tags by setting the tags array (eg: tags="machine-learning")const studies = await kyso.getRecentStudies({ tags, page, limit, apiUrl })
getMainFileconst content = await kyso.getMainFile({ versionId, token (optional), apiUrl })getStudiesconst studies = await kyso.getStudies({ token, apiUrl })getStudiesByAuthorconst studies = await kyso.getStudiesByAuthor({ author, apiUrl })getStudyconst study = await kyso.getStudy({ token, author, name, limit, sha, apiUrl })Author is the author nickname, and name is the studyname. Limit and sha are optional.
getVersionconst version = await kyso.getVersion({ token, versionId, apiUrl })incrementViewsawait incrementViews({ studyId, apiUrl })togglePrivateconst study = await togglePrivate({ token, studyId, privacy, apiUrl })toggleStarconst study = await toggleStar({ token, studyId, privacy, apiUrl })
Comments
createCommentconst comment = await createComment({ token, text, studyId, parentId, apiUrl })getCommentsconst comments = await getComments({ studyId, parentId, apiUrl })editCommentconst comment = await editComment({ token, text, commentId, apiUrl })deleteCommentconst comment = await deleteComment({ token, commentId, apiUrl })This simply removes the comment author from the comment, it still exists.
Containers
getContainerconst container = await kyso.getContainer({ token, proxyUrl, containerId, apiUrl })Returns container object
getContainersconst containers = await kyso.getContainers({ token, apiUrl })Returns list of container objects
getRunningContainersconst runningContainers = await kyso.getRunningContainers({ token, apiUrl })Returns list of container objects
updateContainerActivityawait kyso.updateContainerActivity({ token, proxyUrl, lastActivity, apiUrl })
feedbackawait kyso.feedback({ token, text, apiUrl })
Github
getGithubRepositoriesconst repos = await kyso.getGithubRepositories({ token, apiUrl })Returns list of repo objects
importGithubRepositoryawait kyso.importRepo({ repo, branch, main, token, apiUrl })
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago