@antelopejs/interface-dms 0.7.3 → 0.8.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 +129 -0
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.js +11 -9
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/internal/jwt-auth-decorator.d.ts +20 -0
- package/dist/auth/internal/jwt-auth-decorator.js +51 -0
- package/dist/auth/internal/jwt-auth-decorator.js.map +1 -0
- package/dist/auth/internal/request-authenticators.d.ts +12 -0
- package/dist/auth/internal/request-authenticators.js +22 -0
- package/dist/auth/internal/request-authenticators.js.map +1 -1
- package/dist/base/activity-feed.d.ts +6 -6
- package/dist/base/block-registry/types.d.ts +16 -0
- package/dist/base/block-types.d.ts +1 -0
- package/dist/base/block-types.js +1 -0
- package/dist/base/block-types.js.map +1 -1
- package/dist/base/chart-card.d.ts +15 -0
- package/dist/base/chart-card.js +4 -0
- package/dist/base/chart-card.js.map +1 -1
- package/dist/base/chart-schemas.d.ts +26 -26
- package/dist/base/code-block.d.ts +3 -3
- package/dist/base/data-types/compare-types.js +19 -13
- package/dist/base/data-types/compare-types.js.map +1 -1
- package/dist/base/data-types/core.d.ts +11 -0
- package/dist/base/data-types/core.js +14 -1
- package/dist/base/data-types/core.js.map +1 -1
- package/dist/base/data-types/default-types.d.ts +112 -2
- package/dist/base/data-types/default-types.js +90 -19
- package/dist/base/data-types/default-types.js.map +1 -1
- package/dist/base/data-types/field-types.d.ts +10 -4
- package/dist/base/data-types/field-types.js +12 -2
- package/dist/base/data-types/field-types.js.map +1 -1
- package/dist/base/data-types/internal/compare-types.d.ts +3 -0
- package/dist/base/data-types/internal/compare-types.js +7 -0
- package/dist/base/data-types/internal/compare-types.js.map +1 -1
- package/dist/base/empty-state.d.ts +4 -4
- package/dist/base/form-block-schema.d.ts +59 -3
- package/dist/base/form-block-schema.js +12 -2
- package/dist/base/form-block-schema.js.map +1 -1
- package/dist/base/form-schema.d.ts +46 -1
- package/dist/base/form-schema.js.map +1 -1
- package/dist/base/form-types.d.ts +56 -13
- package/dist/base/form-types.js +12 -4
- package/dist/base/form-types.js.map +1 -1
- package/dist/base/guard.d.ts +6 -6
- package/dist/base/helpers/archive-mode-helpers.js +6 -2
- package/dist/base/helpers/archive-mode-helpers.js.map +1 -1
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.js +1 -0
- package/dist/base/index.js.map +1 -1
- package/dist/base/internal/form-schema.js +2 -0
- package/dist/base/internal/form-schema.js.map +1 -1
- package/dist/base/internal/layouts.d.ts +4 -0
- package/dist/base/key-value-list.d.ts +12 -9
- package/dist/base/key-value-list.js +1 -1
- package/dist/base/key-value-list.js.map +1 -1
- package/dist/base/kpi-card.d.ts +39 -5
- package/dist/base/kpi-card.js +18 -6
- package/dist/base/kpi-card.js.map +1 -1
- package/dist/base/layouts.d.ts +24 -0
- package/dist/base/layouts.js.map +1 -1
- package/dist/base/live-toggle.d.ts +11 -0
- package/dist/base/live-toggle.js +8 -1
- package/dist/base/live-toggle.js.map +1 -1
- package/dist/base/page-toolbar.d.ts +158 -0
- package/dist/base/page-toolbar.js +198 -0
- package/dist/base/page-toolbar.js.map +1 -0
- package/dist/base/period-selector.d.ts +9 -2
- package/dist/base/period-selector.js.map +1 -1
- package/dist/base/placeholder.d.ts +2 -2
- package/dist/base/section.d.ts +2 -2
- package/dist/base/stack.d.ts +2 -2
- package/dist/base/stat-group.d.ts +18 -6
- package/dist/base/stat-group.js +9 -0
- package/dist/base/stat-group.js.map +1 -1
- package/dist/base/table-view/column-display.d.ts +9 -5
- package/dist/base/table-view/column-display.js +1 -1
- package/dist/base/table-view/column-display.js.map +1 -1
- package/dist/base/table-view/data-functions.d.ts +26 -7
- package/dist/base/table-view/data-functions.js +10 -6
- package/dist/base/table-view/data-functions.js.map +1 -1
- package/dist/base/table-view/factory.js +24 -13
- package/dist/base/table-view/factory.js.map +1 -1
- package/dist/base/table-view/internal/auth.d.ts +2 -0
- package/dist/base/table-view/internal/auth.js +3 -1
- package/dist/base/table-view/internal/auth.js.map +1 -1
- package/dist/base/table-view/internal/factory-helpers.d.ts +5 -0
- package/dist/base/table-view/internal/factory-helpers.js +55 -11
- package/dist/base/table-view/internal/factory-helpers.js.map +1 -1
- package/dist/base/table-view/internal/guards.js +19 -2
- package/dist/base/table-view/internal/guards.js.map +1 -1
- package/dist/base/table-view/internal/realtime.js +17 -0
- package/dist/base/table-view/internal/realtime.js.map +1 -1
- package/dist/base/table-view/internal/resource-form.js +1 -0
- package/dist/base/table-view/internal/resource-form.js.map +1 -1
- package/dist/base/table-view/internal/row-actions-schema.d.ts +296 -0
- package/dist/base/table-view/internal/row-actions-schema.js +62 -0
- package/dist/base/table-view/internal/row-actions-schema.js.map +1 -0
- package/dist/base/table-view/internal/validation.d.ts +15 -3
- package/dist/base/table-view/internal/validation.js +70 -2
- package/dist/base/table-view/internal/validation.js.map +1 -1
- package/dist/base/table-view/meta.d.ts +8 -0
- package/dist/base/table-view/meta.js +25 -3
- package/dist/base/table-view/meta.js.map +1 -1
- package/dist/base/table-view/options.d.ts +90 -16
- package/dist/base/table-view/options.js.map +1 -1
- package/dist/base/table-view/realtime.d.ts +8 -0
- package/dist/base/table-view/realtime.js.map +1 -1
- package/dist/base/table-view/routes.js +5 -2
- package/dist/base/table-view/routes.js.map +1 -1
- package/dist/base/table-view/schema.d.ts +36 -30
- package/dist/base/table-view/schema.js +11 -57
- package/dist/base/table-view/schema.js.map +1 -1
- package/dist/base/table-view/source.d.ts +1 -1
- 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 +2 -2
- package/dist/base/table-view.js.map +1 -1
- package/dist/base/top-list-card.d.ts +5 -5
- package/dist/base/types/action-target.d.ts +77 -20
- package/dist/base/types/confirm-dialog.d.ts +5 -1
- package/dist/base/types/custom-button.d.ts +5 -3
- package/dist/base/types/field-config.d.ts +4 -4
- package/dist/base/types/guards.d.ts +10 -0
- package/dist/base/types/row-action.d.ts +6 -1
- package/dist/base/types/size.d.ts +3 -1
- package/dist/client-ip.d.ts +6 -2
- package/dist/client-ip.js +4 -2
- package/dist/client-ip.js.map +1 -1
- package/dist/component.d.ts +8 -0
- package/dist/component.js.map +1 -1
- package/dist/data-controllers/members.d.ts +2 -5
- package/dist/data-controllers/members.js +38 -9
- package/dist/data-controllers/members.js.map +1 -1
- package/dist/db/internal/tenantLifecycle.model.d.ts +4 -0
- package/dist/db/internal/tenantLifecycle.model.js +26 -0
- package/dist/db/internal/tenantLifecycle.model.js.map +1 -1
- package/dist/db/internal/tenantLifecycle.table.d.ts +1 -0
- package/dist/db/internal/tenantLifecycle.table.js +4 -0
- package/dist/db/internal/tenantLifecycle.table.js.map +1 -1
- package/dist/guards.js +2 -3
- package/dist/guards.js.map +1 -1
- package/dist/hooks.d.ts +47 -0
- package/dist/hooks.js +6 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/invite-membership.d.ts +9 -0
- package/dist/internal/invite-membership.js +25 -0
- package/dist/internal/invite-membership.js.map +1 -1
- package/dist/internal/member-changes.d.ts +24 -0
- package/dist/internal/member-changes.js +66 -0
- package/dist/internal/member-changes.js.map +1 -0
- package/dist/internal/tenant-ownership.d.ts +4 -1
- package/dist/internal/tenant-ownership.js +4 -1
- package/dist/internal/tenant-ownership.js.map +1 -1
- package/dist/invite-extensions.d.ts +0 -9
- package/dist/invite-extensions.js +1 -36
- package/dist/invite-extensions.js.map +1 -1
- package/dist/invite-resolution.js +6 -2
- package/dist/invite-resolution.js.map +1 -1
- package/dist/invites.js +36 -22
- package/dist/invites.js.map +1 -1
- package/dist/layout-banners.d.ts +40 -4
- package/dist/layout-banners.js +25 -3
- package/dist/layout-banners.js.map +1 -1
- package/dist/notifications/internal.d.ts +2 -2
- package/dist/notifications/internal.js.map +1 -1
- package/dist/notifications/sendable.d.ts +3 -2
- package/dist/notifications/sendable.js +2 -1
- package/dist/notifications/sendable.js.map +1 -1
- package/dist/notifications/types.d.ts +9 -0
- package/dist/page/controllers.d.ts +44 -0
- package/dist/page/controllers.js +14 -1
- package/dist/page/controllers.js.map +1 -1
- package/dist/page/internal/layout-filter.d.ts +2 -1
- package/dist/page/internal/layout-filter.js +3 -1
- package/dist/page/internal/layout-filter.js.map +1 -1
- package/dist/page/internal/metadata-helpers.d.ts +7 -0
- package/dist/page/internal/metadata-helpers.js +13 -2
- package/dist/page/internal/metadata-helpers.js.map +1 -1
- package/dist/page/internal/page-registration.d.ts +2 -0
- package/dist/page/internal/page-registration.js.map +1 -1
- package/dist/page/layout-filter.js +31 -10
- package/dist/page/layout-filter.js.map +1 -1
- package/dist/page/metadata.js +29 -24
- package/dist/page/metadata.js.map +1 -1
- package/dist/page/types.d.ts +39 -4
- package/dist/page/types.js.map +1 -1
- package/dist/page.d.ts +1 -1
- package/dist/page.js +2 -1
- package/dist/page.js.map +1 -1
- package/dist/permissions-resolver.d.ts +26 -3
- package/dist/permissions-resolver.js +2 -1
- package/dist/permissions-resolver.js.map +1 -1
- package/dist/permissions.d.ts +7 -3
- package/dist/permissions.js +8 -6
- package/dist/permissions.js.map +1 -1
- package/dist/realtime.d.ts +24 -1
- package/dist/realtime.js +7 -1
- package/dist/realtime.js.map +1 -1
- package/dist/request-tenant.d.ts +17 -13
- package/dist/request-tenant.js +54 -42
- package/dist/request-tenant.js.map +1 -1
- package/dist/tenant-access.d.ts +15 -0
- package/dist/tenant-access.js +11 -1
- package/dist/tenant-access.js.map +1 -1
- package/dist/tenant-lifecycle.d.ts +27 -0
- package/dist/tenant-lifecycle.js +35 -0
- package/dist/tenant-lifecycle.js.map +1 -1
- package/dist/tenant-members.d.ts +26 -0
- package/dist/tenant-members.js +29 -0
- package/dist/tenant-members.js.map +1 -0
- package/dist/tenant-ownership.d.ts +4 -1
- package/dist/tenant-ownership.js +15 -3
- package/dist/tenant-ownership.js.map +1 -1
- package/dist/tenant-scoped-model.d.ts +2 -1
- package/dist/tenant-scoped-model.js +4 -3
- package/dist/tenant-scoped-model.js.map +1 -1
- package/docs/1.core/10.layout-banners.md +57 -2
- package/docs/1.core/2.pages-and-modules.md +20 -11
- package/docs/1.core/4.permissions.md +34 -1
- package/docs/1.core/5.tenancy.md +51 -5
- package/docs/1.core/7.hooks.md +13 -0
- package/docs/1.core/8.realtime.md +24 -3
- package/docs/2.auth/2.authentication.md +3 -3
- package/docs/3.base/1.introduction.md +1 -0
- package/docs/3.base/10.display-blocks.md +20 -2
- package/docs/3.base/2.types.md +7 -5
- package/docs/3.base/3.forms.md +21 -6
- package/docs/3.base/4.tables.md +14 -9
- package/docs/3.base/5.charts-and-widgets.md +8 -4
- package/docs/3.base/6.layout.md +38 -1
- package/docs/3.base/8.data-types.md +14 -7
- package/docs/4.notifications/3.sending.md +4 -3
- package/docs/5.html-render/1.introduction.md +5 -7
- package/package.json +3 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,134 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.8.0
|
|
4
|
+
|
|
5
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.7.4...v0.8.0)
|
|
6
|
+
|
|
7
|
+
### 🚀 Enhancements
|
|
8
|
+
|
|
9
|
+
- **config:** Refuse a production start on public secrets or without the dashboard origin ([#401](https://github.com/AntelopeJS/dms/pull/401))
|
|
10
|
+
- **auth:** Take the client address from the header the hosting platform writes (auth.clientIpHeader) ([#405](https://github.com/AntelopeJS/dms/pull/405))
|
|
11
|
+
- **frontend:** Proxy the storage's signed URLs through the frontend server ([#406](https://github.com/AntelopeJS/dms/pull/406))
|
|
12
|
+
- **tenancy:** ⚠️ Route every member and invite write through changeTenantMembers ([#407](https://github.com/AntelopeJS/dms/pull/407))
|
|
13
|
+
- **frontend:** ⚠️ Compute each frontend module from its config, report served versions ([#408](https://github.com/AntelopeJS/dms/pull/408))
|
|
14
|
+
- **dms-core:** One public hydration check, isHydratingComponent ([#376](https://github.com/AntelopeJS/dms/pull/376))
|
|
15
|
+
- **page:** Route params for header-button availability, breadcrumb parent, one PageLayoutRequest ([#387](https://github.com/AntelopeJS/dms/pull/387))
|
|
16
|
+
- Shared page toolbar for pages with a period or live data ([#351](https://github.com/AntelopeJS/dms/pull/351))
|
|
17
|
+
- **drawer:** Resizable drawers, 600px side default, and side panel row options for row drawers ([#375](https://github.com/AntelopeJS/dms/pull/375))
|
|
18
|
+
- **table-view:** Declare watches on the forms a table view generates ([#379](https://github.com/AntelopeJS/dms/pull/379))
|
|
19
|
+
- **interface-dms:** FrontendModulesChanged event for late frontend modules ([#382](https://github.com/AntelopeJS/dms/pull/382))
|
|
20
|
+
- **data-types:** Filter a tags column on the rows holding a tag ([#380](https://github.com/AntelopeJS/dms/pull/380))
|
|
21
|
+
- **table-view:** ⚠️ Adopt @antelopejs/interface-data-api 0.3 ([#389](https://github.com/AntelopeJS/dms/pull/389))
|
|
22
|
+
- **realtime:** Scope page messages to the tenant they are about ([#353](https://github.com/AntelopeJS/dms/pull/353))
|
|
23
|
+
- **automation:** Configurable texts, tone, tenant and templates for the DMS automation nodes ([#337](https://github.com/AntelopeJS/dms/pull/337))
|
|
24
|
+
- **kpi-card:** Show the comparison value and follow the selected comparison ([#352](https://github.com/AntelopeJS/dms/pull/352))
|
|
25
|
+
- **layout-banners:** Scope layout banners to the application's pages by default ([#348](https://github.com/AntelopeJS/dms/pull/348))
|
|
26
|
+
- **row-navigation:** Steps follow the table's full result, live tables and the kanban ([#375](https://github.com/AntelopeJS/dms/pull/375), [#398](https://github.com/AntelopeJS/dms/pull/398))
|
|
27
|
+
- **layout:** Settings from the account menu only, profile picture in the sidebar ([#374](https://github.com/AntelopeJS/dms/pull/374))
|
|
28
|
+
- **form:** Dependent relation options and field value rules ([#346](https://github.com/AntelopeJS/dms/pull/346))
|
|
29
|
+
- **table-view:** Require a table's list for the actions reached from its rows ([#371](https://github.com/AntelopeJS/dms/pull/371))
|
|
30
|
+
- **automation:** Dry-run the DMS actions in a builder test run ([#388](https://github.com/AntelopeJS/dms/pull/388))
|
|
31
|
+
|
|
32
|
+
### 🩹 Fixes
|
|
33
|
+
|
|
34
|
+
- **deps:** Require the tenant admission barrier and access evaluation contract ([#367](https://github.com/AntelopeJS/dms/pull/367))
|
|
35
|
+
- **frontend:** Run on @antelopejs/dms-frontend 0.7 ([#368](https://github.com/AntelopeJS/dms/pull/368))
|
|
36
|
+
- **startup:** Answer 503 with Retry-After until the DMS schemas are bound ([#369](https://github.com/AntelopeJS/dms/pull/369))
|
|
37
|
+
- **tenant-lifecycle:** Refuse admission under a barrier with 409, not 500 ([#409](https://github.com/AntelopeJS/dms/pull/409))
|
|
38
|
+
- **auth:** A session outlives the browser only when written persistent ([#377](https://github.com/AntelopeJS/dms/pull/377))
|
|
39
|
+
- **layout:** Store a signed-in user's footer language switch on their profile ([#383](https://github.com/AntelopeJS/dms/pull/383))
|
|
40
|
+
- **skills:** Make dms-dev.sh stop, status and restart work on Windows Git Bash ([#384](https://github.com/AntelopeJS/dms/pull/384))
|
|
41
|
+
- **layout:** Translated close / select labels and a readable phone header ([#386](https://github.com/AntelopeJS/dms/pull/386))
|
|
42
|
+
- **notifications:** Stop Mark read clicks from landing on Delete in the inbox ([#342](https://github.com/AntelopeJS/dms/pull/342))
|
|
43
|
+
- **grid:** Lay a row nested in a cell out on its own children ([#350](https://github.com/AntelopeJS/dms/pull/350))
|
|
44
|
+
- Onboarding SSR read, and row action, row token and action-target container fixes for block-built pages ([#332](https://github.com/AntelopeJS/dms/pull/332))
|
|
45
|
+
- **chart:** Chart and widget fixes for block-built dashboards ([#334](https://github.com/AntelopeJS/dms/pull/334))
|
|
46
|
+
- **save-bar:** Lift the toasts above a save bar on the bottom edge ([#372](https://github.com/AntelopeJS/dms/pull/372))
|
|
47
|
+
- **table-view:** Row containers, grouped display, cards, bulk row runs, wide tables and calendar period comparisons ([#344](https://github.com/AntelopeJS/dms/pull/344))
|
|
48
|
+
- **realtime:** Share one realtime connection between a browser's tabs ([#335](https://github.com/AntelopeJS/dms/pull/335))
|
|
49
|
+
- **form:** Generic form and i18n fixes (nested options, secret rotation, group labels, module-default note) ([#333](https://github.com/AntelopeJS/dms/pull/333))
|
|
50
|
+
- **data-types:** Keep formatters out of component setup and log dev errors ([#338](https://github.com/AntelopeJS/dms/pull/338))
|
|
51
|
+
- **data-types:** Read a null array as empty in include and exclude filters ([#341](https://github.com/AntelopeJS/dms/pull/341))
|
|
52
|
+
- **form:** Keep a refused submit's field error while its value is unchanged ([#360](https://github.com/AntelopeJS/dms/pull/360))
|
|
53
|
+
- **form:** Label a relation's ids from its select route, in the picker and the filter chips ([#378](https://github.com/AntelopeJS/dms/pull/378))
|
|
54
|
+
- **table:** Write a number field's unit wherever its value is drawn ([#381](https://github.com/AntelopeJS/dms/pull/381))
|
|
55
|
+
- **modules:** Modules page and module store polish (installed tiles, store view, working copies) ([#345](https://github.com/AntelopeJS/dms/pull/345))
|
|
56
|
+
- **format:** Read durations as written, let a number step drive the steppers, group every figure ([#391](https://github.com/AntelopeJS/dms/pull/391))
|
|
57
|
+
- **form:** Address suggestions, relation add entry, confirm Close and date picker close ([#392](https://github.com/AntelopeJS/dms/pull/392))
|
|
58
|
+
- **roles:** Preview a role as a non-owner member, and tell resolvers it is a preview ([#356](https://github.com/AntelopeJS/dms/pull/356))
|
|
59
|
+
- **form:** Forms and KeyValueList follow the container's width in drawers and modals ([#375](https://github.com/AntelopeJS/dms/pull/375), [#399](https://github.com/AntelopeJS/dms/pull/399))
|
|
60
|
+
- **table:** Count the archive without agreeing with a noun, let a table view name it ([#394](https://github.com/AntelopeJS/dms/pull/394))
|
|
61
|
+
- **form:** Show a read-only list as a table of values, a URL as its image ([#395](https://github.com/AntelopeJS/dms/pull/395))
|
|
62
|
+
- **dialog:** Closing any dialog gives the page its clicks at once ([#375](https://github.com/AntelopeJS/dms/pull/375), [#400](https://github.com/AntelopeJS/dms/pull/400))
|
|
63
|
+
- **data-types:** Multiple relation include; date greater than excludes the picked day; order filters skip empty values; typed chip editor ([#363](https://github.com/AntelopeJS/dms/pull/363))
|
|
64
|
+
- **table-view:** Combine views with tabs, date chips for relative filters, and keep the tab on reload ([#358](https://github.com/AntelopeJS/dms/pull/358))
|
|
65
|
+
- **form:** Narrow date fields and repeater rows, and relation labels in change notes ([#361](https://github.com/AntelopeJS/dms/pull/361))
|
|
66
|
+
- **frontend:** Refresh counts after a kanban move, no header sort on a hand-ordered table ([#362](https://github.com/AntelopeJS/dms/pull/362))
|
|
67
|
+
- **frontend:** Configured add label in every placement, bulk toast counts what the route changed ([#364](https://github.com/AntelopeJS/dms/pull/364))
|
|
68
|
+
- **table-view:** Warn at registration about a quick filter with no values to pick ([#370](https://github.com/AntelopeJS/dms/pull/370))
|
|
69
|
+
- **form:** Create, cancel and save behaviour of forms, section scroll, error summary ([#343](https://github.com/AntelopeJS/dms/pull/343))
|
|
70
|
+
- No layout shift from the live toggle, fetched banners, KPI and table skeletons, and live rows ([#354](https://github.com/AntelopeJS/dms/pull/354))
|
|
71
|
+
- **table-view:** Links open on the table's defaults, global nav badges, kept view search ([#365](https://github.com/AntelopeJS/dms/pull/365))
|
|
72
|
+
- **table-view:** Tab and view counters count what a click would list ([#373](https://github.com/AntelopeJS/dms/pull/373))
|
|
73
|
+
- **table-view:** Generic TableView fixes from block-built pages ([#336](https://github.com/AntelopeJS/dms/pull/336))
|
|
74
|
+
- **table-view:** Per-action access in forms, relative dates while hydrating, expanded rows ([#385](https://github.com/AntelopeJS/dms/pull/385))
|
|
75
|
+
|
|
76
|
+
### 💅 Refactors
|
|
77
|
+
|
|
78
|
+
- **startup:** Rely on the api startup gate instead of a DMS one ([#402](https://github.com/AntelopeJS/dms/pull/402))
|
|
79
|
+
- **table-view:** Keep a table view's row actions schema in its own module ([#393](https://github.com/AntelopeJS/dms/pull/393))
|
|
80
|
+
- **dms:** ⚠️ Remove the compatibility paths of #119 and #172, restore the migration guides ([#390](https://github.com/AntelopeJS/dms/pull/390), [#119](https://github.com/AntelopeJS/dms/issues/119), [#172](https://github.com/AntelopeJS/dms/issues/172))
|
|
81
|
+
|
|
82
|
+
### 📖 Documentation
|
|
83
|
+
|
|
84
|
+
- **file-storage:** Uploads stop at 100 MB at the Cloudflare edge on AntelopeJS Cloud ([#410](https://github.com/AntelopeJS/dms/pull/410))
|
|
85
|
+
- **migration:** Note the KPI compared-figure default and include on multiple relations ([#415](https://github.com/AntelopeJS/dms/pull/415))
|
|
86
|
+
|
|
87
|
+
### 🏡 Chore
|
|
88
|
+
|
|
89
|
+
- **release:** @antelopejs/dms v0.9.6 ([0ccc9b57](https://github.com/AntelopeJS/dms/commit/0ccc9b57))
|
|
90
|
+
- **release:** @antelopejs/dms v0.9.7 ([ababaeda](https://github.com/AntelopeJS/dms/commit/ababaeda))
|
|
91
|
+
- **release:** @antelopejs/dms v0.9.8 ([75daeb05](https://github.com/AntelopeJS/dms/commit/75daeb05))
|
|
92
|
+
|
|
93
|
+
### ✅ Tests
|
|
94
|
+
|
|
95
|
+
- Pin file-storage-local 0.1.11, mongodb 1.4.4 and api with interface-api 0.0.16 in the harness ([#411](https://github.com/AntelopeJS/dms/pull/411))
|
|
96
|
+
- **realtime:** Bind the verified tenant as the auth decorator does ([#414](https://github.com/AntelopeJS/dms/pull/414))
|
|
97
|
+
|
|
98
|
+
#### ⚠️ Breaking Changes
|
|
99
|
+
|
|
100
|
+
- **tenancy:** ⚠️ Route every member and invite write through changeTenantMembers ([#407](https://github.com/AntelopeJS/dms/pull/407))
|
|
101
|
+
- **frontend:** ⚠️ Compute each frontend module from its config, report served versions ([#408](https://github.com/AntelopeJS/dms/pull/408))
|
|
102
|
+
- **table-view:** ⚠️ Adopt @antelopejs/interface-data-api 0.3 ([#389](https://github.com/AntelopeJS/dms/pull/389))
|
|
103
|
+
- **dms:** ⚠️ Remove the compatibility paths of #119 and #172, restore the migration guides ([#390](https://github.com/AntelopeJS/dms/pull/390), [#119](https://github.com/AntelopeJS/dms/issues/119), [#172](https://github.com/AntelopeJS/dms/issues/172))
|
|
104
|
+
|
|
105
|
+
### ❤️ Contributors
|
|
106
|
+
|
|
107
|
+
- Antony Rizzitelli <rizzitelli.antony@pm.me>
|
|
108
|
+
- Maxime Westhoven ([@mwesto](http://github.com/mwesto))
|
|
109
|
+
|
|
110
|
+
## v0.7.4
|
|
111
|
+
|
|
112
|
+
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.7.3...v0.7.4)
|
|
113
|
+
|
|
114
|
+
### 🚀 Enhancements
|
|
115
|
+
|
|
116
|
+
- **tenant-lifecycle:** Pause producer admission and evaluate every tenant access gate ([#366](https://github.com/AntelopeJS/dms/pull/366))
|
|
117
|
+
|
|
118
|
+
### 🩹 Fixes
|
|
119
|
+
|
|
120
|
+
- **deps:** Require the shared preview presentation contract ([#340](https://github.com/AntelopeJS/dms/pull/340))
|
|
121
|
+
- **frontend:** Read the onboarding status and permissions through the data layer ([#357](https://github.com/AntelopeJS/dms/pull/357))
|
|
122
|
+
|
|
123
|
+
### 🏡 Chore
|
|
124
|
+
|
|
125
|
+
- **release:** @antelopejs/dms v0.9.5 ([a8e395eb](https://github.com/AntelopeJS/dms/commit/a8e395eb))
|
|
126
|
+
|
|
127
|
+
### ❤️ Contributors
|
|
128
|
+
|
|
129
|
+
- Antony Rizzitelli <rizzitelli.antony@pm.me>
|
|
130
|
+
- Alessandro Aloisio ([@alessaloisio](http://github.com/alessaloisio))
|
|
131
|
+
|
|
3
132
|
## v0.7.3
|
|
4
133
|
|
|
5
134
|
[compare changes](https://github.com/AntelopeJS/dms/compare/interface-v0.7.2...v0.7.3)
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -40,17 +40,17 @@ export declare namespace internal {
|
|
|
40
40
|
/**
|
|
41
41
|
* Authentication decorator that returns raw user data, ignoring email validation.
|
|
42
42
|
*/
|
|
43
|
-
export declare const AuthRawUser: (validator?:
|
|
43
|
+
export declare const AuthRawUser: (validator?: ((data: TenantTokenInput) => boolean | User | Promise<boolean | User>) | undefined) => import("@antelopejs/interface-core/decorators").ClassDecorator<import("@antelopejs/interface-core/decorators").Class<any, any[]>> & import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator;
|
|
44
44
|
/**
|
|
45
45
|
* Authentication decorator that provides the `User` instance and enforces email validation
|
|
46
46
|
* if required by the configuration.
|
|
47
47
|
*/
|
|
48
|
-
export declare const AuthUser: (validator?:
|
|
48
|
+
export declare const AuthUser: (validator?: ((data: TenantTokenInput) => boolean | User | Promise<boolean | User>) | undefined) => import("@antelopejs/interface-core/decorators").ClassDecorator<import("@antelopejs/interface-core/decorators").Class<any, any[]>> & import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator;
|
|
49
49
|
/**
|
|
50
50
|
* Optional authentication decorator that returns User | undefined without throwing 401
|
|
51
51
|
* Use this for routes that work both when authenticated and unauthenticated
|
|
52
52
|
*/
|
|
53
|
-
export declare const IfAuthUser: (validator?:
|
|
53
|
+
export declare const IfAuthUser: (validator?: ((data: TenantTokenInput | undefined) => User | Promise<User | undefined> | undefined) | undefined) => import("@antelopejs/interface-core/decorators").ClassDecorator<import("@antelopejs/interface-core/decorators").Class<any, any[]>> & import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator;
|
|
54
54
|
/**
|
|
55
55
|
* Authentication decorator that requires the authenticated user to be a platform
|
|
56
56
|
* owner (`User.owner === true`). Throws 401 when no token is provided and 403
|
package/dist/auth/index.js
CHANGED
|
@@ -21,13 +21,15 @@ exports.getExternalIdentities = getExternalIdentities;
|
|
|
21
21
|
exports.announceRegistration = announceRegistration;
|
|
22
22
|
exports.createSession = createSession;
|
|
23
23
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
24
|
-
const interface_auth_1 = require("@antelopejs/interface-auth");
|
|
25
24
|
const interface_core_1 = require("@antelopejs/interface-core");
|
|
26
25
|
const logging_1 = require("@antelopejs/interface-core/logging");
|
|
27
26
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
28
27
|
const hooks_1 = require("../hooks");
|
|
29
28
|
const db_1 = require("./db");
|
|
30
29
|
const fire_and_forget_1 = require("../utils/fire-and-forget");
|
|
30
|
+
const jwt_auth_decorator_1 = require("./internal/jwt-auth-decorator");
|
|
31
|
+
const request_authenticators_1 = require("./internal/request-authenticators");
|
|
32
|
+
const constants_1 = require("../constants");
|
|
31
33
|
__exportStar(require("./request-authenticators"), exports);
|
|
32
34
|
/**
|
|
33
35
|
* Sending account e-mails and reading a user agent are DMS behaviour, not
|
|
@@ -59,6 +61,10 @@ async function authenticateRequestUser(ctx) {
|
|
|
59
61
|
if (!validated || typeof validated === "boolean") {
|
|
60
62
|
throw new interface_api_1.HTTPResult(HTTP_UNAUTHORIZED, UNAUTHORIZED_MESSAGE);
|
|
61
63
|
}
|
|
64
|
+
(0, request_authenticators_1.bindVerifiedRequestPrincipal)(ctx, {
|
|
65
|
+
userId: validated._id,
|
|
66
|
+
tenantId: decoded.tenantId || constants_1.DEFAULT_TENANT_ID,
|
|
67
|
+
});
|
|
62
68
|
return validated;
|
|
63
69
|
}
|
|
64
70
|
/**
|
|
@@ -76,8 +82,7 @@ var internal;
|
|
|
76
82
|
/**
|
|
77
83
|
* Authentication decorator that returns raw user data, ignoring email validation.
|
|
78
84
|
*/
|
|
79
|
-
exports.AuthRawUser = (0,
|
|
80
|
-
source: (req, _) => req.headers.authorization?.split(" ")[1],
|
|
85
|
+
exports.AuthRawUser = (0, jwt_auth_decorator_1.CreateJwtAuthDecorator)({
|
|
81
86
|
authenticator: internal.AuthUserAuthenticator,
|
|
82
87
|
validator: internal.AuthRawUserValidator,
|
|
83
88
|
});
|
|
@@ -85,8 +90,7 @@ exports.AuthRawUser = (0, interface_auth_1.CreateAuthDecorator)({
|
|
|
85
90
|
* Authentication decorator that provides the `User` instance and enforces email validation
|
|
86
91
|
* if required by the configuration.
|
|
87
92
|
*/
|
|
88
|
-
exports.AuthUser = (0,
|
|
89
|
-
source: (req, _) => req.headers.authorization?.split(" ")[1],
|
|
93
|
+
exports.AuthUser = (0, jwt_auth_decorator_1.CreateJwtAuthDecorator)({
|
|
90
94
|
authenticator: internal.AuthUserAuthenticator,
|
|
91
95
|
validator: internal.AuthUserValidator,
|
|
92
96
|
});
|
|
@@ -94,8 +98,7 @@ exports.AuthUser = (0, interface_auth_1.CreateAuthDecorator)({
|
|
|
94
98
|
* Optional authentication decorator that returns User | undefined without throwing 401
|
|
95
99
|
* Use this for routes that work both when authenticated and unauthenticated
|
|
96
100
|
*/
|
|
97
|
-
exports.IfAuthUser = (0,
|
|
98
|
-
source: (req, _) => req.headers.authorization?.split(" ")[1],
|
|
101
|
+
exports.IfAuthUser = (0, jwt_auth_decorator_1.CreateJwtAuthDecorator)({
|
|
99
102
|
authenticator: internal.IfAuthUserAuthenticator,
|
|
100
103
|
validator: internal.IfAuthUserValidator,
|
|
101
104
|
});
|
|
@@ -110,8 +113,7 @@ exports.IfAuthUser = (0, interface_auth_1.CreateAuthDecorator)({
|
|
|
110
113
|
* @returns Authentication decorator
|
|
111
114
|
*/
|
|
112
115
|
const AuthOwnerOnly = () => {
|
|
113
|
-
const decorator = (0,
|
|
114
|
-
source: (req, _) => req.headers.authorization?.split(" ")[1],
|
|
116
|
+
const decorator = (0, jwt_auth_decorator_1.CreateJwtAuthDecorator)({
|
|
115
117
|
authenticator: internal.AuthUserAuthenticator,
|
|
116
118
|
validator: (data) => internal.AuthOwnerOnlyValidator(data),
|
|
117
119
|
});
|
package/dist/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA0D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AAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,iBAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,aAAa,CACjC,YAA0B,EAC1B,MAAc,EACd,SAAiB,EACjB,EAAU;IAEV,MAAM,MAAM,GAAG,MAAM,IAAA,sBAAc,EAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC;SACxD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAErC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC;QACpC,MAAM;QACN,SAAS,EAAE,SAAS,IAAI,EAAE;QAC1B,EAAE,EAAE,EAAE,IAAI,EAAE;QACZ,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,EAAE,EAAE,EAAE,IAAI,SAAS;QACnB,UAAU;QACV,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,GAAG;QACd,YAAY,EAAE,GAAG;KAClB,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface VerifiedToken {
|
|
2
|
+
tenantId?: string;
|
|
3
|
+
}
|
|
4
|
+
type Authenticator<T> = (token: string | undefined) => T | Promise<T>;
|
|
5
|
+
type Validator<T, R> = (data: T) => R | Promise<R>;
|
|
6
|
+
/**
|
|
7
|
+
* `CreateAuthDecorator` for the DMS bearer token, which also binds the
|
|
8
|
+
* verified user and tenant to the request: `getRequestTenantId` then answers
|
|
9
|
+
* the tenant of a checked credential, never one read from an unverified token.
|
|
10
|
+
* Applies to a parameter, a property or a class, like `CreateAuthDecorator`;
|
|
11
|
+
* a validator passed to the decorator replaces the configured one, and then
|
|
12
|
+
* binds nothing.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function CreateJwtAuthDecorator<T extends VerifiedToken | undefined, R>(callbacks: {
|
|
17
|
+
authenticator: Authenticator<T>;
|
|
18
|
+
validator: Validator<T, R>;
|
|
19
|
+
}): (validator?: Validator<T, R> | undefined) => import("@antelopejs/interface-core/decorators").ClassDecorator<import("@antelopejs/interface-core/decorators").Class<any, any[]>> & import("@antelopejs/interface-core/decorators").PropertyDecorator & import("@antelopejs/interface-core/decorators").ParameterDecorator;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateJwtAuthDecorator = CreateJwtAuthDecorator;
|
|
4
|
+
const interface_api_1 = require("@antelopejs/interface-api");
|
|
5
|
+
const decorators_1 = require("@antelopejs/interface-core/decorators");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const request_authenticators_1 = require("./request-authenticators");
|
|
8
|
+
const CLASS_PROVIDER_DESCRIPTION = "authentication-class-provider";
|
|
9
|
+
function bearerToken(ctx) {
|
|
10
|
+
const header = ctx.rawRequest?.headers?.authorization;
|
|
11
|
+
return typeof header === "string" ? header.split(" ")[1] : undefined;
|
|
12
|
+
}
|
|
13
|
+
function isVerifiedUser(value) {
|
|
14
|
+
return (typeof value === "object" &&
|
|
15
|
+
value !== null &&
|
|
16
|
+
typeof value._id === "string");
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `CreateAuthDecorator` for the DMS bearer token, which also binds the
|
|
20
|
+
* verified user and tenant to the request: `getRequestTenantId` then answers
|
|
21
|
+
* the tenant of a checked credential, never one read from an unverified token.
|
|
22
|
+
* Applies to a parameter, a property or a class, like `CreateAuthDecorator`;
|
|
23
|
+
* a validator passed to the decorator replaces the configured one, and then
|
|
24
|
+
* binds nothing.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
function CreateJwtAuthDecorator(callbacks) {
|
|
29
|
+
return (0, decorators_1.MakeParameterAndPropertyAndClassDecorator)((target, key, index, validator) => {
|
|
30
|
+
const validate = validator ?? callbacks.validator;
|
|
31
|
+
const provider = async (ctx) => {
|
|
32
|
+
const data = await callbacks.authenticator(bearerToken(ctx));
|
|
33
|
+
const result = await validate(data);
|
|
34
|
+
// A replacement validator may skip the signature check: only the
|
|
35
|
+
// configured one, which verifies the token, binds its tenant.
|
|
36
|
+
if (!validator && data && isVerifiedUser(result)) {
|
|
37
|
+
(0, request_authenticators_1.bindVerifiedRequestPrincipal)(ctx, {
|
|
38
|
+
userId: result._id,
|
|
39
|
+
tenantId: data.tenantId || constants_1.DEFAULT_TENANT_ID,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
if (key === undefined) {
|
|
45
|
+
(0, interface_api_1.SetParameterProvider)(target.prototype, Symbol(CLASS_PROVIDER_DESCRIPTION), undefined, provider);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
(0, interface_api_1.SetParameterProvider)(target, key, index, provider);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=jwt-auth-decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt-auth-decorator.js","sourceRoot":"","sources":["../../../src/auth/internal/jwt-auth-decorator.ts"],"names":[],"mappings":";;AAsCA,wDAgCC;AArED,6DAAiE;AACjE,sEAAkG;AAClG,+CAAoD;AACpD,qEAAwE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C;YACtB,IAAA,oCAAoB,EACjB,MAAgC,CAAC,SAAS,EAC3C,MAAM,CAAC,0BAA0B,CAAC,EAClC,SAAS,EACT,QAAQ,CACT,CAAC;YACF,OAAO;QACT,CAAC;QACD,IAAA,oCAAoB,EAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { type RequestContext } from "@antelopejs/interface-api";
|
|
2
2
|
import type { RequestAuthenticator, RequestPrincipal } from "../request-authenticators";
|
|
3
|
+
interface RequestIdentity {
|
|
4
|
+
userId: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
}
|
|
3
7
|
/** @internal Read only a successfully authenticated, unchanged request's tenant. */
|
|
4
8
|
export declare function getAuthenticatedRequestTenantId(ctx: RequestContext): string | undefined;
|
|
5
9
|
/** @internal Revalidate on every call; failures poison tenant resolution for this request. */
|
|
6
10
|
export declare function resolveRequestPrincipal(ctx: RequestContext, authenticators: readonly RequestAuthenticator[], authenticateJwt: (token: string) => Promise<RequestPrincipal>): Promise<RequestPrincipal>;
|
|
11
|
+
/**
|
|
12
|
+
* @internal Records the identity a JWT auth decorator has just verified, so
|
|
13
|
+
* `getRequestTenantId` reads the tenant of a checked credential. A request
|
|
14
|
+
* already bound to another identity, or to a failed authentication, or whose
|
|
15
|
+
* credential changed since, is refused.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bindVerifiedRequestPrincipal(ctx: RequestContext, identity: RequestIdentity): void;
|
|
18
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAuthenticatedRequestTenantId = getAuthenticatedRequestTenantId;
|
|
4
4
|
exports.resolveRequestPrincipal = resolveRequestPrincipal;
|
|
5
|
+
exports.bindVerifiedRequestPrincipal = bindVerifiedRequestPrincipal;
|
|
5
6
|
const interface_api_1 = require("@antelopejs/interface-api");
|
|
6
7
|
const HTTP_UNAUTHORIZED = 401;
|
|
7
8
|
const requestPrincipals = new WeakMap();
|
|
@@ -79,4 +80,25 @@ async function verifyRequestPrincipal(ctx, authenticators, authenticateJwt) {
|
|
|
79
80
|
requestPrincipals.set(request, { authorization, principal: snapshot });
|
|
80
81
|
return principal;
|
|
81
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal Records the identity a JWT auth decorator has just verified, so
|
|
85
|
+
* `getRequestTenantId` reads the tenant of a checked credential. A request
|
|
86
|
+
* already bound to another identity, or to a failed authentication, or whose
|
|
87
|
+
* credential changed since, is refused.
|
|
88
|
+
*/
|
|
89
|
+
function bindVerifiedRequestPrincipal(ctx, identity) {
|
|
90
|
+
const request = ctx.rawRequest;
|
|
91
|
+
const authorization = request.headers.authorization;
|
|
92
|
+
const previous = requestPrincipals.get(request);
|
|
93
|
+
if (previous) {
|
|
94
|
+
if (!previous.principal ||
|
|
95
|
+
previous.authorization !== authorization ||
|
|
96
|
+
previous.principal.userId !== identity.userId ||
|
|
97
|
+
previous.principal.tenantId !== identity.tenantId) {
|
|
98
|
+
throw unauthorized();
|
|
99
|
+
}
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
requestPrincipals.set(request, { authorization, principal: { ...identity } });
|
|
103
|
+
}
|
|
82
104
|
//# sourceMappingURL=request-authenticators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-authenticators.js","sourceRoot":"","sources":["../../../src/auth/internal/request-authenticators.ts"],"names":[],"mappings":";;AAiCA,0EAYC;AA8BD,0DAkBC;
|
|
1
|
+
{"version":3,"file":"request-authenticators.js","sourceRoot":"","sources":["../../../src/auth/internal/request-authenticators.ts"],"names":[],"mappings":";;AAiCA,0EAYC;AA8BD,0DAkBC;AA4CD,oEAmBC;AA3JD,6DAA4E;AAM5E,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAY9B,MAAM,iBAAiB,GAAG,IA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QAAQ,CAAC,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;YAC7C,QAAQ,CAAC,SAAS,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,EACjD,CAAC;YACD,MAAM,YAAY,EAAE,CAAC;QACvB,CAAC;QACD,OAAO;IACT,CAAC;IACD,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -179,8 +179,8 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
179
179
|
icon?: string | undefined;
|
|
180
180
|
meta?: BlockText[] | undefined;
|
|
181
181
|
to?: string | undefined;
|
|
182
|
-
detail?: BlockText | undefined;
|
|
183
182
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
183
|
+
detail?: BlockText | undefined;
|
|
184
184
|
unread?: boolean | undefined;
|
|
185
185
|
}, {
|
|
186
186
|
title: BlockText;
|
|
@@ -191,8 +191,8 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
191
191
|
icon?: string | undefined;
|
|
192
192
|
meta?: BlockText[] | undefined;
|
|
193
193
|
to?: string | undefined;
|
|
194
|
-
detail?: BlockText | undefined;
|
|
195
194
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
195
|
+
detail?: BlockText | undefined;
|
|
196
196
|
unread?: boolean | undefined;
|
|
197
197
|
}>, "many">>;
|
|
198
198
|
count: z.ZodOptional<z.ZodNumber>;
|
|
@@ -232,8 +232,8 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
232
232
|
icon?: string | undefined;
|
|
233
233
|
meta?: BlockText[] | undefined;
|
|
234
234
|
to?: string | undefined;
|
|
235
|
-
detail?: BlockText | undefined;
|
|
236
235
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
236
|
+
detail?: BlockText | undefined;
|
|
237
237
|
unread?: boolean | undefined;
|
|
238
238
|
}[] | undefined;
|
|
239
239
|
maxItems?: number | undefined;
|
|
@@ -242,7 +242,6 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
242
242
|
fetchUrl?: string | undefined;
|
|
243
243
|
fetchUrlMethod?: import("./types").HttpMethod | undefined;
|
|
244
244
|
periodScope?: string | undefined;
|
|
245
|
-
wrap?: boolean | undefined;
|
|
246
245
|
mono?: boolean | undefined;
|
|
247
246
|
realtimeTopic?: string | string[] | undefined;
|
|
248
247
|
fillHeight?: boolean | undefined;
|
|
@@ -256,6 +255,7 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
256
255
|
}[] | undefined;
|
|
257
256
|
groupByDay?: boolean | undefined;
|
|
258
257
|
visibleItems?: number | undefined;
|
|
258
|
+
wrap?: boolean | undefined;
|
|
259
259
|
empty?: {
|
|
260
260
|
title: string;
|
|
261
261
|
description?: string | undefined;
|
|
@@ -271,8 +271,8 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
271
271
|
icon?: string | undefined;
|
|
272
272
|
meta?: BlockText[] | undefined;
|
|
273
273
|
to?: string | undefined;
|
|
274
|
-
detail?: BlockText | undefined;
|
|
275
274
|
tone?: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral" | undefined;
|
|
275
|
+
detail?: BlockText | undefined;
|
|
276
276
|
unread?: boolean | undefined;
|
|
277
277
|
}[] | undefined;
|
|
278
278
|
maxItems?: number | undefined;
|
|
@@ -282,7 +282,6 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
282
282
|
fetchUrlMethod?: import("./types").HttpMethod | undefined;
|
|
283
283
|
card?: boolean | undefined;
|
|
284
284
|
periodScope?: string | undefined;
|
|
285
|
-
wrap?: boolean | undefined;
|
|
286
285
|
mono?: boolean | undefined;
|
|
287
286
|
realtimeTopic?: string | string[] | undefined;
|
|
288
287
|
fillHeight?: boolean | undefined;
|
|
@@ -296,6 +295,7 @@ export declare const ActivityFeedSchema: z.ZodObject<{
|
|
|
296
295
|
}[] | undefined;
|
|
297
296
|
groupByDay?: boolean | undefined;
|
|
298
297
|
visibleItems?: number | undefined;
|
|
298
|
+
wrap?: boolean | undefined;
|
|
299
299
|
empty?: {
|
|
300
300
|
title: string;
|
|
301
301
|
description?: string | undefined;
|
|
@@ -223,6 +223,22 @@ export interface BlockTypeDefinition {
|
|
|
223
223
|
fixedOptions?: Record<string, unknown>;
|
|
224
224
|
/** Whether the factory takes a leading controller class before its options. */
|
|
225
225
|
controllerArg?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* The children an editor places in a new block of this type, as the
|
|
228
|
+
* module-side helper places them in code: `pageToolbar()`'s `LiveToggle`
|
|
229
|
+
* and `PeriodSelector` with their defaults. An editor reads them here
|
|
230
|
+
* rather than keeping its own copy of those defaults.
|
|
231
|
+
*/
|
|
232
|
+
initialChildren?: BlockInitialChild[];
|
|
233
|
+
}
|
|
234
|
+
/** One child a new block starts with (see `BlockTypeDefinition.initialChildren`). */
|
|
235
|
+
export interface BlockInitialChild {
|
|
236
|
+
/** The child id under its parent, the one roles name it by. */
|
|
237
|
+
id: string;
|
|
238
|
+
/** The child's block type, a key of the catalog (`LiveToggle`). */
|
|
239
|
+
type: string;
|
|
240
|
+
/** The child's options, JSON-serializable. */
|
|
241
|
+
options: Record<string, unknown>;
|
|
226
242
|
}
|
|
227
243
|
/** A block type as reported by `ListBlockTypes`, with its schemas described. */
|
|
228
244
|
export interface BlockTypeDescriptor extends Omit<BlockTypeDefinition, "schema" | "childMeta"> {
|
package/dist/base/block-types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,mBAAiB;AACjB,4BAA0B;AAC1B,sBAAoB;AACpB,yBAAuB;AACvB,mBAAiB;AACjB,2BAAyB;AACzB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"block-types.js","sourceRoot":"","sources":["../../src/base/block-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,2BAAyB;AACzB,oBAAkB;AAClB,kBAAgB;AAChB,oCAAkC;AAClC,wBAAsB;AACtB,wBAAsB;AACtB,yBAAuB;AACvB,+BAA6B;AAC7B,kBAAgB;AAChB,mBAAiB;AACjB,4BAA0B;AAC1B,sBAAoB;AACpB,yBAAuB;AACvB,mBAAiB;AACjB,2BAAyB;AACzB,0BAAwB;AACxB,6BAA2B;AAC3B,yBAAuB;AACvB,kCAAgC;AAChC,qBAAmB;AACnB,mBAAiB;AACjB,wBAAsB;AACtB,iBAAe;AACf,+BAA6B;AAC7B,2BAAyB;AAEzB,2EAA2E;AAC3E,6DAA6D;AAC7D,iDAA+B;AAC/B,2DAAyC;AACzC,4DAA0C;AAC1C,yDAAuC"}
|
|
@@ -24,6 +24,12 @@ export interface ChartCardProps extends BaseComponentProps {
|
|
|
24
24
|
currencyCode?: string;
|
|
25
25
|
valuePrecision?: ValuePrecision;
|
|
26
26
|
showDelta?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Treat an increase as bad, for a metric where lower is better (errors,
|
|
29
|
+
* latency): a rising delta shows in the error colour, a falling one in the
|
|
30
|
+
* success colour. The arrow still follows the raw direction.
|
|
31
|
+
*/
|
|
32
|
+
invert?: boolean;
|
|
27
33
|
/**
|
|
28
34
|
* The card's own legend, "Period" and "Comparison" in its head, drawn when
|
|
29
35
|
* the route answers a comparison. Defaults to `true`.
|
|
@@ -36,6 +42,12 @@ export interface ChartCardProps extends BaseComponentProps {
|
|
|
36
42
|
*/
|
|
37
43
|
showSeriesLegend?: boolean;
|
|
38
44
|
primaryLabel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The legend's name for the comparison series. Optional: with a
|
|
47
|
+
* `periodScope`, it names the comparison its selector applies ("Previous
|
|
48
|
+
* year"), else "Comparison". With no comparison selected, the card draws no
|
|
49
|
+
* change, no "vs" figure and no comparison series.
|
|
50
|
+
*/
|
|
39
51
|
comparisonLabel?: string;
|
|
40
52
|
}
|
|
41
53
|
export interface ChartCardBuilderOptions extends ChartCardProps {
|
|
@@ -61,6 +73,7 @@ export declare const ChartCardSchema: z.ZodObject<{
|
|
|
61
73
|
valueFormat: z.ZodOptional<z.ZodEnum<["number", "currency", "percent", "compact"]>>;
|
|
62
74
|
currencyCode: z.ZodOptional<z.ZodString>;
|
|
63
75
|
showDelta: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
invert: z.ZodOptional<z.ZodBoolean>;
|
|
64
77
|
showLegend: z.ZodDefault<z.ZodBoolean>;
|
|
65
78
|
showSeriesLegend: z.ZodOptional<z.ZodBoolean>;
|
|
66
79
|
primaryLabel: z.ZodOptional<z.ZodString>;
|
|
@@ -78,6 +91,7 @@ export declare const ChartCardSchema: z.ZodObject<{
|
|
|
78
91
|
realtimeTopic?: string | string[] | undefined;
|
|
79
92
|
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
80
93
|
currencyCode?: string | undefined;
|
|
94
|
+
invert?: boolean | undefined;
|
|
81
95
|
showSeriesLegend?: boolean | undefined;
|
|
82
96
|
primaryLabel?: string | undefined;
|
|
83
97
|
comparisonLabel?: string | undefined;
|
|
@@ -94,6 +108,7 @@ export declare const ChartCardSchema: z.ZodObject<{
|
|
|
94
108
|
valueFormat?: "number" | "percent" | "compact" | "currency" | undefined;
|
|
95
109
|
currencyCode?: string | undefined;
|
|
96
110
|
showDelta?: boolean | undefined;
|
|
111
|
+
invert?: boolean | undefined;
|
|
97
112
|
showSeriesLegend?: boolean | undefined;
|
|
98
113
|
primaryLabel?: string | undefined;
|
|
99
114
|
comparisonLabel?: string | undefined;
|
package/dist/base/chart-card.js
CHANGED
|
@@ -97,6 +97,10 @@ exports.ChartCardSchema = zod_1.z.object({
|
|
|
97
97
|
group: "appearance",
|
|
98
98
|
widget: "switch",
|
|
99
99
|
}),
|
|
100
|
+
invert: (0, block_registry_1.ui)(zod_1.z
|
|
101
|
+
.boolean()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe("Treat a falling value as the good outcome."), { label: "Invert variation", group: "behavior", widget: "switch" }),
|
|
100
104
|
showLegend: (0, block_registry_1.ui)(zod_1.z.boolean().default(true), {
|
|
101
105
|
label: "Show legend",
|
|
102
106
|
group: "appearance",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-card.js","sourceRoot":"","sources":["../../src/base/chart-card.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"chart-card.js","sourceRoot":"","sources":["../../src/base/chart-card.ts"],"names":[],"mappings":";;;AAyFA,8BAgBC;AAzGD,4CAAgE;AAChE,6BAAwB;AACxB,qDAK0B;AAC1B,mCAA+E;AAC/E,4DAA6D;AAC7D,uCAAqD;AACrD,gEAAsE;AAEtE,uCAA0C;AAsD1C,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AACnD,MAAM,eAAe,GAAG,OAAO,CAAC;AAChC;;;GAGG;AACH,MAAM,2BAA2B,GAAG;IAClC,OAAO;IACP,aAAa;IACb,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,aAAa;IACb,eAAe;CAChB,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,SAAS,CACvB,OAAiC;IAEjC,MAAM,EAAE,KAAK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