tm-service-vendors

1.0.1 • Public • Published

Documentation

VendorsService

Extends TMMicroServiceAPI

Vendors Micro Service API

Parameters

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

Array

Vendors list object

Type: VendorsList

Properties

  • null-null Array<Vendor> array of vendors

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

messages

Object with class service messages

get

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

Read vendors list

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

Returns VendorsList array of posts

details

Get information about current vendor

Examples

Get vendor details

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

Returns Vendor vendor details

detailsById

Get information about specific vendor by id

Parameters

Examples

Get vendor details

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

Returns Vendor vendor details

detailsByNickname

Get information about specific vendor by nickname

Parameters

  • nickname string vendor nickname

Examples

Get vendor details

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

Returns Vendor vendor details

count

Get vendors count

Examples

Get vendors count

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

Returns number vendors count

/tm-service-vendors/

    Package Sidebar

    Install

    npm i tm-service-vendors

    Weekly Downloads

    1

    Version

    1.0.1

    License

    CC-BY-4.0

    Last publish

    Collaborators

    • silentimp