[data-reveal]{opacity:1!important;transform:none!important}
AntelopeJS DMS
DocumentationPages, plans and data

Pages, plans and data

Stable page extension anchors, plan projections and safe use of the canonical data exports.

These contracts let consumers build backend-declared DMS pages without importing private SaaS controllers.

Importing @antelopejs/interface-dms-saas adds workspaceScoped?: boolean to DMS page options. Set it on detail pages whose URL names a record in the current workspace, for example PageController("project", { displayName: "Project", urlSlug: "project/:id", hidden: true, workspaceScoped: true }). Switching workspaces from that page lands on the homepage (HOME_PATH) instead of reloading the old record's URL. Pages that omit the flag or set it to false keep reloading the current URL.

Page extensions

These names are exported from /pages. tenantBillingPage identifies settings.workspace.billing at /settings/workspace/billing. Its components holds the anchors freeAccessBanner, pastDueAlert, planCard, paymentMethod, billingForm, refundButton and table. TenantBillingPageComponentKey is the union of those keys. tenantBillingPageAnchorPaths maps each key to its path in the current nested layout. An extension names the key, never a copied path.

RegisterTenantBillingPageExtension(extension: TenantBillingPageExtension): TenantBillingPageExtensionRegistration registers { name: string, components: readonly TenantBillingPageExtensionComponent[] } and returns { unregister(): void }. Registration can happen before the page loads. A module calls the handle's unregister() during stop().

Each component has key: string, component: Component and an optional order: number (default 0). An anchored component adds side: "before" | "after" and anchorKey: TenantBillingPageComponentKey. An appended component has an optional side: "end" and no anchor. These shapes are exported as TenantBillingPageExtensionComponentBase, TenantBillingPageAnchoredExtensionComponent and TenantBillingPageAppendedExtensionComponent. The plan and payment anchors resolve inside their column's stack, so a block placed beside one does not add a grid column.

platformSaasModule: CategoryInfo is a synchronous descriptor, not the canonical registered module object. GetPlatformSaasModule(): Promise<CategoryInfo> resolves the registered object once the runtime is attached, and rejects when it is unavailable. platformWorkspaceDetailPage identifies modules.saas.customers.workspaces.detail, with the anchors header, summary and body.

RegisterPlatformWorkspaceDetailPageExtension(extension: PlatformWorkspaceDetailPageExtension): PlatformWorkspaceDetailPageExtensionRegistration takes { name: string, components: readonly PageExtensionComponent[] } and returns an unregister handle. These blocks follow the DMS PageExtensionComponent placement contract. Neither registration grants access. The platform workspace detail page stays reserved to the platform owner, and tenant page components need their own metadata and permissions.

/page-definitions exports MODULES_ROOT_DEFINITION: PageInfo, SAAS_MODULE_ID ("saas") and SAAS_MODULE_DEFINITION, which holds the full ID, the full slug and the module registration metadata. These are descriptors, not runtime registration functions. The workspace settings category comes from @antelopejs/interface-dms/page, as the example shows.

ts
import { PageController, RegisterPage, workspaceSettingsCategory } from "@antelopejs/interface-dms/page";

@RegisterPage()
export class WorkspaceRegistriesController extends PageController("registries", {
  displayName: "Registries",
  category: workspaceSettingsCategory,
  icon: "i-ph-package",
  order: 10,
}) {}

Plan helpers

These helpers are exported from /plans. They do not charge customers or authorize access.

FunctionContract
monthlyPrice(plan: Plan): numberReturns the price as a monthly amount. A yearly price is divided by 12
isDowngrade(current: Plan | null, target: Plan, seats?: number): booleanCompares the monthly cost. A per-seat plan is multiplied by seats, at least 1, and seats defaults to 1. A null current returns false, and an equal cost is not a downgrade
localizeFeature(feature: Feature, locale: string): FeatureReads displayName, description, tooltip and unit in locale. FEATURE_LOCALIZED_FIELDS lists them. A missing translation falls back to FEATURE_FALLBACK_LOCALE (en, from /db)
localizePlan(plan: Plan, locale: string): PlanReads name, description and borderLabel in locale. PLAN_LOCALIZED_FIELDS (from /db) lists them. A missing translation falls back to PLAN_FALLBACK_LOCALE (en, from /db). Every PlanModel read already returns plans read in that fallback locale
buildTenantPlanCatalog(planModel: PlanModel, featureModel: FeatureModel, plans: Plan[], locale: string): Promise<TenantPlanCatalog>Reads the features, resolves plan inheritance, drops unknown feature IDs and sorts plans and features by order. Plan names and feature labels are read in locale. A model read failure rejects

