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

@devly-cl/billing-core

v0.1.0

Published

Pure financial billing contracts, validation, provider resolution and durable work orchestration.

Readme

@devly-cl/billing-core

Pure financial contracts and durable billing work orchestration. CommonJS with an explicit public entrypoint and TypeScript declarations; Node 24 is the tested consumer runtime. No runtime dependencies, Node builtins, DOM types, framework, database, environment access or payment provider implementation. Published releases are installed from npm; local npm pack only creates a candidate tarball.

Install

npm install @devly-cl/billing-core

The current financial model supports exact integer CLP amounts and monthly/yearly subscriptions. FinancialQuote contains financial terms and customer dimensions. An integrator can extend LocalSubscription<Quote> with its own quote type; commercial contract IDs, quote serialization and hash generation remain outside this package.

Public API

  • BillingError and SubscriptionGatewayError: single constructors shared by CommonJS, ESM and host compatibility exports. Codes, kind and uncertain retain their meaning.
  • billingKey, termsInput, validateCheckout, validateTermsConfirmation: validate the existing financial contracts. Confirmation compares an existing version/hash; it never computes or serializes a fingerprint.
  • validateInvoiceDimensions, validateInvoice, invoiceFinancialStatus: validate remote identity, frozen amount/currency/environment, quantity, finite period bounds, normalized period evidence and payment/credit settlement. An external or unconfirmed payment remains review. Explicit zero-amount credit settlement requires a positive recurring amount and affirmative adapter evidence.
  • BillingProviderRegistry: resolves explicit persisted ProviderBinding values and capabilities. resolve never calls new-subscription selection. forNewSubscription is an explicit, separate operation.
  • BillingWorker: executes checkout, reconciliation, cancellation, invoice and notice work through structural ports. BillingProviderResolver can be implemented without a registry class. Subscription, provider, recurring-change, one-off invoice, payment-method and managed-plan-change contracts are exported as types; the package does not implement those provider capabilities.

Worker integration

import { BillingWorker } from '@devly-cl/billing-core';
import type {
  BillingWorkerStore, BillingProviderResolver, BillingWorkerAvailability,
  BillingMail, BillingWorkerPolicy,
} from '@devly-cl/billing-core';

declare const store: BillingWorkerStore;
declare const resolver: BillingProviderResolver;
declare const availability: BillingWorkerAvailability;
declare const mail: BillingMail;
declare const policy: BillingWorkerPolicy;
const worker = new BillingWorker(store, resolver, availability, mail, policy);
await worker.tick();

The host supplies persisted subscription/event binding resolution, an execution profile and canonical invoice-period evidence. Profiles explicitly state checkout/cancellation retry windows and whether deferred cancellation is confirmed. null retry windows require a provider implementation with durable safe resumption; they are not permission to repeat an uncertain POST. The worker compares no provider names and never consults new-sale routing for old work.

invoiceEvidence must validate provider calendar/timezone/DST and original canonical period evidence before returning normalized InvoicePeriodEvidence. The core checks invoice dimensions before invoking that policy and checks the resulting interval and exact boundaries. The host transaction must revalidate against the current/historical frozen quote before writing.

claim owns durable lease acquisition and must honor maintenanceOnly; each subsequent store operation must fence by BillingWork.leaseToken. tick processes at most 30 work items. Cursor continuation, eight-attempt exhaustion, review classification, saas-checkout:<workId>, saas-cancel:<workId> and mail idempotency keys remain stable. Eligibility and the dynamic sales gate are checked before a new checkout mutation; maintenance reconciliation, cancellation and notices remain available with sales disabled. Provider adapters must also gate each actual POST where required.

The store owns resource/tenant authorization, locks, transactions, remote-operation journals, invoice/cycle uniqueness, monotonic paid state, historical quote lookup, audit and durable notifications. Mail delivery must honor the provided idempotency key. No in-memory production store or retry scheduler is provided. A browser return is never financial evidence.

Verification and development

From this repository root: npm run build:packages, npm run test:packages, npm run test:package-boundaries, npm run test:package-artifacts. The artifact smoke installs this package alone, offline outside the repository, then executes validation, resolver, financial worker and notice behavior with a fictitious provider/store/mail. It also checks CommonJS/ESM error identity and strict NodeNext .cts/.mts consumers with types: [], lib: ["ES2023"].

The integrating application owns its exact quote JSON and SHA-256 fingerprints, calendar policies, legacy binding fallback, controllers, permissions, database and framework integration. Package behavior is locally verified; no real provider, production deployment or external mail delivery is certified by these tests.

Rebuild packages and restart Nest after source changes. Automatic package hot reload has not been validated.