@antelopejs/interface-dms-saas
The AntelopeJS interface that extends the DMS SaaS module with billing, plans, registration, workspace pages and lifecycle.
What it does
- Adds invoice line items, reads customer balances and previews the upcoming invoice.
- Builds plan projections and catalogues, and normalizes prices.
- Extends registration and the provisioning of a new workspace.
- Adds blocks to the tenant billing page and the platform workspace detail page.
- Listens to tenant lifecycle events, guards paid-to-Free plan changes, and exposes the canonical SaaS tables and models (
/db).
A module that extends @antelopejs/dms-saas depends on this package, never on the runtime.
Install
pnpm add @antelopejs/interface-dms-saas
Quick start
The root entry holds every extension point except db. invoiceLineItems, tenantLifecycle and planChanges are namespaces at the root:
import { invoiceLineItems, tenantLifecycle } from "@antelopejs/interface-dms-saas";
export const usageKey = invoiceLineItems.buildInvoiceLineKey("example.compute", "minutes");
export const isProvisioningCommitted = tenantLifecycle.IsTenantProvisioningCommitted;
The entry-point reference lists the supported subpaths. Importing /db registers the SaaS tables, so it is not a types-only import. After direct subscription writes, call RecomputeTenantBillingState to refresh the derived billing state and the workspace directory row.
A module may seed plans straight into the db plan table. It writes name, description and borderLabel with one value per locale through localize("*"). It leaves Plan.paymentProviderRefs empty and never rewrites it, because @antelopejs/dms-saas links every billed plan to Stripe itself. See Plans and their Stripe products.
Compatibility
@antelopejs/dms-saas implements this interface. The compatibility block of its README lists the interface range each module release supports. The interface declares these dependencies:
| Package | Supported | Tested with |
|---|---|---|
@antelopejs/interface-core | >=0.2.4 <1.0.0 | 0.4.0 |
@antelopejs/interface-data-api | >=0.6.1 <1.0.0 | 0.6.1 |
@antelopejs/interface-database | >=0.1.11 <1.0.0 | 0.3.0 |
@antelopejs/interface-database-decorators | >=0.1.10 <1.0.0 | 0.2.0 |
@antelopejs/interface-dms | >=0.12.0 <1.0.0 | 0.12.0 |
@antelopejs/interface-core, @antelopejs/interface-database and @antelopejs/interface-database-decorators are peer dependencies. @antelopejs/interface-data-api and @antelopejs/interface-dms are regular dependencies.
Subpaths resolve through the exports map only, so compile consumers with moduleResolution set to bundler, node16 or nodenext. Upgrade this package together with @antelopejs/dms-saas. The upgrade notes cover the tenant billing page anchors and the rows written by earlier builds.
Documentation
- The consumer reference covers billing, usage, lifecycle, pages, plans and the database boundary.
- Extending the SaaS module shows every extension point with examples.
- Stripe explains how the module drives Stripe.
- The SaaS module guide covers installation and configuration.
Contributing
This package lives in the AntelopeJS/dms-saas pnpm workspace, next to the module that implements it. Read CONTRIBUTING.md and the repository README for the development commands. Release this package on its own workflow before the module that implements it.