@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.
Files changed (367) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +1 -1
  3. package/dist/config/internal/state.d.ts +5 -3
  4. package/dist/config/internal/state.js +9 -1
  5. package/dist/config/internal/state.js.map +1 -1
  6. package/dist/implementations/dms-builder/engine/compose-page.js +3 -2
  7. package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
  8. package/dist/implementations/dms-builder/engine/connection-targets.d.ts +2 -0
  9. package/dist/implementations/dms-builder/engine/connection-targets.js +276 -0
  10. package/dist/implementations/dms-builder/engine/connection-targets.js.map +1 -0
  11. package/dist/implementations/dms-builder/engine/dms-database.d.ts +1 -0
  12. package/dist/implementations/dms-builder/engine/dms-database.js +1 -0
  13. package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
  14. package/dist/implementations/dms-builder/engine/driver-packages.js +16 -4
  15. package/dist/implementations/dms-builder/engine/driver-packages.js.map +1 -1
  16. package/dist/implementations/dms-builder/engine/index.d.ts +1 -0
  17. package/dist/implementations/dms-builder/engine/index.js +1 -0
  18. package/dist/implementations/dms-builder/engine/index.js.map +1 -1
  19. package/dist/implementations/dms-builder/engine/theme-scaffold.js +1 -1
  20. package/dist/implementations/dms-html-render/index.js +5 -2
  21. package/dist/implementations/dms-html-render/index.js.map +1 -1
  22. package/dist/mcp/page-verify/index.d.ts +1 -0
  23. package/dist/mcp/page-verify/index.js +1 -0
  24. package/dist/mcp/page-verify/index.js.map +1 -1
  25. package/dist/mcp/page-verify/redact-report.d.ts +2 -0
  26. package/dist/mcp/page-verify/redact-report.js +120 -0
  27. package/dist/mcp/page-verify/redact-report.js.map +1 -0
  28. package/dist/mcp/page-verify/render.js +4 -1
  29. package/dist/mcp/page-verify/render.js.map +1 -1
  30. package/dist/mcp/redact.d.ts +87 -0
  31. package/dist/mcp/redact.js +139 -0
  32. package/dist/mcp/redact.js.map +1 -0
  33. package/dist/mcp/tools/builder-compose.js +11 -2
  34. package/dist/mcp/tools/builder-compose.js.map +1 -1
  35. package/dist/mcp/tools/builder-project.js +59 -26
  36. package/dist/mcp/tools/builder-project.js.map +1 -1
  37. package/dist/mcp/tools/builder-queries.js +41 -4
  38. package/dist/mcp/tools/builder-queries.js.map +1 -1
  39. package/dist/mcp/tools/builder-shared.d.ts +3 -1
  40. package/dist/mcp/tools/builder-shared.js +5 -0
  41. package/dist/mcp/tools/builder-shared.js.map +1 -1
  42. package/dist/mcp/tools/database.js +3 -2
  43. package/dist/mcp/tools/database.js.map +1 -1
  44. package/dist/mcp/tools/page-verify.js +3 -2
  45. package/dist/mcp/tools/page-verify.js.map +1 -1
  46. package/frontend-vue/dms.frontend.ts +6 -2
  47. package/frontend-vue/eslint-globals.generated.mjs +259 -942
  48. package/frontend-vue/layers/dms-auth/app/build/composables/useAuthFormError.ts +5 -3
  49. package/frontend-vue/layers/dms-auth/app/composables/useOAuthErrorToast.ts +6 -4
  50. package/frontend-vue/layers/dms-auth/app/composables/usePostLoginRedirect.ts +3 -2
  51. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +1 -1
  52. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +1 -1
  53. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +12 -4
  54. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +1 -1
  55. package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +12 -6
  56. package/frontend-vue/layers/dms-auth/app/middleware/auth.ts +4 -2
  57. package/frontend-vue/layers/dms-auth/server/oauth.ts +13 -7
  58. package/frontend-vue/layers/dms-auth/server/session.ts +37 -6
  59. package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +46 -23
  60. package/frontend-vue/layers/dms-core/app/build/composables/auth/usePermissionPreview.ts +34 -23
  61. package/frontend-vue/layers/dms-core/app/build/composables/user/preferencesCookie.ts +8 -2
  62. package/frontend-vue/layers/dms-core/app/build/composables/user/tablePreferences.ts +11 -5
  63. package/frontend-vue/layers/dms-core/app/build/utils/crossTab.ts +4 -2
  64. package/frontend-vue/layers/dms-core/app/build/utils/json.ts +31 -0
  65. package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +6 -11
  66. package/frontend-vue/layers/dms-core/app/build/utils/record.ts +4 -0
  67. package/frontend-vue/layers/dms-core/app/build/utils/sharedRealtimeConnection.ts +56 -36
  68. package/frontend-vue/layers/dms-core/app/composables/auth/useApiData.ts +2 -2
  69. package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +6 -1
  70. package/frontend-vue/layers/dms-core/app/composables/auth/useCurrentUser.ts +3 -2
  71. package/frontend-vue/layers/dms-core/app/composables/auth/useLogout.ts +3 -2
  72. package/frontend-vue/layers/dms-core/app/composables/auth/useMultiAccount.ts +15 -14
  73. package/frontend-vue/layers/dms-core/app/composables/auth/useSessionRecovery.ts +21 -8
  74. package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -3
  75. package/frontend-vue/layers/dms-core/app/composables/page/useSiteLayout.ts +11 -9
  76. package/frontend-vue/layers/dms-core/app/composables/period/periodLink.ts +3 -2
  77. package/frontend-vue/layers/dms-core/app/composables/period/usePeriod.ts +2 -2
  78. package/frontend-vue/layers/dms-core/app/composables/realtime/usePageRealtime.ts +10 -3
  79. package/frontend-vue/layers/dms-core/app/composables/realtime/useSseStream.ts +22 -16
  80. package/frontend-vue/layers/dms-core/app/composables/realtime/useUserRealtime.ts +68 -46
  81. package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +22 -11
  82. package/frontend-vue/layers/dms-core/app/composables/useEventedAction.ts +4 -1
  83. package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +14 -6
  84. package/frontend-vue/layers/dms-core/app/composables/user/usePreferences.ts +8 -3
  85. package/frontend-vue/layers/dms-core/app/composables/watch/useWatch.ts +17 -8
  86. package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -1
  87. package/frontend-vue/layers/dms-core/app/types/page.ts +3 -1
  88. package/frontend-vue/layers/dms-core/app/utils/dedupedRefresh.ts +2 -2
  89. package/frontend-vue/layers/dms-core/app/utils/formatter.ts +5 -5
  90. package/frontend-vue/layers/dms-core/app/utils/menu.ts +12 -4
  91. package/frontend-vue/layers/dms-core/app/utils/pageQuery.ts +7 -4
  92. package/frontend-vue/layers/dms-core/app/utils/row-action-rule-evaluator.ts +7 -3
  93. package/frontend-vue/layers/dms-core/app/utils/stringTypeParser.ts +8 -10
  94. package/frontend-vue/layers/dms-core/app/utils/type-check.ts +25 -12
  95. package/frontend-vue/layers/dms-layout/app/build/branding/BrandingColorPair.vue +5 -2
  96. package/frontend-vue/layers/dms-layout/app/build/branding/device-draft.ts +2 -1
  97. package/frontend-vue/layers/dms-layout/app/build/branding/logos.ts +11 -13
  98. package/frontend-vue/layers/dms-layout/app/build/branding/model.ts +6 -2
  99. package/frontend-vue/layers/dms-layout/app/build/branding/preview-style.ts +12 -10
  100. package/frontend-vue/layers/dms-layout/app/build/branding/raster.ts +7 -4
  101. package/frontend-vue/layers/dms-layout/app/build/branding/useBrandingEditor.ts +59 -31
  102. package/frontend-vue/layers/dms-layout/app/build/branding/values.ts +2 -1
  103. package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +1 -1
  104. package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +37 -24
  105. package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +2 -4
  106. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/profile/ProfileSummaryRow.vue +2 -2
  107. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/security/SecuritySessions.vue +35 -10
  108. package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/theme/CssVariablesList.vue +2 -2
  109. package/frontend-vue/layers/dms-layout/app/build/composables/dev-reload/useDevReloadHolder.ts +4 -4
  110. package/frontend-vue/layers/dms-layout/app/build/composables/navigation/useVisitNavBadges.ts +26 -4
  111. package/frontend-vue/layers/dms-layout/app/build/composables/security/useSessionHandoff.ts +3 -6
  112. package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useAccountData.ts +16 -12
  113. package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityFormat.ts +12 -9
  114. package/frontend-vue/layers/dms-layout/app/build/mockup/header-action.ts +2 -2
  115. package/frontend-vue/layers/dms-layout/app/build/utils/modules-catalog.ts +13 -6
  116. package/frontend-vue/layers/dms-layout/app/build/utils/notificationPayload.ts +81 -0
  117. package/frontend-vue/layers/dms-layout/app/build/utils/submittedUrl.ts +14 -0
  118. package/frontend-vue/layers/dms-layout/app/components/AppWidgetsDock.vue +3 -1
  119. package/frontend-vue/layers/dms-layout/app/composables/general/useSystemState.ts +4 -5
  120. package/frontend-vue/layers/dms-layout/app/composables/layout/useServedHeaderActions.ts +7 -5
  121. package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +2 -2
  122. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleHistory.ts +1 -1
  123. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStore.ts +3 -3
  124. package/frontend-vue/layers/dms-layout/app/composables/page/useModuleStoreActions.ts +2 -2
  125. package/frontend-vue/layers/dms-layout/app/composables/page/useModulesListing.ts +17 -4
  126. package/frontend-vue/layers/dms-layout/app/composables/page/usePageComponentPreload.ts +15 -7
  127. package/frontend-vue/layers/dms-layout/app/composables/page/usePageRecordDeletion.ts +2 -2
  128. package/frontend-vue/layers/dms-layout/app/composables/profile/useUserLanguage.ts +3 -2
  129. package/frontend-vue/layers/dms-layout/app/composables/useCommandPaletteSources.ts +20 -2
  130. package/frontend-vue/layers/dms-layout/app/custom-pages/settings/roles.vue +5 -1
  131. package/frontend-vue/layers/dms-layout/app/custom-pages/settings/shortcuts.vue +4 -1
  132. package/frontend-vue/layers/dms-layout/app/pages/[...slug].vue +13 -5
  133. package/frontend-vue/layers/dms-layout/app/plugins/command-palette-session.client.ts +8 -8
  134. package/frontend-vue/layers/dms-layout/app/plugins/dms-dev-reload.client.ts +1 -1
  135. package/frontend-vue/layers/dms-layout/app/plugins/dms-mcp-navigate.client.ts +4 -2
  136. package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +3 -3
  137. package/frontend-vue/layers/dms-layout/app/plugins/notification-stream.client.ts +47 -40
  138. package/frontend-vue/layers/dms-layout/app/plugins/permission-preview.client.ts +2 -2
  139. package/frontend-vue/layers/dms-layout/app/plugins/profile-sync.client.ts +3 -10
  140. package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +2 -2
  141. package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +3 -2
  142. package/frontend-vue/layers/dms-layout/server/html-render.ts +5 -1
  143. package/frontend-vue/layers/dms-layout/server/render-token.ts +3 -2
  144. package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +1 -1
  145. package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +1 -1
  146. package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +2 -1
  147. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEditOverlay.vue +2 -2
  148. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIndex.vue +1 -1
  149. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +3 -2
  150. package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspectorField.vue +5 -2
  151. package/frontend-vue/layers/dms-ui/app/build/components/containers/drawer/DynamicDrawer.vue +4 -3
  152. package/frontend-vue/layers/dms-ui/app/build/components/containers/modal/DynamicModal.vue +3 -2
  153. package/frontend-vue/layers/dms-ui/app/build/components/containers/row/RowHeader.vue +2 -1
  154. package/frontend-vue/layers/dms-ui/app/build/components/period/PeriodRangeCalendar.vue +10 -7
  155. package/frontend-vue/layers/dms-ui/app/build/components/sortable/SortableList.vue +2 -2
  156. package/frontend-vue/layers/dms-ui/app/build/components/table/FiltersRow.vue +20 -18
  157. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuColumns.vue +2 -5
  158. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuDensity.vue +3 -4
  159. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuFilter.vue +3 -4
  160. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuImport.vue +2 -5
  161. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuPage.vue +2 -5
  162. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuRoot.vue +3 -4
  163. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuSort.vue +2 -5
  164. package/frontend-vue/layers/dms-ui/app/build/components/table/MenuViewMode.vue +21 -19
  165. package/frontend-vue/layers/dms-ui/app/build/components/table/RowSelection.vue +3 -4
  166. package/frontend-vue/layers/dms-ui/app/build/components/table/Table.types.ts +4 -4
  167. package/frontend-vue/layers/dms-ui/app/build/components/table/TableActions.vue +3 -4
  168. package/frontend-vue/layers/dms-ui/app/build/components/table/TableMenu.vue +3 -4
  169. package/frontend-vue/layers/dms-ui/app/build/components/table/TablePagination.vue +3 -4
  170. package/frontend-vue/layers/dms-ui/app/build/components/table/TableRoot.vue +3 -5
  171. package/frontend-vue/layers/dms-ui/app/build/components/table/TableTabs.vue +2 -5
  172. package/frontend-vue/layers/dms-ui/app/build/components/table/TableViews.vue +3 -4
  173. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentFilters.ts +4 -4
  174. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentPreferences.ts +4 -3
  175. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentRows.ts +4 -3
  176. package/frontend-vue/layers/dms-ui/app/build/components/table/tableComponentTheme.ts +11 -0
  177. package/frontend-vue/layers/dms-ui/app/build/components/table-view/CardsDisplay.vue +35 -9
  178. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetActions.ts +24 -17
  179. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetConfirmation.ts +53 -30
  180. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetHandlers.ts +2 -2
  181. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRequests.ts +2 -2
  182. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetRows.ts +8 -4
  183. package/frontend-vue/layers/dms-ui/app/build/composables/actions/actionTargetTypes.ts +1 -1
  184. package/frontend-vue/layers/dms-ui/app/build/composables/actions/rowNavigation.ts +3 -2
  185. package/frontend-vue/layers/dms-ui/app/build/composables/actions/useActionTargets.ts +9 -2
  186. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +156 -99
  187. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +2 -2
  188. package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +194 -161
  189. package/frontend-vue/layers/dms-ui/app/build/composables/blocks/blockDataState.ts +2 -1
  190. package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useGuard.ts +38 -11
  191. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexRawOptions.ts +34 -5
  192. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexSeriesStyle.ts +32 -3
  193. package/frontend-vue/layers/dms-ui/app/build/composables/chart/apexTheme.ts +13 -6
  194. package/frontend-vue/layers/dms-ui/app/build/composables/confirm/useActionConfirm.ts +8 -3
  195. package/frontend-vue/layers/dms-ui/app/build/composables/containers/drawerSize.ts +4 -4
  196. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/cellHelpers.ts +23 -1
  197. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultChoiceTypes.ts +11 -11
  198. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDateCells.ts +7 -1
  199. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultIdentityCells.ts +22 -8
  200. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultMediaTypes.ts +5 -5
  201. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +10 -9
  202. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultRelationTypes.ts +8 -8
  203. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/metricCells.ts +12 -6
  204. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/numberSuffix.ts +4 -6
  205. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationRows.ts +2 -2
  206. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/relationValue.ts +10 -5
  207. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/twoLineCell.ts +21 -3
  208. package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +6 -4
  209. package/frontend-vue/layers/dms-ui/app/build/composables/detach.ts +9 -0
  210. package/frontend-vue/layers/dms-ui/app/build/composables/files/useFileMetadata.ts +1 -1
  211. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldComponentProps.ts +38 -14
  212. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldSaved.ts +6 -8
  213. package/frontend-vue/layers/dms-ui/app/build/composables/form/fieldValueRule.ts +19 -2
  214. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentCancel.ts +2 -1
  215. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +3 -2
  216. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +28 -8
  217. package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +5 -6
  218. package/frontend-vue/layers/dms-ui/app/build/composables/form/formState.ts +15 -7
  219. package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +12 -3
  220. package/frontend-vue/layers/dms-ui/app/build/composables/form/registerFormFunctions.ts +7 -8
  221. package/frontend-vue/layers/dms-ui/app/build/composables/form/stringSet.ts +6 -0
  222. package/frontend-vue/layers/dms-ui/app/build/composables/form/useFormModel.ts +60 -16
  223. package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +5 -4
  224. package/frontend-vue/layers/dms-ui/app/build/composables/instant-save/useInstantSave.ts +13 -9
  225. package/frontend-vue/layers/dms-ui/app/build/composables/layout/rowSidePanel.ts +2 -1
  226. package/frontend-vue/layers/dms-ui/app/build/composables/live/currentPageLive.ts +1 -1
  227. package/frontend-vue/layers/dms-ui/app/build/composables/live/liveCadence.ts +2 -2
  228. package/frontend-vue/layers/dms-ui/app/build/composables/live/missedTally.ts +8 -6
  229. package/frontend-vue/layers/dms-ui/app/build/composables/live/pageLiveController.ts +2 -2
  230. package/frontend-vue/layers/dms-ui/app/build/composables/live/usePageDataRefresh.ts +3 -3
  231. package/frontend-vue/layers/dms-ui/app/build/composables/navigation/useNavBadges.ts +1 -1
  232. package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +42 -14
  233. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionDescriptors.ts +63 -46
  234. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnActionSizing.ts +2 -2
  235. package/frontend-vue/layers/dms-ui/app/build/composables/table/tableColumnStructure.ts +2 -2
  236. package/frontend-vue/layers/dms-ui/app/build/composables/table/useRelationFilterLabels.ts +4 -2
  237. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTable.ts +4 -2
  238. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableConfigClipboard.ts +71 -9
  239. package/frontend-vue/layers/dms-ui/app/build/composables/table/useTableStates.ts +6 -4
  240. package/frontend-vue/layers/dms-ui/app/build/composables/table/utils/rowId.ts +15 -0
  241. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/registerDefaultFunctions.ts +21 -7
  242. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionBulkRequests.ts +3 -3
  243. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionContainers.ts +1 -17
  244. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionNavigation.ts +12 -7
  245. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableRowActionValues.ts +25 -4
  246. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewArrival.ts +8 -5
  247. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewCounts.ts +4 -5
  248. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +2 -1
  249. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplays.ts +18 -14
  250. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewEvents.ts +4 -3
  251. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +2 -2
  252. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +4 -1
  253. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewLive.ts +4 -1
  254. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickActions.ts +4 -3
  255. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewQuickFilters.ts +4 -2
  256. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewRealtime.ts +9 -7
  257. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewTabs.ts +4 -4
  258. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useCardFields.ts +1 -1
  259. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useExpandedRowDetails.ts +6 -3
  260. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +7 -7
  261. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/usePersistedPagination.ts +2 -1
  262. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useReorderHandles.ts +9 -2
  263. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +4 -2
  264. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +2 -6
  265. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTablePreferences.ts +19 -12
  266. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRecordLink.ts +6 -3
  267. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableReorder.ts +7 -7
  268. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +4 -2
  269. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableViewRowActions.ts +6 -5
  270. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/bulkActions.ts +3 -1
  271. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/card.ts +14 -12
  272. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +38 -0
  273. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/expandedRows.ts +4 -2
  274. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +12 -10
  275. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/reorder.ts +6 -5
  276. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/sortableColumns.ts +38 -9
  277. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableCounts.ts +8 -3
  278. package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +14 -11
  279. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/formValue.ts +22 -12
  280. package/frontend-vue/layers/dms-ui/app/build/composables/unsaved-changes/registry.ts +27 -6
  281. package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +1 -1
  282. package/frontend-vue/layers/dms-ui/app/build/mockups/resync.ts +9 -1
  283. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +34 -25
  284. package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +52 -26
  285. package/frontend-vue/layers/dms-ui/app/build/utils/calendarDay.ts +4 -1
  286. package/frontend-vue/layers/dms-ui/app/build/utils/characterCount.ts +1 -1
  287. package/frontend-vue/layers/dms-ui/app/build/utils/dispatchQuickActionTarget.ts +16 -11
  288. package/frontend-vue/layers/dms-ui/app/build/utils/fieldOptionsI18n.ts +23 -21
  289. package/frontend-vue/layers/dms-ui/app/build/utils/json.ts +74 -0
  290. package/frontend-vue/layers/dms-ui/app/build/utils/link.ts +2 -2
  291. package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +4 -4
  292. package/frontend-vue/layers/dms-ui/app/build/utils/mockupCatalog.ts +59 -50
  293. package/frontend-vue/layers/dms-ui/app/build/utils/mockupDrop.ts +1 -1
  294. package/frontend-vue/layers/dms-ui/app/build/utils/mockupEdit.ts +8 -6
  295. package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +34 -28
  296. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStamp.ts +11 -3
  297. package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +5 -2
  298. package/frontend-vue/layers/dms-ui/app/build/utils/streamHighlight.ts +8 -6
  299. package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +2 -1
  300. package/frontend-vue/layers/dms-ui/app/components/RecursiveComponent.vue +3 -6
  301. package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +5 -4
  302. package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +1 -2
  303. package/frontend-vue/layers/dms-ui/app/components/card/NavCard.vue +4 -1
  304. package/frontend-vue/layers/dms-ui/app/components/chart/ApexChartHost.vue +62 -13
  305. package/frontend-vue/layers/dms-ui/app/components/chart/ChartBlock.vue +18 -6
  306. package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +9 -4
  307. package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +9 -6
  308. package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +16 -18
  309. package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +4 -9
  310. package/frontend-vue/layers/dms-ui/app/components/form/LocalizedField.vue +2 -2
  311. package/frontend-vue/layers/dms-ui/app/components/form/components/InputAddress.vue +2 -2
  312. package/frontend-vue/layers/dms-ui/app/components/form/components/InputImage.vue +5 -8
  313. package/frontend-vue/layers/dms-ui/app/components/form/components/RichText.vue +3 -2
  314. package/frontend-vue/layers/dms-ui/app/components/master-detail/MasterDetail.vue +3 -1
  315. package/frontend-vue/layers/dms-ui/app/components/period/usePeriodSelectorInteraction.ts +9 -7
  316. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanBoard.vue +11 -6
  317. package/frontend-vue/layers/dms-ui/app/components/table-view/KanbanDisplay.vue +40 -3
  318. package/frontend-vue/layers/dms-ui/app/composables/chart/apexDatetimeBuckets.ts +9 -5
  319. package/frontend-vue/layers/dms-ui/app/composables/chart/events.ts +6 -3
  320. package/frontend-vue/layers/dms-ui/app/composables/chart/heatmapColors.ts +1 -1
  321. package/frontend-vue/layers/dms-ui/app/composables/chart/localizeSeries.ts +13 -2
  322. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.ts +27 -4
  323. package/frontend-vue/layers/dms-ui/app/composables/chart/useApexChart.types.ts +3 -2
  324. package/frontend-vue/layers/dms-ui/app/composables/chart/useChartFetch.ts +3 -4
  325. package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -1
  326. package/frontend-vue/layers/dms-ui/app/composables/containers/openDynamicContainer.ts +6 -6
  327. package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +1 -1
  328. package/frontend-vue/layers/dms-ui/app/composables/containers/useDrawer.ts +8 -5
  329. package/frontend-vue/layers/dms-ui/app/composables/containers/useModal.ts +1 -1
  330. package/frontend-vue/layers/dms-ui/app/composables/form/types/props.ts +5 -2
  331. package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +80 -39
  332. package/frontend-vue/layers/dms-ui/app/composables/live/usePageLiveRefresh.ts +1 -1
  333. package/frontend-vue/layers/dms-ui/app/composables/resolveDmsComponent.ts +9 -2
  334. package/frontend-vue/layers/dms-ui/app/composables/tab/useTab.ts +2 -2
  335. package/frontend-vue/layers/dms-ui/app/composables/table-view/shortcuts/tableViewShiftA.ts +2 -2
  336. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +2 -1
  337. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/column.ts +3 -1
  338. package/frontend-vue/layers/dms-ui/app/composables/table-view/types/display.ts +6 -2
  339. package/frontend-vue/layers/dms-ui/app/composables/table-view/useTableViewExport.ts +6 -5
  340. package/frontend-vue/layers/dms-ui/app/composables/unsaved-changes/useUnsavedChanges.ts +1 -1
  341. package/frontend-vue/layers/dms-ui/app/composables/useExportJob.ts +21 -9
  342. package/frontend-vue/layers/dms-ui/app/utils/blockRefresh.ts +8 -2
  343. package/frontend-vue/layers/dms-ui/app/utils/cascader.ts +18 -8
  344. package/frontend-vue/layers/dms-ui/app/utils/metadataRetry.ts +1 -1
  345. package/frontend-vue/lazy-plugin.ts +1 -1
  346. package/frontend-vue/package.json +5 -4
  347. package/frontend-vue/scripts/check-api-error-presentation.mjs +257 -117
  348. package/frontend-vue/scripts/check-autoimport-boundaries.mjs +143 -27
  349. package/frontend-vue/scripts/check-disable-blocks.mjs +26 -4
  350. package/frontend-vue/scripts/check-dms-components.mjs +152 -246
  351. package/frontend-vue/scripts/check-invariants.mjs +100 -42
  352. package/frontend-vue/scripts/check-page-invariants.mjs +103 -40
  353. package/frontend-vue/scripts/dms-components-dependencies.mjs +106 -13
  354. package/frontend-vue/scripts/dms-components-script.mjs +375 -0
  355. package/frontend-vue/scripts/eslint-test-quality.mjs +126 -0
  356. package/frontend-vue/scripts/jsconfig.json +10 -0
  357. package/frontend-vue/scripts/probes/capture-frontend-probe.cjs +4 -2
  358. package/frontend-vue/scripts/probes/frontend-behavior.cjs +217 -47
  359. package/frontend-vue/scripts/probes/frontend-legacy.cjs +159 -8
  360. package/frontend-vue/scripts/probes/frontend-probe-controls.cjs +89 -10
  361. package/frontend-vue/scripts/prove-comment-emit.mjs +33 -4
  362. package/frontend-vue/scripts/prove-component-registration.mjs +110 -24
  363. package/frontend-vue/scripts/test-autoimport-boundaries.mjs +37 -6
  364. package/frontend-vue/scripts/test-dms-components.mjs +70 -5
  365. package/frontend-vue/server/request-body.ts +29 -5
  366. package/package.json +5 -3
  367. 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 { isObject, isString } from "../../utils/type-check";
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?: Record<string, unknown>;
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 && !!data && isObject(data) && "topic" in data;
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 && isObject(data) && isString(data.topic) && isString(data.type);
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
- data: RealtimeFrameData,
180
+ sessionId: string,
181
+ greeting: SessionGreeting,
148
182
  ): void => {
149
- if (!data || !isObject(data) || !("sessionId" in data)) return;
150
- state.sessionId.value = String(data.sessionId);
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 } = data;
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
- return await response.json();
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()) void openSession(forConnection);
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
- adopt(forConnection, greeting!);
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
- void openSession(connectionId);
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
- if (next) void openSession(next);
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: PageSubscriptionAnswer | null;
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?.topics;
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
- void reconcilePage(state, baseUrl);
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
- () => state.connection?.renewSession(),
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: unknown,
44
+ error: ApiFailure,
42
45
  options: ResolveApiErrorOptions,
