@plasma-platform/service-vendors
v2.4.1-alpha.2
Published
Vendors Service API
Downloads
16
Readme
Full documentation
install:npm i @plasma-platform/service-vendors -S
Short documentation
Table of Contents
VendorsService
Vendors Micro Service API
Parameters
url
string service urltoken
(string | null) user access tocken if available (optional, defaultnull
)
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, defaulttrue
)page
Number page number (optional, default1
)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
id
number post id
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
getProfileByVendorId
Get information about specific vendor by vendor id
Parameters
id
string vendor id
Examples
Get vendor profile by vendor id
(async () => {
const Vendors = new VendorsService('//api.templatemonster.com/authors/v1/');
const details = await Vendors.getProfileByVendorId(831);
})();
Returns Vendor vendor details
Array
Vendors list object
Type: VendorsList
Properties
Vendor
Vendor object
Type: Vendor
Properties
id
number vendor idnickname
string vendor nicknamecountry
string author country (2 char code)nickname
string vendor nicknamecover
string url to author cover imageavatar
string url to author avatar imagerating
number author total ratingdesignQualityIndex
number Design Quality IndexsupportQualityIndex
number Support Quality Index (don't use it at the moment)userReviewsRatings
number User Reviews Ratingdescription
string author descriptionuser_id
number author user ID (required)exclusive_percent
number revenue percent of exclusive sales per itemregular_percent
number revenue percent of regular sales per itemis_trusted
number 1 if trusted either 0is_internal
number 1 if is TM vendor and 0 if external vendorsocialAccounts
object social accounts (additional field)supportOptions
object support options (additional field)_links
object HATEOAS linksproducts
number products countsales
number sales countcreated_at
number creation timestampupdated_at
number update timestamp