@plasma-platform/tm-service-vendors

2.0.3 • Public • Published

Documentation

Table of Contents

VendorsService

Vendors Micro Service API

Parameters

  • url string service url
  • token (string | null) user access tocken if available (optional, default null)

messages

Object with class service messages

Type: Object

getList

Get vendors list

Parameters

  • sortBy String sort by field (optional, default 'rating')
  • sortAsc Boolean ascending sorting (optional, default true)
  • page Number page number (optional, default 1)
  • nickname String search by nickname (optional, default '')

Examples

Get vendors list

(async () => {
  const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
  const items = await Vendors.getList();
})();

Returns VendorsList array of posts

getListCount

Get vendors count

Examples

Get vendors list count

(async () => {
  const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
  const count = await Vendors.getListCount();
})();

Returns number vendors count

getProfile

Get information about current vendor

Examples

Get vendor details

(async () => {
  const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
  const details = await Vendors.getProfile();
})();

Returns Vendor vendor details

getProfileById

Get information about specific vendor by id

Parameters

Examples

Get vendor profile by id

(async () => {
  const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
  const details = await Vendors.getProfileById(2);
})();

Returns Vendor vendor details

getProfileByNickname

Get information about specific vendor by nickname

Parameters

  • nickname string vendor nickname

Examples

Get vendor profile by nickname

(async () => {
  const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
  const details = await Vendors.getProfileByNickname('nickname');
})();

Returns Vendor vendor details

Array

Vendors list object

Type: VendorsList

Properties

Vendor

Vendor object

Type: Vendor

Properties

  • id number vendor id
  • nickname string vendor nickname
  • country string author country (2 char code)
  • nickname string vendor nickname
  • cover string url to author cover image
  • avatar string url to author avatar image
  • rating number author total rating
  • designQualityIndex number Design Quality Index
  • supportQualityIndex number Support Quality Index (don't use it at the moment)
  • userReviewsRatings number User Reviews Rating
  • description string author description
  • user_id number author user ID (required)
  • exclusive_percent number revenue percent of exclusive sales per item
  • regular_percent number revenue percent of regular sales per item
  • is_trusted number 1 if trusted either 0
  • is_internal number 1 if is TM vendor and 0 if external vendor
  • socialAccounts object social accounts (additional field)
  • supportOptions object support options (additional field)
  • _links object HATEOAS links
  • products number products count
  • sales number sales count
  • created_at number creation timestamp
  • updated_at number update timestamp

Package Sidebar

Install

npm i @plasma-platform/tm-service-vendors

Weekly Downloads

0

Version

2.0.3

License

CC-BY-4.0

Unpacked Size

29.5 kB

Total Files

4

Last publish

Collaborators

  • alienmonster
  • ch-tm
  • viram