@antelopejs/interface-dms 0.10.4 → 0.12.0

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 (374) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +21 -10
  3. package/dist/attachments.d.ts +15 -2
  4. package/dist/attachments.js +14 -1
  5. package/dist/attachments.js.map +1 -1
  6. package/dist/auth/db/models/sessions.model.d.ts +7 -5
  7. package/dist/auth/db/models/sessions.model.js +2 -9
  8. package/dist/auth/db/models/sessions.model.js.map +1 -1
  9. package/dist/auth/db/models/userExternalIdentities.model.d.ts +7 -5
  10. package/dist/auth/db/models/users.model.d.ts +7 -5
  11. package/dist/auth/db/tables/users.table.d.ts +2 -2
  12. package/dist/auth/db/tables/users.table.js.map +1 -1
  13. package/dist/auth/index.d.ts +4 -4
  14. package/dist/auth/internal/jwt-auth-decorator.d.ts +1 -1
  15. package/dist/auth/internal/jwt-auth-decorator.js +6 -3
  16. package/dist/auth/internal/jwt-auth-decorator.js.map +1 -1
  17. package/dist/auth/internal/request-authenticators.d.ts +12 -0
  18. package/dist/auth/internal/request-authenticators.js +53 -10
  19. package/dist/auth/internal/request-authenticators.js.map +1 -1
  20. package/dist/base/activity-feed.d.ts +34 -32
  21. package/dist/base/activity-feed.js +2 -0
  22. package/dist/base/activity-feed.js.map +1 -1
  23. package/dist/base/banner.d.ts +12 -10
  24. package/dist/base/banner.js +2 -0
  25. package/dist/base/banner.js.map +1 -1
  26. package/dist/base/block-registry/internal/describe.js +3 -9
  27. package/dist/base/block-registry/internal/describe.js.map +1 -1
  28. package/dist/base/block-registry/internal/ui.js +1 -1
  29. package/dist/base/block-registry/internal/ui.js.map +1 -1
  30. package/dist/base/card.d.ts +11 -9
  31. package/dist/base/card.js +2 -0
  32. package/dist/base/card.js.map +1 -1
  33. package/dist/base/chart-card.d.ts +4 -2
  34. package/dist/base/chart-card.js +2 -0
  35. package/dist/base/chart-card.js.map +1 -1
  36. package/dist/base/chart-schemas.d.ts +148 -148
  37. package/dist/base/chart.d.ts +65 -0
  38. package/dist/base/chart.js +65 -0
  39. package/dist/base/chart.js.map +1 -1
  40. package/dist/base/code-block.d.ts +5 -3
  41. package/dist/base/code-block.js +2 -0
  42. package/dist/base/code-block.js.map +1 -1
  43. package/dist/base/custom.d.ts +5 -0
  44. package/dist/base/custom.js +5 -0
  45. package/dist/base/custom.js.map +1 -1
  46. package/dist/base/data-types/default/address.d.ts +5 -0
  47. package/dist/base/data-types/default/address.js +5 -0
  48. package/dist/base/data-types/default/address.js.map +1 -1
  49. package/dist/base/data-types/default/choices.d.ts +20 -0
  50. package/dist/base/data-types/default/choices.js +20 -0
  51. package/dist/base/data-types/default/choices.js.map +1 -1
  52. package/dist/base/data-types/default/files.d.ts +22 -5
  53. package/dist/base/data-types/default/files.js +20 -0
  54. package/dist/base/data-types/default/files.js.map +1 -1
  55. package/dist/base/data-types/default/numbers.d.ts +15 -0
  56. package/dist/base/data-types/default/numbers.js +25 -9
  57. package/dist/base/data-types/default/numbers.js.map +1 -1
  58. package/dist/base/data-types/default/relations.d.ts +10 -2
  59. package/dist/base/data-types/default/relations.js +9 -6
  60. package/dist/base/data-types/default/relations.js.map +1 -1
  61. package/dist/base/data-types/default/strings.d.ts +25 -0
  62. package/dist/base/data-types/default/strings.js +25 -0
  63. package/dist/base/data-types/default/strings.js.map +1 -1
  64. package/dist/base/data-types/default-types.d.ts +1 -1
  65. package/dist/base/data-types/field-types.d.ts +10 -0
  66. package/dist/base/data-types/field-types.js +10 -0
  67. package/dist/base/data-types/field-types.js.map +1 -1
  68. package/dist/base/data-types/internal/relation-endpoints.js +1 -0
  69. package/dist/base/data-types/internal/relation-endpoints.js.map +1 -1
  70. package/dist/base/data-types/status-type.d.ts +5 -0
  71. package/dist/base/data-types/status-type.js +5 -0
  72. package/dist/base/data-types/status-type.js.map +1 -1
  73. package/dist/base/display.d.ts +6 -6
  74. package/dist/base/empty-state.d.ts +15 -13
  75. package/dist/base/empty-state.js +2 -0
  76. package/dist/base/empty-state.js.map +1 -1
  77. package/dist/base/form-block-schema.d.ts +50 -50
  78. package/dist/base/form-schema.d.ts +2 -0
  79. package/dist/base/form-schema.js +2 -0
  80. package/dist/base/form-schema.js.map +1 -1
  81. package/dist/base/grid.d.ts +4 -0
  82. package/dist/base/grid.js +4 -0
  83. package/dist/base/grid.js.map +1 -1
  84. package/dist/base/guard.d.ts +30 -28
  85. package/dist/base/guard.js +2 -0
  86. package/dist/base/guard.js.map +1 -1
  87. package/dist/base/helpers/archive-mode-helpers.d.ts +1 -1
  88. package/dist/base/helpers/file-refs.js +15 -15
  89. package/dist/base/helpers/file-refs.js.map +1 -1
  90. package/dist/base/internal/form-schema-validation.js +7 -1
  91. package/dist/base/internal/form-schema-validation.js.map +1 -1
  92. package/dist/base/internal/realtime-topics.js.map +1 -1
  93. package/dist/base/internal/searchable.d.ts +2 -1
  94. package/dist/base/internal/searchable.js +1 -3
  95. package/dist/base/internal/searchable.js.map +1 -1
  96. package/dist/base/key-value-list.d.ts +21 -19
  97. package/dist/base/key-value-list.js +2 -0
  98. package/dist/base/key-value-list.js.map +1 -1
  99. package/dist/base/kpi-card.d.ts +4 -2
  100. package/dist/base/kpi-card.js +2 -0
  101. package/dist/base/kpi-card.js.map +1 -1
  102. package/dist/base/live-toggle.d.ts +2 -0
  103. package/dist/base/live-toggle.js +2 -0
  104. package/dist/base/live-toggle.js.map +1 -1
  105. package/dist/base/meter.d.ts +23 -21
  106. package/dist/base/meter.js +2 -0
  107. package/dist/base/meter.js.map +1 -1
  108. package/dist/base/nav-card-grid.d.ts +24 -19
  109. package/dist/base/nav-card-grid.js +5 -0
  110. package/dist/base/nav-card-grid.js.map +1 -1
  111. package/dist/base/page-toolbar.d.ts +2 -0
  112. package/dist/base/page-toolbar.js +2 -0
  113. package/dist/base/page-toolbar.js.map +1 -1
  114. package/dist/base/period-selector.d.ts +3 -1
  115. package/dist/base/period-selector.js +2 -0
  116. package/dist/base/period-selector.js.map +1 -1
  117. package/dist/base/placeholder.d.ts +2 -0
  118. package/dist/base/placeholder.js +2 -0
  119. package/dist/base/placeholder.js.map +1 -1
  120. package/dist/base/resource-form-schema.d.ts +2 -2
  121. package/dist/base/searchable.d.ts +3 -2
  122. package/dist/base/searchable.js +2 -2
  123. package/dist/base/searchable.js.map +1 -1
  124. package/dist/base/section.d.ts +6 -2
  125. package/dist/base/section.js +4 -0
  126. package/dist/base/section.js.map +1 -1
  127. package/dist/base/stack.d.ts +6 -0
  128. package/dist/base/stack.js +6 -0
  129. package/dist/base/stack.js.map +1 -1
  130. package/dist/base/stat-group.d.ts +16 -14
  131. package/dist/base/stat-group.js +2 -0
  132. package/dist/base/stat-group.js.map +1 -1
  133. package/dist/base/tab.d.ts +10 -8
  134. package/dist/base/tab.js +2 -0
  135. package/dist/base/tab.js.map +1 -1
  136. package/dist/base/table-view/column-display.d.ts +1 -1
  137. package/dist/base/table-view/column-display.js.map +1 -1
  138. package/dist/base/table-view/data-functions.d.ts +10 -4
  139. package/dist/base/table-view/data-functions.js.map +1 -1
  140. package/dist/base/table-view/factory.d.ts +5 -0
  141. package/dist/base/table-view/factory.js +8 -4
  142. package/dist/base/table-view/factory.js.map +1 -1
  143. package/dist/base/table-view/internal/auth.d.ts +17 -3
  144. package/dist/base/table-view/internal/auth.js +26 -5
  145. package/dist/base/table-view/internal/auth.js.map +1 -1
  146. package/dist/base/table-view/internal/column-conditions.d.ts +8 -1
  147. package/dist/base/table-view/internal/column-conditions.js +25 -13
  148. package/dist/base/table-view/internal/column-conditions.js.map +1 -1
  149. package/dist/base/table-view/internal/column-display.d.ts +1 -2
  150. package/dist/base/table-view/internal/column-display.js +3 -9
  151. package/dist/base/table-view/internal/column-display.js.map +1 -1
  152. package/dist/base/table-view/internal/factory-helpers.d.ts +1 -1
  153. package/dist/base/table-view/internal/factory-helpers.js +17 -14
  154. package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
  155. package/dist/base/table-view/internal/factory-lifecycle-created.d.ts +2 -3
  156. package/dist/base/table-view/internal/factory-lifecycle-created.js +5 -5
  157. package/dist/base/table-view/internal/factory-lifecycle-created.js.map +1 -1
  158. package/dist/base/table-view/internal/factory-lifecycle-filter.d.ts +2 -2
  159. package/dist/base/table-view/internal/factory-private-actions.d.ts +2 -2
  160. package/dist/base/table-view/internal/files.d.ts +2 -1
  161. package/dist/base/table-view/internal/files.js +14 -5
  162. package/dist/base/table-view/internal/files.js.map +1 -1
  163. package/dist/base/table-view/internal/footer.d.ts +3 -3
  164. package/dist/base/table-view/internal/footer.js +16 -15
  165. package/dist/base/table-view/internal/footer.js.map +1 -1
  166. package/dist/base/table-view/internal/guards.d.ts +27 -5
  167. package/dist/base/table-view/internal/guards.js +127 -49
  168. package/dist/base/table-view/internal/guards.js.map +1 -1
  169. package/dist/base/table-view/internal/meta-helpers.d.ts +1 -1
  170. package/dist/base/table-view/internal/meta-helpers.js +3 -4
  171. package/dist/base/table-view/internal/meta-helpers.js.map +1 -1
  172. package/dist/base/table-view/internal/meta.js +2 -3
  173. package/dist/base/table-view/internal/meta.js.map +1 -1
  174. package/dist/base/table-view/internal/option-contract.d.ts +1 -1
  175. package/dist/base/table-view/internal/option-footer.d.ts +2 -2
  176. package/dist/base/table-view/internal/option-row-actions.d.ts +1 -1
  177. package/dist/base/table-view/internal/realtime.d.ts +52 -11
  178. package/dist/base/table-view/internal/realtime.js +23 -16
  179. package/dist/base/table-view/internal/realtime.js.map +1 -1
  180. package/dist/base/table-view/internal/resource-form.d.ts +1 -1
  181. package/dist/base/table-view/internal/resource-form.js +1 -1
  182. package/dist/base/table-view/internal/resource-form.js.map +1 -1
  183. package/dist/base/table-view/internal/row-actions-schema.d.ts +12 -12
  184. package/dist/base/table-view/internal/row-rule-shape.d.ts +11 -5
  185. package/dist/base/table-view/internal/row-rule-shape.js +60 -30
  186. package/dist/base/table-view/internal/row-rule-shape.js.map +1 -1
  187. package/dist/base/table-view/internal/row-rules.d.ts +28 -1
  188. package/dist/base/table-view/internal/row-rules.js +8 -19
  189. package/dist/base/table-view/internal/row-rules.js.map +1 -1
  190. package/dist/base/table-view/internal/tabs.d.ts +1 -1
  191. package/dist/base/table-view/internal/tabs.js +1 -4
  192. package/dist/base/table-view/internal/tabs.js.map +1 -1
  193. package/dist/base/table-view/internal/validation.d.ts +2 -2
  194. package/dist/base/table-view/internal/validation.js +7 -7
  195. package/dist/base/table-view/internal/validation.js.map +1 -1
  196. package/dist/base/table-view/meta.d.ts +7 -6
  197. package/dist/base/table-view/meta.js +12 -7
  198. package/dist/base/table-view/meta.js.map +1 -1
  199. package/dist/base/table-view/resource-form.d.ts +3 -1
  200. package/dist/base/table-view/resource-form.js +2 -0
  201. package/dist/base/table-view/resource-form.js.map +1 -1
  202. package/dist/base/table-view/routes.d.ts +73 -21
  203. package/dist/base/table-view/routes.js +13 -10
  204. package/dist/base/table-view/routes.js.map +1 -1
  205. package/dist/base/table-view/schema.d.ts +152 -152
  206. package/dist/base/table-view/source.js +4 -1
  207. package/dist/base/table-view/source.js.map +1 -1
  208. package/dist/base/table-view.d.ts +1 -1
  209. package/dist/base/table-view.js.map +1 -1
  210. package/dist/base/top-list-card.d.ts +35 -33
  211. package/dist/base/top-list-card.js +2 -0
  212. package/dist/base/top-list-card.js.map +1 -1
  213. package/dist/base/types/error.js +5 -2
  214. package/dist/base/types/error.js.map +1 -1
  215. package/dist/base/types/guards.d.ts +4 -4
  216. package/dist/base/types/json.d.ts +1 -10
  217. package/dist/base/types/row-action.d.ts +7 -7
  218. package/dist/component-options/confirm-dialog.d.ts +2 -0
  219. package/dist/component-options/confirm-dialog.js.map +1 -1
  220. package/dist/component-options/data-type.d.ts +2 -2
  221. package/dist/component-options/data-type.js +7 -7
  222. package/dist/component-options/data-type.js.map +1 -1
  223. package/dist/component-options/row-action.d.ts +14 -9
  224. package/dist/component-slots.d.ts +11 -2
  225. package/dist/component-slots.js +1 -0
  226. package/dist/component-slots.js.map +1 -1
  227. package/dist/component.d.ts +7 -8
  228. package/dist/component.js +17 -25
  229. package/dist/component.js.map +1 -1
  230. package/dist/data-controllers/members.d.ts +11 -7
  231. package/dist/data-controllers/members.js +1 -1
  232. package/dist/data-controllers/members.js.map +1 -1
  233. package/dist/data-controllers/roles.d.ts +32 -10
  234. package/dist/db/internal/exportJobs.model.d.ts +7 -5
  235. package/dist/db/internal/inviteResolutions.model.d.ts +7 -5
  236. package/dist/db/internal/tenantLifecycle.model.d.ts +7 -5
  237. package/dist/db/models/roles.model.d.ts +7 -5
  238. package/dist/db/models/tenantMembers.model.d.ts +7 -5
  239. package/dist/db/models/tenants.model.d.ts +7 -5
  240. package/dist/db/models/user_invites.model.d.ts +7 -5
  241. package/dist/guards.d.ts +1 -1
  242. package/dist/hooks.d.ts +1 -2
  243. package/dist/hooks.js +33 -26
  244. package/dist/hooks.js.map +1 -1
  245. package/dist/internal/attachments.d.ts +2 -2
  246. package/dist/internal/component-builder.js +2 -1
  247. package/dist/internal/component-builder.js.map +1 -1
  248. package/dist/internal/component-serialization.d.ts +2 -4
  249. package/dist/internal/component-serialization.js +4 -3
  250. package/dist/internal/component-serialization.js.map +1 -1
  251. package/dist/internal/component-slots.d.ts +19 -2
  252. package/dist/internal/component-slots.js +35 -12
  253. package/dist/internal/component-slots.js.map +1 -1
  254. package/dist/internal/component-watch-filter.d.ts +11 -0
  255. package/dist/internal/component-watch-filter.js +22 -0
  256. package/dist/internal/component-watch-filter.js.map +1 -0
  257. package/dist/internal/component-watches.js +0 -1
  258. package/dist/internal/component-watches.js.map +1 -1
  259. package/dist/internal/own-entry.d.ts +7 -0
  260. package/dist/internal/own-entry.js +13 -0
  261. package/dist/internal/own-entry.js.map +1 -0
  262. package/dist/invite-extension-payloads.d.ts +14 -2
  263. package/dist/invite-extensions/internal/delivery.js +1 -2
  264. package/dist/invite-extensions/internal/delivery.js.map +1 -1
  265. package/dist/invite-extensions/internal/edit.d.ts +2 -1
  266. package/dist/invite-extensions/internal/edit.js +8 -9
  267. package/dist/invite-extensions/internal/edit.js.map +1 -1
  268. package/dist/invite-extensions/internal/form-slot.js +8 -15
  269. package/dist/invite-extensions/internal/form-slot.js.map +1 -1
  270. package/dist/invite-extensions/internal/payload-slices.d.ts +33 -3
  271. package/dist/invite-extensions/internal/payload-slices.js +84 -19
  272. package/dist/invite-extensions/internal/payload-slices.js.map +1 -1
  273. package/dist/invite-extensions/internal/types.d.ts +10 -1
  274. package/dist/invite-resolution.js +6 -4
  275. package/dist/invite-resolution.js.map +1 -1
  276. package/dist/json.d.ts +10 -0
  277. package/dist/json.js +3 -0
  278. package/dist/json.js.map +1 -0
  279. package/dist/layout-banners.d.ts +5 -2
  280. package/dist/layout-banners.js.map +1 -1
  281. package/dist/page/controllers.d.ts +2 -2
  282. package/dist/page/internal/extension-validation.js +3 -2
  283. package/dist/page/internal/extension-validation.js.map +1 -1
  284. package/dist/page/internal/metadata-layout.js +1 -1
  285. package/dist/page/internal/metadata-layout.js.map +1 -1
  286. package/dist/page/internal/metadata-publish.js +3 -2
  287. package/dist/page/internal/metadata-publish.js.map +1 -1
  288. package/dist/page/internal/metadata-registration.js +5 -4
  289. package/dist/page/internal/metadata-registration.js.map +1 -1
  290. package/dist/page/internal/metadata-upload-registration.d.ts +3 -1
  291. package/dist/page/internal/metadata-upload-registration.js +9 -0
  292. package/dist/page/internal/metadata-upload-registration.js.map +1 -1
  293. package/dist/page/internal/metadata-uploads.d.ts +18 -5
  294. package/dist/page/internal/metadata-uploads.js +7 -8
  295. package/dist/page/internal/metadata-uploads.js.map +1 -1
  296. package/dist/page/internal/page-record.d.ts +2 -3
  297. package/dist/page/internal/page-record.js +19 -14
  298. package/dist/page/internal/page-record.js.map +1 -1
  299. package/dist/page/layout-filter.js +17 -6
  300. package/dist/page/layout-filter.js.map +1 -1
  301. package/dist/page/metadata.js +5 -7
  302. package/dist/page/metadata.js.map +1 -1
  303. package/dist/request-tenant.d.ts +10 -4
  304. package/dist/request-tenant.js +16 -34
  305. package/dist/request-tenant.js.map +1 -1
  306. package/dist/tenant-export.d.ts +2 -1
  307. package/dist/tenant-lifecycle.d.ts +13 -4
  308. package/dist/tenant-lifecycle.js +51 -18
  309. package/dist/tenant-lifecycle.js.map +1 -1
  310. package/dist/types.d.ts +20 -0
  311. package/dist/uploads.js +42 -59
  312. package/dist/uploads.js.map +1 -1
  313. package/dist/utils/fire-and-forget.js.map +1 -1
  314. package/dist/utils/internal/decorated-class.d.ts +14 -0
  315. package/dist/utils/internal/decorated-class.js +37 -0
  316. package/dist/utils/internal/decorated-class.js.map +1 -0
  317. package/dist/utils/internal/type-check.d.ts +9 -0
  318. package/dist/utils/internal/type-check.js +13 -5
  319. package/dist/utils/internal/type-check.js.map +1 -1
  320. package/dist/utils/internal/value-parser.d.ts +1 -1
  321. package/dist/utils/internal/value-parser.js +22 -9
  322. package/dist/utils/internal/value-parser.js.map +1 -1
  323. package/dist/watch-actions.d.ts +1 -1
  324. package/docs/1.core/1.introduction.md +82 -77
  325. package/docs/1.core/10.layout-banners.md +57 -45
  326. package/docs/1.core/11.modules-and-dynamic-menus.md +178 -0
  327. package/docs/1.core/12.frontend-modules-and-request-helpers.md +155 -0
  328. package/docs/1.core/13.tenant-data-export.md +120 -0
  329. package/docs/1.core/2.pages-and-modules.md +140 -367
  330. package/docs/1.core/3.components.md +21 -22
  331. package/docs/1.core/4.permissions.md +92 -71
  332. package/docs/1.core/5.tenancy.md +112 -86
  333. package/docs/1.core/6.invites.md +90 -65
  334. package/docs/1.core/7.hooks.md +96 -166
  335. package/docs/1.core/8.realtime.md +44 -45
  336. package/docs/1.core/9.quick-actions.md +37 -30
  337. package/docs/2.auth/1.introduction.md +33 -35
  338. package/docs/2.auth/2.authentication.md +60 -38
  339. package/docs/2.auth/3.tokens-and-sessions.md +56 -55
  340. package/docs/2.auth/4.users.md +79 -51
  341. package/docs/2.auth/5.external-identities.md +25 -26
  342. package/docs/3.base/1.introduction.md +64 -60
  343. package/docs/3.base/10.display-blocks.md +15 -16
  344. package/docs/3.base/11.page-layouts.md +273 -0
  345. package/docs/3.base/12.table-row-actions.md +122 -0
  346. package/docs/3.base/13.table-filters-and-forms.md +104 -0
  347. package/docs/3.base/14.table-events-and-helpers.md +114 -0
  348. package/docs/3.base/15.table-sources-and-gates.md +24 -0
  349. package/docs/3.base/2.types.md +44 -41
  350. package/docs/3.base/3.forms.md +27 -28
  351. package/docs/3.base/4.tables.md +34 -367
  352. package/docs/3.base/5.charts-and-widgets.md +28 -29
  353. package/docs/3.base/6.layout.md +21 -270
  354. package/docs/3.base/8.data-types.md +39 -40
  355. package/docs/3.base/9.helpers.md +36 -38
  356. package/docs/4.notifications/1.introduction.md +22 -26
  357. package/docs/4.notifications/2.categories-and-subjects.md +58 -55
  358. package/docs/4.notifications/3.sending.md +72 -68
  359. package/docs/5.html-render/1.introduction.md +119 -81
  360. package/docs/5.html-render/2.built-in-emails.md +71 -51
  361. package/docs/index.md +18 -29
  362. package/docs/tsconfig.json +4 -0
  363. package/package.json +11 -11
  364. package/docs/images/emails-admin-invite.png +0 -0
  365. package/docs/images/emails-change-notice.png +0 -0
  366. package/docs/images/emails-change-verification.png +0 -0
  367. package/docs/images/emails-digest-logo-dark.png +0 -0
  368. package/docs/images/emails-digest-logo-light.png +0 -0
  369. package/docs/images/emails-digest.png +0 -0
  370. package/docs/images/emails-export-partial.png +0 -0
  371. package/docs/images/emails-export-ready.png +0 -0
  372. package/docs/images/emails-reset-password.png +0 -0
  373. package/docs/images/emails-two-factor.png +0 -0
  374. package/docs/images/emails-user-validation.png +0 -0
