@antelopejs/interface-dms 0.7.1 → 0.7.3

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 (75) hide show
  1. package/CHANGELOG.md +86 -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-registry/index.d.ts +1 -0
  7. package/dist/base/block-registry/index.js +1 -0
  8. package/dist/base/block-registry/index.js.map +1 -1
  9. package/dist/base/block-registry/presentation.d.ts +21 -0
  10. package/dist/base/block-registry/presentation.js +108 -0
  11. package/dist/base/block-registry/presentation.js.map +1 -0
  12. package/dist/base/block-types.d.ts +1 -0
  13. package/dist/base/block-types.js +1 -0
  14. package/dist/base/block-types.js.map +1 -1
  15. package/dist/base/live-toggle.d.ts +2 -2
  16. package/dist/base/period-selector.d.ts +2 -2
  17. package/dist/base/placeholder.js +2 -2
  18. package/dist/base/placeholder.js.map +1 -1
  19. package/dist/base/table-view/schema.d.ts +4 -4
  20. package/dist/db/internal/exportJobs.model.d.ts +1 -0
  21. package/dist/db/internal/inviteResolutions.model.d.ts +1 -0
  22. package/dist/db/internal/tenantLifecycle.model.d.ts +1 -0
  23. package/dist/db/models/roles.model.d.ts +1 -0
  24. package/dist/db/models/tenantMembers.model.d.ts +1 -0
  25. package/dist/db/models/tenants.model.d.ts +1 -0
  26. package/dist/db/models/user_invites.model.d.ts +1 -0
  27. package/docs/.navigation.yml +2 -0
  28. package/docs/1.core/.navigation.yml +2 -0
  29. package/docs/1.core/1.introduction.md +169 -0
  30. package/docs/1.core/10.layout-banners.md +133 -0
  31. package/docs/1.core/2.pages-and-modules.md +649 -0
  32. package/docs/1.core/3.components.md +287 -0
  33. package/docs/1.core/4.permissions.md +279 -0
  34. package/docs/1.core/5.tenancy.md +358 -0
  35. package/docs/1.core/6.invites.md +239 -0
  36. package/docs/1.core/7.hooks.md +354 -0
  37. package/docs/1.core/8.realtime.md +147 -0
  38. package/docs/1.core/9.quick-actions.md +115 -0
  39. package/docs/2.auth/.navigation.yml +2 -0
  40. package/docs/2.auth/1.introduction.md +75 -0
  41. package/docs/2.auth/2.authentication.md +222 -0
  42. package/docs/2.auth/3.tokens-and-sessions.md +352 -0
  43. package/docs/2.auth/4.users.md +256 -0
  44. package/docs/2.auth/5.external-identities.md +122 -0
  45. package/docs/3.base/.navigation.yml +2 -0
  46. package/docs/3.base/1.introduction.md +202 -0
  47. package/docs/3.base/10.display-blocks.md +136 -0
  48. package/docs/3.base/2.types.md +402 -0
  49. package/docs/3.base/3.forms.md +349 -0
  50. package/docs/3.base/4.tables.md +608 -0
  51. package/docs/3.base/5.charts-and-widgets.md +466 -0
  52. package/docs/3.base/6.layout.md +437 -0
  53. package/docs/3.base/8.data-types.md +361 -0
  54. package/docs/3.base/9.helpers.md +414 -0
  55. package/docs/4.notifications/.navigation.yml +2 -0
  56. package/docs/4.notifications/1.introduction.md +81 -0
  57. package/docs/4.notifications/2.categories-and-subjects.md +214 -0
  58. package/docs/4.notifications/3.sending.md +285 -0
  59. package/docs/5.html-render/.navigation.yml +2 -0
  60. package/docs/5.html-render/1.introduction.md +386 -0
  61. package/docs/5.html-render/2.built-in-emails.md +157 -0
  62. package/docs/images/emails-admin-invite.png +0 -0
  63. package/docs/images/emails-change-notice.png +0 -0
  64. package/docs/images/emails-change-verification.png +0 -0
  65. package/docs/images/emails-digest-logo-dark.png +0 -0
  66. package/docs/images/emails-digest-logo-light.png +0 -0
  67. package/docs/images/emails-digest.png +0 -0
  68. package/docs/images/emails-export-partial.png +0 -0
  69. package/docs/images/emails-export-ready.png +0 -0
  70. package/docs/images/emails-reset-password.png +0 -0
  71. package/docs/images/emails-two-factor.png +0 -0
  72. package/docs/images/emails-user-validation.png +0 -0
  73. package/docs/index.md +109 -0
  74. package/docs/tsconfig.json +11 -0
  75. package/package.json +25 -18