43
46
  ): ApiErrorNotice | null;
44
- presentError(error: unknown, options: PresentApiErrorOptions): void;
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
- function isCompiledMessage(value: unknown): boolean {
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: unknown,
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(error: unknown, options: PresentApiErrorOptions): void {
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?: (error: unknown) => ComponentEventData["data"];
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 entry = codes[code] ?? codes[bare] ?? codes[`$${bare}`];
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 { presentError, resolveError } = useApiErrorPresenter();
488
- const fieldIds = Object.keys(options.fields) as F[];
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
- errors[entry.field as F] = resolveError(entry.message, {
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
- await focus(fields[0]!.field as F);
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 = <T>(value: T): T =>
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 = toPlain(tree.value);
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 = toPlain(tree.value);
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 { isUndefined } from "../../utils/type-check";
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 === null || current === undefined) return undefined;
12
- current = (current as Record<string, unknown>)[key];
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
- event: WatchEvent,
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, event.detail, componentState);
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 { detail } = event;
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, event);
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?: Record<string, unknown>;
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?: Record<string, unknown>;
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, unknown>,
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] as Promise<T> | null | undefined;
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 === undefined || date === null) {
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 instanceof Date) {
194
+ if (isDate(date)) {
195
195
  validDate = date;
196
196
  } else {
197
- validDate = new Date(date as string | number);
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 typeof code === "string" && CURRENCY_CODE.test(code)
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 { isString } from "./type-check";
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
- const target = to as MenuItemTarget | undefined;
68
- if (target && isString(target.path)) {
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: Record<string, unknown> | undefined,
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 in params ? params[name]! : segment,
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((name) => left[name] === right[name])
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 compare = def.compare;
29
- return compare(fieldValue, ruleObj[operator]);
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
  }