@antelopejs/interface-dms 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +70 -68
  3. package/dist/auth/db/models/sessions.model.d.ts +1 -0
  4. package/dist/auth/db/models/userExternalIdentities.model.d.ts +1 -0
  5. package/dist/auth/db/models/users.model.d.ts +1 -0
  6. package/dist/base/block-types.d.ts +1 -0
  7. package/dist/base/block-types.js +1 -0
  8. package/dist/base/block-types.js.map +1 -1
  9. package/dist/base/live-toggle.d.ts +2 -2
  10. package/dist/base/period-selector.d.ts +2 -2
  11. package/dist/base/table-view/schema.d.ts +4 -4
  12. package/dist/db/internal/exportJobs.model.d.ts +1 -0
  13. package/dist/db/internal/inviteResolutions.model.d.ts +1 -0
  14. package/dist/db/internal/tenantLifecycle.model.d.ts +1 -0
  15. package/dist/db/models/roles.model.d.ts +1 -0
  16. package/dist/db/models/tenantMembers.model.d.ts +1 -0
  17. package/dist/db/models/tenants.model.d.ts +1 -0
  18. package/dist/db/models/user_invites.model.d.ts +1 -0
  19. package/docs/.navigation.yml +2 -0
  20. package/docs/1.core/.navigation.yml +2 -0
  21. package/docs/1.core/1.introduction.md +169 -0
  22. package/docs/1.core/10.layout-banners.md +133 -0
  23. package/docs/1.core/2.pages-and-modules.md +647 -0
  24. package/docs/1.core/3.components.md +287 -0
  25. package/docs/1.core/4.permissions.md +279 -0
  26. package/docs/1.core/5.tenancy.md +356 -0
  27. package/docs/1.core/6.invites.md +239 -0
  28. package/docs/1.core/7.hooks.md +354 -0
  29. package/docs/1.core/8.realtime.md +147 -0
  30. package/docs/1.core/9.quick-actions.md +115 -0
  31. package/docs/2.auth/.navigation.yml +2 -0
  32. package/docs/2.auth/1.introduction.md +75 -0
  33. package/docs/2.auth/2.authentication.md +222 -0
  34. package/docs/2.auth/3.tokens-and-sessions.md +352 -0
  35. package/docs/2.auth/4.users.md +256 -0
  36. package/docs/2.auth/5.external-identities.md +122 -0
  37. package/docs/3.base/.navigation.yml +2 -0
  38. package/docs/3.base/1.introduction.md +202 -0
  39. package/docs/3.base/10.display-blocks.md +136 -0
  40. package/docs/3.base/2.types.md +402 -0
  41. package/docs/3.base/3.forms.md +349 -0
  42. package/docs/3.base/4.tables.md +608 -0
  43. package/docs/3.base/5.charts-and-widgets.md +466 -0
  44. package/docs/3.base/6.layout.md +431 -0
  45. package/docs/3.base/8.data-types.md +361 -0
  46. package/docs/3.base/9.helpers.md +414 -0
  47. package/docs/4.notifications/.navigation.yml +2 -0
  48. package/docs/4.notifications/1.introduction.md +79 -0
  49. package/docs/4.notifications/2.categories-and-subjects.md +212 -0
  50. package/docs/4.notifications/3.sending.md +283 -0
  51. package/docs/5.html-render/.navigation.yml +2 -0
  52. package/docs/5.html-render/1.introduction.md +372 -0
  53. package/docs/5.html-render/2.built-in-emails.md +107 -0
  54. package/docs/index.md +100 -0
  55. package/docs/tsconfig.json +11 -0
  56. package/package.json +24 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,61 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.7.2
