@plasma-platform/service-vendors v2.4.1-alpha.2
Full documentation
install:npm i @plasma-platform/service-vendors -S
Short documentation
Table of Contents
VendorsService
Vendors Micro Service API
Parameters
urlstring service urltoken(string | null) user access tocken if available (optional, defaultnull)
messages
Object with class service messages
Type: Object
getList
Get vendors list
Parameters
sortByString sort by field (optional, default'rating')sortAscBoolean ascending sorting (optional, defaulttrue)pageNumber page number (optional, default1)nicknameString 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
idnumber 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
nicknamestring 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
idstring 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
idnumber vendor idnicknamestring vendor nicknamecountrystring author country (2 char code)nicknamestring vendor nicknamecoverstring url to author cover imageavatarstring url to author avatar imageratingnumber author total ratingdesignQualityIndexnumber Design Quality IndexsupportQualityIndexnumber Support Quality Index (don't use it at the moment)userReviewsRatingsnumber User Reviews Ratingdescriptionstring author descriptionuser_idnumber author user ID (required)exclusive_percentnumber revenue percent of exclusive sales per itemregular_percentnumber revenue percent of regular sales per itemis_trustednumber 1 if trusted either 0is_internalnumber 1 if is TM vendor and 0 if external vendorsocialAccountsobject social accounts (additional field)supportOptionsobject support options (additional field)_linksobject HATEOAS linksproductsnumber products countsalesnumber sales countcreated_atnumber creation timestampupdated_atnumber update timestamp
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 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