@@ -1,33 +1,32 @@
1
1
  ---
2
2
  title: "Realtime"
3
3
  description: "Publish events on topics from the backend, and how page-bound topics reach the browsers viewing the page."
4
+ mode: reference
4
5
  ---
5
6
 
6
- # Realtime
7
-
8
7
  ## Overview
9
8
 
10
- Realtime works on topics. A topic is a plain string a page declares interest in, and any backend code can publish a message on it. `RegisterPageTopic` binds a topic to a page id; `PublishMessage` sends an event on that topic to every client currently subscribed to it. `SubscribeMessage` is the read half: it lets backend code receive what is published, instead of only feeding the dashboard's own streams.
9
+ Realtime works on topics. A topic is a plain string that a page declares interest in, and any backend code can publish a message on it. `RegisterPageTopic` binds a topic to a page id. `PublishMessage` sends an event on that topic to every client session subscribed to it. `SubscribeMessage` is the read half. It lets backend code receive what is published, in addition to the streams the dashboard opens for its pages.
11
10
 
12
11
  Everything on this page lives in `@antelopejs/interface-dms/realtime`.
13
12
 
14
- ## How a Page Ends Up Subscribed
13
+ ## How a page ends up subscribed
15
14
 
16
- Subscription is derived, not requested by the publisher:
15
+ The page-topic registry derives the subscriptions. The publisher never requests them.
17
16
 
