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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@deliverart/sdk-js-stats

v2.10.2

Published

Deliverart JavaScript SDK for Stats

Readme

@deliverart/sdk-js-stats

Statistics and analytics package for the DeliverArt JavaScript SDK.

Installation

npm install @deliverart/sdk-js-stats @deliverart/sdk-js-core
# or
pnpm add @deliverart/sdk-js-stats @deliverart/sdk-js-core
# or
yarn add @deliverart/sdk-js-stats @deliverart/sdk-js-core

Exported Types

Models

CourierDailyStats

interface CourierDailyStats {
  id: string
  day: string
  pointOfSale?: string
  courierUser?: string
  source: OrderSource
  partner: OrderPartner | null
  paymentMethod: PaymentMethod | null
  ordersCount: number
  totalCountableItems: number
  totalAmount: string
  calculatedAt: string
}

Daily statistics for courier deliveries.

Properties:

  • id: string - Unique statistics identifier
  • day: string - Date in YYYY-MM-DD format
  • pointOfSale?: string - Point of sale IRI (optional)
  • courierUser?: string - Courier user IRI (optional)
  • source: OrderSource - Order source ('application', 'ecommerce', 'partner')
  • partner: OrderPartner | null - Partner identifier (nullable)
  • paymentMethod: PaymentMethod | null - Payment method used (nullable)
  • ordersCount: number - Total number of orders
  • totalCountableItems: number - Total number of countable items
  • totalAmount: string - Total amount (monetary value as string)
  • calculatedAt: string - Calculation timestamp (ISO 8601)

CourierDailyStatsQueryParams

interface CourierDailyStatsQueryParams {
  pointOfSale?: string | string[]
  courierUser?: string | string[]
  partner?: OrderPartner | OrderPartner[]
  source?: OrderSource | OrderSource[]
  paymentMethod?: PaymentMethod | PaymentMethod[]
  'day[before]'?: string
  'day[strictly_before]'?: string
  'day[after]'?: string
  'day[strictly_after]'?: string
  'calculatedAt[before]'?: string
  'calculatedAt[strictly_before]'?: string
  'calculatedAt[after]'?: string
  'calculatedAt[strictly_after]'?: string
  'order[day]'?: 'asc' | 'desc'
  'order[calculatedAt]'?: 'asc' | 'desc'
  page?: number
}

Query parameters for filtering and sorting courier daily statistics.

Filter Parameters:

  • pointOfSale?: string | string[] - Filter by point of sale IRI(s)
  • courierUser?: string | string[] - Filter by courier user IRI(s)
  • partner?: OrderPartner | OrderPartner[] - Filter by partner(s)
  • source?: OrderSource | OrderSource[] - Filter by order source(s)
  • paymentMethod?: PaymentMethod | PaymentMethod[] - Filter by payment method(s)

Date Range Filters:

  • day[before]?: string - Days before (inclusive)
  • day[strictly_before]?: string - Days strictly before (exclusive)
  • day[after]?: string - Days after (inclusive)
  • day[strictly_after]?: string - Days strictly after (exclusive)

Calculation Date Range Filters:

  • calculatedAt[before]?: string - Calculated before (inclusive)
  • calculatedAt[strictly_before]?: string - Calculated strictly before (exclusive)
  • calculatedAt[after]?: string - Calculated after (inclusive)
  • calculatedAt[strictly_after]?: string - Calculated strictly after (exclusive)

Sort Parameters:

  • order[day]?: 'asc' | 'desc' - Sort by day
  • order[calculatedAt]?: 'asc' | 'desc' - Sort by calculation date

Pagination:

  • page?: number - Page number (default: 1)

IRI Types

CourierDailyStatsIri

type CourierDailyStatsIri = string

Courier daily statistics IRI type (format: /courier_daily_stats/:id)

Available Requests

Courier Daily Statistics

GetCourierDailyStats

Retrieve a list of courier daily statistics with filtering and pagination.

import { GetCourierDailyStats } from '@deliverart/sdk-js-stats';

const stats = await sdk.call(new GetCourierDailyStats({
  query: {
    'day[after]': '2024-01-01',
    'day[before]': '2024-12-31',
    source: 'application',
    'order[day]': 'desc',
    page: 1
  }
}));

Query Parameters: See CourierDailyStatsQueryParams above for all available filters.

Response: Returns a paginated list of CourierDailyStats objects.


GetCourierDailyStatsDetails

Retrieve detailed information for a specific courier daily statistics entry.

import { GetCourierDailyStatsDetails } from '@deliverart/sdk-js-stats';

const stats = await sdk.call(new GetCourierDailyStatsDetails('stats-123'));

Parameters:

  • courierDailyStatsId: string (required) - The statistics ID

Response: Returns a single CourierDailyStats object.


GetCourierDailyStatsFromPointOfSale

Retrieve courier daily statistics for a specific point of sale.

import { GetCourierDailyStatsFromPointOfSale } from '@deliverart/sdk-js-stats';

const stats = await sdk.call(new GetCourierDailyStatsFromPointOfSale('pos-123', {
  query: {
    'day[after]': '2024-01-01',
    source: 'application',
    page: 1
  }
}));

Parameters:

  • pointOfSaleId: string (required) - The point of sale ID
  • query?: CourierDailyStatsQueryParams (optional) - Query parameters for filtering

Response: Returns a paginated list of CourierDailyStats objects for the specified point of sale.


GetCourierDailyStatsFromUser

Retrieve courier daily statistics for a specific user (courier).

import { GetCourierDailyStatsFromUser } from '@deliverart/sdk-js-stats';

const stats = await sdk.call(new GetCourierDailyStatsFromUser('user-123', {
  query: {
    'day[after]': '2024-01-01',
    'day[before]': '2024-01-31',
    'order[day]': 'asc',
    page: 1
  }
}));

Parameters:

  • userId: string (required) - The user (courier) ID
  • query?: CourierDailyStatsQueryParams (optional) - Query parameters for filtering

Response: Returns a paginated list of CourierDailyStats objects for the specified courier.


Usage Examples

Get Statistics for a Date Range

import { GetCourierDailyStats } from '@deliverart/sdk-js-stats';

// Get all stats for January 2024
const januaryStats = await sdk.call(new GetCourierDailyStats({
  query: {
    'day[after]': '2024-01-01',
    'day[strictly_before]': '2024-02-01',
    'order[day]': 'asc'
  }
}));

Get Statistics by Point of Sale and Source

import { GetCourierDailyStatsFromPointOfSale } from '@deliverart/sdk-js-stats';

const posStats = await sdk.call(new GetCourierDailyStatsFromPointOfSale('pos-123', {
  query: {
    source: ['application', 'ecommerce'],
    'day[after]': '2024-01-01'
  }
}));

Get Courier Performance

import { GetCourierDailyStatsFromUser } from '@deliverart/sdk-js-stats';

const courierStats = await sdk.call(new GetCourierDailyStatsFromUser('courier-456', {
  query: {
    'day[after]': '2024-01-01',
    'order[day]': 'desc'
  }
}));

// Analyze courier performance
courierStats.member.forEach(stat => {
  console.log(`${stat.day}: ${stat.ordersCount} orders, ${stat.totalAmount} revenue`);
});

Filter by Payment Method

import { GetCourierDailyStats } from '@deliverart/sdk-js-stats';

const cashStats = await sdk.call(new GetCourierDailyStats({
  query: {
    paymentMethod: 'cash',
    'day[after]': '2024-01-01'
  }
}));

License

See the main SDK repository for license information.