TenantPlanCatalog has plans: TenantPlanView[] and features: TenantPlanFeature[].

  • TenantPlanView has _id: string, name: string, price: number, currency: string, interval: PlanInterval (month or year), order: number, checkoutAvailable: boolean, and featureValues: FeatureValues (Record<string, FeatureValue>, from /db, where FeatureValue is boolean | number | string | null). checkoutAvailable is true when the plan has a Stripe price reference. It is not an authorization decision.
  • TenantPlanFeature has featureId: string, displayName: string, tooltip: string | null, unit: string | null, valueType: FeatureValueType (boolean, number, or string), isDetailRow: boolean, and order: number.

The catalogue builder does not filter an arbitrary plan list down to what a user may buy, so the caller authorizes the plans and models it passes. Localized plan and feature texts are written through the canonical model's localize("*") convention, with one value per locale ({ en: "Pro", fr: "Pro" }), never as $ i18n keys. The feature integration guide shows the convention.

localize("*", FEATURE_LOCALIZED_FIELDS) returns a FeatureInAllLocales, and localize("*", PLAN_LOCALIZED_FIELDS) a PlanInAllLocales (both from /db). In that view a module assigns per-locale wording to each localized field directly. Read from the database, a field holds that record, the plain text of a row written before the field was localized, or nothing when the text was never set, so a reader narrows it first. localize(locale) on the view gives back the row type that insert and update take, with every locale still stored:

ts
import { GetModel } from "@antelopejs/interface-database-decorators";
import {
  FEATURE_FALLBACK_LOCALE,
  FEATURE_LOCALIZED_FIELDS,
  type FeatureInAllLocales,
  FeatureModel,
} from "@antelopejs/interface-dms-saas/db";

export async function renameMembersFeature(id: string): Promise<void> {
  const model = GetModel(FeatureModel);
  const row = await model.get(id);
  if (!row) return;
  const texts: FeatureInAllLocales = row.localize("*", FEATURE_LOCALIZED_FIELDS);
  texts.displayName = { en: "Members", fr: "Membres" };
  texts.tooltip = { en: "People in the workspace" };
  await model.update(id, texts.localize(FEATURE_FALLBACK_LOCALE));
}

HiddenStringFilter

HiddenStringFilter(): PropertyDecorator is exported from /data-api, /hidden-filter and the root. It registers string comparisons, including the is mode that TableView.routeParamFilters uses, without a visible @Column. It decorates a field of the data controller prototype, such as _instance or userId.

The data API applies a filter only when its field is registered, and silently drops a route filter on any other field. Without the decorator, the table returns rows from every instance or user. The decorator does not authenticate a user or make a client-supplied tenant ID trustworthy. The server authorization boundary enforces the scope.

Canonical database exports

/db exports the table and model pairs for plans, features, subscriptions, billing info, billing state, billing settings, invoices, credit notes, refunds, legal documents, trial consumptions, segments, user segments, platform notes, plan migrations and Stripe webhook events. /db/models and /db/tables expose those groups separately. For example, PlanModel works with Plan, FeatureModel with Feature, and TenantSubscriptionModel with TenantSubscription. Their published TypeScript declarations list the persistence fields and methods.

These are registered persistence classes, not copies to redeclare. Importing them registers the tables, so a type-only import suits a type. Direct model writes skip the runtime's orchestration and need the correct tenant scope. The database boundary covers seeds and imports, and RecomputeTenantBillingState refreshes the derived billing state after the writes.