18
- 1. A page — or a component on it — calls `RegisterPageTopic(pageId, topic)` at registration time. `pageId` is the page's `fullId` ([Pages and Modules](/docs/interfaces/core/pages-and-modules)), not its slug.
19
- 2. A client opens a realtime session and reports which page it is on. The backend checks that the user may access that page, then subscribes the session to every topic registered for that page id, and drops the topics that are no longer wanted.
20
- 3. `PublishMessage(topic, type)` delivers to the sessions currently subscribed to `topic` — with a `tenantId`, only to those of that tenant (see [Tenant-scoped messages](#tenant-scoped-messages)).
17
+ 1. A page, or a component on it, calls `RegisterPageTopic(pageId, topic)` at registration time. `pageId` is the page's `fullId` ([Pages and modules](/docs/interfaces/core/pages-and-modules)), not its slug.
18
+ 2. A client opens a realtime session and reports which page it is on. The backend checks that the user may access that page. It then subscribes the session to every topic registered for that page id, and drops the topics the session no longer needs.
19
+ 3. `PublishMessage(topic, type)` delivers to the sessions subscribed to `topic`. With a `tenantId`, it delivers only to the sessions of that tenant (see [Tenant-scoped messages](#tenant-scoped-messages)).
21
20
 
22
- So a publisher never addresses a page or a user. It addresses a topic, and the page-topic registry decides who is listening.
21
+ A publisher never addresses a page or a user. It addresses a topic, and the page-topic registry decides who is listening.
23
22
 
24
- Registering the same topic for the same page twice is harmless — a page's topics are a set.
23
+ A page's topics are a set, so registering the same topic for the same page twice has no further effect.
25
24
 
26
- A binding belongs to the module that registered it: it is removed when that module is unloaded, and it survives a reload of the DMS module, which gets every binding back from the core. Registering from `onCreated`, as below, makes the module whose page it is that owner.
25
+ A binding belongs to the module that registered it. The DMS removes the binding when that module is unloaded. The binding survives a reload of the DMS module, which gets every binding back from the core. A registration from `onCreated`, as in the next example, makes the module whose page it is the owner.
27
26
 
28
- ## Register a Topic for a Page
27
+ ## Register a topic for a page
29
28
 
30
- The typical caller is a component builder's `onCreated` callback, which receives the `PageMetadata` of the page the component was declared on ([Components](/docs/interfaces/core/components)):
29
+ The usual caller is the `onCreated` callback of a component builder. The callback receives the page the component was declared on, typed `CreatedPage`: its `target`, and its `pageInfo.fullId` and `pageInfo.fullSlug`. At run time it is the page's `PageMetadata` ([Components](/docs/interfaces/core/components)).
31
30
 
32
31
  ```typescript
33
32
  import { ComponentBuilder } from "@antelopejs/interface-dms/component";
@@ -46,17 +45,17 @@ export function StockCounter(options: { fetchUrl: string }) {
46
45
  }
47
46
  ```
48
47
 
49
- Registering from `onCreated` is what makes the binding follow the component: whichever page the component is placed on gets the topic. The chart builders of the [Base](/docs/interfaces/base/introduction) domain do exactly this — a chart declaring `realtimeTopic` registers each of its topics on the page it is placed on.
48
+ A registration from `onCreated` makes the binding follow the component, because every page the component is placed on gets the topic. The blocks of the [Base](/docs/interfaces/base/introduction) domain that take a `realtimeTopic` option, such as the chart and KPI cards, work the same way. Each one registers its topics on the page it is placed on.
50
49
 
51
- To bind a topic to a page you know statically, call `RegisterPageTopic` with that page's `fullId` directly.
50
+ To bind a topic to a page you know when you write the code, call `RegisterPageTopic` with that page's `fullId`.
52
51
 
53
- ```typescript
52
+ ```typescript fragment
54
53
  RegisterPageTopic(pageId: string, topic: string): void
55
54
  ```
56
55
 
57
- ## Publish a Message
56
+ ## Publish a message
58
57
 
59
- ```typescript
58
+ ```typescript fragment
60
59
  import { Controller, Post } from "@antelopejs/interface-api";
61
60
  import { PublishMessage } from "@antelopejs/interface-dms/realtime";
62
61
  import { STOCK_TOPIC } from "../components/stock-counter";
@@ -74,7 +73,7 @@ export class StockController extends Controller("/api/stock") {
74
73
  }
75
74
  ```
76
75
 
77
- ```typescript
76
+ ```typescript fragment
78
77
  PublishMessage(
79
78
  topic: string,
80
79
  type: string,
@@ -84,25 +83,25 @@ PublishMessage(
84
83
 
85
84
  | Parameter | Description |
86
85
  | --------- | ----------- |
87
- | `topic` | The topic to publish on. Subscribers are the sessions on a page that registered this topic. |
88
- | `type` | The event type carried with the message, for subscribers that distinguish several kinds of event on one topic. |
89
- | `options` | Optional payload, actor and tenant. |
86
+ | `topic` | The topic to publish on. The browser sessions that receive it are those on a page that registered this topic. Backend `SubscribeMessage` handlers on the topic receive it regardless. |
87
+ | `type` | The event type carried with the message, for subscribers that tell apart several kinds of event on one topic. |
88
+ | `options` | The optional payload, actor and tenant. |
90
89
 
91
90
  ### `PublishMessageOptions`
92
91
 
93
92
  | Option | Type | Description |
94
93
  | ------ | ---- | ----------- |
95
94
  | `payload` | `Record<string, unknown>` | Data carried with the event. |
96
- | `actorId` | `string` | Identifies who caused the event, so a client can ignore an event it triggered itself. |
97
- | `tenantId` | `string` | The tenant the event is about: only the sessions of that tenant receive it. Omitted, the message is global and reaches every tenant. |
95
+ | `actorId` | `string` | Who caused the event, so a client can ignore an event it triggered itself. |
96
+ | `tenantId` | `string` | The tenant the event is about. Only the sessions of that tenant receive it. Without it, the message is global and reaches every tenant. |
98
97
 
99
- `PublishMessage` resolves once the message has been handed to the broker. It does not report how many sessions received it, and publishing on a topic no page registered is not an error — it simply reaches nobody.
98
+ `PublishMessage` resolves once the broker has the message. It does not report how many sessions received it. A message on a topic that no page registered is not an error. It reaches no browser session, and backend `SubscribeMessage` handlers on the topic still receive it.
100
99
 
101
100
  ### Tenant-scoped messages
102
101
 
103
- Page topics are shared by every tenant: a page registers the same topic whichever workspace views it. A message published without a `tenantId` therefore reaches the sessions of **every** workspace on that page — each one refetches, and a paused live page counts the message in its "N new" banner. Publish a workspace's data with the tenant it belongs to:
102
+ Every tenant shares the page topics, because a page registers the same topic whichever workspace views it. A message published without a `tenantId` reaches the sessions of **every** workspace on that page. Each of those pages refetches, and a paused live page counts the message in its "N new" banner. Publish the data of a workspace with the tenant it belongs to:
104
103
 
105
- ```typescript
104
+ ```typescript fragment
106
105
  import { getRequestTenantId } from "@antelopejs/interface-dms/request-tenant";
107
106
 
108
107
  await PublishMessage(CAMPAIGN_TOPIC, "campaign.sent", {
@@ -111,17 +110,17 @@ await PublishMessage(CAMPAIGN_TOPIC, "campaign.sent", {
111
110
  });
112
111
  ```
113
112
 
114
- A session is bound to the tenant of the request that opened it, and receives the messages of that tenant plus the global ones. When the browser switches workspace (or account), the client opens a new session in the new one, and the server ends a session whose page requests come from a workspace or account other than its own, so the previous workspace's messages stop with it. A session on the connection a browser's tabs share is ended alone: the other tabs' sessions on it stay. Keep messages without a tenant for what is the same for every workspace: a platform-wide setting, a catalogue shared by all tenants.
113
+ A session belongs to the tenant of the request that opened it. It receives the messages of that tenant and the global ones. When the browser switches workspace or account, the client opens a new session in the new one. The server ends a session whose page requests come from another workspace or account, so the messages of the previous workspace stop with it. The tabs of a browser share one connection, and the server ends the session of one tab alone. The sessions of the other tabs stay open. Keep messages without a tenant for data that is the same for every workspace, such as a platform-wide setting or a catalog that every tenant shares.
115
114
 
116
- A session on a platform page (a page of a module, which only the platform owner opens) receives the messages of **every** tenant on that page's topics, whichever workspace the owner has open: such a page lists the data of all of them.
115
+ A platform page is a page of a module, which only the platform owner opens. A session on a platform page receives the messages of **every** tenant on that page's topics, whichever workspace the owner has open, because such a page lists the data of all of them.
117
116
 
118
- The table views of the [Base](/docs/interfaces/base/tables#realtime) domain publish their row changes and presence for the writer's tenant, or for every tenant when their rows live in the shared schema. Messages to one user (notifications) and the menu invalidations already name their audience in the topic.
117
+ The table views of the [Base](/docs/interfaces/base/table-events-and-helpers#realtime) domain publish their row changes and presence for the tenant of the writer. When their rows live in the shared core schema, they publish for every tenant. Messages to one user (notifications) and the menu invalidations already name their audience in the topic.
119
118
 
120
- ## Subscribe from the Backend
119
+ ## Subscribe from the backend
121
120
 
122
- `SubscribeMessage` receives every message published on a topic, whichever instance and whichever tenant published it (a handler serving one tenant filters on `message.tenantId` itself): the subscription rides the same broker as `PublishMessage`, so what one instance publishes reaches subscribers on every other.
121
+ `SubscribeMessage` receives every message published on a topic, whichever instance and whichever tenant published it. A handler that serves one tenant filters on `message.tenantId` itself. The subscription uses the same broker as `PublishMessage`, so what one instance publishes reaches the subscribers on every other instance.
123
122
 
124
- ```typescript
123
+ ```typescript fragment
125
124
  import { SubscribeMessage } from "@antelopejs/interface-dms/realtime";
126
125
  import { STOCK_TOPIC } from "../components/stock-counter";
127
126
 
@@ -134,7 +133,7 @@ const unsubscribe = SubscribeMessage(STOCK_TOPIC, (message) => {
134
133
  });
135
134
  ```
136
135
 
137
- ```typescript
136
+ ```typescript fragment
138
137
  function SubscribeMessage(
139
138
  topic: string,
140
139
  handler: RealtimeMessageHandler,
@@ -148,21 +147,21 @@ type UnsubscribeMessage = () => void;
148
147
 
149
148
  | Field | Type | Description |
150
149
  | ----- | ---- | ----------- |
151
- | `topic` | `string` | Topic the message was published on. |
152
- | `type` | `string` | Event type given to `PublishMessage`. |
150
+ | `topic` | `string` | The topic the message was published on. |
151
+ | `type` | `string` | The event type given to `PublishMessage`. |
153
152
  | `payload` | `Record<string, unknown>` | Data carried with the event, when the publisher sent any. |
154
153
  | `actorId` | `string` | Who caused the event, when the publisher named an actor. |
155
- | `tenantId` | `string` | The tenant the message was published for; absent on a global message. |
156
- | `ts` | `number` | Publication timestamp. |
154
+ | `tenantId` | `string` | The tenant the message was published for. Absent on a global message. |
155
+ | `ts` | `number` | The publication timestamp, in milliseconds since the epoch. |
157
156
 
158
- Paired with `PublishMessage`, this turns the DMS's broker into one a module can use for realtime channels of its own — its own endpoint subscribes here and the DMS carries the messages — instead of bringing a second broker to do the same job.
157
+ With `PublishMessage` and `SubscribeMessage` together, a module can run realtime channels of its own on the DMS broker. Its own endpoint subscribes here and the DMS carries the messages, so the module needs no second broker.
159
158
 
160
- Three properties to design around:
159
+ Design a subscriber around three properties:
161
160
 
162
- - **Handlers must not throw.** They are called on the delivering instance's event loop, and nothing catches for you.
163
- - **Delivery is fire-and-forget.** There is no replay: a message published while nobody was subscribed is gone. Do not use a topic as a queue.
164
- - **Unsubscribing is automatic** when the registering module is unloaded. The returned `UnsubscribeMessage` is for ending a subscription earlier than that; calling it twice is a no-op.
161
+ - **Handlers must not throw.** The DMS calls them on the event loop of the delivering instance. The broker catches a thrown error or a rejected promise and logs it, and the error never reaches the publisher.
162
+ - **Delivery is fire-and-forget.** The broker keeps no message for later. A message published while nobody was subscribed is gone, so do not use a topic as a queue.
163
+ - **Unsubscribing is automatic** when the registering module is unloaded. Call the returned `UnsubscribeMessage` to end a subscription earlier. A second call has no effect.
165
164
 
166
- ## Next Steps
165
+ ## Next steps
167
166
 
168
- [Quick Actions](/docs/interfaces/core/quick-actions) covers the other way a module reaches the running dashboard: entries in the command palette.
167
+ [Quick actions](/docs/interfaces/core/quick-actions) covers another way a module reaches the running dashboard: entries in the command palette.
@@ -1,23 +1,20 @@
1
1
  ---
2
- title: "Quick Actions"
3
- description: "A quick action is a shortcut the backend contributes to the dashboard's command palette: a labelled entry, grouped under a category, that points at a registered page, a table creation form, a table toolbar button, or…"
2
+ title: "Quick actions"
3
+ description: "A quick action is a shortcut a backend module adds to the dashboard's command palette and header menu. Categories, actions, targets, and how access is computed."
4
+ mode: reference
4
5
  ---
5
6
 
6
- # Quick Actions
7
-
8
- ## Overview
9
-
10
- A quick action is a shortcut the backend contributes to the dashboard's command palette: a labelled entry, grouped under a category, that points at a registered page, a table creation form, a table toolbar button, or an event. Actions register at import time. Access follows the target page and, for a form or a button, the permission of what it opens.
7
+ A quick action is a shortcut a backend module adds to the dashboard. The command palette and the quick actions menu in the dashboard header both list it. Each action has a label, belongs to a category, and points at a registered page. Running it opens that page, opens a table's creation form, presses a table toolbar button, or emits an event. Actions register when their file is imported. Access follows the target page, and for a form or a button, the permission of what it opens.
11
8
 
12
9
  Both functions live in `@antelopejs/interface-dms/quick-actions`.
13
10
 
14
- ## Declare a Category and Its Actions
11
+ ## Declare a category and its actions
15
12
 
16
- `QuickActionCategory(id, info)` registers the group; `QuickAction(id, info)` registers an entry in it. Both return the registered record. Create the category first: registering an action whose category is unknown throws.
13
+ `QuickActionCategory(id, info)` registers a category, and `QuickAction(id, info)` registers an action in it. Both return the registered record. Register the category first, because registering an action whose category is unknown throws `QuickAction category "<id>" is not registered. Register the category before its actions.`
17
14
 
18
15
  This example assumes your application exports a registered `TasksPage` from `./pages/tasks`.
19
16
 
20
- ```typescript
17
+ ```typescript fragment
21
18
  import { TasksPage } from "./pages/tasks";
22
19
  import {
23
20
  QuickAction,
@@ -38,44 +35,55 @@ QuickAction("tasks-new", {
38
35
  });
39
36
  ```
40
37
 
41
- Actions are keyed by their category id and their own id, so the same action id may appear under two categories. Registering an id that is already taken keeps the first registration.
38
+ An action's key is its category id and its own id, so the same action id may appear under two categories. Registering a category id or an action key that is already taken keeps the first registration.
39
+
40
+ Declare quick actions in a file your module imports, next to the pages they point at, so the registrations run at import time.
42
41
 
43
42
  ## `QuickActionCategoryInfo`
44
43
 
45
44
  | Field | Type | Description |
46
45
  | ----- | ---- | ----------- |
47
- | `id` | `string` | Category id. Supplied as the first argument of `QuickActionCategory`, not inside `info`. |
48
- | `displayName` | `string` | Group label. Required. |
46
+ | `id` | `string` | Category id. Passed as the first argument of `QuickActionCategory`, not inside `info`. |
47
+ | `displayName` | `string` | Category label. Required. |
49
48
  | `icon` | `string` | Icon name. |
50
- | `order` | `number` | Sort order among categories. |
49
+ | `order` | `number` | Sort order among categories, ascending. A missing `order` counts as `0`. |
51
50
 
52
51
  ## `QuickActionInfo`
53
52
 
54
53
  | Field | Type | Description |
55
54
  | ----- | ---- | ----------- |
56
- | `id` | `string` | Action id. Supplied as the first argument of `QuickAction`, not inside `info`. |
57
- | `category` | `QuickActionCategoryInfo` | The record returned by `QuickActionCategory`. Required. |
58
- | `displayName` | `string` | Entry label. Required. |
55
+ | `id` | `string` | Action id. Passed as the first argument of `QuickAction`, not inside `info`. |
56
+ | `category` | `QuickActionCategoryInfo` | The record `QuickActionCategory` returned. Required. |
57
+ | `displayName` | `string` | Action label. Required. |
59
58
  | `icon` | `string` | Icon name. Required. |
60
- | `order` | `number` | Sort order within the category. |
59
+ | `order` | `number` | Sort order within the category, ascending. A missing `order` counts as `0`. |
61
60
  | `target` | `QuickActionTarget` | What running the action does. Required. |
62
61
 
63
- Access is computed per caller from the registered target page, including its permission and tenant access gate ([Permissions](/docs/interfaces/core/permissions)). An `openForm` target also checks the selected table's create action; a `button` target checks the button's own `permission`. Configure access on the destination rather than adding a separate `permission` property to the quick action.
62
+ ## Access
63
+
64
+ The DMS computes access per caller from the target page, including its permission and its tenant access gate ([Permissions](/docs/interfaces/core/permissions)). An `openForm` target also checks the permission of the selected table's `add` action. A `button` target also checks the button's own `permission`, and a button with no permission adds no check. A quick action has no `permission` property of its own. Configure access on the page, the table or the button it points at.
65
+
66
+ The DMS leaves out an action the caller cannot run, and a category whose actions were all left out. It also leaves out, with a server warning, an action whose target cannot be resolved:
67
+
68
+ - The target `page` is not a registered page.
69
+ - An explicit `component` is not mounted on the page.
70
+ - `component` is omitted and the page has no matching component or several of them.
71
+ - The `button` is not declared by the selected component.
64
72
 
65
73
  ## `QuickActionTarget`
66
74
 
67
- Every target requires `page`, the registered page controller class. The frontend URL derives from that page, so renaming a route does not leave a stale URL in the action.
75
+ Every target requires `page`, the registered page controller class. The DMS derives the frontend route from that page, so a renamed route does not leave a stale URL in the action.
68
76
 
69
- | Variant | Fields | Meaning |
77
+ | Variant | Fields | Effect |
70
78
  | ------- | ------ | ------- |
71
- | `"navigate"` | `page`, optional `query` | Navigate to the page with optional string query parameters. |
72
- | `"openForm"` | `page`, optional `component` | Open a table's creation form. Select the component explicitly if the page has more than one eligible table. |
73
- | `"button"` | `page`, `button`, optional `component` | Open the page and press the table toolbar button whose `id` is `button`, e.g. to open the modal it opens. Select the component explicitly if several components of the page declare that button id. |
74
- | `"event"` | `page`, `name`, optional `payload` | Navigate to the page and emit the named event. |
79
+ | `"navigate"` | `page`, optional `query` | Navigates to the page, with optional string query parameters. |
80
+ | `"openForm"` | `page`, optional `component` | Navigates to the page and opens a table's creation form. Pass `component` when the page mounts more than one component that can create a row. |
81
+ | `"button"` | `page`, `button`, optional `component` | Navigates to the page and presses the table toolbar button whose `id` is `button`, for example to open the modal it opens. Pass `component` when several components of the page declare that button id. |
82
+ | `"event"` | `page`, `name`, optional `payload` | Dispatches a window `CustomEvent` named `name` on the current page, with `payload` as its `detail`. It does not navigate. `page` only sets who can see the action. |
75
83
 
76
- The following examples assume an existing registered `BooksPage` with a `TableView` stored in its static `table` field. For a nested table, pass a target such as `BooksPage.content.targetChild("table")` instead.
84
+ The following examples assume a registered `BooksPage` with a `TableView` in its static `table` field. For a nested table, pass a target such as `BooksPage.content.targetChild("table")` instead.
77
85
 
78
- ```typescript
86
+ ```typescript fragment
79
87
  import { BooksPage } from "./pages/books";
80
88
  import {
81
89
  QuickAction,
@@ -94,7 +102,6 @@ QuickAction("catalog-new-book", {
94
102
  target: { type: "openForm", page: BooksPage, component: BooksPage.table },
95
103
  });
96
104
 
97
- // BooksPage.table declares customButtons: [{ id: "import", permission: "add", … }]
98
105
  QuickAction("catalog-import", {
99
106
  category: catalog,
100
107
  displayName: "$my_app.quick_actions.import_books",
@@ -110,6 +117,6 @@ QuickAction("catalog-refresh", {
110
117
  });
111
118
  ```
112
119
 
113
- Declare quick actions in a file imported by your module so the registrations run at import time, next to the pages they point at.
120
+ The `catalog-import` action assumes that `BooksPage.table` declares a custom button with `id: "import"` in its `customButtons`.
114
121
 
115
- [Layout Banners](/docs/interfaces/core/layout-banners) covers the other global surface a backend module contributes to: messages under the dashboard header.
122
+ [Layout banners](/docs/interfaces/core/layout-banners) covers messages under the dashboard header, the other global place a backend module adds to.
@@ -1,50 +1,48 @@
1
1
  ---
2
2
  title: "Introduction"
3
3
  description: "The auth domain answers who is calling: authentication decorators, tokens and sessions, users and external identities."
4
+ mode: explanation
4
5
  ---
5
6
 
6
- # Introduction
7
-
8
7
  ## Overview
9
8
 
10
- The `auth` domain of `@antelopejs/interface-dms` answers one question for the DMS: who is calling. It resolves the bearer token on an HTTP request into a `User` row, issues and validates the tokens that make such a request possible, records logins as sessions, binds the accounts a user owns on external login providers, and owns the `users`, `sessions` and `user_external_identities` tables together with their models.
9
+ The `auth` domain of `@antelopejs/interface-dms` answers one question for the DMS: who is calling. It resolves the bearer token of an HTTP request into a `User` row. It issues and validates the tokens that make such a request possible, records logins as sessions, and binds the accounts a user owns on external login providers. It also owns the `users`, `sessions` and `user_external_identities` tables and their models.
11
10
 
12
- It stops at identity. Deciding what an authenticated caller is allowed to do — permissions, roles, tenant membership — belongs to the [Core](/docs/interfaces/core/introduction) domain, whose tenant guards build on the `authenticateRequestUser` function documented here.
11
+ The domain stops at identity. The [Core](/docs/interfaces/core/introduction) domain decides what an authenticated caller may do, through permissions, roles and tenant membership. Its tenant guards build on the `authenticateRequestUser` function this domain exports.
13
12
 
14
13
  The domain is published under three subpaths:
15
14
 
16
15
  | Subpath | Contents |
17
16
  | ------- | -------- |
18
- | `@antelopejs/interface-dms/auth` | The authentication decorators, `authenticateRequestUser`, the token generators and validators, `createSession`, `sanitizeUser`, the external-identity functions, `announceRegistration`, and the account mail entry points. |
19
- | `@antelopejs/interface-dms/auth/db` | The `User`, `Session` and `UserExternalIdentity` tables, their models, and the table-name constants. |
20
- | `@antelopejs/interface-dms/auth/password` | The password policy: `PASSWORD_MIN_LENGTH`, `PASSWORD_PATTERN` and `isPasswordCompliant`. Pure values, usable without the DMS loaded. |
21
-
22
- ## Key Features
23
-
24
- - **Request Authentication Decorators** — Gate a route, a controller property, or a whole controller class on a valid bearer token with `AuthUser` and `AuthRawUser`, and receive the resolved `User`.
25
- - **Optional Authentication** — Serve the same route to signed-in and anonymous callers with `IfAuthUser`, which injects `User | undefined` instead of rejecting the request.
26
- - **Owner-Only Gate** — Restrict administration surfaces to platform owners with `AuthOwnerOnly`, which answers `403` to an authenticated non-owner.
27
- - **Composable Authentication** — Build your own parameter providers on `authenticateRequestUser`, the same primitive the DMS tenant guards start from.
28
- - **Token Lifecycle** — Issue and validate tenant-scoped access and refresh tokens, plus the short-lived two-factor and tenant-assignment tokens that stand between a password check and a real session.
29
- - **Revocable Sessions** — Record each login as a `Session` row carrying its device, IP and current refresh token, so a single session or every session of a user can be revoked.
30
- - **User Table and Model** — A `User` table with hashed passwords through `HashModifier`, and a `UserModel` with lookups by email and by owner flag.
31
- - **External Login Providers** — Bind the accounts a user owns on GitHub, Google or any configured provider with `linkExternalIdentity`, and resolve a provider profile back to a user on the next login.
32
- - **Safe Responses** — Strip authentication secrets from a user with `sanitizeUser` before returning it over HTTP.
33
- - **One Password Policy** — Check a password against the policy the DMS enforces with `isPasswordCompliant`, so a module's own signup accepts exactly what the DMS accepts.
34
- - **Account Emails** — Send the second-factor, email-validation, password-reset and invite messages the authentication flows depend on.
35
- - **One Registration Path** — Run the notifications and the `USER_REGISTERED` hook through `announceRegistration`, whichever flow created the account.
17
+ | `@antelopejs/interface-dms/auth` | The authentication decorators, `authenticateRequestUser`, the token generators and validators, `createSession`, `sanitizeUser`, the external-identity functions, `announceRegistration`, the account mail functions, and the `RequestPrincipal` and `RequestAuthenticator` types. |
18
+ | `@antelopejs/interface-dms/auth/db` | The `User`, `Session` and `UserExternalIdentity` tables, their models, the table-name constants, `normalizeEmail`, `isCurrentRefreshToken` and `buildExternalIdentityId`. |
19
+ | `@antelopejs/interface-dms/auth/password` | The password policy: `PASSWORD_MIN_LENGTH`, `PASSWORD_PATTERN` and `isPasswordCompliant`. These are plain values and a pure function, usable without the DMS loaded. |
20
+
21
+ ## What the domain provides
22
+
23
+ - **Request authentication decorators.** `AuthUser` and `AuthRawUser` gate a route, a controller property, or a whole controller class on a valid bearer token, and inject the resolved `User`.
24
+ - **Optional authentication.** `IfAuthUser` serves the same route to signed-in and anonymous callers. It injects `User | undefined` instead of rejecting the request.
25
+ - **An owner-only gate.** `AuthOwnerOnly` restricts administration routes to platform owners. It answers `403` to an authenticated caller who is not an owner.
26
+ - **Composable authentication.** `authenticateRequestUser` runs the same checks outside a decorator. The DMS tenant guards start from it, and your own parameter providers can too.
27
+ - **Token lifecycle.** The domain issues and validates access and refresh tokens scoped to a tenant. It also issues the short-lived two-factor and tenant-assignment tokens that sit between a password check and a real session.
28
+ - **Revocable sessions.** Each login is a `Session` row with its device, IP, and the hash of its current refresh token. You can revoke one session, or every session of a user.
29
+ - **The user table and model.** The `User` table hashes passwords through `HashModifier`. `UserModel` looks users up by email and by owner flag.
30
+ - **External login providers.** `linkExternalIdentity` binds the accounts a user owns on GitHub, Google, or any configured provider. On the next login, the DMS resolves the provider profile back to the user.
31
+ - **Safe responses.** `sanitizeUser` strips authentication secrets from a user before you return it over HTTP.
32
+ - **One password policy.** `isPasswordCompliant` checks a password against the policy the DMS enforces, so the signup of a module accepts exactly what the DMS accepts.
33
+ - **Account emails.** The domain sends the second-factor, email-validation, password-reset and invite messages that the authentication flows depend on.
34
+ - **One registration path.** `announceRegistration` runs the notifications and the `USER_REGISTERED` hook, whichever flow created the account.
36
35
 
37
36
  ## Dependencies
38
37
 
39
- This interface relies on the following AntelopeJS packages:
38
+ This domain relies on the following AntelopeJS packages:
40
39
 
41
- - [@antelopejs/interface-auth](https://github.com/AntelopeJS/interface-auth) - `CreateAuthDecorator`, which builds the authentication decorators from a source, an authenticator and a validator.
42
- - [@antelopejs/interface-api](https://github.com/AntelopeJS/interface-api) - Controllers, `RequestContext` and `HTTPResult`, used to read the request and to reject it.
43
- - [@antelopejs/interface-database-decorators](https://github.com/AntelopeJS/interface-database-decorators) - Table definitions, the `HashModifier` mixin, and `BasicDataModel` for the user and session models.
44
- - [@antelopejs/interface-database](https://github.com/AntelopeJS/interface-database) - Query value proxies used by the owner lookups on `UserModel`.
45
- - [@antelopejs/interface-core](https://github.com/AntelopeJS/interface-core) - `InterfaceFunction`, which wires the token, sanitization and mail entry points to their implementation.
40
+ - [`@antelopejs/interface-api`](https://github.com/AntelopeJS/interface-api): Controllers, `RequestContext`, `SetParameterProvider` and `HTTPResult`, used to read the request and to reject it.
41
+ - [`@antelopejs/interface-core`](https://github.com/AntelopeJS/interface-core): `InterfaceFunction`, which wires the token, sanitization and mail functions to their implementation, and the decorator factories the authentication decorators are built with.
42
+ - [`@antelopejs/interface-database-decorators`](https://github.com/AntelopeJS/interface-database-decorators): Table definitions, the `HashModifier` mixin, and `BasicDataModel` for the user, session and identity models.
43
+ - [`@antelopejs/interface-database`](https://github.com/AntelopeJS/interface-database): The query value proxies behind the owner lookups of `UserModel`.
46
44
 
47
- ## Quick Start
45
+ ## Quick start
48
46
 
49
47
  The following controller gates a route on an authenticated user and returns the account with its secrets stripped.
50
48
 
@@ -65,11 +63,11 @@ export class ProfileController extends Controller("/api/profile") {
65
63
  }
66
64
  ```
67
65
 
68
- A client reaches it by sending the access token issued at login in the `Authorization` header, as `Bearer <access token>`.
66
+ A client calls it with the access token issued at login, in the `Authorization` header, as `Bearer <access token>`.
69
67
 
70
- ## Documentation Sections
68
+ ## Pages in this section
71
69
 
72
- - [Authentication](/docs/interfaces/auth/authentication) - Resolve a request to a user with the authentication decorators and `authenticateRequestUser`
73
- - [Tokens and Sessions](/docs/interfaces/auth/tokens-and-sessions) - Issue and validate access, refresh, two-factor and tenant-assignment tokens, and record login sessions
74
- - [Users](/docs/interfaces/auth/users) - The user table and model, password hashing, the password policy, sanitization, the account mail entry points, and announcing a registration
75
- - [External Identities](/docs/interfaces/auth/external-identities) - Bind and read the accounts a user owns on external login providers
70
+ - [Authentication](/docs/interfaces/auth/authentication): Resolve a request to a user with the authentication decorators and `authenticateRequestUser`.
71
+ - [Tokens and sessions](/docs/interfaces/auth/tokens-and-sessions): Issue and validate access, refresh, two-factor and tenant-assignment tokens, and record login sessions.
72
+ - [Users](/docs/interfaces/auth/users): The user table and model, password hashing, the password policy, sanitization, the account mail functions, and announcing a registration.
73
+ - [External identities](/docs/interfaces/auth/external-identities): Bind and read the accounts a user owns on external login providers.