zappier/jobs/report-usage

Package: zappier
Source: packages/zappier/src/jobs/report-usage.ts
Lines: 130

What this module is

Implementation module in zappier. The tables below are extracted from the source (signatures + JSDoc).

Exports

ReportUsageDeps, REPORT_USAGE_LOCK, firstOfMonthUtc, reportMonthlyUsage

Types / interfaces / classes

Kind

Name

interface

ReportUsageDeps

Functions

Name

Parameters

Param types (JSDoc)

Returns

Calls (same file / helpers)

firstOfMonthUtc

now: Date

—

unknown

see Call graph

reportMonthlyUsage

deps: ReportUsageDeps

—

unknown

see Call graph

main

(none)

—

unknown

see Call graph

Methods (class / object)

Name

Parameters

loadEnv

{ path: path.join(PROJECT_ROOT, '.env'

main

(none)

What it imports / requires

  • better-sqlite3

  • path

  • stripe

  • ../app

  • ../auth

  • ../billing/stripe

  • ../db/billing-repo

  • ../db/customer-repo

  • ../db/pricing-store

  • ../db/usage-repo

  • ../paths

  • ../pricing

  • ../usage

Call graph (identifiers invoked)

firstOfMonthUtc, setUTCDate, setUTCHours, reportMonthlyUsage, tryAcquireLock, log, toISOString, slice, list, find, warn, listFor, computeBillableCents, getReportedCents, computeDelta, createMeterEvent, upsertReportedCents, releaseLock, main, import, loadEnv, join, async, create, getTiers, error, exit

Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.

Return values (how to read this)

  • HTTP route handlers return Express res.json(...) bodies (see route docs).

  • Zapier perform functions return a single object (creates) or an array (triggers/searches).

  • Pricing functions return integer cents on Quote.totalCents.