@antelopejs/interface-dms 0.10.3 → 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.
- package/CHANGELOG.md +47 -0
- package/README.md +21 -10
- package/dist/attachments.d.ts +15 -2
- package/dist/attachments.js +14 -1
- package/dist/attachments.js.map +1 -1
- package/dist/auth/db/models/sessions.model.d.ts +7 -5
- package/dist/auth/db/models/sessions.model.js +2 -9
- package/dist/auth/db/models/sessions.model.js.map +1 -1
- package/dist/auth/db/models/userExternalIdentities.model.d.ts +7 -5
- package/dist/auth/db/models/users.model.d.ts +7 -5
- package/dist/auth/db/tables/users.table.d.ts +4 -2
- package/dist/auth/db/tables/users.table.js.map +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/internal/jwt-auth-decorator.d.ts +1 -1
- package/dist/auth/internal/jwt-auth-decorator.js +6 -3
- package/dist/auth/internal/jwt-auth-decorator.js.map +1 -1
- package/dist/auth/internal/request-authenticators.d.ts +12 -0
- package/dist/auth/internal/request-authenticators.js +53 -10
- package/dist/auth/internal/request-authenticators.js.map +1 -1
- package/dist/base/activity-feed.d.ts +34 -32
- package/dist/base/activity-feed.js +2 -0
- package/dist/base/activity-feed.js.map +1 -1
- package/dist/base/banner.d.ts +12 -10
- package/dist/base/banner.js +2 -0
- package/dist/base/banner.js.map +1 -1
- package/dist/base/block-registry/internal/describe.js +3 -9
- package/dist/base/block-registry/internal/describe.js.map +1 -1
- package/dist/base/block-registry/internal/ui.js +1 -1
- package/dist/base/block-registry/internal/ui.js.map +1 -1
- package/dist/base/card.d.ts +11 -9
- package/dist/base/card.js +2 -0
- package/dist/base/card.js.map +1 -1
- package/dist/base/chart-card.d.ts +4 -2
- package/dist/base/chart-card.js +2 -0
- package/dist/base/chart-card.js.map +1 -1
- package/dist/base/chart-schemas.d.ts +148 -148
- package/dist/base/chart.d.ts +65 -0
- package/dist/base/chart.js +65 -0
- package/dist/base/chart.js.map +1 -1
- package/dist/base/code-block.d.ts +5 -3
- package/dist/base/code-block.js +2 -0
- package/dist/base/code-block.js.map +1 -1
- package/dist/base/custom.d.ts +5 -0
- package/dist/base/custom.js +5 -0
- package/dist/base/custom.js.map +1 -1
- package/dist/base/data-types/default/address.d.ts +5 -0
- package/dist/base/data-types/default/address.js +5 -0
- package/dist/base/data-types/default/address.js.map +1 -1
- package/dist/base/data-types/default/choices.d.ts +20 -0
- package/dist/base/data-types/default/choices.js +20 -0
- package/dist/base/data-types/default/choices.js.map +1 -1
- package/dist/base/data-types/default/files.d.ts +22 -5
- package/dist/base/data-types/default/files.js +20 -0
- package/dist/base/data-types/default/files.js.map +1 -1
- package/dist/base/data-types/default/numbers.d.ts +15 -0
- package/dist/base/data-types/default/numbers.js +25 -9
- package/dist/base/data-types/default/numbers.js.map +1 -1
- package/dist/base/data-types/default/relations.d.ts +10 -2
- package/dist/base/data-types/default/relations.js +9 -6
- package/dist/base/data-types/default/relations.js.map +1 -1
- package/dist/base/data-types/default/strings.d.ts +25 -0
- package/dist/base/data-types/default/strings.js +25 -0
- package/dist/base/data-types/default/strings.js.map +1 -1
- package/dist/base/data-types/default-types.d.ts +1 -1
- package/dist/base/data-types/field-types.d.ts +10 -0
- package/dist/base/data-types/field-types.js +10 -0
- package/dist/base/data-types/field-types.js.map +1 -1
- package/dist/base/data-types/internal/relation-endpoints.js +1 -0
- package/dist/base/data-types/internal/relation-endpoints.js.map +1 -1
- package/dist/base/data-types/status-type.d.ts +5 -0
- package/dist/base/data-types/status-type.js +5 -0
- package/dist/base/data-types/status-type.js.map +1 -1
- package/dist/base/display.d.ts +6 -6
- package/dist/base/empty-state.d.ts +15 -13
- package/dist/base/empty-state.js +2 -0
- package/dist/base/empty-state.js.map +1 -1
- package/dist/base/form-block-schema.d.ts +50 -50
- package/dist/base/form-schema.d.ts +2 -0
- package/dist/base/form-schema.js +2 -0
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/grid.d.ts +4 -0
- package/dist/base/grid.js +4 -0
- package/dist/base/grid.js.map +1 -1
- package/dist/base/guard.d.ts +30 -28
- package/dist/base/guard.js +2 -0
- package/dist/base/guard.js.map +1 -1
- package/dist/base/helpers/archive-mode-helpers.d.ts +1 -1
- package/dist/base/helpers/file-refs.js +15 -15
- package/dist/base/helpers/file-refs.js.map +1 -1
- package/dist/base/internal/form-schema-validation.js +7 -1
- package/dist/base/internal/form-schema-validation.js.map +1 -1
- package/dist/base/internal/realtime-topics.js.map +1 -1
- package/dist/base/internal/searchable.d.ts +2 -1
- package/dist/base/internal/searchable.js +1 -3
- package/dist/base/internal/searchable.js.map +1 -1
- package/dist/base/key-value-list.d.ts +21 -19
- package/dist/base/key-value-list.js +2 -0
- package/dist/base/key-value-list.js.map +1 -1
- package/dist/base/kpi-card.d.ts +4 -2
- package/dist/base/kpi-card.js +2 -0
- package/dist/base/kpi-card.js.map +1 -1
- package/dist/base/live-toggle.d.ts +2 -0
- package/dist/base/live-toggle.js +2 -0
- package/dist/base/live-toggle.js.map +1 -1
- package/dist/base/meter.d.ts +23 -21
- package/dist/base/meter.js +2 -0
- package/dist/base/meter.js.map +1 -1
- package/dist/base/nav-card-grid.d.ts +24 -19
- package/dist/base/nav-card-grid.js +5 -0
- package/dist/base/nav-card-grid.js.map +1 -1
- package/dist/base/page-toolbar.d.ts +2 -0
- package/dist/base/page-toolbar.js +2 -0
- package/dist/base/page-toolbar.js.map +1 -1
- package/dist/base/period-selector.d.ts +3 -1
- package/dist/base/period-selector.js +2 -0
- package/dist/base/period-selector.js.map +1 -1
- package/dist/base/placeholder.d.ts +2 -0
- package/dist/base/placeholder.js +2 -0
- package/dist/base/placeholder.js.map +1 -1
- package/dist/base/resource-form-schema.d.ts +2 -2
- package/dist/base/searchable.d.ts +3 -2
- package/dist/base/searchable.js +2 -2
- package/dist/base/searchable.js.map +1 -1
- package/dist/base/section.d.ts +6 -2
- package/dist/base/section.js +4 -0
- package/dist/base/section.js.map +1 -1
- package/dist/base/stack.d.ts +6 -0
- package/dist/base/stack.js +6 -0
- package/dist/base/stack.js.map +1 -1
- package/dist/base/stat-group.d.ts +16 -14
- package/dist/base/stat-group.js +2 -0
- package/dist/base/stat-group.js.map +1 -1
- package/dist/base/tab.d.ts +10 -8
- package/dist/base/tab.js +2 -0
- package/dist/base/tab.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +1 -1
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/data-functions.d.ts +10 -4
- package/dist/base/table-view/data-functions.js.map +1 -1
- package/dist/base/table-view/factory.d.ts +5 -0
- package/dist/base/table-view/factory.js +8 -4
- package/dist/base/table-view/factory.js.map +1 -1
- package/dist/base/table-view/internal/auth.d.ts +17 -3
- package/dist/base/table-view/internal/auth.js +26 -5
- package/dist/base/table-view/internal/auth.js.map +1 -1
- package/dist/base/table-view/internal/column-conditions.d.ts +8 -1
- package/dist/base/table-view/internal/column-conditions.js +25 -13
- package/dist/base/table-view/internal/column-conditions.js.map +1 -1
- package/dist/base/table-view/internal/column-display.d.ts +1 -2
- package/dist/base/table-view/internal/column-display.js +3 -9
- package/dist/base/table-view/internal/column-display.js.map +1 -1
- package/dist/base/table-view/internal/factory-helpers.d.ts +1 -1
- package/dist/base/table-view/internal/factory-helpers.js +17 -14
- package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
- package/dist/base/table-view/internal/factory-lifecycle-created.d.ts +2 -3
- package/dist/base/table-view/internal/factory-lifecycle-created.js +5 -5
- package/dist/base/table-view/internal/factory-lifecycle-created.js.map +1 -1
- package/dist/base/table-view/internal/factory-lifecycle-filter.d.ts +2 -2
- package/dist/base/table-view/internal/factory-private-actions.d.ts +2 -2
- package/dist/base/table-view/internal/files.d.ts +2 -1
- package/dist/base/table-view/internal/files.js +14 -5
- package/dist/base/table-view/internal/files.js.map +1 -1
- package/dist/base/table-view/internal/footer.d.ts +3 -3
- package/dist/base/table-view/internal/footer.js +16 -15
- package/dist/base/table-view/internal/footer.js.map +1 -1
- package/dist/base/table-view/internal/guards.d.ts +27 -5
- package/dist/base/table-view/internal/guards.js +127 -49
- package/dist/base/table-view/internal/guards.js.map +1 -1
- package/dist/base/table-view/internal/meta-helpers.d.ts +1 -1
- package/dist/base/table-view/internal/meta-helpers.js +3 -4
- package/dist/base/table-view/internal/meta-helpers.js.map +1 -1
- package/dist/base/table-view/internal/meta.js +2 -3
- package/dist/base/table-view/internal/meta.js.map +1 -1
- package/dist/base/table-view/internal/option-contract.d.ts +1 -1
- package/dist/base/table-view/internal/option-footer.d.ts +2 -2
- package/dist/base/table-view/internal/option-row-actions.d.ts +1 -1
- package/dist/base/table-view/internal/realtime.d.ts +52 -11
- package/dist/base/table-view/internal/realtime.js +23 -16
- package/dist/base/table-view/internal/realtime.js.map +1 -1
- package/dist/base/table-view/internal/resource-form.d.ts +1 -1
- package/dist/base/table-view/internal/resource-form.js +1 -1
- package/dist/base/table-view/internal/resource-form.js.map +1 -1
- package/dist/base/table-view/internal/row-actions-schema.d.ts +12 -12
- package/dist/base/table-view/internal/row-rule-shape.d.ts +11 -5
- package/dist/base/table-view/internal/row-rule-shape.js +60 -30
- package/dist/base/table-view/internal/row-rule-shape.js.map +1 -1
- package/dist/base/table-view/internal/row-rules.d.ts +28 -1
- package/dist/base/table-view/internal/row-rules.js +8 -19
- package/dist/base/table-view/internal/row-rules.js.map +1 -1
- package/dist/base/table-view/internal/tabs.d.ts +1 -1
- package/dist/base/table-view/internal/tabs.js +1 -4
- package/dist/base/table-view/internal/tabs.js.map +1 -1
- package/dist/base/table-view/internal/validation.d.ts +2 -2
- package/dist/base/table-view/internal/validation.js +7 -7
- package/dist/base/table-view/internal/validation.js.map +1 -1
- package/dist/base/table-view/meta.d.ts +7 -6
- package/dist/base/table-view/meta.js +12 -7
- package/dist/base/table-view/meta.js.map +1 -1
- package/dist/base/table-view/resource-form.d.ts +3 -1
- package/dist/base/table-view/resource-form.js +2 -0
- package/dist/base/table-view/resource-form.js.map +1 -1
- package/dist/base/table-view/routes.d.ts +73 -21
- package/dist/base/table-view/routes.js +13 -10
- package/dist/base/table-view/routes.js.map +1 -1
- package/dist/base/table-view/schema.d.ts +152 -152
- package/dist/base/table-view/source.js +4 -1
- package/dist/base/table-view/source.js.map +1 -1
- package/dist/base/table-view.d.ts +1 -1
- package/dist/base/table-view.js.map +1 -1
- package/dist/base/top-list-card.d.ts +35 -33
- package/dist/base/top-list-card.js +2 -0
- package/dist/base/top-list-card.js.map +1 -1
- package/dist/base/types/error.js +5 -2
- package/dist/base/types/error.js.map +1 -1
- package/dist/base/types/guards.d.ts +4 -4
- package/dist/base/types/json.d.ts +1 -10
- package/dist/base/types/row-action.d.ts +7 -7
- package/dist/component-options/confirm-dialog.d.ts +2 -0
- package/dist/component-options/confirm-dialog.js.map +1 -1
- package/dist/component-options/data-type.d.ts +2 -2
- package/dist/component-options/data-type.js +7 -7
- package/dist/component-options/data-type.js.map +1 -1
- package/dist/component-options/row-action.d.ts +14 -9
- package/dist/component-slots.d.ts +11 -2
- package/dist/component-slots.js +1 -0
- package/dist/component-slots.js.map +1 -1
- package/dist/component.d.ts +7 -8
- package/dist/component.js +17 -25
- package/dist/component.js.map +1 -1
- package/dist/data-controllers/members.d.ts +11 -7
- package/dist/data-controllers/members.js +1 -1
- package/dist/data-controllers/members.js.map +1 -1
- package/dist/data-controllers/roles.d.ts +32 -10
- package/dist/db/internal/exportJobs.model.d.ts +7 -5
- package/dist/db/internal/inviteResolutions.model.d.ts +7 -5
- package/dist/db/internal/tenantLifecycle.model.d.ts +7 -5
- package/dist/db/models/roles.model.d.ts +7 -5
- package/dist/db/models/tenantMembers.model.d.ts +7 -5
- package/dist/db/models/tenants.model.d.ts +7 -5
- package/dist/db/models/user_invites.model.d.ts +7 -5
- package/dist/db/tables/tenants.table.d.ts +9 -0
- package/dist/db/tables/tenants.table.js +4 -0
- package/dist/db/tables/tenants.table.js.map +1 -1
- package/dist/guards.d.ts +1 -1
- package/dist/hooks.d.ts +10 -9
- package/dist/hooks.js +42 -33
- package/dist/hooks.js.map +1 -1
- package/dist/internal/attachments.d.ts +2 -2
- package/dist/internal/component-builder.js +2 -1
- package/dist/internal/component-builder.js.map +1 -1
- package/dist/internal/component-serialization.d.ts +2 -4
- package/dist/internal/component-serialization.js +4 -3
- package/dist/internal/component-serialization.js.map +1 -1
- package/dist/internal/component-slots.d.ts +19 -2
- package/dist/internal/component-slots.js +35 -12
- package/dist/internal/component-slots.js.map +1 -1
- package/dist/internal/component-watch-filter.d.ts +11 -0
- package/dist/internal/component-watch-filter.js +22 -0
- package/dist/internal/component-watch-filter.js.map +1 -0
- package/dist/internal/component-watches.js +0 -1
- package/dist/internal/component-watches.js.map +1 -1
- package/dist/internal/own-entry.d.ts +7 -0
- package/dist/internal/own-entry.js +13 -0
- package/dist/internal/own-entry.js.map +1 -0
- package/dist/invite-extension-payloads.d.ts +14 -2
- package/dist/invite-extensions/internal/delivery.js +1 -2
- package/dist/invite-extensions/internal/delivery.js.map +1 -1
- package/dist/invite-extensions/internal/edit.d.ts +2 -1
- package/dist/invite-extensions/internal/edit.js +8 -9
- package/dist/invite-extensions/internal/edit.js.map +1 -1
- package/dist/invite-extensions/internal/form-slot.js +8 -15
- package/dist/invite-extensions/internal/form-slot.js.map +1 -1
- package/dist/invite-extensions/internal/payload-slices.d.ts +33 -3
- package/dist/invite-extensions/internal/payload-slices.js +84 -19
- package/dist/invite-extensions/internal/payload-slices.js.map +1 -1
- package/dist/invite-extensions/internal/types.d.ts +10 -1
- package/dist/invite-resolution.js +6 -4
- package/dist/invite-resolution.js.map +1 -1
- package/dist/json.d.ts +10 -0
- package/dist/json.js +3 -0
- package/dist/json.js.map +1 -0
- package/dist/layout-banners.d.ts +5 -2
- package/dist/layout-banners.js.map +1 -1
- package/dist/page/controllers.d.ts +2 -2
- package/dist/page/internal/extension-validation.js +3 -2
- package/dist/page/internal/extension-validation.js.map +1 -1
- package/dist/page/internal/metadata-layout.js +1 -1
- package/dist/page/internal/metadata-layout.js.map +1 -1
- package/dist/page/internal/metadata-publish.js +3 -2
- package/dist/page/internal/metadata-publish.js.map +1 -1
- package/dist/page/internal/metadata-registration.js +5 -4
- package/dist/page/internal/metadata-registration.js.map +1 -1
- package/dist/page/internal/metadata-upload-registration.d.ts +3 -1
- package/dist/page/internal/metadata-upload-registration.js +9 -0
- package/dist/page/internal/metadata-upload-registration.js.map +1 -1
- package/dist/page/internal/metadata-uploads.d.ts +18 -5
- package/dist/page/internal/metadata-uploads.js +7 -8
- package/dist/page/internal/metadata-uploads.js.map +1 -1
- package/dist/page/internal/page-record.d.ts +2 -3
- package/dist/page/internal/page-record.js +19 -14
- package/dist/page/internal/page-record.js.map +1 -1
- package/dist/page/layout-filter.js +17 -6
- package/dist/page/layout-filter.js.map +1 -1
- package/dist/page/metadata.js +5 -7
- package/dist/page/metadata.js.map +1 -1
- package/dist/request-tenant.d.ts +10 -4
- package/dist/request-tenant.js +16 -34
- package/dist/request-tenant.js.map +1 -1
- package/dist/tenant-export.d.ts +2 -1
- package/dist/tenant-lifecycle.d.ts +13 -4
- package/dist/tenant-lifecycle.js +51 -18
- package/dist/tenant-lifecycle.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/uploads.js +42 -59
- package/dist/uploads.js.map +1 -1
- package/dist/utils/fire-and-forget.js.map +1 -1
- package/dist/utils/internal/decorated-class.d.ts +14 -0
- package/dist/utils/internal/decorated-class.js +37 -0
- package/dist/utils/internal/decorated-class.js.map +1 -0
- package/dist/utils/internal/type-check.d.ts +9 -0
- package/dist/utils/internal/type-check.js +13 -5
- package/dist/utils/internal/type-check.js.map +1 -1
- package/dist/utils/internal/value-parser.d.ts +1 -1
- package/dist/utils/internal/value-parser.js +22 -9
- package/dist/utils/internal/value-parser.js.map +1 -1
- package/dist/watch-actions.d.ts +1 -1
- package/docs/1.core/1.introduction.md +82 -77
- package/docs/1.core/10.layout-banners.md +57 -45
- package/docs/1.core/11.modules-and-dynamic-menus.md +178 -0
- package/docs/1.core/12.frontend-modules-and-request-helpers.md +155 -0
- package/docs/1.core/13.tenant-data-export.md +120 -0
- package/docs/1.core/2.pages-and-modules.md +140 -367
- package/docs/1.core/3.components.md +21 -22
- package/docs/1.core/4.permissions.md +92 -71
- package/docs/1.core/5.tenancy.md +112 -86
- package/docs/1.core/6.invites.md +90 -65
- package/docs/1.core/7.hooks.md +96 -166
- package/docs/1.core/8.realtime.md +44 -45
- package/docs/1.core/9.quick-actions.md +37 -30
- package/docs/2.auth/1.introduction.md +33 -35
- package/docs/2.auth/2.authentication.md +60 -38
- package/docs/2.auth/3.tokens-and-sessions.md +56 -55
- package/docs/2.auth/4.users.md +82 -52
- package/docs/2.auth/5.external-identities.md +25 -26
- package/docs/3.base/1.introduction.md +64 -60
- package/docs/3.base/10.display-blocks.md +15 -16
- package/docs/3.base/11.page-layouts.md +273 -0
- package/docs/3.base/12.table-row-actions.md +122 -0
- package/docs/3.base/13.table-filters-and-forms.md +104 -0
- package/docs/3.base/14.table-events-and-helpers.md +114 -0
- package/docs/3.base/15.table-sources-and-gates.md +24 -0
- package/docs/3.base/2.types.md +44 -41
- package/docs/3.base/3.forms.md +27 -28
- package/docs/3.base/4.tables.md +34 -367
- package/docs/3.base/5.charts-and-widgets.md +28 -29
- package/docs/3.base/6.layout.md +21 -270
- package/docs/3.base/8.data-types.md +39 -40
- package/docs/3.base/9.helpers.md +36 -38
- package/docs/4.notifications/1.introduction.md +22 -26
- package/docs/4.notifications/2.categories-and-subjects.md +58 -55
- package/docs/4.notifications/3.sending.md +72 -68
- package/docs/5.html-render/1.introduction.md +119 -81
- package/docs/5.html-render/2.built-in-emails.md +71 -51
- package/docs/index.md +18 -29
- package/docs/tsconfig.json +4 -0
- package/package.json +12 -12
- package/docs/images/emails-admin-invite.png +0 -0
- package/docs/images/emails-change-notice.png +0 -0
- package/docs/images/emails-change-verification.png +0 -0
- package/docs/images/emails-digest-logo-dark.png +0 -0
- package/docs/images/emails-digest-logo-light.png +0 -0
- package/docs/images/emails-digest.png +0 -0
- package/docs/images/emails-export-partial.png +0 -0
- package/docs/images/emails-export-ready.png +0 -0
- package/docs/images/emails-reset-password.png +0 -0
- package/docs/images/emails-two-factor.png +0 -0
- 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
|
|
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
|
|
13
|
+
## How a page ends up subscribed
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
The page-topic registry derives the subscriptions. The publisher never requests them.
|
|
17
16
|
|
|
18
|
-
1. A page
|
|
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
|
|
20
|
-
3. `PublishMessage(topic, type)` delivers to the sessions
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
27
|
+
## Register a topic for a page
|
|
29
28
|
|
|
30
|
-
The
|
|
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
|
-
|
|
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
|
|
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
|
|
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.
|
|
88
|
-
| `type` | The event type carried with the message, for subscribers that
|
|
89
|
-
| `options` |
|
|
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` |
|
|
97
|
-
| `tenantId` | `string` | The tenant the event is about
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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/
|
|
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
|
|
119
|
+
## Subscribe from the backend
|
|
121
120
|
|
|
122
|
-
`SubscribeMessage` receives every message published on a topic, whichever instance and whichever tenant published it
|
|
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` |
|
|
152
|
-
| `type` | `string` |
|
|
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
|
|
156
|
-
| `ts` | `number` |
|
|
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
|
-
|
|
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
|
-
|
|
159
|
+
Design a subscriber around three properties:
|
|
161
160
|
|
|
162
|
-
- **Handlers must not throw.**
|
|
163
|
-
- **Delivery is fire-and-forget.**
|
|
164
|
-
- **Unsubscribing is automatic** when the registering module is unloaded.
|
|
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
|
|
165
|
+
## Next steps
|
|
167
166
|
|
|
168
|
-
[Quick
|
|
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
|
|
3
|
-
description: "A quick action is a shortcut
|
|
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
|
-
|
|
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
|
|
11
|
+
## Declare a category and its actions
|
|
15
12
|
|
|
16
|
-
`QuickActionCategory(id, info)` registers
|
|
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
|
-
|
|
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.
|
|
48
|
-
| `displayName` | `string` |
|
|
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.
|
|
57
|
-
| `category` | `QuickActionCategoryInfo` | The record
|
|
58
|
-
| `displayName` | `string` |
|
|
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
|
|
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
|
|
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 |
|
|
77
|
+
| Variant | Fields | Effect |
|
|
70
78
|
| ------- | ------ | ------- |
|
|
71
|
-
| `"navigate"` | `page`, optional `query` |
|
|
72
|
-
| `"openForm"` | `page`, optional `component` |
|
|
73
|
-
| `"button"` | `page`, `button`, optional `component` |
|
|
74
|
-
| `"event"` | `page`, `name`, optional `payload` |
|
|
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
|
|
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
|
-
|
|
120
|
+
The `catalog-import` action assumes that `BooksPage.table` declares a custom button with `id: "import"` in its `customButtons`.
|
|
114
121
|
|
|
115
|
-
[Layout
|
|
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
|
|
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
|
-
|
|
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`,
|
|
19
|
-
| `@antelopejs/interface-dms/auth/db` | The `User`, `Session` and `UserExternalIdentity` tables, their models,
|
|
20
|
-
| `@antelopejs/interface-dms/auth/password` | The password policy: `PASSWORD_MIN_LENGTH`, `PASSWORD_PATTERN` and `isPasswordCompliant`.
|
|
21
|
-
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
- **Request
|
|
25
|
-
- **Optional
|
|
26
|
-
- **
|
|
27
|
-
- **Composable
|
|
28
|
-
- **Token
|
|
29
|
-
- **Revocable
|
|
30
|
-
- **
|
|
31
|
-
- **External
|
|
32
|
-
- **Safe
|
|
33
|
-
- **One
|
|
34
|
-
- **Account
|
|
35
|
-
- **One
|
|
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
|
|
38
|
+
This domain relies on the following AntelopeJS packages:
|
|
40
39
|
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
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
|
|
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
|
|
66
|
+
A client calls it with the access token issued at login, in the `Authorization` header, as `Bearer <access token>`.
|
|
69
67
|
|
|
70
|
-
##
|
|
68
|
+
## Pages in this section
|
|
71
69
|
|
|
72
|
-
- [Authentication](/docs/interfaces/auth/authentication)
|
|
73
|
-
- [Tokens and
|
|
74
|
-
- [Users](/docs/interfaces/auth/users)
|
|
75
|
-
- [External
|
|
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.
|