@antelopejs/dms 0.20.2 → 0.20.4
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 +49 -0
- package/README.md +1 -1
- package/dist/config/internal/state.d.ts +5 -3
- package/dist/config/internal/state.js +9 -1
- package/dist/config/internal/state.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/connection-targets.d.ts +2 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js +276 -0
- package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js +1 -0
- package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
- package/dist/implementations/dms-builder/engine/driver-packages.js +16 -4
- package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
- package/dist/implementations/dms-builder/engine/index.js +1 -0
- package/dist/implementations/dms-builder/engine/index.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -1
- package/dist/implementations/dms-html-render/index.js +5 -2
- package/dist/implementations/dms-html-render/index.js.map +1 -1
- package/dist/mcp/page-verify/index.d.ts +1 -0
- package/dist/mcp/page-verify/index.js +1 -0
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/redact-report.d.ts +2 -0
- package/dist/mcp/page-verify/redact-report.js +120 -0
- package/dist/mcp/page-verify/redact-report.js.map +1 -0
- package/dist/mcp/page-verify/render.js +4 -1
- package/dist/mcp/page-verify/render.js.map +1 -1
- package/dist/mcp/redact.d.ts +87 -0
- package/dist/mcp/redact.js +139 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/tools/builder-compose.js +11 -2
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-project.js +59 -26
- package/dist/mcp/tools/builder-project.js.map +1 -1
- package/dist/mcp/tools/builder-queries.js +41 -4
- package/dist/mcp/tools/builder-queries.js.map +1 -1
- package/dist/mcp/tools/builder-shared.d.ts +3 -1
- package/dist/mcp/tools/builder-shared.js +5 -0
- package/dist/mcp/tools/builder-shared.js.map +1 -1
- package/dist/mcp/tools/database.js +3 -2
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/page-verify.js +3 -2
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/frontend-vue/dms.frontend.ts +6 -2
- package/frontend-vue/eslint-globals.generated.mjs +259 -942
- package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +5 -3
- package/frontend-vue/layers/dms-auth/app/composables/useOAuthErrorToast.ts +6 -4
- package/frontend-vue/layers/dms-auth/app/composables/usePostLoginRedirect.ts +3 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +12 -4
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +1 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +12 -6
- package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +4 -2
- package/frontend-vue/layers/dms-auth/server/oauth.ts +13 -7
- package/frontend-vue/layers/dms-auth/server/session.ts +37 -6
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
- package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
- package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
- package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
- package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
- package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
- package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
- package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
- package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
- package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
- package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
- package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
- package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
- package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
- package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
- package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
- package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
- package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
- package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
- package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
- package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
- package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
- package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
- package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
- package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
- package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
- package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
- package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
- package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +5 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +11 -13
- package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +6 -2
- package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +12 -10
- package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +7 -4
- package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +59 -31
- package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +2 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +37 -24
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -4
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/profile/ProfileSummaryRow.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/security/SecuritySessions.vue +35 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +2 -2
- package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +4 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +26 -4
- package/frontend-vue/layers/dms-layout/app/build/composables/security/useSessionHandoff.ts +3 -6
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useAccountData.ts +16 -12
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +12 -9
- package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +13 -6
- package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +81 -0
- package/frontend-vue/layers/dms-layout/app/build/utils/submittedUrl.ts +14 -0
- package/frontend-vue/layers/dms-layout/app/components/AppWidgetsDock.vue +3 -1
- package/frontend-vue/layers/dms-layout/app/composables/general/useSystemState.ts +4 -5
- package/frontend-vue/layers/dms-layout/app/composables/layout/useServedHeaderActions.ts +7 -5
- package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStoreActions.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +17 -4
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageComponentPreload.ts +15 -7
- package/frontend-vue/layers/dms-layout/app/composables/page/usePageRecordDeletion.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/composables/profile/useUserLanguage.ts +3 -2
- package/frontend-vue/layers/dms-layout/app/composables/useCommandPaletteSources.ts +20 -2
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/roles.vue +5 -1
- package/frontend-vue/layers/dms-layout/app/custom-pages/settings/shortcuts.vue +4 -1
- package/frontend-vue/layers/dms-layout/app/pages/[...slug].vue +13 -5
- package/frontend-vue/layers/dms-layout/app/plugins/command-palette-session.client.ts +8 -8
- package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-mcp-navigate.client.ts +4 -2
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +3 -3
- package/frontend-vue/layers/dms-layout/app/plugins/notification-stream.client.ts +47 -40
- package/frontend-vue/layers/dms-layout/app/plugins/permission-preview.client.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/plugins/profile-sync.client.ts +3 -10
- package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +2 -2
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +3 -2
- package/frontend-vue/layers/dms-layout/server/html-render.ts +5 -1
- package/frontend-vue/layers/dms-layout/server/render-token.ts +3 -2
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -1
- package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
- package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
- package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
- package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetActions.ts +24 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetConfirmation.ts +53 -30
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +8 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetTypes.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowNavigation.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +156 -99
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +194 -161
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/blockDataState.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useGuard.ts +38 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +34 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexSeriesStyle.ts +32 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +13 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/useActionConfirm.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +23 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultChoiceTypes.ts +11 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +7 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +22 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +5 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +10 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +8 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +12 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +4 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +10 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +21 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/detach.ts +9 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/files/useFileMetadata.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +38 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +6 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +19 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentCancel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +28 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +5 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +15 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/form/registerFormFunctions.ts +7 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/form/stringSet.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +60 -16
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +5 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +13 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/layout/rowSidePanel.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/currentPageLive.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/live/liveCadence.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/missedTally.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/live/pageLiveController.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/live/usePageDataRefresh.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +42 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +63 -46
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnStructure.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +71 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableStates.ts +6 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/rowId.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +21 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionBulkRequests.ts +3 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +1 -17
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionNavigation.ts +12 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +25 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewCounts.ts +4 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +18 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewEvents.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickActions.ts +4 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickFilters.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useCardFields.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useReorderHandles.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +2 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +19 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRecordLink.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableReorder.ts +7 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/bulkActions.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +14 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/expandedRows.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +12 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/reorder.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/sortableColumns.ts +38 -9
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableCounts.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +14 -11
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +22 -12
- package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +27 -6
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
- package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
- package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
- package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
- package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
- package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
- package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
- package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
- package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
- package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
- package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
- package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
- package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
- package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
- package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
- package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
- package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
- package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
- package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
- package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
- package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
- package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
- package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
- package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
- package/frontend-vue/lazy-plugin.ts +1 -1
- package/frontend-vue/package.json +5 -4
- package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
- package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
- package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
- package/frontend-vue/scripts/check-dms-components.mjs +152 -246
- package/frontend-vue/scripts/check-invariants.mjs +100 -42
- package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
- package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
- package/frontend-vue/scripts/dms-components-script.mjs +375 -0
- package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
- package/frontend-vue/scripts/jsconfig.json +10 -0
- package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
- package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
- package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
- package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
- package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
- package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
- package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
- package/frontend-vue/scripts/test-dms-components.mjs +70 -5
- package/frontend-vue/server/request-body.ts +29 -5
- package/package.json +5 -3
- package/frontend-vue/eslint-test-quality.mjs +0 -62
|
@@ -6,7 +6,15 @@ import {
|
|
|
6
6
|
type StreamRecovery,
|
|
7
7
|
} from "../../build/utils/sharedRealtimeConnection";
|
|
8
8
|
import { HTTP_UNAUTHORIZED } from "../../utils/http-status";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
isNumber,
|
|
11
|
+
isObject,
|
|
12
|
+
isString,
|
|
13
|
+
isUndefined,
|
|
14
|
+
} from "../../utils/type-check";
|
|
15
|
+
import { isJsonObject } from "../../build/utils/json";
|
|
16
|
+
import { isRecord } from "../../build/utils/record";
|
|
17
|
+
import type { JsonValue } from "../../types/json";
|
|
10
18
|
|
|
11
19
|
const REALTIME_CONNECTION_PATH = "/api/realtime/connection";
|
|
12
20
|
const REALTIME_SESSION_PATH = "/api/realtime/session";
|
|
@@ -32,7 +40,7 @@ type RealtimeFrameData = Parameters<
|
|
|
32
40
|
export interface RealtimeEvent {
|
|
33
41
|
topic: string;
|
|
34
42
|
type: string;
|
|
35
|
-
payload?:
|
|
43
|
+
payload?: { [key: string]: JsonValue };
|
|
36
44
|
actorId?: string;
|
|
37
45
|
ts: number;
|
|
38
46
|
}
|
|
@@ -132,27 +140,52 @@ const dispatchToHandlers = (
|
|
|
132
140
|
for (const handler of handlers) handler(event);
|
|
133
141
|
};
|
|
134
142
|
|
|
143
|
+
const isOptionalString = (value: unknown): value is string | undefined =>
|
|
144
|
+
isUndefined(value) || isString(value);
|
|
145
|
+
|
|
146
|
+
const isSnapshotEntry = (
|
|
147
|
+
value: unknown,
|
|
148
|
+
): value is RealtimeSnapshotEvent["entries"][number] =>
|
|
149
|
+
isRecord(value) &&
|
|
150
|
+
isString(value.topic) &&
|
|
151
|
+
isString(value.rowId) &&
|
|
152
|
+
isRecord(value.actor) &&
|
|
153
|
+
isString(value.actor.id) &&
|
|
154
|
+
isOptionalString(value.actor.displayName) &&
|
|
155
|
+
isOptionalString(value.actor.avatarUrl) &&
|
|
156
|
+
isString(value.sessionId) &&
|
|
157
|
+
isString(value.instanceId) &&
|
|
158
|
+
isNumber(value.since);
|
|
159
|
+
|
|
135
160
|
const isSnapshotEvent = (
|
|
136
161
|
eventName: string,
|
|
137
162
|
data: RealtimeFrameData,
|
|
138
163
|
): data is RealtimeSnapshotEvent =>
|
|
139
|
-
eventName === SNAPSHOT_EVENT &&
|
|
164
|
+
eventName === SNAPSHOT_EVENT &&
|
|
165
|
+
isRecord(data) &&
|
|
166
|
+
isString(data.topic) &&
|
|
167
|
+
Array.isArray(data.entries) &&
|
|
168
|
+
data.entries.every(isSnapshotEntry);
|
|
140
169
|
|
|
141
170
|
const isRealtimeEvent = (data: RealtimeFrameData): data is RealtimeEvent =>
|
|
142
|
-
!!data &&
|
|
171
|
+
!!data &&
|
|
172
|
+
isObject(data) &&
|
|
173
|
+
isString(data.topic) &&
|
|
174
|
+
isString(data.type) &&
|
|
175
|
+
(isUndefined(data.payload) || isJsonObject(data.payload));
|
|
143
176
|
|
|
144
177
|
/** Takes the session a greeting names, with the menu topics it announces. */
|
|
145
178
|
const handleHello = (
|
|
146
179
|
state: UserRealtimeState,
|
|
147
|
-
|
|
180
|
+
sessionId: string,
|
|
181
|
+
greeting: SessionGreeting,
|
|
148
182
|
): void => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const { menuTopics } = data;
|
|
183
|
+
state.sessionId.value = sessionId;
|
|
184
|
+
const { menuTopics } = greeting;
|
|
152
185
|
state.menuTopics.value = Array.isArray(menuTopics)
|
|
153
186
|
? menuTopics.filter((topic): topic is string => isString(topic))
|
|
154
187
|
: [];
|
|
155
|
-
const { devReloadTopic } =
|
|
188
|
+
const { devReloadTopic } = greeting;
|
|
156
189
|
state.devReloadTopic.value = isString(devReloadTopic)
|
|
157
190
|
? devReloadTopic
|
|
158
191
|
: undefined;
|
|
@@ -180,6 +213,7 @@ interface ConnectionCallbacks extends StreamRecovery {
|
|
|
180
213
|
interface SessionGreeting {
|
|
181
214
|
sessionId?: unknown;
|
|
182
215
|
menuTopics?: unknown;
|
|
216
|
+
devReloadTopic?: unknown;
|
|
183
217
|
}
|
|
184
218
|
|
|
185
219
|
interface BufferedFrame {
|
|
@@ -192,7 +226,8 @@ const readGreeting = async (
|
|
|
192
226
|
response: Response,
|
|
193
227
|
): Promise<SessionGreeting | null> => {
|
|
194
228
|
try {
|
|
195
|
-
|
|
229
|
+
const greeting: unknown = await response.json();
|
|
230
|
+
return isRecord(greeting) ? greeting : null;
|
|
196
231
|
} catch {
|
|
197
232
|
return null;
|
|
198
233
|
}
|
|
@@ -233,24 +268,9 @@ const connectTab = (
|
|
|
233
268
|
const retries = createReconnector();
|
|
234
269
|
const sessionCloseUrl = `${baseUrl}${REALTIME_SESSION_CLOSE_PATH}`;
|
|
235
270
|
let connectionId: string | undefined;
|
|
236
|
-
|
|
237
271
|
let attempt = 0;
|
|
238
|
-
|
|
239
272
|
let buffered: BufferedFrame[] | undefined;
|
|
240
273
|
|
|
241
|
-
const adopt = (forConnection: string, greeting: SessionGreeting) => {
|
|
242
|
-
const sessionId = String(greeting.sessionId);
|
|
243
|
-
handleHello(state, greeting);
|
|
244
|
-
const pending = buffered ?? [];
|
|
245
|
-
buffered = undefined;
|
|
246
|
-
for (const frame of pending) {
|
|
247
|
-
if (frame.sessionId === sessionId) dispatch(frame.eventName, frame.data);
|
|
248
|
-
}
|
|
249
|
-
retries.resetDelay();
|
|
250
|
-
connection.announceSession(forConnection, sessionId);
|
|
251
|
-
callbacks.onConnected();
|
|
252
|
-
};
|
|
253
|
-
|
|
254
274
|
const openSession = async (forConnection: string): Promise<void> => {
|
|
255
275
|
const ownAttempt = ++attempt;
|
|
256
276
|
const isCurrent = () =>
|
|
@@ -258,15 +278,14 @@ const connectTab = (
|
|
|
258
278
|
connectionId === forConnection &&
|
|
259
279
|
attempt === ownAttempt;
|
|
260
280
|
const retry = () =>
|
|
261
|
-
retries.schedule(() => {
|
|
262
|
-
if (isCurrent())
|
|
281
|
+
retries.schedule(async () => {
|
|
282
|
+
if (isCurrent()) await openSession(forConnection);
|
|
263
283
|
});
|
|
264
284
|
buffered = [];
|
|
265
285
|
let response: Response;
|
|
266
286
|
try {
|
|
267
287
|
response = await fetch(`${baseUrl}${REALTIME_SESSION_PATH}`, {
|
|
268
288
|
method: "POST",
|
|
269
|
-
|
|
270
289
|
headers: { [CONNECTION_HEADER]: forConnection },
|
|
271
290
|
credentials: "include",
|
|
272
291
|
});
|
|
@@ -298,17 +317,25 @@ const connectTab = (
|
|
|
298
317
|
});
|
|
299
318
|
return;
|
|
300
319
|
}
|
|
301
|
-
|
|
320
|
+
handleHello(state, sessionId, greeting!);
|
|
321
|
+
const pending = buffered ?? [];
|
|
322
|
+
buffered = undefined;
|
|
323
|
+
for (const frame of pending) {
|
|
324
|
+
if (frame.sessionId === sessionId) dispatch(frame.eventName, frame.data);
|
|
325
|
+
}
|
|
326
|
+
retries.resetDelay();
|
|
327
|
+
connection.announceSession(forConnection, sessionId);
|
|
328
|
+
callbacks.onConnected();
|
|
302
329
|
};
|
|
303
330
|
|
|
304
|
-
const renewSession = () => {
|
|
331
|
+
const renewSession = async () => {
|
|
305
332
|
if (retries.isCancelled() || !connectionId) return;
|
|
306
333
|
const sessionId = state.sessionId.value;
|
|
307
334
|
if (sessionId) {
|
|
308
335
|
closeStraySession(sessionCloseUrl, connectionId, sessionId);
|
|
309
336
|
callbacks.onDisconnected();
|
|
310
337
|
}
|
|
311
|
-
|
|
338
|
+
await openSession(connectionId);
|
|
312
339
|
};
|
|
313
340
|
|
|
314
341
|
const connection = joinSharedRealtimeConnection({
|
|
@@ -316,11 +343,11 @@ const connectTab = (
|
|
|
316
343
|
streamUrl: `${baseUrl}${REALTIME_CONNECTION_PATH}`,
|
|
317
344
|
sessionCloseUrl,
|
|
318
345
|
onConnection: (next) => {
|
|
319
|
-
if (retries.isCancelled()) return;
|
|
346
|
+
if (retries.isCancelled()) return undefined;
|
|
320
347
|
if (state.sessionId.value) callbacks.onDisconnected();
|
|
321
348
|
buffered = undefined;
|
|
322
349
|
connectionId = next;
|
|
323
|
-
|
|
350
|
+
return next ? openSession(next) : undefined;
|
|
324
351
|
},
|
|
325
352
|
onFrame: (sessionId, eventName, data) => {
|
|
326
353
|
if (sessionId === undefined) {
|
|
@@ -328,10 +355,7 @@ const connectTab = (
|
|
|
328
355
|
return;
|
|
329
356
|
}
|
|
330
357
|
if (sessionId === state.sessionId.value) {
|
|
331
|
-
if (eventName === SESSION_ENDED_EVENT)
|
|
332
|
-
renewSession();
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
358
|
+
if (eventName === SESSION_ENDED_EVENT) return renewSession();
|
|
335
359
|
dispatch(eventName, data);
|
|
336
360
|
return;
|
|
337
361
|
}
|
|
@@ -353,19 +377,15 @@ const connectTab = (
|
|
|
353
377
|
};
|
|
354
378
|
};
|
|
355
379
|
|
|
356
|
-
interface PageSubscriptionAnswer {
|
|
357
|
-
topics?: unknown;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
380
|
/** The topics a page subscription answered, none when it answered none. */
|
|
361
381
|
const readPageTopics = async (response: Response): Promise<string[]> => {
|
|
362
|
-
let answer:
|
|
382
|
+
let answer: unknown;
|
|
363
383
|
try {
|
|
364
384
|
answer = await response.json();
|
|
365
385
|
} catch {
|
|
366
386
|
return [];
|
|
367
387
|
}
|
|
368
|
-
const topics = answer
|
|
388
|
+
const topics = isRecord(answer) ? answer.topics : undefined;
|
|
369
389
|
return Array.isArray(topics)
|
|
370
390
|
? topics.filter((topic): topic is string => isString(topic))
|
|
371
391
|
: [];
|
|
@@ -476,8 +496,8 @@ const buildApi = (): UserRealtimeApi => {
|
|
|
476
496
|
state.menuTopics.value = [];
|
|
477
497
|
if (userKey === undefined) return;
|
|
478
498
|
state.connection = connectTab(state, baseUrl, userKey, {
|
|
479
|
-
onConnected: () => {
|
|
480
|
-
|
|
499
|
+
onConnected: async () => {
|
|
500
|
+
await reconcilePage(state, baseUrl);
|
|
481
501
|
},
|
|
482
502
|
onDisconnected: () => resetSession(state),
|
|
483
503
|
refreshSession,
|
|
@@ -489,7 +509,9 @@ const buildApi = (): UserRealtimeApi => {
|
|
|
489
509
|
|
|
490
510
|
watch(
|
|
491
511
|
() => sessionScopeOf(session?.value),
|
|
492
|
-
() =>
|
|
512
|
+
() => {
|
|
513
|
+
state.connection?.renewSession();
|
|
514
|
+
},
|
|
493
515
|
);
|
|
494
516
|
}
|
|
495
517
|
|
|
@@ -35,13 +35,16 @@ export interface PresentApiErrorOptions extends ResolveApiErrorOptions {
|
|
|
35
35
|
readonly replaceToastId?: ApiErrorToastId;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** Anything thrown or rejected, as `decodeApiFailure` reads it. */
|
|
39
|
+
type ApiFailure = Parameters<typeof decodeApiFailure>[0];
|
|
40
|
+
|
|
38
41
|
/** Captured during setup and callable after awaits. */
|
|
39
42
|
export interface ApiErrorPresenter {
|
|
40
43
|
resolveError(
|
|
41
|
-
error:
|
|
44
|
+
error: ApiFailure,
|
|
42
45
|
options: ResolveApiErrorOptions,
|
|
43
46
|
): ApiErrorNotice | null;
|
|
44
|
-
presentError(error:
|
|
47
|
+
presentError(error: ApiFailure, options: PresentApiErrorOptions): void;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
const GENERIC_KEY = "error.500.description";
|
|
@@ -53,7 +56,17 @@ const ICONS: Record<ApiErrorSeverity, string> = {
|
|
|
53
56
|
error: "i-ph-warning-circle",
|
|
54
57
|
};
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
/** A message vue-i18n compiled ahead of time: its AST, typed `0` at the root. */
|
|
60
|
+
type CompiledMessage = { type: 0 } | { t: 0 };
|
|
61
|
+
|
|
62
|
+
/** A message `rt` renders: its source text, a message function or a compiled AST. */
|
|
63
|
+
type RenderableMessage =
|
|
64
|
+
| string
|
|
65
|
+
| ((...args: never[]) => string)
|
|
66
|
+
| CompiledMessage;
|
|
67
|
+
|
|
68
|
+
function isRenderableMessage(value: unknown): value is RenderableMessage {
|
|
69
|
+
if (typeof value === "string" || typeof value === "function") return true;
|
|
57
70
|
return (
|
|
58
71
|
value !== null &&
|
|
59
72
|
typeof value === "object" &&
|
|
@@ -80,12 +93,7 @@ export function useApiErrorPresenter(): ApiErrorPresenter {
|
|
|
80
93
|
if (!key) return null;
|
|
81
94
|
try {
|
|
82
95
|
const message = i18n.tm(key.startsWith("$") ? key.slice(1) : key);
|
|
83
|
-
if (
|
|
84
|
-
typeof message !== "string" &&
|
|
85
|
-
typeof message !== "function" &&
|
|
86
|
-
!isCompiledMessage(message)
|
|
87
|
-
)
|
|
88
|
-
return null;
|
|
96
|
+
if (!isRenderableMessage(message)) return null;
|
|
89
97
|
return i18n.rt(message, params);
|
|
90
98
|
} catch {
|
|
91
99
|
return null;
|
|
@@ -110,13 +118,16 @@ export function useApiErrorPresenter(): ApiErrorPresenter {
|
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
function resolveError(
|
|
113
|
-
error:
|
|
121
|
+
error: ApiFailure,
|
|
114
122
|
options: ResolveApiErrorOptions,
|
|
115
123
|
): ApiErrorNotice | null {
|
|
116
124
|
return noticeOf(decodeApiFailure(error), options);
|
|
117
125
|
}
|
|
118
126
|
|
|
119
|
-
function presentError(
|
|
127
|
+
function presentError(
|
|
128
|
+
error: ApiFailure,
|
|
129
|
+
options: PresentApiErrorOptions,
|
|
130
|
+
): void {
|
|
120
131
|
if (import.meta.env.SSR) return;
|
|
121
132
|
const failure = decodeApiFailure(error);
|
|
122
133
|
const notice = noticeOf(failure, options);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentEventData } from "../types/component";
|
|
2
|
+
import type { ApiErrorPresenter } from "./useApiErrorPresenter";
|
|
2
3
|
|
|
3
4
|
interface EventedActionOptions {
|
|
4
5
|
componentId?: string;
|
|
@@ -12,7 +13,9 @@ interface EventedActionOptions {
|
|
|
12
13
|
interface ExecuteOptions<TResult> {
|
|
13
14
|
startPayload?: ComponentEventData["data"];
|
|
14
15
|
successPayload?: (result: TResult) => ComponentEventData["data"];
|
|
15
|
-
errorPayload?: (
|
|
16
|
+
errorPayload?: (
|
|
17
|
+
error: Parameters<ApiErrorPresenter["resolveError"]>[0],
|
|
18
|
+
) => ComponentEventData["data"];
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
export function useEventedAction<TResult = unknown>(
|
|
@@ -317,7 +317,9 @@ function lookupCode<F extends string>(
|
|
|
317
317
|
): ApiFieldError | undefined {
|
|
318
318
|
if (!code || !codes) return undefined;
|
|
319
319
|
const bare = code.startsWith("$") ? code.slice(1) : code;
|
|
320
|
-
const
|
|
320
|
+
const own = (key: string) =>
|
|
321
|
+
Object.hasOwn(codes, key) ? codes[key] : undefined;
|
|
322
|
+
const entry = own(code) ?? own(bare) ?? own(`$${bare}`);
|
|
321
323
|
if (!entry) return undefined;
|
|
322
324
|
return isString(entry)
|
|
323
325
|
? { field: entry, message: code }
|
|
@@ -484,8 +486,12 @@ export interface HandleApiErrorOptions {
|
|
|
484
486
|
export function useFieldErrors<F extends string>(
|
|
485
487
|
options: UseFieldErrorsOptions<F>,
|
|
486
488
|
) {
|
|
487
|
-
const
|
|
488
|
-
const fieldIds = Object.keys(options.fields)
|
|
489
|
+
const errorPresenter = useApiErrorPresenter();
|
|
490
|
+
const fieldIds = Object.keys(options.fields).filter((key): key is F =>
|
|
491
|
+
Object.hasOwn(options.fields, key),
|
|
492
|
+
);
|
|
493
|
+
const knownFields = new Set<string>(fieldIds);
|
|
494
|
+
const isField = (name: string): name is F => knownFields.has(name);
|
|
489
495
|
const errors: Partial<Record<F, string>> = reactive({});
|
|
490
496
|
|
|
491
497
|
function controlId(field: F): string {
|
|
@@ -547,12 +553,14 @@ export function useFieldErrors<F extends string>(
|
|
|
547
553
|
if (fields.length === 0) return false;
|
|
548
554
|
clear();
|
|
549
555
|
for (const entry of fields) {
|
|
550
|
-
|
|
556
|
+
if (!isField(entry.field)) continue;
|
|
557
|
+
errors[entry.field] = errorPresenter.resolveError(entry.message, {
|
|
551
558
|
fallbackKey: entry.fallbackKey ?? "dms.field_errors.invalid",
|
|
552
559
|
params: entry.params,
|
|
553
560
|
})?.message;
|
|
554
561
|
}
|
|
555
|
-
|
|
562
|
+
const first = fields[0]!.field;
|
|
563
|
+
if (isField(first)) await focus(first);
|
|
556
564
|
return !hasUnmatched;
|
|
557
565
|
}
|
|
558
566
|
|
|
@@ -561,7 +569,7 @@ export function useFieldErrors<F extends string>(
|
|
|
561
569
|
error: Parameters<typeof resolveApiErrorMessage>[0],
|
|
562
570
|
toastOptions: HandleApiErrorOptions,
|
|
563
571
|
) {
|
|
564
|
-
presentError(error, {
|
|
572
|
+
errorPresenter.presentError(error, {
|
|
565
573
|
fallbackKey: toastOptions.toastDescription ?? toastOptions.toastTitle,
|
|
566
574
|
});
|
|
567
575
|
}
|
|
@@ -23,9 +23,14 @@ const COOKIE_MAX_AGE_ONE_YEAR = 60 * 60 * 24 * 365;
|
|
|
23
23
|
*/
|
|
24
24
|
export const MAX_PREFERENCES_COOKIE_BYTES = 3 * 1024;
|
|
25
25
|
|
|
26
|
-
const toPlain =
|
|
26
|
+
const toPlain = (value: PreferencesTree[string]): PreferencesTree[string] =>
|
|
27
27
|
value === undefined ? value : JSON.parse(JSON.stringify(value));
|
|
28
28
|
|
|
29
|
+
const toPlainTree = (tree: PreferencesTree): PreferencesTree => {
|
|
30
|
+
const plain = toPlain(tree);
|
|
31
|
+
return isBranch(plain) ? plain : {};
|
|
32
|
+
};
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* The user's preferences, kept in the `dms-preferences` cookie so that a
|
|
31
36
|
* server render reads them too: a tree addressed by dotted paths, stored as
|
|
@@ -70,7 +75,7 @@ export const usePreferences = () => {
|
|
|
70
75
|
value: UserPreferences[string],
|
|
71
76
|
): void => {
|
|
72
77
|
const keys = keyPath.split(".");
|
|
73
|
-
const next =
|
|
78
|
+
const next = toPlainTree(tree.value);
|
|
74
79
|
writeAt(next, keys, toPlain(value));
|
|
75
80
|
markWritten(next, keys);
|
|
76
81
|
commit(next);
|
|
@@ -79,7 +84,7 @@ export const usePreferences = () => {
|
|
|
79
84
|
const removePreference = (keyPath: string): void => {
|
|
80
85
|
const keys = keyPath.split(".");
|
|
81
86
|
const lastKey = keys.pop()!;
|
|
82
|
-
const next =
|
|
87
|
+
const next = toPlainTree(tree.value);
|
|
83
88
|
const parent = keys.length === 0 ? next : readAt(next, keys);
|
|
84
89
|
if (!isBranch(parent) || !(lastKey in parent)) return;
|
|
85
90
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRecord } from "../../build/utils/record";
|
|
2
|
+
import { isNull, isString, isUndefined } from "../../utils/type-check";
|
|
2
3
|
import { ComponentId } from "../../types/watch";
|
|
3
4
|
|
|
4
5
|
function getValueByPath(
|
|
@@ -8,8 +9,9 @@ function getValueByPath(
|
|
|
8
9
|
const keys = path.split(".");
|
|
9
10
|
let current: unknown = obj;
|
|
10
11
|
for (const key of keys) {
|
|
11
|
-
if (current
|
|
12
|
-
|
|
12
|
+
if (isNull(current) || isUndefined(current)) return undefined;
|
|
13
|
+
const target: unknown = Object(current);
|
|
14
|
+
current = isRecord(target) ? target[key] : undefined;
|
|
13
15
|
}
|
|
14
16
|
return current;
|
|
15
17
|
}
|
|
@@ -41,6 +43,13 @@ interface WatchEventDetail {
|
|
|
41
43
|
|
|
42
44
|
type WatchEvent = Event & Partial<Pick<CustomEvent, "detail">>;
|
|
43
45
|
|
|
46
|
+
function isWatchEventDetail(value: unknown): value is WatchEventDetail {
|
|
47
|
+
return (
|
|
48
|
+
isRecord(value) &&
|
|
49
|
+
(isUndefined(value.component) || isString(value.component))
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
function checkParamConditions(
|
|
45
54
|
onParam: WatchAction["onParam"],
|
|
46
55
|
data: WatchEventDetail["data"],
|
|
@@ -87,7 +96,7 @@ export function useWatch(
|
|
|
87
96
|
*/
|
|
88
97
|
function runMatchingActions(
|
|
89
98
|
matchingActions: WatchAction[],
|
|
90
|
-
|
|
99
|
+
detail: WatchEventDetail,
|
|
91
100
|
) {
|
|
92
101
|
isLoading.value = true;
|
|
93
102
|
try {
|
|
@@ -98,7 +107,7 @@ export function useWatch(
|
|
|
98
107
|
}
|
|
99
108
|
// prettier-ignore
|
|
100
109
|
try {
|
|
101
|
-
actionFn(action,
|
|
110
|
+
actionFn(action, detail, componentState);
|
|
102
111
|
} catch {
|
|
103
112
|
// eslint-disable-line no-empty -- A synchronous action failure does not stop subsequent actions.
|
|
104
113
|
}
|
|
@@ -109,8 +118,8 @@ export function useWatch(
|
|
|
109
118
|
}
|
|
110
119
|
|
|
111
120
|
function handleWatchEvent(event: WatchEvent) {
|
|
112
|
-
const
|
|
113
|
-
if (!detail) {
|
|
121
|
+
const detail: unknown = event.detail;
|
|
122
|
+
if (!isWatchEventDetail(detail)) {
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
125
|
|
|
@@ -122,7 +131,7 @@ export function useWatch(
|
|
|
122
131
|
return;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
|
-
runMatchingActions(matchingActions,
|
|
134
|
+
runMatchingActions(matchingActions, detail);
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
onMounted(() => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { JsonValue } from "./json";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Mirror of the backend's module store listing (`GET /dms/store/listing`,
|
|
3
5
|
* `src/store/types.ts` in `@antelopejs/dms`).
|
|
@@ -133,7 +135,7 @@ export interface StoreDependencyChoice {
|
|
|
133
135
|
/** npm package, never a git or local source. */
|
|
134
136
|
package: string;
|
|
135
137
|
/** Config written to its antelope.config.ts entry. */
|
|
136
|
-
config?:
|
|
138
|
+
config?: { [key: string]: JsonValue };
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
/** Body of `POST /dms/store/<kind>`; only an install carries dependencies. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlockText } from "#dms-core/app/types/composed-text";
|
|
2
|
+
import type { JsonValue } from "#dms-core/app/types/json";
|
|
2
3
|
import type { BlockAction } from "#dms-core/app/entries/types/block-action";
|
|
3
4
|
import type { PageLiveOptions } from "#dms-core/app/types/live";
|
|
4
5
|
import type { ModuleSourceKind } from "./module-store";
|
|
@@ -141,7 +142,8 @@ export interface LayoutBanner {
|
|
|
141
142
|
/** Link buttons after the text; the last one leads. */
|
|
142
143
|
actions?: BlockAction[];
|
|
143
144
|
component?: string;
|
|
144
|
-
props
|
|
145
|
+
/** The props `component` is drawn with, as the backend sends them. */
|
|
146
|
+
props?: { [key: string]: JsonValue };
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
export type SiteLayout = {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* token out from under each other and log the user out.
|
|
10
10
|
*/
|
|
11
11
|
export function runDeduped<T>(
|
|
12
|
-
holder: Record<PropertyKey,
|
|
12
|
+
holder: Record<PropertyKey, Promise<T> | null | undefined>,
|
|
13
13
|
key: PropertyKey,
|
|
14
14
|
task: () => Promise<T>,
|
|
15
15
|
): Promise<T> {
|
|
16
|
-
const existing = holder[key]
|
|
16
|
+
const existing = Object.hasOwn(holder, key) ? holder[key] : undefined;
|
|
17
17
|
if (existing) {
|
|
18
18
|
return existing;
|
|
19
19
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
regionalDateTimeFormat,
|
|
4
4
|
regionalDayNumber,
|
|
5
5
|
} from "./regional";
|
|
6
|
-
import { isNumber } from "./type-check";
|
|
6
|
+
import { isDate, isNull, isNumber, isString, isUndefined } from "./type-check";
|
|
7
7
|
import type { I18nTranslate } from "../composables/translation/useTranslation";
|
|
8
8
|
|
|
9
9
|
const DEFAULT_LOCALE = "en-US";
|
|
@@ -183,7 +183,7 @@ export function formatDate(
|
|
|
183
183
|
locale: string = DEFAULT_LOCALE,
|
|
184
184
|
options?: Intl.DateTimeFormatOptions,
|
|
185
185
|
): string | null {
|
|
186
|
-
if (date
|
|
186
|
+
if (isUndefined(date) || isNull(date)) {
|
|
187
187
|
return null;
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -191,10 +191,10 @@ export function formatDate(
|
|
|
191
191
|
const formatOptions = options || defaultDateFormatterOptions;
|
|
192
192
|
|
|
193
193
|
try {
|
|
194
|
-
if (date
|
|
194
|
+
if (isDate(date)) {
|
|
195
195
|
validDate = date;
|
|
196
196
|
} else {
|
|
197
|
-
validDate = new Date(date
|
|
197
|
+
validDate = new Date(isNumber(date) ? date : String(date));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
if (Number.isNaN(validDate.getTime())) {
|
|
@@ -278,7 +278,7 @@ const CURRENCY_CODE = /^[A-Za-z]{3}$/;
|
|
|
278
278
|
*/
|
|
279
279
|
function priceCurrency(options: Intl.NumberFormatOptions | undefined): string {
|
|
280
280
|
const code = options?.currency;
|
|
281
|
-
return
|
|
281
|
+
return isString(code) && CURRENCY_CODE.test(code)
|
|
282
282
|
? code.toUpperCase()
|
|
283
283
|
: DEFAULT_CURRENCY;
|
|
284
284
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NavigationMenuItem } from "@nuxt/ui";
|
|
2
2
|
import { parseLinkQuery, stripQueryAndHash } from "./routePath";
|
|
3
|
-
import {
|
|
3
|
+
import { isRecord } from "../build/utils/record";
|
|
4
|
+
import { isString, isUndefined } from "./type-check";
|
|
4
5
|
|
|
5
6
|
export const MENU_STATUS_TEXT_CLASSES: Record<MenuItemStatus, string> = {
|
|
6
7
|
success: "text-success",
|
|
@@ -58,15 +59,22 @@ const matchesRoutePrefix = (currentPath: string, to: string): boolean => {
|
|
|
58
59
|
return current === target || current.startsWith(`${target}/`);
|
|
59
60
|
};
|
|
60
61
|
|
|
62
|
+
const isMenuItemTarget = (
|
|
63
|
+
value: NavigationMenuItem["to"],
|
|
64
|
+
): value is MenuItemTarget =>
|
|
65
|
+
isRecord(value) &&
|
|
66
|
+
isString(value.path) &&
|
|
67
|
+
(isUndefined(value.query) ||
|
|
68
|
+
(isRecord(value.query) && Object.values(value.query).every(isString)));
|
|
69
|
+
|
|
61
70
|
const resolveItemTarget = (
|
|
62
71
|
to: NavigationMenuItem["to"],
|
|
63
72
|
): MenuItemTarget | null => {
|
|
64
73
|
if (isString(to)) {
|
|
65
74
|
return { path: stripQueryAndHash(to), query: parseLinkQuery(to) };
|
|
66
75
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return { path: target.path, query: target.query };
|
|
76
|
+
if (isMenuItemTarget(to)) {
|
|
77
|
+
return { path: to.path, query: to.query };
|
|
70
78
|
}
|
|
71
79
|
return null;
|
|
72
80
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { isString } from "#dms-core/app/utils/type-check";
|
|
2
|
+
import type { ValidationRouteContext } from "./query-validation";
|
|
2
3
|
|
|
3
4
|
/** The page query as the server reads it: one value per name, the last one. */
|
|
4
5
|
export function pageQueryValues(
|
|
5
|
-
query:
|
|
6
|
+
query: ValidationRouteContext["query"] | undefined,
|
|
6
7
|
): Record<string, string> {
|
|
7
8
|
return Object.fromEntries(
|
|
8
9
|
Object.entries(query ?? {}).flatMap(([name, value]) => {
|
|
9
|
-
const last = Array.isArray(value) ? value.at(-1) : value;
|
|
10
|
+
const last: unknown = Array.isArray(value) ? value.at(-1) : value;
|
|
10
11
|
return isString(last) ? [[name, last]] : [];
|
|
11
12
|
}),
|
|
12
13
|
);
|
|
@@ -65,7 +66,7 @@ export function fillRouteParams(
|
|
|
65
66
|
params: Record<string, string>,
|
|
66
67
|
): string {
|
|
67
68
|
return layoutUrl.replace(/:([^/]+)/g, (segment, name: string) =>
|
|
68
|
-
name
|
|
69
|
+
Object.hasOwn(params, name) ? params[name]! : segment,
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -77,6 +78,8 @@ export function isSameRouteParams(
|
|
|
77
78
|
const names = Object.keys(left);
|
|
78
79
|
return (
|
|
79
80
|
names.length === Object.keys(right).length &&
|
|
80
|
-
names.every(
|
|
81
|
+
names.every(
|
|
82
|
+
(name) => Object.hasOwn(right, name) && left[name] === right[name],
|
|
83
|
+
)
|
|
81
84
|
);
|
|
82
85
|
}
|
|
@@ -22,11 +22,15 @@ export const evaluateRowActionRule: RuleEvaluator = (rule, row) => {
|
|
|
22
22
|
|
|
23
23
|
if (FIELD_KEY in rule) {
|
|
24
24
|
const ruleObj: RuleDictionary = rule;
|
|
25
|
-
const fieldValue = get(row, rule.field);
|
|
25
|
+
const fieldValue: unknown = get(row, rule.field);
|
|
26
26
|
for (const [operator, def] of Object.entries(FIELD_OPERATORS)) {
|
|
27
27
|
if (operator in ruleObj) {
|
|
28
|
-
const
|
|
29
|
-
return compare(fieldValue,
|
|
28
|
+
const ruleValue = ruleObj[operator];
|
|
29
|
+
if (!def.isArray) return def.compare(fieldValue, ruleValue);
|
|
30
|
+
const ruleValues: unknown[] | undefined = Array.isArray(ruleValue)
|
|
31
|
+
? ruleValue
|
|
32
|
+
: undefined;
|
|
33
|
+
return ruleValues !== undefined && def.compare(fieldValue, ruleValues);
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
36
|
}
|