SaaS interface
Supported backend imports and side-effect boundaries for modules extending DMS SaaS.
Consumers depend on @antelopejs/interface-dms-saas, not on the runtime's private services or page controllers. The functions that need an implementation work only when @antelopejs/dms-saas is loaded in the same AntelopeJS project. Subpaths resolve through the package's exports map, so a consumer compiles with moduleResolution set to "bundler", "node16" or "nodenext".
Entry points
Import after @antelopejs/interface-dms-saas | Contract |
|---|---|
| Root | Billing, data API, JSON, pages, plans, provisioning and registration exports, plus the invoiceLineItems, tenantLifecycle, planChanges and billingEmails namespaces |
/billing | Balances, previews and billing-state recomputation |
/billing-emails | Billing e-mail subjects and enrichers |
/invoice-line-items | Usage providers, line types and key helpers |
/plan-changes | Inventory policy and guarded Free downgrade |
/tenant-lifecycle | Durable lifecycle consumers and provisioning gate |
/provisioning, /registration, /json | Provisioning payload, registration limits and JSON types |
/pages, /page-definitions | Page descriptors and extension registration |
/plans | Plan projections, localization and pricing helpers |
/data-api, /hidden-filter | HiddenStringFilter |
/db, /db/models, /db/tables | Canonical SaaS models and table classes, described in the database section |
invoiceLineItems, tenantLifecycle and planChanges are namespaces at the root, not flat exports. Each of these modules has its own internal proxy namespace, and two internal names cannot share one barrel. The direct subpaths export the same functions by name. The internal namespaces are implementation plumbing, not consumer APIs.
IsTenantProvisioningCommitted passes storage errors through. The example below lets them reject, so an unavailable store never grants eligibility.
import { invoiceLineItems, tenantLifecycle } from "@antelopejs/interface-dms-saas";
export const usageKey = invoiceLineItems.buildInvoiceLineKey("example.compute", "minutes");
export async function mayProvision(tenantId: string): Promise<boolean> {
return tenantLifecycle.IsTenantProvisioningCommitted(tenantId);
}
Database imports have side effects
The root does not re-export db. Importing /db registers the canonical SaaS tables. A consumer does not create duplicate table definitions or load the runtime's registration graph to reach them, and uses import type when it needs only a type. The root also exports plan helpers that import database values, so a value import from the root can still register tables. A narrow subpath names the contract the consumer needs.
Database exports are persistence classes. They are neither an authorization API nor a billing service. A tenant-scoped model needs the correct tenant, and direct writes belong in trusted import or seed code. A direct write skips the Stripe, lifecycle, cache and directory work that the runtime's own operations do.
After seeding or importing subscription records, call RecomputeTenantBillingState for each affected tenant once the writes finish. It republishes the derived billing state and the directory row. It does not turn an arbitrary direct write into a normal billing operation. A plan seed leaves Plan.paymentProviderRefs empty and never overwrites the runtime's Stripe link, as the plan and Stripe guide explains.
workspaceSettingsCategory belongs to @antelopejs/interface-dms/page, not to this package. There is no SaaS GetWorkspaceSettingsCategory export. /pages holds the SaaS billing page and platform workspace extension anchors.
The runtime guide covers installation, public screens, UI integration and examples. These pages define the backend consumer contracts.