@@ -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
@@ -0,0 +1,133 @@
1
+ ---
2
+ title: "Layout Banners"
3
+ description: "A layout banner is a global message the backend adds under the dashboard header: a colored strip carrying a line of text and its link buttons, or a component of your frontend layer."
4
+ ---
5
+
6
+ # Layout Banners
7
+
8
+ ## Overview
9
+
10
+ A layout banner is a global message the backend adds under the dashboard header: a colored strip carrying a line of text and its link buttons, or a component of your frontend layer. It renders on every page of the dashboard layout — tenant pages and the module back-office pages under `/modules` alike — and banners stack by `order`.
11
+
12
+ Whether a banner shows is decided per request, on the server, while the site layout is built. The answer is part of the server-rendered page, so a banner never flashes in or out after hydration.
13
+
14
+ Everything lives in `@antelopejs/interface-dms/layout-banners`.
15
+
16
+ ## Register a Banner
17
+
18
+ `RegisterLayoutBanner(info)` registers the banner and returns a function removing it. Register at import time, next to the state the banner reports on; the registration is dropped automatically when your module stops.
19
+
20
+ ```typescript
21
+ import {
22
+ LayoutBannerVariant,
23
+ RegisterLayoutBanner,
24
+ } from "@antelopejs/interface-dms/layout-banners";
25
+ import { isMaintenanceScheduled } from "./maintenance";
26
+
27
+ RegisterLayoutBanner({
28
+ key: "my-app:maintenance",
29
+ variant: LayoutBannerVariant.WARNING,
30
+ text: "$my_app.banners.maintenance",
31
+ order: 10,
32
+ dismissible: true,
33
+ visible: async ({ tenantId }) => isMaintenanceScheduled(tenantId),
34
+ });
35
+ ```
36
+
37
+ The text can be a [composed text](/docs/components/block-fundamentals#composed-texts) — an i18n key and the raw values it names, written in the reader's language — and `actions` adds link buttons after it, the last one leading:
38
+
39
+ ```typescript
40
+ RegisterLayoutBanner({
41
+ key: "my-app:maintenance",
42
+ variant: LayoutBannerVariant.WARNING,
43
+ text: {
44
+ key: "my_app.banners.maintenance_at", // "Maintenance {date}"
45
+ params: { date: { type: "datetime", value: "2026-10-12T22:00:00Z" } },
46
+ },
47
+ actions: [{ label: "$my_app.banners.status", to: "https://status.example.com" }],
48
+ });
49
+ ```
50
+
51
+ ## Resolve the Content per Request
52
+
53
+ When the message names the state that makes the banner show — the invoice that failed, its amount, the day the workspace is suspended — `resolve(context)` builds the text and the buttons for each request, or answers `undefined` to hide the banner. It replaces `visible`: one read decides both.
54
+
55
+ ```typescript
56
+ RegisterLayoutBanner({
57
+ key: "saas:past-due",
58
+ variant: LayoutBannerVariant.ERROR,
59
+ resolve: async ({ tenantId }) => {
60
+ const invoice = await openInvoice(tenantId);
61
+ if (!invoice) return undefined;
62
+ return {
63
+ text: {
64
+ key: "saas.banner.past_due", // "Invoice {invoice} of {amount} failed, retry {date}"
65
+ params: {
66
+ invoice: invoice.number,
67
+ amount: { type: "money", value: invoice.amountDue, currency: invoice.currency },
68
+ date: { type: "date", value: invoice.nextAttemptAt, format: "day" },
69
+ },
70
+ },
71
+ actions: [{ label: "$saas.banner.pay", to: "/settings/workspace/billing?pay=1" }],
72
+ };
73
+ },
74
+ });
75
+ ```
76
+
77
+ The server sends the raw values; the browser formats them for the reader's language, time zone and clock, so the resolver never formats text. A banner like this one needs no frontend component.
78
+
79
+ ## Mount a Component
80
+
81
+ A banner can mount a global component of your [frontend layer](/docs/building/frontend-layer) instead of a text. The DMS still draws the chrome around it — color, icon, close button and ARIA role — and passes `props` to the component:
82
+
83
+ ```typescript
84
+ RegisterLayoutBanner({
85
+ key: "my-app:trial",
86
+ variant: LayoutBannerVariant.INFO,
87
+ component: "MyAppTrialBanner",
88
+ props: { upgradeUrl: "/settings/billing" },
89
+ visible: ({ isOwner }) => isOwner,
90
+ });
91
+ ```
92
+
93
+ Re-registering a `key` replaces the banner.
94
+
95
+ ## `LayoutBannerInfo`
96
+
97
+ | Field | Type | Description |
98
+ | ----- | ---- | ----------- |
99
+ | `key` | `string` | Unique across the deployment. Required. Also what a dismissal remembers: give a banner a new key when it must show again to users who dismissed it. |
100
+ | `variant` | `LayoutBannerVariant` | `"info"`, `"warning"` or `"error"`. Required. Picks the color, the default icon and the ARIA role. |
101
+ | `text` | `string \| ComposedText` | The message. A `$`-prefixed value resolves as an i18n key; a `ComposedText` is written in the reader's language. Exclusive with `component` and `resolve`; one of the three is required. |
102
+ | `actions` | `BlockLinkAction[]` | Link buttons after `text`, the last one leading. Labels follow the `$` convention. |
103
+ | `component` | `string` | Name of a global component rendered as the banner's content. Exclusive with `text` and `resolve`. |
104
+ | `props` | `Record<string, unknown>` | Props passed to `component`. Must be serializable. |
105
+ | `order` | `number` | Stack order, ascending from the top. Defaults to `0`; ties keep the registration order. |
106
+ | `icon` | `string` | Leading icon. Defaults to one matching the variant. |
107
+ | `dismissible` | `boolean` | Whether the user can close the banner. Defaults to `false`. |
108
+ | `visible` | `LayoutBannerVisibility` | Decides per request whether a `text` or `component` banner shows. Absent means always. |
109
+ | `resolve` | `LayoutBannerResolver` | Builds `{ text, actions? }` per request, or `undefined` to hide the banner. Exclusive with `text`, `component` and `visible`. |
110
+
111
+ ## Visibility
112
+
113
+ `visible(context)` returns a boolean, or a promise of one; `resolve(context)` returns a `LayoutBannerContent` (`{ text, actions? }`), `undefined`, or a promise of either. They run server-side for every site layout request, all resolvers together, so the request waits for the slowest one rather than for their sum. A resolver that throws or does not answer within two seconds hides its banner for that request, as does a `visible` returning anything but `true` or a `resolve` answering no text; the other banners are unaffected.
114
+
115
+ ### `LayoutBannerContext`
116
+
117
+ | Field | Type | Description |
118
+ | ----- | ---- | ----------- |
119
+ | `user` | `User \| undefined` | The caller; `undefined` for an unauthenticated request. |
120
+ | `tenantId` | `string` | The tenant the site layout is built for. |
121
+ | `permissions` | `Set<string>` | The caller's effective permissions in the tenant. |
122
+ | `isOwner` | `boolean` | Whether the caller holds the wildcard permission. |
123
+ | `isTenantAccessDenied` | `boolean` | Whether a [tenant access gate](/docs/interfaces/core/tenancy) currently refuses the caller. |
124
+
125
+ Unlike product surfaces, a banner reads the permissions a denying access gate would hide: telling a suspended or past-due workspace why is exactly what a banner is for. Check `isTenantAccessDenied` when the two situations call for different banners.
126
+
127
+ The resolvers run whenever a client fetches its site layout — on a full page load and after a menu invalidation. When the state a resolver reads changes, call `NotifyMenuChanged(tenantId)` from `@antelopejs/interface-dms/page` so the connected clients of that tenant re-fetch it and the banner appears or goes without a reload.
128
+
129
+ ## Rendering
130
+
131
+ Banners render under the header of the dashboard layout, full width, in `order`, a text banner's `actions` on its right. Each one is its own live region: `error` banners carry `role="alert"`, `info` and `warning` banners `role="status"`.
132
+
133
+ A dismissible banner shows a close button. The dismissal lasts for the browser session and is kept in the `dms-dismissed-banners` cookie, which the server reads too, so a dismissed banner is already absent from the server-rendered page. A banner that is not dismissible ignores any dismissal recorded under its key.