4
+
5
+ [compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.7.1...v0.7.2)
6
+
7
+ ### 🚀 Enhancements
8
+
9
+ - **preview:** Live block preview page, block catalog and screenshots for the docs ([#280](https://github.com/AntelopeJS/dms/pull/280))
10
+
11
+ ### 🔥 Performance
12
+
13
+ - **layout:** Bundle the Geist fonts and preload only the text face ([#311](https://github.com/AntelopeJS/dms/pull/311))
14
+ - **table:** Drag with SortableJS through useSortable instead of vuedraggable ([#312](https://github.com/AntelopeJS/dms/pull/312))
15
+ - **table-view:** Share a source read between the list and a counter asking the same ([#313](https://github.com/AntelopeJS/dms/pull/313))
16
+
17
+ ### 🩹 Fixes
18
+
19
+ - **deps:** Move to @antelopejs/core 1.15.2, @antelopejs/interface-core 0.2.3 and @antelopejs/interface-dms 0.7.1 ([#303](https://github.com/AntelopeJS/dms/pull/303))
20
+ - **docs:** Regenerate the block catalog for dms 0.9.2 ([#315](https://github.com/AntelopeJS/dms/pull/315))
21
+ - **form:** Leave a failed record read's toast to the browser ([#304](https://github.com/AntelopeJS/dms/pull/304))
22
+ - **page:** Leave a page's layout out of the components its preload looks up ([#306](https://github.com/AntelopeJS/dms/pull/306))
23
+ - **settings:** Suggest the reader's time zone in a server-rendered region page ([#308](https://github.com/AntelopeJS/dms/pull/308))
24
+ - **frontend:** Set the async data scope before any module's plugin reads ([#305](https://github.com/AntelopeJS/dms/pull/305))
25
+ - **blocks:** Have refreshPageBlocks() wait for the charts and tables it refreshes ([#307](https://github.com/AntelopeJS/dms/pull/307))
26
+
27
+ ### 📖 Documentation
28
+
29
+ - **dms:** Restructure docs with per-block pages, live previews and an AI section ([#277](https://github.com/AntelopeJS/dms/pull/277))
30
+ - Remove the DMS 0.9 upgrade page ([#316](https://github.com/AntelopeJS/dms/pull/316))
31
+ - **dms:** Document running the DMS inside AdonisJS ([#318](https://github.com/AntelopeJS/dms/pull/318))
32
+ - Make the DMS 0.9 upgrade notes accurate and complete ([#310](https://github.com/AntelopeJS/dms/pull/310))
33
+ - Streamline agent guidance ([#317](https://github.com/AntelopeJS/dms/pull/317))
34
+ - Colocate the DMS consumer reference with its interface ([#320](https://github.com/AntelopeJS/dms/pull/320))
35
+ - Make dense guide sections easier to scan ([#321](https://github.com/AntelopeJS/dms/pull/321))
36
+
37
+ ### 📦 Build
38
+
39
+ - **dms:** Leave tests and tooling out of the published package ([#314](https://github.com/AntelopeJS/dms/pull/314))
40
+
41
+ ### 🏡 Chore
42
+
43
+ - **release:** @antelopejs/dms v0.9.2 ([beb09f9d](https://github.com/AntelopeJS/dms/commit/beb09f9d))
44
+ - **release:** Propagate published dependency floors ([#323](https://github.com/AntelopeJS/dms/pull/323))
45
+
46
+ ### ✅ Tests
47
+
48
+ - **live:** Hold the page's data refresh while paused, not a user's ([#309](https://github.com/AntelopeJS/dms/pull/309))
49
+
50
+ ### 🤖 CI
51
+
52
+ - **docs:** Build and verify the hosted preview playground ([#319](https://github.com/AntelopeJS/dms/pull/319))
53
+
54
+ ### ❤️ Contributors
55
+
56
+ - Antony Rizzitelli <rizzitelli.antony@pm.me>
57
+ - Alessandro Aloisio
58
+
3
59
  ## v0.7.1
4
60
 
5
61
  [compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.7.0...v0.7.1)
package/README.md CHANGED
@@ -1,76 +1,78 @@
1
- # `@antelopejs/interface-dms`
2
-
3
1
  <div align="center">
4
- <a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge&labelColor=000000"></a>
5
- <a href="https://antelopejs.com"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
2
+
3
+ # @antelopejs/interface-dms
4
+
5
+ <a href="https://www.npmjs.com/package/@antelopejs/interface-dms"><img alt="npm" src="https://img.shields.io/npm/v/@antelopejs/interface-dms?style=for-the-badge&labelColor=000000&color=000000"></a>
6
+ <a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/interface-dms?style=for-the-badge&labelColor=000000&color=000000"></a>
7
+ <a href="https://discord.gg/sjK28QHrA7"><img alt="Discord" src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000"></a>
8
+ <a href="https://dms.antelopejs.com/docs/interfaces"><img alt="Documentation" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a>
9
+
10
+ The public contracts of the AntelopeJS DMS: pages and components, permissions and tenancy, authentication, notifications and HTML rendering.
11
+
6
12
  </div>
7
13
 
8
- The public contracts of the AntelopeJS DMS: pages and components, permissions
9
- and tenancy, authentication, notifications and HTML rendering. A module that
10
- extends the DMS imports them from here and never from `@antelopejs/dms`, so it
11
- compiles against the contract rather than against the implementation.
14
+ ## What it does
15
+
16
+ - Declares pages, categories, modules and page extensions (`/page`), and the blocks they carry: forms, tables, charts and layouts (`/base`).
17
+ - Registers permissions, guards routes, and scopes data to a tenant (`/permissions`, `/guards`, `/tenant-scoped-model`…).
18
+ - Authenticates requests and manages users, sessions and external identities (`/auth`).
19
+ - Declares notification categories and sends notifications (`/notifications`), and renders HTML templates server-side (`/html-render`).
20
+ - Lets a module compile against the contract rather than against the implementation, [`@antelopejs/dms`](https://www.npmjs.com/package/@antelopejs/dms).
21
+
22
+ ## Install
23
+
24
+ Add the interface to the module that extends the DMS:
12
25
 
13
26
  ```bash
14
27
  pnpm add @antelopejs/interface-dms
15
28
  ```
16
29
 
17
- ## Entry points
18
-
19
- | Import | What it holds |
20
- | --------------------------------------- | ---------------------------------------------------------- |
21
- | `@antelopejs/interface-dms` | the `dms` interface itself: pages, permissions, tenancy, hooks |
22
- | `@antelopejs/interface-dms/<module>` | one module of it -- `/page`, `/permissions`, `/hooks`, `/db`, ... |
23
- | `@antelopejs/interface-dms/auth` | authentication: users, sessions, external identities |
24
- | `@antelopejs/interface-dms/base` | the component library: forms, tables, charts, layouts |
25
- | `@antelopejs/interface-dms/notifications` | notification categories, subjects and delivery |
26
- | `@antelopejs/interface-dms/html-render` | server-side HTML templates |
27
-
28
- `/auth`, `/base` and `/notifications` take subpaths of their own
29
- (`/auth/db`, `/auth/password`, `/base/table-view`, `/base/data-types`, `/notifications/builder`,
30
- ...). The reference documentation lives in the runtime package, under
31
- `docs/07.interfaces/`.
32
-
33
- ## One copy, always
34
-
35
- Every AntelopeJS interface is a peer dependency, and so is this one in effect:
36
- the host and every module have to resolve **the same installed copy**.
37
-
38
- That is stricter here than the usual "duplicate dependencies waste space". This
39
- package holds live state, not just types -- the page, category and extension
40
- registries, the permission tree, the hook registry, the data-type and block
41
- registries, the component slot resolvers -- and the interface proxies a module
42
- registers into are identified per loaded instance. A second copy gets its own
43
- empty registries and its own proxies: pages register into a tree nobody reads,
44
- permissions never reach the roles form, and hooks never fire. Nothing throws.
45
-
46
- `@antelopejs/core` checks this before constructing modules and fails with
47
- `Incompatible interface package resolution` when a consumer resolves a copy
48
- other than the canonical one, so a mismatch is caught at startup rather than
49
- diagnosed later. Depend on it with a wide range -- `>=0.0.1 <1.0.0`, raising the lower bound
50
- to the version you actually need rather than pinning an upper one -- so package
51
- managers can deduplicate, and never vendor or bundle this package into a module.
52
- `@antelopejs/dms`, which implements this interface, is the exception: it caps its
53
- range below the next minor, so a breaking minor of this package never reaches an
54
- older DMS.
55
-
56
- One more consequence worth knowing when writing a module: the runtime hands a
57
- module a per-context view of the values it receives through an interface, so
58
- reference equality does not survive the round trip. Compare registrations on a
59
- field, never with `===`.
60
-
61
- The same goes for *finding* a registration again, not just comparing two. A
62
- view has to be resolved back to the registered object by its token before it can
63
- be used as a key: `RegisteringProxy` looks its entries up by object reference,
64
- so unregistering with the view a module holds matches nothing and leaves the
65
- registration live -- silently, exactly like a second copy would. `RegisterPage`
66
- and `RegisterCategory` resolve their argument through `RegistrationIdentity`
67
- (`page/internal/registry`) for that reason; anything else keyed on a value
68
- that crossed the boundary has to do the same. The same trap catches structural comparisons:
69
- `isDeepStrictEqual` and `assert.deepStrictEqual` both refuse two views that hold
70
- equal values, so compare plain data, field by field or after a JSON round trip.
71
-
72
- ## Releasing
73
-
74
- Release this package before releasing a `@antelopejs/dms` version that needs it,
75
- and upgrade it first on the consumer side. It has its own workflow
76
- (`Release DMS interface`); releasing the runtime never releases it.
30
+ Depend on it with a wide range, such as `>=0.7.0 <1.0.0`, and never bundle or vendor it: the host and every module must resolve the same installed copy, since the package holds live registries. `@antelopejs/core` fails at startup with `Incompatible interface package resolution` when a module resolves another copy.
31
+
32
+ ## Quick start
33
+
34
+ ```ts
35
+ import { PageController, RegisterPage, pagesCategory } from "@antelopejs/interface-dms/page";
36
+ import { KpiCard } from "@antelopejs/interface-dms/base/kpi-card";
37
+
38
+ @RegisterPage()
39
+ export class SalesPage extends PageController("sales", {
40
+ displayName: "Sales",
41
+ icon: "i-ph-chart-line",
42
+ category: pagesCategory,
43
+ }) {
44
+ static revenue = KpiCard({ title: "Revenue", fetchUrl: "/api/sales/revenue" });
45
+ }
46
+ ```
47
+
48
+ | Import | What it holds |
49
+ | --- | --- |
50
+ | `@antelopejs/interface-dms` | the core surface: pages, permissions, tenancy, hooks |
51
+ | `@antelopejs/interface-dms/<module>` | one module of it: `/page`, `/permissions`, `/hooks`, `/db`… |
52
+ | `@antelopejs/interface-dms/auth` | authentication: users, sessions, external identities |
53
+ | `@antelopejs/interface-dms/base` | the component library: forms, tables, charts, layouts |
54
+ | `@antelopejs/interface-dms/notifications` | notification categories, subjects and delivery |
55
+ | `@antelopejs/interface-dms/html-render` | server-side HTML templates |
56
+
57
+ ## Compatibility
58
+
59
+ | `@antelopejs/interface-dms` | `@antelopejs/dms` (implementation) |
60
+ | --- | --- |
61
+ | 0.7 | 0.9 |
62
+ | 0.6 | 0.8 |
63
+
64
+ ## Documentation
65
+
66
+ - [The DMS interface](./docs/index.md): the canonical consumer reference, shipped with this package and published at [docs/interfaces](https://dms.antelopejs.com/docs/interfaces)
67
+ - [Core](./docs/1.core/1.introduction.md), [Auth](./docs/2.auth/1.introduction.md), [Base](./docs/3.base/1.introduction.md), [Notifications](./docs/4.notifications/1.introduction.md), [HTML Render](./docs/5.html-render/1.introduction.md)
68
+ - [Pages and components](https://dms.antelopejs.com/docs/building/pages-and-components): the task-by-task guide
69
+
70
+ An importable file is not necessarily a supported API. Paths under `internal/`, symbols tagged `@internal`, and `internal` namespaces are implementation wiring, even when the wildcard export makes them reachable. Use the public declarations and contracts documented here.
71
+
72
+ ## Contributing
73
+
74
+ This package lives in the [`AntelopeJS/dms`](https://github.com/AntelopeJS/dms) pnpm workspace, next to the runtime that implements it. Read [CONTRIBUTING.md](https://github.com/AntelopeJS/dms/blob/main/CONTRIBUTING.md), the [repository README](https://github.com/AntelopeJS/dms#contributing) and [AGENTS.md](https://github.com/AntelopeJS/dms/blob/main/AGENTS.md), which covers what is public and what is internal. Release this package (**Release DMS interface**) before a `@antelopejs/dms` version that needs it.
75
+
76
+ ## License
77
+
78
+ [Apache-2.0](./LICENSE)
@@ -20,6 +20,7 @@ declare const SessionModel_base: {
20
20
  delete(id: string): Promise<number>;
21
21
  };
22
22
  readonly schemaName: string;
23
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Session>;
23
24
  fromPlainData(obj: any): Session;
24
25
  fromDatabase(obj: any): Session | undefined;
25
26
  toDatabase(obj: any): Record<string, any>;
@@ -17,6 +17,7 @@ declare const UserExternalIdentityModel_base: {
17
17
  delete(id: string): Promise<number>;
18
18
  };
19
19
  readonly schemaName: string;
20
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<UserExternalIdentity>;
20
21
  fromPlainData(obj: any): UserExternalIdentity;
21
22
  fromDatabase(obj: any): UserExternalIdentity | undefined;
22
23
  toDatabase(obj: any): Record<string, any>;
@@ -20,6 +20,7 @@ declare const UserModel_base: {
20
20
  delete(id: string): Promise<number>;
21
21
  };
22
22
  readonly schemaName: string;
23
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<User>;
23
24
  fromPlainData(obj: any): User;
24
25
  fromDatabase(obj: any): User | undefined;
25
26
  toDatabase(obj: any): Record<string, any>;
@@ -22,6 +22,7 @@ import "./grid";
22
22
  import "./guard";
23
23
  import "./key-value-list";
24
24
  import "./kpi-card";
25
+ import "./live-toggle";
25
26
  import "./meter";
26
27
  import "./nav-card-grid";
27
28
  import "./period-selector";
@@ -38,6 +38,7 @@ require("./grid");
38
38
  require("./guard");
39
39
  require("./key-value-list");
40
40
  require("./kpi-card");
41
+ require("./live-toggle");
41
42
  require("./meter");
42
43
  require("./nav-card-grid");
43
44
  require("./period-selector");
@@ -1 +1 @@
1
- {"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,mBAAiB;AACjB,4BAA0B;AAC1B,sBAAoB;AACpB,mBAAiB;AACjB,2BAAyB;AACzB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
1
+ {"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,mBAAiB;AACjB,4BAA0B;AAC1B,sBAAoB;AACpB,yBAAuB;AACvB,mBAAiB;AACjB,2BAAyB;AACzB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
@@ -58,11 +58,11 @@ export declare const LiveToggleSchema: z.ZodObject<{
58
58
  }, "strip", z.ZodTypeAny, {
59
59
  variant?: "segmented" | "pill" | undefined;
60
60
  align?: "left" | "right" | "center" | undefined;
61
- missedLabel?: string | undefined;
62
61
  showUpdatedAt?: boolean | undefined;
62
+ missedLabel?: string | undefined;
63
63
  }, {
64
64
  variant?: "segmented" | "pill" | undefined;
65
65
  align?: "left" | "right" | "center" | undefined;
66
- missedLabel?: string | undefined;
67
66
  showUpdatedAt?: boolean | undefined;
67
+ missedLabel?: string | undefined;
68
68
  }>;
@@ -141,13 +141,13 @@ export declare const PeriodSelectorSchema: z.ZodObject<{
141
141
  size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
142
142
  variant?: "default" | "segmented" | undefined;
143
143
  rememberKey?: string | undefined;
144
+ align?: "left" | "right" | "center" | undefined;
144
145
  defaultPreset?: "custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year" | undefined;
145
146
  defaultComparison?: "custom" | "none" | "previous-period" | "previous-year" | undefined;
146
147
  presets?: ("custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year")[] | undefined;
147
148
  comparisons?: ("custom" | "none" | "previous-period" | "previous-year")[] | undefined;
148
149
  presetLabels?: Partial<Record<"custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year", string>> | undefined;
149
150
  comparisonLabels?: Partial<Record<"custom" | "none" | "previous-period" | "previous-year", string>> | undefined;
150
- align?: "left" | "right" | "center" | undefined;
151
151
  showRangeLabel?: boolean | undefined;
152
152
  rangeLabel?: "relative" | "absolute" | undefined;
153
153
  comparisonControl?: "hidden" | "menu" | "toggle" | undefined;
@@ -157,13 +157,13 @@ export declare const PeriodSelectorSchema: z.ZodObject<{
157
157
  id?: string | undefined;
158
158
  variant?: "default" | "segmented" | undefined;
159
159
  rememberKey?: string | undefined;
160
+ align?: "left" | "right" | "center" | undefined;
160
161
  defaultPreset?: "custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year" | undefined;
161
162
  defaultComparison?: "custom" | "none" | "previous-period" | "previous-year" | undefined;
162
163
  presets?: ("custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year")[] | undefined;
163
164
  comparisons?: ("custom" | "none" | "previous-period" | "previous-year")[] | undefined;
164
165
  presetLabels?: Partial<Record<"custom" | "all" | "last-hour" | "last-24h" | "today" | "yesterday" | "last-7-days" | "last-30-days" | "last-90-days" | "this-month" | "last-month" | "this-quarter" | "last-quarter" | "ytd" | "last-year", string>> | undefined;
165
166
  comparisonLabels?: Partial<Record<"custom" | "none" | "previous-period" | "previous-year", string>> | undefined;
166
- align?: "left" | "right" | "center" | undefined;
167
167
  showRangeLabel?: boolean | undefined;
168
168
  rangeLabel?: "relative" | "absolute" | undefined;
169
169
  comparisonControl?: "hidden" | "menu" | "toggle" | undefined;
@@ -839,17 +839,17 @@ export declare const TableViewSchema: z.ZodObject<{
839
839
  whileSorted: z.ZodOptional<z.ZodBoolean>;
840
840
  missedLabel: z.ZodOptional<z.ZodString>;
841
841
  }, "strip", z.ZodTypeAny, {
842
+ missedLabel?: string | undefined;
842
843
  whileRowOpen?: boolean | undefined;
843
844
  whileScrolled?: boolean | undefined;
844
845
  whileSearching?: boolean | undefined;
845
846
  whileSorted?: boolean | undefined;
846
- missedLabel?: string | undefined;
847
847
  }, {
848
+ missedLabel?: string | undefined;
848
849
  whileRowOpen?: boolean | undefined;
849
850
  whileScrolled?: boolean | undefined;
850
851
  whileSearching?: boolean | undefined;
851
852
  whileSorted?: boolean | undefined;
852
- missedLabel?: string | undefined;
853
853
  }>]>>;
854
854
  kanban: z.ZodOptional<z.ZodObject<{
855
855
  groupByField: z.ZodString;
@@ -1137,11 +1137,11 @@ export declare const TableViewSchema: z.ZodObject<{
1137
1137
  strictRuleValidation?: boolean | undefined;
1138
1138
  realtimeTopic?: string | string[] | undefined;
1139
1139
  liveHold?: boolean | {
1140
+ missedLabel?: string | undefined;
1140
1141
  whileRowOpen?: boolean | undefined;
1141
1142
  whileScrolled?: boolean | undefined;
1142
1143
  whileSearching?: boolean | undefined;
1143
1144
  whileSorted?: boolean | undefined;
1144
- missedLabel?: string | undefined;
1145
1145
  } | undefined;
1146
1146
  defaultDisplay?: string | undefined;
1147
1147
  guards?: TableViewGuards<Record<string, unknown>> | undefined;
@@ -1352,11 +1352,11 @@ export declare const TableViewSchema: z.ZodObject<{
1352
1352
  realtime?: boolean | undefined;
1353
1353
  realtimeTopic?: string | string[] | undefined;
1354
1354
  liveHold?: boolean | {
1355
+ missedLabel?: string | undefined;
1355
1356
  whileRowOpen?: boolean | undefined;
1356
1357
  whileScrolled?: boolean | undefined;
1357
1358
  whileSearching?: boolean | undefined;
1358
1359
  whileSorted?: boolean | undefined;
1359
- missedLabel?: string | undefined;
1360
1360
  } | undefined;
1361
1361
  defaultDisplay?: string | undefined;
1362
1362
  guards?: TableViewGuards<Record<string, unknown>> | undefined;
@@ -24,6 +24,7 @@ declare const ExportJobModel_base: {
24
24
  delete(id: string): Promise<number>;
25
25
  };
26
26
  readonly schemaName: string;
27
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<ExportJob>;
27
28
  fromPlainData(obj: any): ExportJob;
28
29
  fromDatabase(obj: any): ExportJob | undefined;
29
30
  toDatabase(obj: any): Record<string, any>;
@@ -13,6 +13,7 @@ declare const InviteResolutionsModel_base: {
13
13
  delete(id: string): Promise<number>;
14
14
  };
15
15
  readonly schemaName: string;
16
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<InviteResolution>;
16
17
  fromPlainData(obj: any): InviteResolution;
17
18
  fromDatabase(obj: any): InviteResolution | undefined;
18
19
  toDatabase(obj: any): Record<string, any>;
@@ -12,6 +12,7 @@ declare const TenantLifecycleModel_base: {
12
12
  delete(id: string): Promise<number>;
13
13
  };
14
14
  readonly schemaName: string;
15
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<TenantLifecycle>;
15
16
  fromPlainData(obj: any): TenantLifecycle;
16
17
  fromDatabase(obj: any): TenantLifecycle | undefined;
17
18
  toDatabase(obj: any): Record<string, any>;
@@ -12,6 +12,7 @@ declare const RoleModel_base: {
12
12
  delete(id: string): Promise<number>;
13
13
  };
14
14
  readonly schemaName: string;
15
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Role>;
15
16
  fromPlainData(obj: any): Role;
16
17
  fromDatabase(obj: any): Role | undefined;
17
18
  toDatabase(obj: any): Record<string, any>;
@@ -12,6 +12,7 @@ declare const TenantMemberModel_base: {
12
12
  delete(id: string): Promise<number>;
13
13
  };
14
14
  readonly schemaName: string;
15
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<TenantMember>;
15
16
  fromPlainData(obj: any): TenantMember;
16
17
  fromDatabase(obj: any): TenantMember | undefined;
17
18
  toDatabase(obj: any): Record<string, any>;
@@ -12,6 +12,7 @@ declare const TenantModel_base: {
12
12
  delete(id: string): Promise<number>;
13
13
  };
14
14
  readonly schemaName: string;
15
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<Tenant>;
15
16
  fromPlainData(obj: any): Tenant;
16
17
  fromDatabase(obj: any): Tenant | undefined;
17
18
  toDatabase(obj: any): Record<string, any>;
@@ -16,6 +16,7 @@ declare const UserInviteModel_base: {
16
16
  delete(id: string): Promise<number>;
17
17
  };
18
18
  readonly schemaName: string;
19
+ readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<UserInvite>;
19
20
  fromPlainData(obj: any): UserInvite;
20
21
  fromDatabase(obj: any): UserInvite | undefined;
21
22
  toDatabase(obj: any): Record<string, any>;
@@ -0,0 +1,2 @@
1
+ title: Interfaces
2
+ icon: i-lucide-file-code-2
@@ -0,0 +1,2 @@
1
+ title: Core
2
+ icon: i-lucide-cpu
@@ -0,0 +1,169 @@
1
+ ---
2
+ title: "Introduction"
3
+ description: "The core contract of the DMS: pages and modules, components, permissions, tenancy, invites, hooks, realtime, quick actions and layout banners."
4
+ ---
5
+
6
+ # Introduction
7
+
8
+ ## Overview
9
+
10
+ The root export of `@antelopejs/interface-dms` and the subpaths listed below are the core contract of the AntelopeJS DMS. It encodes one inversion: the backend declares the screen, as serializable data. A page is a controller class, its components are static fields holding builders, and the page's layout route returns the description a shared frontend renders. Adding an admin screen is a backend change.
11
+
12
+ Around that core the interface carries what an admin backend needs to be more than a renderer: hierarchical permissions derived from the page tree, multi-tenant data access scoped by the model handle, lifecycle hooks, realtime topics, and command-palette entries.
13
+
14
+ Everything here is imported from a subpath of `@antelopejs/interface-dms`. Two other domains of the same package complete the picture and are referenced throughout these pages: [Auth](/docs/interfaces/auth/introduction) (`/auth`) for authentication and the `User` table, and [Base](/docs/interfaces/base/introduction) (`/base`) for the concrete component vocabulary (`Form`, `TableView`, `Grid`, the chart family) built on the component types documented here.
15
+
16
+ ## Key Features
17
+
18
+ - **Pages as controllers** — `PageController` builds a controller class bound to a URL; `@RegisterPage()` records it, registers its permissions, and serves its layout.
19
+ - **Components that serialize** — a `ComponentBuilder` produces data, not a live component, so one frontend renders every module's screens.
20
+ - **Categories and modules** — a sidebar tree of nested categories, plus modules that own a whole branch under `/modules`.
21
+ - **Dynamic navigation** — providers that resolve extra menu entries per request, so one page can back an entry per project or workspace.
22
+ - **Page extensions** — inject components into a page owned by another module, permissioned in that page's own tree.
23
+ - **Hierarchical permissions** — ids derived from page, component and action, with a base set from roles and an effective set shaped by registered resolvers.
24
+ - **Route guards** — permission, tenant-member and tenant-owner decorators usable as parameter or property decorators.
25
+ - **Tenancy in the handle** — per-tenant schemas and model handles bound to one tenant, rather than a tenant column filtered on every query.
26
+ - **Tenant access gates** — one binary check that denies a tenant at every authorization surface at once.
27
+ - **Invites** — one call that either grants membership to an existing user or issues a token-bearing invite.
28
+ - **Lifecycle hooks** — typed events for tenants, members, invites and registrations, dispatched either to notify or to collect contributions.
29
+ - **Realtime topics** — bind a topic to a page, publish to whoever is on it, and subscribe from the backend to what others publish.
30
+ - **Quick actions** — contribute grouped, permission-gated entries to the command palette.
31
+
32
+ ## Dependencies
33
+
34
+ This interface relies on the following AntelopeJS packages:
35
+
36
+ - [@antelopejs/interface-api](https://github.com/AntelopeJS/interface-api) - Controllers, route registration and request context.
37
+ - [@antelopejs/interface-auth](https://github.com/AntelopeJS/interface-auth) - The authentication decorator machinery the guards build on.
38
+ - [@antelopejs/interface-core](https://github.com/AntelopeJS/interface-core) - Interface functions, registering proxies and decorator helpers.
39
+ - [@antelopejs/interface-database-decorators](https://github.com/AntelopeJS/interface-database-decorators) - Table definitions, data models and model injection.
40
+ - [@antelopejs/interface-data-api](https://github.com/AntelopeJS/interface-data-api) - Used by the `/data-controllers` subpath for the built-in members and roles controllers.
41
+
42
+ ## Quick Start
43
+
44
+ Declare the application's table and model first. `BookModel` is not a DMS export; this example defines it with the stock flag used by the KPI query.
45
+
46
+ ```typescript [db.ts]
47
+ import {
48
+ BasicDataModel,
49
+ Field,
50
+ RegisterTable,
51
+ Table,
52
+ } from "@antelopejs/interface-database-decorators";
53
+
54
+ export const CATALOG_SCHEMA = "example_catalog";
55
+
56
+ @RegisterTable("books", CATALOG_SCHEMA)
57
+ export class Book extends Table {
58
+ @Field("string") declare _id: string;
59
+ @Field("string") declare title: string;
60
+ @Field("boolean") declare inStock: boolean;
61
+ }
62
+
63
+ export class BookModel extends BasicDataModel(Book, "books") {}
64
+ ```
65
+
66
+ Then declare a category, a page with a component, and the route that component fetches from:
67
+
68
+ ```typescript [books-page.ts]
69
+ import { Get } from "@antelopejs/interface-api";
70
+ import { GetModel } from "@antelopejs/interface-database-decorators";
71
+ import {
72
+ Category,
73
+ PageController,
74
+ RegisterPage,
75
+ pagesCategory,
76
+ } from "@antelopejs/interface-dms/page";
77
+ import { KpiCard } from "@antelopejs/interface-dms/base";
78
+ import { BookModel } from "./db";
79
+
80
+ export const catalog = Category("catalog", {
81
+ displayName: "Catalog",
82
+ icon: "i-ph-books",
83
+ category: pagesCategory,
84
+ });
85
+
86
+ @RegisterPage()
87
+ export class BooksPage extends PageController("books", {
88
+ displayName: "Books",
89
+ description: "Everything currently in the catalog",
90
+ icon: "i-ph-book-open",
91
+ category: catalog,
92
+ order: 1,
93
+ }) {
94
+ static inStockKpi = KpiCard({
95
+ title: "In stock",
96
+ icon: "i-ph-package",
97
+ fetchUrl: "/catalog/books/stats/in-stock",
98
+ valueFormat: "number",
99
+ });
100
+
101
+ @Get("/stats/in-stock")
102
+ async inStock() {
103
+ const value = await GetModel(BookModel).table
104
+ .filter((book) => book.key("inStock").eq(true)).count().run();
105
+ return { value };
106
+ }
107
+ }
108
+ ```
109
+
110
+ Import the page and register the schema from your module's entry file, merging this into an existing `start()` if necessary:
111
+
112
+ ```typescript [index.ts]
113
+ import "./books-page";
114
+ import { RegisterSchema } from "@antelopejs/interface-database-decorators";
115
+ import { CATALOG_SCHEMA } from "./db";
116
+
117
+ export async function start(): Promise<void> {
118
+ await RegisterSchema(CATALOG_SCHEMA);
119
+ }
120
+ ```
121
+
122
+ The page resolves at `/catalog/books` and its layout at `/dms/pages/catalog/books/pagelayout`: a page controller's routes live under `/dms/pages` (`pageRoutePath`), a prefix the frontend server proxies to the backend, since the page's own path is the page. Its permission id is the chain of ids down from the root category — `pages.catalog.books` — with `pages.catalog.books.inStockKpi` registered underneath it.
123
+
124
+ ## Subpath Map
125
+
126
+ | Subpath | Contains | Documented in |
127
+ | ------- | -------- | ------------- |
128
+ | `/page` | Pages, categories, modules, layouts, page extensions, dynamic menus, frontend modules | [Pages and Modules](/docs/interfaces/core/pages-and-modules) |
129
+ | `/component` | `Component`, `ComponentBuilder`, actions, watches | [Components](/docs/interfaces/core/components) |
130
+ | `/component-slots` | `RegisterComponentSlot`, `ComponentSlotResolver`, `SlotOptions` | [Components](/docs/interfaces/core/components#registercomponentslot) |
131
+ | `/attachments` | `SaveComponentFiles` and its request, field and result types | [Pages and Modules](/docs/interfaces/core/pages-and-modules#savecomponentfiles) |
132
+ | `/permission-gate` | Shared `PermissionGate` fields | [Base types](/docs/interfaces/base/types#permissiongate) |
133
+ | `/permissions` | The permission registry and the permission computation | [Permissions](/docs/interfaces/core/permissions) |
134
+ | `/permissions-resolver` | Registering and running permission resolvers | [Permissions](/docs/interfaces/core/permissions) |
135
+ | `/guards` | `AuthUserWithPermission`, `AuthTenantOwner`, `AuthTenantMember` | [Permissions](/docs/interfaces/core/permissions) |
136
+ | `/constants` | Schema names and the default tenant | [Tenancy](/docs/interfaces/core/tenancy) |
137
+ | `/db` | The `Tenant`, `TenantMember`, `Role` and `UserInvite` tables and models | [Tenancy](/docs/interfaces/core/tenancy), [Invites](/docs/interfaces/core/invites) |
138
+ | `/request-tenant` | `getRequestTenantId` | [Tenancy](/docs/interfaces/core/tenancy) |
139
+ | `/tenant-scoped-model` | `TenantScopedModel` | [Tenancy](/docs/interfaces/core/tenancy) |
140
+ | `/tenant-access` | Tenant access gates | [Tenancy](/docs/interfaces/core/tenancy) |
141
+ | `/tenant-ownership` | Membership and ownership writes | [Tenancy](/docs/interfaces/core/tenancy) |
142
+ | `/tenant-lifecycle` | Producer admission and closure before tenant deletion | [Tenancy](/docs/interfaces/core/tenancy#tenant-lifecycle-admission) |
143
+ | `/data-controllers` | The built-in members and roles data controllers | [Tenancy](/docs/interfaces/core/tenancy) |
144
+ | `/invites` | Inviting a user into a tenant | [Invites](/docs/interfaces/core/invites) |
145
+ | `/invite-extensions` | Invite form contributions, callbacks and availability | [Invites](/docs/interfaces/core/invites#registerinviteextension) |
146
+ | `/invite-resolution` | Durable terminal decisions and retryable effects | [Invites](/docs/interfaces/core/invites#durable-invite-resolution) |
147
+ | `/hooks` | The `Hook` enum, handlers and dispatch | [Hooks](/docs/interfaces/core/hooks) |
148
+ | `/tenant-export` | The tenant data export archive, contribution and manifest types, re-exported from `/hooks` | [Hooks](/docs/interfaces/core/hooks) |
149
+ | `/realtime` | Page topics, publishing and backend subscription | [Realtime](/docs/interfaces/core/realtime) |
150
+ | `/quick-actions` | Command-palette entries | [Quick Actions](/docs/interfaces/core/quick-actions) |
151
+ | `/layout-banners` | Global banners under the dashboard header | [Layout Banners](/docs/interfaces/core/layout-banners) |
152
+ | `/uploads` | Signed upload tokens for the file and image fields of a serialized component | [Pages and Modules](/docs/interfaces/core/pages-and-modules) |
153
+ | `/types` | `MaybePromise`, the one shared type alias | [Pages and Modules](/docs/interfaces/core/pages-and-modules) |
154
+ | `/api-base-url`, `/client-base-url` | `GetApiBaseUrl`, `GetClientBaseUrl`: the public origins of the API and the dashboard | [Pages and Modules](/docs/interfaces/core/pages-and-modules#public-urls) |
155
+ | `/client-ip` | `getClientIp`, `ResolveClientIp`: a request's client address behind the trusted proxies | [Pages and Modules](/docs/interfaces/core/pages-and-modules#client-address) |
156
+
157
+ Paths under `internal/`, symbols tagged `@internal`, and `internal` namespaces are implementation wiring, not supported consumer APIs. The wildcard export does not change that boundary.
158
+
159
+ ## Documentation Sections
160
+
161
+ - [Pages and Modules](/docs/interfaces/core/pages-and-modules) - Declare pages, group them into categories, own a branch of the sidebar with a module, and extend a page from another one
162
+ - [Components](/docs/interfaces/core/components) - Build serializable components, declare actions and watches
163
+ - [Permissions](/docs/interfaces/core/permissions) - Register permissions, compute a user's effective set, guard routes
164
+ - [Tenancy](/docs/interfaces/core/tenancy) - Schemas, the tenancy tables, tenant-scoped models and access gates
165
+ - [Invites](/docs/interfaces/core/invites) - Bring a user into a tenant by email
166
+ - [Hooks](/docs/interfaces/core/hooks) - React to platform events and contribute to the tenant data export
167
+ - [Realtime](/docs/interfaces/core/realtime) - Bind topics to pages, publish messages and subscribe to them
168
+ - [Quick Actions](/docs/interfaces/core/quick-actions) - Contribute entries to the command palette
169
+ - [Layout Banners](/docs/interfaces/core/layout-banners) - Show a global banner under the dashboard header, decided per request