4.4.1 • Published 5 years ago

@kyso/client v4.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

@kyso/api

Kyso API client javascript library

Installation

yarn add @kyso/api

or

npm install @kyso/api

Usage

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

  • login Returns a response object!

      const response = await kyso.login({ email, password, apiUrl })
  • getMe Returns a response object!

      const response = await kyso.getMe({ token, apiUrl })
  • signup Returns a response object!

      const response = await kyso.signup({ userData, apiUrl })

    userData must include email, username and password

  • checkNameUniqueness Checks if a nickname is already taken

      const { exists } = await kyso.checkNameUniqueness({ name, apiUrl })

    Exists will be true or false

  • getAuth0User - not in use anymore

  • linkAuth0Accounts - not in use anymore

  • setNickname

      await kyso.setNickname({ token, nickname, apiUrl })

    Sets the nickname of a user

  • uploadProfilePicture !!! needs testing and example

      await kyso.uploadProfilePicture({ token, data, apiUrl })

    data must be the buffer or base64 content of the image file.

Studies

  • createVersion Use the library @kyso/publish to create a version

  • createStudy Use the library @kyso/publish to create a study

  • addTags

      await kyso.addTags({ token, studyId, tags, apiUrl })
  • getTagSuggestions

  await kyso.getTagSuggestions({ apiUrl })
  • checkVersionExists

      const { exists } = await kyso.checkVersionExists({ token, name, versionSha, apiUrl })
  • deleteStudy

      await kyso.deleteStudy({ token, studyId, apiUrl })
  • getExploreStudies

      const 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
      const studies = await kyso.getRecentStudies({ tags, page, limit, apiUrl })
    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")
  • getMainFile

      const content = await kyso.getMainFile({ versionId, token (optional), apiUrl })
  • getStudies

      const studies = await kyso.getStudies({ token, apiUrl })
  • getStudiesByAuthor

      const studies = await kyso.getStudiesByAuthor({ author, apiUrl })
  • getStudy

      const 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.

  • getVersion

      const version = await kyso.getVersion({ token, versionId, apiUrl })
  • incrementViews

      await incrementViews({ studyId, apiUrl })
  • togglePrivate

      const study = await togglePrivate({ token, studyId, privacy, apiUrl })
  • toggleStar

      const study = await toggleStar({ token, studyId, privacy, apiUrl })

Comments

  • createComment

      const comment = await createComment({ token, text, studyId, parentId, apiUrl })
  • getComments

      const comments = await getComments({ studyId, parentId, apiUrl })
  • editComment

      const comment = await editComment({ token, text, commentId, apiUrl })
  • deleteComment

      const comment = await deleteComment({ token, commentId, apiUrl })

    This simply removes the comment author from the comment, it still exists.

Containers

  • getContainer

      const container = await kyso.getContainer({ token, proxyUrl, containerId, apiUrl })

    Returns container object

  • getContainers

      const containers = await kyso.getContainers({ token, apiUrl })

    Returns list of container objects

  • getRunningContainers

      const runningContainers = await kyso.getRunningContainers({ token, apiUrl })

    Returns list of container objects

  • updateContainerActivity

      await kyso.updateContainerActivity({ token, proxyUrl, lastActivity, apiUrl })

Email

  • feedback
      await kyso.feedback({ token, text, apiUrl })

Github

  • getGithubRepositories

      const repos = await kyso.getGithubRepositories({ token, apiUrl })

    Returns list of repo objects

  • importGithubRepository

    await kyso.importRepo({ repo, branch, main, token, apiUrl })
4.4.1

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.4

5 years ago

4.2.3

5 years ago

4.2.2

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.3

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.11

5 years ago

4.0.10

5 years ago

4.0.9

5 years ago

4.0.8

5 years ago

4.0.7

5 years ago

4.0.6

5 years ago

4.0.5

5 years ago

4.0.4

6 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

6 years ago

3.11.1

6 years ago

3.11.0

6 years ago

3.10.2

6 years ago

3.10.1

6 years ago

3.10.0

6 years ago