npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@plasma-platform/service-statistics

v2.1.6

Published

TM statistics service api

Downloads

67

Readme

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/service-statistics -S

Short documentation

Table of Contents

StatisticsService

Parameters

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

trackTemplateView

Request Services

Parameters

  • params object { templateId: Template id. (to track statistic on template), userId: Author User Id. (to track statistic on author), } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v1/');
  const request = await service.trackTemplateView(params);
})();

Returns Promise<any>

getReviewStatistics

Request Services

Parameters

  • params object { entity_id: entity id - id author or template, access_token: users token, type: type review statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group review for statistics, default day, type_id: type id for filter statistics data, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getReviewStatistics(params);
})();

Returns Promise<any>

getOneStatistics

Request Services

Parameters

  • params object { access_token: user's access token, entity_id: entity id - id author or template, type: type one statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, type_id: type id for filter statistics data, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getOneStatistics(params);
})();

Returns Promise<any>

getSaleStatistics

Request Services

Parameters

  • params object { entity_id: entity id - id author or template, access_token: users token, type: type sale statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group sale for statistics, default day, country: country for filter sale statistics, type_id: type id for filter statistics data, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getSaleStatistics(params);
})();

Returns Promise<any>

getViewStatistics

Request Services

Parameters

  • params object { entity_id: entity id - id author or template, access_token: users token, type: type view statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: group view for statistics, default day, country: country for filter view statistics, type_id: id of type products for filter view statistics, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getViewStatistics(params);
})();

Returns Promise<any>

getTrafficStatisticsByChannel

Request Services

Parameters

  • params object { entity_id: entity id - id author or template, access_token: users token, type: type traffic statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, country: Get statistic filtered by country iso2code } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getSaleStatistics(params);
})();

Returns Promise<any>

getStatisticsChannelTraffic

Request Services

Parameters

  • params object { access_token: users token, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, channel: Get statistic filtered by channel type_id: Get statistic filtered by type_id product_id: Get statistic filtered by product_id } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getStatisticsChannelTraffic(params);
})();

Returns Promise<any>

getTrafficStatisticsBySource

Request Services

Parameters

  • params object { entity_id: entity id - id author or template, access_token: users token, type: type traffic statistics - author or template, date_from: date start for statistics, date_to: date end for statistics, group: Statistic grouping, default day, country: Get statistic filtered by country iso2code source: Get statistic filtered by source, perPage: Max statistic per one page (20 by default, 50 is max size), page: Page number to view, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getSaleStatistics(params);
})();

Returns Promise<any>

getStatisticsTrafficChannelsList

Request Services

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getStatisticsTrafficChannelsList(params);
})();

Returns Promise<any>

getTotalSaleStatistics

Request Services

Parameters

  • params object { author_user_id: authors id, access_token: users token, date_from: date start for total statistics, date_to: date end for total statistics, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getTotalSaleStatistics(params);
})();

Returns Promise<any>

getTotalProductStatistics

Request Services

Parameters

  • params object { author_user_id: authors id, product_ids: List of Product Id, access_token: users token, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getTotalProductStatistics(params);
})();

Returns Promise<any>

getStatisticsTransactionsInfo

Request Services

Parameters

  • params object { date_from: date start for total statistics: format 20200723, date_to: date end for total statistics: format 20200726, types: types of transactions (sale,refund,withdraw), country: country of transactions, perPage: count items of page, page: number of page, format: response format, access_token: authors token, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getStatisticsTransactionsInfo(params);
})();

Returns Promise<any>

getMinYearStatistics

Request Services

Parameters

  • params object { author_user_id: author user id, type_view: in what stats search, entity_type: what type id for filter set, entity_id: entity id - id author or template, access_token: users token, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getMinYearStatistics(params);
})();

Returns Promise<any>

getStatisticsProductDiscounts

Request Services

Parameters

  • params object { template_id: Show data for this product, date_from: Start day in period for get statistic, date_to: End day in period for get statistic, access_token: users token, locale: locale, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getStatisticsProductDiscounts(params);
})();

Returns Promise<any>

getStatisticsProductBoosts

Request Services

Parameters

  • params object { template_id: Show data for this product, date_from: Start day in period for get statistic, date_to: End day in period for get statistic, access_token: users token, } (optional, default {})

Examples

(async () => {
  const service = new Service('http://api.templatemonsterdev.com/statistics/v2/');
  const request = await service.getStatisticsProductBoosts(params);
})();

Returns Promise<any>