@deepvision/adventist-api

1.2.7 • Public • Published

Creator.JS

Installing

To install library use:

npm install @deepvision/creator.js

Initializing

For working using api library import to your script file and create instance with new. Notice, that endpoint argument is required in constructor.

import CreatorApi from '<path_to_library>';

const creatorApi = new CreatorApi({
    endpoint: 'your-enpoint',
    token: 'your-token',
});

Usage

Courses

List Courses

Get list of courses with pagination, sorting and filters

creatorApi.courses.list(params)

params

  • owner - available options: 'self'
  • limit – used to specify the number of items to return
  • offset – the position in the dataset of a particular item
  • sort – sorting fetched list
  • filters –

Get Course

Get the course by id

creatorApi.courses.withId(id).get()

Create Course

Create new course with specify data

creatorApi.courses.create(data)

data

  • title - name of course
  • description - course description
  • language - course language

Delete Course

Delete the course by id

creatorApi.courses.withId(id).delete()

Update Course

Update the course by id with specify data

creatorApi.courses.withId(id).update(data)

data

  • title - name of course
  • description - course description
  • language - course language

Authors

List Authors

Get list of authors with pagination, sorting and filters

creatorApi.authors.list(params)

params

  • limit – used to specify the number of items to return
  • offset – the position in the dataset of a particular item
  • sort – sorting fetched list
  • filters –

Get Author

Get the author by id

creatorApi.authors.withId(id).get()

Create Author

Create new author with specify data

creatorApi.authors.create(data)

data

  • firstName - first name of the author
  • lastName - last name of the author
  • photo - avatar of the author

Delete Author

Delete the author by id

creatorApi.authors.withId(id).delete()

Update Author

Update the course by id with specify data

creatorApi.authors.withId(id).update(data)

Lessons

List Lessons

Get list of lessons with pagination, sorting and filters

creatorApi.lessons.list(params, { courseId })

params

  • limit – used to specify the number of items to return

  • offset – the position in the dataset of a particular item

  • sort – sorting fetched list

  • filters –

  • courseId - id of parent course

Get Lesson

Get the lesson by id

creatorApi.lessons.withId(id).get()

Create Lesson

Create new lesson with specify data

creatorApi.lessons.create(data, { courseId })

data

  • title - title of the lesson

  • courseId - id of parent course

Delete Lesson

Delete the author by id

creatorApi.authors.withId(id).delete()

Update Lesson

Update the lesson by id with specify data

creatorApi.lessons.withId(id).update(data)

data

  • title - title of the lesson

License

This project is licensed under the MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i @deepvision/adventist-api

Weekly Downloads

27

Version

1.2.7

License

SEE LICENSE IN LICENSE

Unpacked Size

354 kB

Total Files

96

Last publish

Collaborators

  • v.angolenko
  • ftornik
  • denys.shnurenko
  • deepbot
  • andrew.vlasiuk
  • cerj