New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

medusa-plugin-stats

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medusa-plugin-stats

A plugin to get store stastistics

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Medusa-plugin-stats

banner image

medusa-plugin-stats is MedusaJS plugin to retreive store statistics data.

⚠️ Note - Plugin only tested for Postgres DB, and under active development.

Installation & Usage

  1. Run - yarn add medusa-plugin-stats or npm install medusa-plugin-stats

  2. Add plugin to your medusa-config.js -

plugins: [
  ...
  `medusa-plugin-stats`
  ]
  1. GET /admin/stats with following params will return the statictics data

Query params ->

{
  entity:[ "sales", "products", "orders", "customers"],
  start: "02-24-2022" // start date in MM-dd-yyyy format,
  end: "11-24-2022" // end date in MM-dd-yyyy format,
  period: "day" // day | week | month | year
}

Response ->

{
    "stats": {
        "sales": {
            "timeseries": {
                "10-20-2022": 1000
            },
            "metrics": {
                "total": 1000
            },
            "period": "day"
        },
        "products": {
            "timeseries": {
                "10-22-2022": 7
            },
            "metrics": {
                "total": "7"
            },
            "period": "day"
        },
        "orders": {
            "timeseries": {
                "10-20-2022": 1,
                "10-22-2022": 1,
                "10-25-2022": 1
            },
            "metrics": {
                "total": "3"
            },
            "period": "day"
        }
    }
}

Devlopment

  • Refactor API to allow options to each resource type

  • Add time series stats

  • Add more stat metrics & dimensions. Required Suggestions

  • Improve sales stat to allow multiple currencies

Keywords

FAQs

Package last updated on 26 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc