@antelopejs/dms 0.25.5 → 0.25.6-next.1135.gc1cba20
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/E2E.md +1 -1
- package/README.md +16 -16
- package/data/mockup-spec.schema.json +289 -5
- package/dist/implementations/dms-auth/account-emails.js +2 -2
- package/dist/implementations/dms-auth/account-emails.js.map +1 -1
- package/dist/implementations/dms-auth/index.js +1 -2
- package/dist/implementations/dms-auth/index.js.map +1 -1
- package/dist/implementations/dms-base/group-order.d.ts +18 -0
- package/dist/implementations/dms-base/group-order.js +66 -0
- package/dist/implementations/dms-base/group-order.js.map +1 -0
- package/dist/implementations/dms-base/search-route.js +8 -5
- package/dist/implementations/dms-base/search-route.js.map +1 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js +4 -1
- package/dist/implementations/dms-builder/engine/cell-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/dms-database.js.map +1 -1
- package/dist/implementations/dms-builder/engine/driver-probe.d.ts +1 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js +5 -1
- package/dist/implementations/dms-builder/engine/mapped-displays.js.map +1 -1
- package/dist/implementations/dms-builder/engine/resource-emit.js +4 -0
- package/dist/implementations/dms-builder/engine/resource-emit.js.map +1 -1
- package/dist/implementations/dms-builder/engine/theme-assets.js +5 -17
- package/dist/implementations/dms-builder/engine/theme-assets.js.map +1 -1
- package/dist/mcp/tool.d.ts +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js +1 -1
- package/dist/mcp/tools/mockup-apply-to-page.js.map +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js +1 -1
- package/dist/mcp/tools/mockup-patch-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-write-spec.js +1 -1
- package/dist/mcp/tools/mockup-write-spec.js.map +1 -1
- package/dist/mockup/apply-notes.d.ts +1 -1
- package/dist/mockup/apply-notes.js +2 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/apply-plan.js +3 -0
- package/dist/mockup/apply-plan.js.map +1 -1
- package/dist/mockup/capture-routes.d.ts +18 -0
- package/dist/mockup/capture-routes.js +101 -0
- package/dist/mockup/capture-routes.js.map +1 -0
- package/dist/mockup/capture.d.ts +10 -0
- package/dist/mockup/capture.js +64 -0
- package/dist/mockup/capture.js.map +1 -0
- package/dist/mockup/compile.js +16 -8
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +62 -10
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/display-values.js +1 -1
- package/dist/mockup/display-values.js.map +1 -1
- package/dist/mockup/files.d.ts +2 -1
- package/dist/mockup/files.js +3 -2
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixtures.d.ts +3 -1
- package/dist/mockup/fixtures.js +25 -2
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/form-fields.js +10 -1
- package/dist/mockup/form-fields.js.map +1 -1
- package/dist/mockup/header-action.d.ts +47 -0
- package/dist/mockup/header-action.js +46 -0
- package/dist/mockup/header-action.js.map +1 -0
- package/dist/mockup/history-routes.js +8 -1
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/json-schema-header.d.ts +2 -0
- package/dist/mockup/json-schema-header.js +69 -0
- package/dist/mockup/json-schema-header.js.map +1 -0
- package/dist/mockup/json-schema-layout.d.ts +2 -0
- package/dist/mockup/json-schema-layout.js +61 -0
- package/dist/mockup/json-schema-layout.js.map +1 -0
- package/dist/mockup/json-schema.js +5 -16
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/model.d.ts +204 -18
- package/dist/mockup/model.js +46 -12
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/page-links.d.ts +2 -1
- package/dist/mockup/page-links.js +14 -3
- package/dist/mockup/page-links.js.map +1 -1
- package/dist/mockup/refusals.d.ts +1 -0
- package/dist/mockup/refusals.js +1 -0
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.js +11 -1
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sample-rows.js +4 -0
- package/dist/mockup/sample-rows.js.map +1 -1
- package/dist/mockup/store.d.ts +1 -0
- package/dist/mockup/store.js +9 -19
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/summary-fields.d.ts +20 -0
- package/dist/mockup/summary-fields.js +22 -0
- package/dist/mockup/summary-fields.js.map +1 -0
- package/dist/mockup/table-columns.js +9 -3
- package/dist/mockup/table-columns.js.map +1 -1
- package/dist/mockup/table-options.d.ts +4 -1
- package/dist/mockup/table-options.js +40 -2
- package/dist/mockup/table-options.js.map +1 -1
- package/dist/mockup/table-param-filters.d.ts +52 -0
- package/dist/mockup/table-param-filters.js +83 -0
- package/dist/mockup/table-param-filters.js.map +1 -0
- package/dist/mockup/table-row-actions.d.ts +2 -0
- package/dist/mockup/table-row-actions.js +85 -0
- package/dist/mockup/table-row-actions.js.map +1 -0
- package/dist/mockup/unknown-keys.d.ts +3 -0
- package/dist/mockup/unknown-keys.js +45 -0
- package/dist/mockup/unknown-keys.js.map +1 -0
- package/dist/mockup/validate.d.ts +7 -1
- package/dist/mockup/validate.js +76 -3
- package/dist/mockup/validate.js.map +1 -1
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +1 -0
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/settings/overview/account-summary.d.ts +2 -0
- package/dist/pages/settings/overview/account-summary.js +17 -8
- package/dist/pages/settings/overview/account-summary.js.map +1 -1
- package/dist/pages/settings/settings-index.js +2 -1
- package/dist/pages/settings/settings-index.js.map +1 -1
- package/dist/realtime/sse.js +2 -4
- package/dist/realtime/sse.js.map +1 -1
- package/dist/store/internal/frontend/dev-reload.js +7 -1
- package/dist/store/internal/frontend/dev-reload.js.map +1 -1
- package/dist/utils/account-notifications.js +1 -0
- package/dist/utils/account-notifications.js.map +1 -1
- package/dist/utils/email-change-mail.js +2 -2
- package/dist/utils/email-change-mail.js.map +1 -1
- package/dist/utils/email-plain-text.d.ts +1 -0
- package/dist/utils/email-plain-text.js +95 -0
- package/dist/utils/email-plain-text.js.map +1 -0
- package/dist/utils/export-jobs.js +2 -2
- package/dist/utils/export-jobs.js.map +1 -1
- package/dist/utils/html-email.d.ts +8 -0
- package/dist/utils/html-email.js +9 -0
- package/dist/utils/html-email.js.map +1 -0
- package/dist/utils/image-signatures.d.ts +3 -0
- package/dist/utils/image-signatures.js +22 -0
- package/dist/utils/image-signatures.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/sse-keepalive/index.d.ts +3 -0
- package/dist/utils/sse-keepalive/index.js +8 -0
- package/dist/utils/sse-keepalive/index.js.map +1 -0
- package/dist/validation/allowed-keys.d.ts +2 -0
- package/dist/validation/allowed-keys.js +16 -0
- package/dist/validation/allowed-keys.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/index.js.map +1 -1
- package/frontend-vue/.prettierignore +1 -0
- package/frontend-vue/build/backend-boundary.ts +80 -80
- package/frontend-vue/eslint-globals.generated.mjs +2 -2
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/2fa.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/backup.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot-validation.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/forgot.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/login.vue +4 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/recover.vue +3 -0
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/signup.vue +17 -1
- package/frontend-vue/layers/dms-auth/app/custom-pages/auth/validate.vue +3 -0
- package/frontend-vue/layers/dms-auth/i18n/locales/auth-fr-FR.json +10 -10
- package/frontend-vue/layers/dms-auth/server/backend-answers.ts +12 -9
- package/frontend-vue/layers/dms-auth/server/oauth.ts +6 -6
- package/frontend-vue/layers/dms-core/app/build/composables/api-error.ts +8 -0
- package/frontend-vue/layers/dms-core/app/build/composables/field-errors.ts +485 -0
- package/frontend-vue/layers/dms-core/app/build/composables/useHydrated.ts +27 -0
- package/frontend-vue/layers/dms-core/app/build/utils/permission-preview.ts +1 -2
- package/frontend-vue/layers/dms-core/app/composables/data-types/useDataType.ts +3 -2
- package/frontend-vue/layers/dms-core/app/composables/period/types.ts +1 -4
- package/frontend-vue/layers/dms-core/app/composables/translation/useUniqueLocales.ts +23 -5
- package/frontend-vue/layers/dms-core/app/composables/useApiErrorPresenter.ts +2 -3
- package/frontend-vue/layers/dms-core/app/composables/useFieldErrors.ts +12 -443
- package/frontend-vue/layers/dms-core/app/composables/useFormValidation.ts +1 -2
- package/frontend-vue/layers/dms-core/app/entries/composables/useHydrated.ts +1 -0
- package/frontend-vue/layers/dms-core/app/types/composed-text.ts +1 -4
- package/frontend-vue/layers/dms-core/app/types/confirm-dialog.ts +1 -2
- package/frontend-vue/layers/dms-core/app/types/data-type.ts +1 -2
- package/frontend-vue/layers/dms-core/app/types/json.ts +1 -3
- package/frontend-vue/layers/dms-core/app/types/module-store.ts +3 -17
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +8 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +8 -0
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardHeader.vue +7 -4
- package/frontend-vue/layers/dms-layout/app/build/components/layout/EmptyLayoutBrand.vue +49 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/LayoutFooter.vue +2 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PageHeaderActionBar.vue +3 -2
- package/frontend-vue/layers/dms-layout/app/build/components/layout/PreviewPageHeader.vue +29 -10
- package/frontend-vue/layers/dms-layout/app/build/components/layout/StageCard.vue +1 -5
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +3 -8
- package/frontend-vue/layers/dms-layout/app/build/components/notification/NotificationPopover.vue +11 -3
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationInboxItem.vue +9 -12
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixCategory.vue +6 -2
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationMatrixSubject.vue +27 -22
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/NotificationPreferencesForm.vue +8 -10
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/notification/notificationDisplay.ts +39 -3
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/roles/role-permissions.ts +1 -1
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +38 -5
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/profile/useProfilePreferences.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/security/useSecurityOverview.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/build/utils/dev-reload-stream.ts +23 -4
- package/frontend-vue/layers/dms-layout/app/build/utils/module-store-install.ts +1 -3
- package/frontend-vue/layers/dms-layout/app/composables/notification/useNotifications.ts +1 -5
- package/frontend-vue/layers/dms-layout/app/custom-layouts/EmptyLayout.vue +39 -31
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +60 -4
- package/frontend-vue/layers/dms-layout/app/entries/components/pages/settings/shell/SettingsShell.ts +2 -0
- package/frontend-vue/layers/dms-layout/app/error.vue +1 -1
- package/frontend-vue/layers/dms-layout/app/middleware/module-routing.global.ts +7 -1
- package/frontend-vue/layers/dms-layout/app/plugins/dms-menu-sync.client.ts +14 -1
- package/frontend-vue/layers/dms-layout/app/utils/breadcrumb.ts +13 -0
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +1 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +5 -5
- package/frontend-vue/layers/dms-onboarding/app/build/components/onboarding/steps/StepPlatform.vue +3 -0
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/StepRegister.vue +3 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupHeaderActions.vue +1 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupInspector.vue +2 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupIssues.vue +22 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +125 -178
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewArrows.vue +110 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewFrameImage.vue +75 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +117 -6
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +67 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +10 -4
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +8 -1
- package/frontend-vue/layers/dms-ui/app/build/components/blocks/BlockActions.vue +4 -2
- package/frontend-vue/layers/dms-ui/app/build/components/table-view/ExpandedRowDetail.vue +26 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +247 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCaptureAssets.ts +181 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +8 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewRaster.ts +45 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +46 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +109 -35
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +4 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSectionEditing.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +3 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +136 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +68 -8
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewLinks.ts +17 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/blocks/useRefreshTriggers.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/confirm/fetchedConfirmDialog.ts +6 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultDisplayComponents.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/defaultPrimitiveTypes.ts +38 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/registerFieldTypes.ts +69 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/data-types/useColumnValueRenderer.ts +20 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentErrors.ts +1 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentRealtime.ts +4 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formComponentValidation.ts +4 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/form/formValidation.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/form/keyValueRows.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/form/useInstantForm.ts +4 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/period/periodQuery.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewDisplayContext.ts +35 -37
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewGrouping.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewListing.ts +21 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/tableViewSorting.ts +8 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useGroupedRows.ts +32 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableFooter.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableLiveHold.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/useTableRows.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/displayOptions.ts +14 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/groupedRows.ts +68 -6
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/recordLink.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/table-view/utils/tableQuery.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCard.vue +74 -51
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +18 -11
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupThumbnail.vue +34 -124
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +7 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewCapture.ts +96 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +10 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +29 -118
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +61 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/dotGrid.ts +37 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/legalIdentifier.ts +279 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +34 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +130 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +7 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +35 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +44 -17
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +1 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +26 -14
- package/frontend-vue/layers/dms-ui/app/build/utils/previewHeader.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +149 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +42 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +56 -6
- package/frontend-vue/layers/dms-ui/app/components/blocks/BannerBlock.vue +3 -4
- package/frontend-vue/layers/dms-ui/app/components/blocks/KeyValueListBlock.vue +4 -2
- package/frontend-vue/layers/dms-ui/app/components/blocks/StatGroupBlock.vue +4 -2
- package/frontend-vue/layers/dms-ui/app/components/code-snippet/CodeSnippet.vue +2 -3
- package/frontend-vue/layers/dms-ui/app/components/confirm/ConfirmModal.vue +7 -7
- package/frontend-vue/layers/dms-ui/app/components/flow-canvas/FlowCanvas.vue +4 -7
- package/frontend-vue/layers/dms-ui/app/components/form/FormBlock.vue +5 -1
- package/frontend-vue/layers/dms-ui/app/components/form/components/DatePicker.vue +4 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputCalendar.vue +4 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputCode.vue +1 -2
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputIdentifier.vue +90 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/InputPhone.vue +5 -0
- package/frontend-vue/layers/dms-ui/app/components/form/components/KeyValue.vue +2 -20
- package/frontend-vue/layers/dms-ui/app/components/key-value-list/KeyValueList.vue +52 -21
- package/frontend-vue/layers/dms-ui/app/composables/confirm/types.ts +5 -4
- package/frontend-vue/layers/dms-ui/app/composables/containers/types.ts +5 -8
- package/frontend-vue/layers/dms-ui/app/composables/form/useForm.ts +3 -8
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/action-target.ts +4 -2
- package/frontend-vue/layers/dms-ui/app/composables/table-view/types/config.ts +15 -10
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCapture.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/previewCaptureAssets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePreviewFrame.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/table-view/utils/displayOptions.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/mockups/manage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +3 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/legalIdentifier.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/types/modal.ts +1 -9
- package/frontend-vue/layers/dms-ui/app/types/quick-actions.ts +1 -2
- package/frontend-vue/layers/dms-ui/app/types/table/query.ts +5 -0
- package/frontend-vue/layers/dms-ui/app/utils/mockupAssistant.ts +1 -4
- package/frontend-vue/layers/dms-ui/app/utils/semanticTint.ts +1 -6
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +2 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +12 -10
- package/frontend-vue/package.json +5 -5
- package/frontend-vue/scripts/check-api-error-presentation.mjs +3 -3
- package/frontend-vue/scripts/check-invariants.mjs +101 -0
- package/frontend-vue/scripts/check-page-invariants.mjs +6 -9
- package/frontend-vue/scripts/dms-components-script.mjs +7 -7
- package/package.json +10 -11
- package/skills/dms/SKILL.md +4 -2
- package/skills/dms-module/SKILL.md +3 -0
|
@@ -72,6 +72,7 @@ function notifyNewLogin(user, device) {
|
|
|
72
72
|
const params = { ...delivery.params };
|
|
73
73
|
if (device.country) {
|
|
74
74
|
params.country = (0, sign_in_country_1.countryDisplayName)(device.country, user.language);
|
|
75
|
+
params.countryCode = device.country;
|
|
75
76
|
}
|
|
76
77
|
return (0, notification_emitter_1.emitNotification)(user._id, isRecognised ? templates.newLogin : templates.newLoginUnknownDevice, {
|
|
77
78
|
...delivery,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-notifications.js","sourceRoot":"","sources":["../../src/utils/account-notifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2EAGiD;AACjD,iEAKgC;AAChC,6DAA4E;AAC5E,uDAAuD;AAGvD,SAAS,gBAAgB,CACvB,SAAiB,EACjB,IAAY,EACZ,IAAkC;IAElC,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,+BAAe;QACxB,SAAS;QACT,MAAM,EAAE,yCAAkB,CAAC,QAAQ;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC;IAClE,qBAAqB,EAAE,gBAAgB,CACrC,0BAA0B,EAC1B,cAAc,EACd,SAAS,CACV;IACD,eAAe,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC;IACxE,YAAY,EAAE,gBAAgB,CAC5B,eAAe,EACf,sBAAsB,EACtB,SAAS,CACV;IACD,sBAAsB,EAAE,gBAAgB,CACtC,0BAA0B,EAC1B,uBAAuB,EACvB,SAAS,CACV;IACD,cAAc,EAAE,gBAAgB,CAC9B,kBAAkB,EAClB,eAAe,EACf,SAAS,CACV;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,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;AAC7D,CAAC;
|
|
1
|
+
{"version":3,"file":"account-notifications.js","sourceRoot":"","sources":["../../src/utils/account-notifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,2EAGiD;AACjD,iEAKgC;AAChC,6DAA4E;AAC5E,uDAAuD;AAGvD,SAAS,gBAAgB,CACvB,SAAiB,EACjB,IAAY,EACZ,IAAkC;IAElC,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,+BAAe;QACxB,SAAS;QACT,MAAM,EAAE,yCAAkB,CAAC,QAAQ;QACnC,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG;IAChB,QAAQ,EAAE,gBAAgB,CAAC,WAAW,EAAE,cAAc,EAAE,SAAS,CAAC;IAClE,qBAAqB,EAAE,gBAAgB,CACrC,0BAA0B,EAC1B,cAAc,EACd,SAAS,CACV;IACD,eAAe,EAAE,gBAAgB,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC;IACxE,YAAY,EAAE,gBAAgB,CAC5B,eAAe,EACf,sBAAsB,EACtB,SAAS,CACV;IACD,sBAAsB,EAAE,gBAAgB,CACtC,0BAA0B,EAC1B,uBAAuB,EACvB,SAAS,CACV;IACD,cAAc,EAAE,gBAAgB,CAC9B,kBAAkB,EAClB,eAAe,EACf,SAAS,CACV;IACD,aAAa,EAAE,gBAAgB,CAC7B,iBAAiB,EACjB,sBAAsB,EACtB,OAAO,CACR;IACD,gBAAgB,EAAE,gBAAgB,CAChC,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,CACR;IACD,OAAO,EAAE;QACP,IAAI,EAA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AAI,CAAC,EAAE,EAC/D,EAAE,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CACrD,CAAC;AACJ,CAAC;AAUD,6BACE,MAAc,EACd,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB;IAE1D,OAAO,IAAA,uCAAgB,EAAC,MAAM,EAAE,SAAS,CAAC,aAAa,EAAE;QACvD,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE;QACzC,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,aAAa;KACxE,CAAC,CAAC;AACL,CAAC;AAcD,gCACE,MAAc,EACd,EAAE,KAAK,EAAE,aAAa,EAAyB,EAC/C,OAAe;IAEf,OAAO,IAAA,uCAAgB,EAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,EAAE;QAC1D,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE;QACzC,cAAc,EAAE,sBAAsB,OAAO,EAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED,uBAA8B,MAAc,EAAE,IAAY;IACxD,OAAO,IAAA,uCAAgB,EACrB,MAAM,EACN,SAAS,CAAC,OAAO,EACjB,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendEmailChangeCode = sendEmailChangeCode;
|
|
4
4
|
exports.sendEmailChangeNotice = sendEmailChangeNotice;
|
|
5
|
-
const interface_email_1 = require("@antelopejs/interface-email");
|
|
6
5
|
const html_render_1 = require("@antelopejs/interface-dms/html-render");
|
|
7
6
|
const email_subjects_1 = require("./email-subjects");
|
|
7
|
+
const html_email_1 = require("./html-email");
|
|
8
8
|
const CodeTemplate = (0, html_render_1.RegisterHtmlTemplate)("EmailChangeVerification");
|
|
9
9
|
const NoticeTemplate = (0, html_render_1.RegisterHtmlTemplate)("EmailChangeNotice");
|
|
10
10
|
async function sendOrThrow(to, subject, html) {
|
|
11
|
-
const result = await (0,
|
|
11
|
+
const result = await (0, html_email_1.sendHtmlEmail)({ to, subject, html });
|
|
12
12
|
if (!result.success) {
|
|
13
13
|
throw new Error(`Failed to send email: ${result.error?.message}`);
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-change-mail.js","sourceRoot":"","sources":["../../src/utils/email-change-mail.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"email-change-mail.js","sourceRoot":"","sources":["../../src/utils/email-change-mail.ts"],"names":[],"mappings":";;;;AACA,uEAG+C;AAC/C,qDAAuD;AACvD,6CAA6C;AAe7C,MAAM,YAAY,GAAG,IAAA,kCAAoB,EACvC,yBAAyB,CAC1B,CAAC;AACF,MAAM,cAAc,GAClB,IAAA,kCAAoB,EAAwB,mBAAmB,CAAC,CAAC;AAEnE,KAAK,UAAU,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,IAAY;IAClE,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAa,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAOM,KAAK,8BACV,IAAU,EACV,QAAgB,EAChB,IAAY,EACZ,cAAsB;IAEtB,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAY,EAC7B,YAAY,EACZ;QACE,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK;QACjC,QAAQ;QACR,IAAI;QACJ,SAAS,EAAE,GAAG,cAAc,QAAQ;QACpC,cAAc;KACf,EACD,IAAI,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,WAAW,CACf,QAAQ,EACR,IAAA,oCAAmB,EAAC,yBAAyB,EAAE,IAAI,CAAC,QAAQ,CAAC,EAC7D,IAAI,CACL,CAAC;AACJ,CAAC;AAGM,KAAK,gCACV,IAAU,EACV,QAAgB;IAEhB,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAY,EAC7B,cAAc,EACd,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAC/C,IAAI,CAAC,QAAQ,CACd,CAAC;IACF,MAAM,WAAW,CACf,IAAI,CAAC,KAAK,EACV,IAAA,oCAAmB,EAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,EACvD,IAAI,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function emailPlainText(html: string): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emailPlainText = emailPlainText;
|
|
4
|
+
const parse5_1 = require("parse5");
|
|
5
|
+
const LINE_BREAK = "\n";
|
|
6
|
+
const PARAGRAPH_BREAK = "\n\n";
|
|
7
|
+
const SPACE = " ";
|
|
8
|
+
const UNREAD_ELEMENTS = new Set([
|
|
9
|
+
"head",
|
|
10
|
+
"img",
|
|
11
|
+
"noscript",
|
|
12
|
+
"picture",
|
|
13
|
+
"script",
|
|
14
|
+
"style",
|
|
15
|
+
"svg",
|
|
16
|
+
"template",
|
|
17
|
+
"title",
|
|
18
|
+
]);
|
|
19
|
+
const BLOCK_ELEMENTS = new Set([
|
|
20
|
+
"address",
|
|
21
|
+
"article",
|
|
22
|
+
"aside",
|
|
23
|
+
"blockquote",
|
|
24
|
+
"dd",
|
|
25
|
+
"div",
|
|
26
|
+
"dl",
|
|
27
|
+
"dt",
|
|
28
|
+
"footer",
|
|
29
|
+
"h1",
|
|
30
|
+
"h2",
|
|
31
|
+
"h3",
|
|
32
|
+
"h4",
|
|
33
|
+
"h5",
|
|
34
|
+
"h6",
|
|
35
|
+
"header",
|
|
36
|
+
"hr",
|
|
37
|
+
"li",
|
|
38
|
+
"main",
|
|
39
|
+
"ol",
|
|
40
|
+
"p",
|
|
41
|
+
"pre",
|
|
42
|
+
"section",
|
|
43
|
+
"table",
|
|
44
|
+
"td",
|
|
45
|
+
"th",
|
|
46
|
+
"tr",
|
|
47
|
+
"ul",
|
|
48
|
+
]);
|
|
49
|
+
const HIDDEN_STYLE = /(?:^|;)\s*display\s*:\s*none/i;
|
|
50
|
+
const WEB_LINK = /^https?:\/\//i;
|
|
51
|
+
const WHITESPACE_RUN = /\s+/g;
|
|
52
|
+
const BLANK_LINES = /\n{3,}/g;
|
|
53
|
+
function attributeOf(element, name) {
|
|
54
|
+
return element.attrs.find((entry) => entry.name === name)?.value ?? "";
|
|
55
|
+
}
|
|
56
|
+
function isRead(element) {
|
|
57
|
+
return (!UNREAD_ELEMENTS.has(element.tagName) &&
|
|
58
|
+
!HIDDEN_STYLE.test(attributeOf(element, "style")));
|
|
59
|
+
}
|
|
60
|
+
function linkAddress(element, label) {
|
|
61
|
+
const address = attributeOf(element, "href").trim();
|
|
62
|
+
if (element.tagName !== "a" || !WEB_LINK.test(address))
|
|
63
|
+
return "";
|
|
64
|
+
const shown = label.trim();
|
|
65
|
+
if (shown === address)
|
|
66
|
+
return "";
|
|
67
|
+
return shown === "" ? address : `: ${address}`;
|
|
68
|
+
}
|
|
69
|
+
function asBlock(element, text) {
|
|
70
|
+
return BLOCK_ELEMENTS.has(element.tagName)
|
|
71
|
+
? `${PARAGRAPH_BREAK}${text}${PARAGRAPH_BREAK}`
|
|
72
|
+
: text;
|
|
73
|
+
}
|
|
74
|
+
function readNode(node) {
|
|
75
|
+
if (parse5_1.defaultTreeAdapter.isTextNode(node)) {
|
|
76
|
+
return node.value.replaceAll(WHITESPACE_RUN, SPACE);
|
|
77
|
+
}
|
|
78
|
+
if (!parse5_1.defaultTreeAdapter.isElementNode(node) || !isRead(node))
|
|
79
|
+
return "";
|
|
80
|
+
if (node.tagName === "br")
|
|
81
|
+
return LINE_BREAK;
|
|
82
|
+
const inner = node.childNodes.map((child) => readNode(child)).join("");
|
|
83
|
+
return asBlock(node, `${inner}${linkAddress(node, inner)}`);
|
|
84
|
+
}
|
|
85
|
+
function emailPlainText(html) {
|
|
86
|
+
return (0, parse5_1.parse)(html)
|
|
87
|
+
.childNodes.map((node) => readNode(node))
|
|
88
|
+
.join("")
|
|
89
|
+
.split(LINE_BREAK)
|
|
90
|
+
.map((line) => line.trim())
|
|
91
|
+
.join(LINE_BREAK)
|
|
92
|
+
.replaceAll(BLANK_LINES, PARAGRAPH_BREAK)
|
|
93
|
+
.trim();
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=email-plain-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-plain-text.js","sourceRoot":"","sources":["../../src/utils/email-plain-text.ts"],"names":[],"mappings":";;;AAAA,mCAIgB;AAKhB,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,KAAK,GAAG,GAAG,CAAC;AAGlB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,MAAM;IACN,KAAK;IACL,UAAU;IACV,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;IACL,UAAU;IACV,OAAO;CACR,CAAC,CAAC;AAGH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,SAAS;IACT,SAAS;IACT,OAAO;IACP,YAAY;IACZ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ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21,7 +21,6 @@ const node_os_1 = __importDefault(require("node:os"));
|
|
|
21
21
|
const node_path_1 = __importDefault(require("node:path"));
|
|
22
22
|
const interface_api_util_1 = require("@antelopejs/interface-api-util");
|
|
23
23
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
24
|
-
const interface_email_1 = require("@antelopejs/interface-email");
|
|
25
24
|
const interface_file_storage_1 = require("@antelopejs/interface-file-storage");
|
|
26
25
|
const db_1 = require("@antelopejs/interface-dms/db");
|
|
27
26
|
const db_2 = require("@antelopejs/interface-dms/auth/db");
|
|
@@ -32,6 +31,7 @@ const zod_1 = require("zod");
|
|
|
32
31
|
const config_1 = require("../config");
|
|
33
32
|
const exportJobs_model_1 = require("@antelopejs/interface-dms/db/internal/exportJobs.model");
|
|
34
33
|
const email_subjects_1 = require("./email-subjects");
|
|
34
|
+
const html_email_1 = require("./html-email");
|
|
35
35
|
const run_in_batches_1 = require("./run-in-batches");
|
|
36
36
|
const export_jobs_1 = require("@antelopejs/interface-dms/base/export-jobs");
|
|
37
37
|
const time_1 = require("@antelopejs/interface-dms/utils/internal/time");
|
|
@@ -136,7 +136,7 @@ const emailDeliverer = {
|
|
|
136
136
|
const user = await (0, interface_database_decorators_1.GetModel)(db_2.UserModel).get(exportRecord.userId);
|
|
137
137
|
(0, interface_api_util_1.assert)(user, 500, "Export recipient not found");
|
|
138
138
|
const html = await (0, html_render_1.GenerateHtml)(ExportReadyTemplate, exportReadyEmailData(user, exportRecord), user.language);
|
|
139
|
-
const sent = await (0,
|
|
139
|
+
const sent = await (0, html_email_1.sendHtmlEmail)({
|
|
140
140
|
to: user.email,
|
|
141
141
|
subject: (0, email_subjects_1.builtInEmailSubject)("exportReady", user.language),
|
|
142
142
|
html,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-jobs.js","sourceRoot":"","sources":["../../src/utils/export-jobs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAuC;AACvC,sDAAyB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AAC;QACT,MAAM,IAAA,6BAAY,EAAC,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACrE,IAAI,MAAM,CAAC,UAAU;gBAAE,MAAM,uBAAuB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,GAAG,sBAAsB;YAAE,MAAM;QACnD,MAAM,IAAI,sBAAsB,CAAC;IACnC,CAAC;IACD,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;AACnC,CAAC;AAED,SAAS,uBAAuB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;AACvE,CAAC;AAED,6BAAoC,IAAY,EAAE,SAAiB;IACjE,MAAM,SAAS,GAAG,uBAAuB,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,GAAG,QAAQ,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendHtmlEmail = sendHtmlEmail;
|
|
4
|
+
const interface_email_1 = require("@antelopejs/interface-email");
|
|
5
|
+
const email_plain_text_1 = require("./email-plain-text");
|
|
6
|
+
function sendHtmlEmail(email) {
|
|
7
|
+
return (0, interface_email_1.Send)({ ...email, text: (0, email_plain_text_1.emailPlainText)(email.html) });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=html-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-email.js","sourceRoot":"","sources":["../../src/utils/html-email.ts"],"names":[],"mappings":";;;AAAA,iEAAmD;AACnD,yDAAoD;AAapD,uBAA8B,KAAgB;IAC5C,OAAO,IAAA,sBAAI,EAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,IAAA,iCAAc,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startsWith = startsWith;
|
|
4
|
+
exports.isPng = isPng;
|
|
5
|
+
exports.isWebp = isWebp;
|
|
6
|
+
const PNG_SIGNATURE = Buffer.from([
|
|
7
|
+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
|
|
8
|
+
]);
|
|
9
|
+
const RIFF_SIGNATURE = Buffer.from("RIFF");
|
|
10
|
+
const WEBP_SIGNATURE = Buffer.from("WEBP");
|
|
11
|
+
const WEBP_SIGNATURE_OFFSET = 8;
|
|
12
|
+
function startsWith(bytes, signature, offset = 0) {
|
|
13
|
+
return bytes.subarray(offset, offset + signature.length).equals(signature);
|
|
14
|
+
}
|
|
15
|
+
function isPng(bytes) {
|
|
16
|
+
return startsWith(bytes, PNG_SIGNATURE);
|
|
17
|
+
}
|
|
18
|
+
function isWebp(bytes) {
|
|
19
|
+
return (startsWith(bytes, RIFF_SIGNATURE) &&
|
|
20
|
+
startsWith(bytes, WEBP_SIGNATURE, WEBP_SIGNATURE_OFFSET));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=image-signatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-signatures.js","sourceRoot":"","sources":["../../src/utils/image-signatures.ts"],"names":[],"mappings":";;;;;AAAA,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC;IAChC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/C,CAAC,CAAC;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAGhC,oBACE,KAAa,EACb,SAAiB,EACjB,MAAM,GAAG,CAAC;IAEV,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC7E,CAAC;AAGD,eAAsB,KAAa;IACjC,OAAO,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAGD,gBAAuB,KAAa;IAClC,OAAO,CACL,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC;QACjC,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,qBAAqB,CAAC,CACzD,CAAC;AACJ,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -14,8 +14,10 @@ export * from "./auth-constants";
|
|
|
14
14
|
export * from "./auth-key";
|
|
15
15
|
export * from "./client-ip";
|
|
16
16
|
export * from "./email-change-mail";
|
|
17
|
+
export * from "./email-plain-text";
|
|
17
18
|
export * from "./email-subjects";
|
|
18
19
|
export * from "./failed-sign-ins";
|
|
20
|
+
export * from "./html-email";
|
|
19
21
|
export * from "./jwt-claims";
|
|
20
22
|
export * from "./login-throttle";
|
|
21
23
|
export * from "./notification-emitter";
|
package/dist/utils/index.js
CHANGED
|
@@ -30,8 +30,10 @@ __exportStar(require("./auth-constants"), exports);
|
|
|
30
30
|
__exportStar(require("./auth-key"), exports);
|
|
31
31
|
__exportStar(require("./client-ip"), exports);
|
|
32
32
|
__exportStar(require("./email-change-mail"), exports);
|
|
33
|
+
__exportStar(require("./email-plain-text"), exports);
|
|
33
34
|
__exportStar(require("./email-subjects"), exports);
|
|
34
35
|
__exportStar(require("./failed-sign-ins"), exports);
|
|
36
|
+
__exportStar(require("./html-email"), exports);
|
|
35
37
|
__exportStar(require("./jwt-claims"), exports);
|
|
36
38
|
__exportStar(require("./login-throttle"), exports);
|
|
37
39
|
__exportStar(require("./notification-emitter"), exports);
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,0DAAwC;AACxC,wFAAsE;AACtE,gFAA8D;AAC9D,wFAAsE;AACtE,qDAAmC;AACnC,0DAAwC;AACxC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,sDAAoC;AACpC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,+DAA6C;AAC7C,8CAA4B;AAC5B,8DAA4C;AAC5C,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,0DAAwC;AACxC,wFAAsE;AACtE,gFAA8D;AAC9D,wFAAsE;AACtE,qDAAmC;AACnC,0DAAwC;AACxC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,oDAAkC;AAClC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,kDAAgC;AAChC,oDAAkC;AAClC,gDAA8B;AAC9B,+DAA6C;AAC7C,8CAA4B;AAC5B,8DAA4C;AAC5C,oDAAkC;AAClC,oDAAkC;AAClC,qDAAmC;AACnC,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startKeepalive = void 0;
|
|
4
|
+
const SSE_KEEPALIVE_INTERVAL_MS = 20_000;
|
|
5
|
+
const KEEPALIVE_FRAME = ": keepalive\n\n";
|
|
6
|
+
const startKeepalive = (writer) => setInterval(() => writer.write(KEEPALIVE_FRAME), SSE_KEEPALIVE_INTERVAL_MS);
|
|
7
|
+
exports.startKeepalive = startKeepalive;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/sse-keepalive/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAOnC,MAAM,cAAc,GAAG,CAAC,MAE9B,EAAkB,EAAE,CACnB,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,yBAAyB,CAAC,CAAC;AAHjE,QAAA,cAAc,GAAd,cAAc,CAGmD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allowedKeysError = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const allowedKeysError = (issue) => {
|
|
6
|
+
if (issue.code !== "unrecognized_keys")
|
|
7
|
+
return undefined;
|
|
8
|
+
if (!(issue.inst instanceof zod_1.z.core.$ZodObject))
|
|
9
|
+
return undefined;
|
|
10
|
+
const written = issue.keys.map((key) => `"${key}"`).join(", ");
|
|
11
|
+
const allowed = Object.keys(issue.inst._zod.def.shape).join(", ");
|
|
12
|
+
const noun = issue.keys.length === 1 ? "key" : "keys";
|
|
13
|
+
return `Unrecognized ${noun}: ${written}; the keys are ${allowed}`;
|
|
14
|
+
};
|
|
15
|
+
exports.allowedKeysError = allowedKeysError;
|
|
16
|
+
//# sourceMappingURL=allowed-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-keys.js","sourceRoot":"","sources":["../../src/validation/allowed-keys.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAOjB,MAAM,gBAAgB,GAAwB,CAAC,KAAK,EAAE,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAmB;QAAE,OAAO,SAAS,CAAC;IACzD,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,OAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACtD,OAAO,gBAAgB,IAAI,KAAK,OAAO,kBAAkB,OAAO,EAAE,CAAC;AACrE,CAAC,CAAC;AAPW,QAAA,gBAAgB,GAAhB,gBAAgB,CAO3B"}
|
package/dist/validation/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./account-deletion.schema"), exports);
|
|
18
|
+
__exportStar(require("./allowed-keys"), exports);
|
|
18
19
|
__exportStar(require("./auth.schema"), exports);
|
|
19
20
|
__exportStar(require("./file.schema"), exports);
|
|
20
21
|
__exportStar(require("./issue-message"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,yDAAuC;AACvC,4DAA0C;AAC1C,qEAAmD;AACnD,gEAA8C;AAC9C,uDAAqC;AACrC,oDAAkC;AAClC,iDAA+B;AAC/B,yEAAuD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,yDAAuC;AACvC,4DAA0C;AAC1C,qEAAmD;AACnD,gEAA8C;AAC9C,uDAAqC;AACrC,oDAAkC;AAClC,iDAA+B;AAC/B,yEAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tests/fixtures/mockup-starters/
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { existsSync, readFileSync, realpathSync } from
|
|
2
|
-
import { dirname, isAbsolute, join, relative, sep } from
|
|
3
|
-
import type { DmsVitePluginEntry } from
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, sep } from "node:path";
|
|
3
|
+
import type { DmsVitePluginEntry } from "#dms/frontend-build";
|
|
4
4
|
|
|
5
|
-
type VitePlugin = Extract<DmsVitePluginEntry, { name: string }
|
|
5
|
+
type VitePlugin = Extract<DmsVitePluginEntry, { name: string }>;
|
|
6
6
|
|
|
7
|
-
const BACKEND_PACKAGE = "@antelopejs/dms"
|
|
8
|
-
const BACKEND_SOURCE =
|
|
9
|
-
const QUERY_OR_HASH = /[?#]
|
|
7
|
+
const BACKEND_PACKAGE = "@antelopejs/dms";
|
|
8
|
+
const BACKEND_SOURCE = "src";
|
|
9
|
+
const QUERY_OR_HASH = /[?#].*$/;
|
|
10
10
|
|
|
11
|
-
const backendRoots = new Map<string, string | null>()
|
|
11
|
+
const backendRoots = new Map<string, string | null>();
|
|
12
12
|
|
|
13
13
|
/** Whether a parsed manifest names its package. */
|
|
14
14
|
function isNamedManifest(value: unknown): value is { name: string } {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
return (
|
|
16
|
+
typeof value === "object" &&
|
|
17
|
+
value !== null &&
|
|
18
|
+
"name" in value &&
|
|
19
|
+
typeof value.name === "string"
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/** The package name a `package.json` declares, or `undefined`. */
|
|
24
24
|
function packageName(manifest: string): string | undefined {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
try {
|
|
26
|
+
const parsed: unknown = JSON.parse(readFileSync(manifest, "utf8"));
|
|
27
|
+
return isNamedManifest(parsed) ? parsed.name : undefined;
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/** The directory of the backend package that holds `directory`, or null. */
|
|
34
34
|
function backendRoot(directory: string): string | null {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
const known = backendRoots.get(directory);
|
|
36
|
+
if (known !== undefined) {
|
|
37
|
+
return known;
|
|
38
|
+
}
|
|
39
|
+
const manifest = join(directory, "package.json");
|
|
40
|
+
const parent = dirname(directory);
|
|
41
|
+
let root: string | null = null;
|
|
42
|
+
if (existsSync(manifest)) {
|
|
43
|
+
root = packageName(manifest) === BACKEND_PACKAGE ? directory : null;
|
|
44
|
+
} else if (parent !== directory) {
|
|
45
|
+
root = backendRoot(parent);
|
|
46
|
+
}
|
|
47
|
+
backendRoots.set(directory, root);
|
|
48
|
+
return root;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -55,28 +55,28 @@ function backendRoot(directory: string): string | null {
|
|
|
55
55
|
* the build workspace. Virtual ids and ids that are not files are ignored.
|
|
56
56
|
*/
|
|
57
57
|
function backendSourceFile(id: string): string | undefined {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
const path = id.replace(QUERY_OR_HASH, "");
|
|
59
|
+
if (!isAbsolute(path)) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
let real: string;
|
|
63
|
+
try {
|
|
64
|
+
real = realpathSync(path);
|
|
65
|
+
} catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const root = backendRoot(dirname(real));
|
|
69
|
+
if (root === null) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return relative(root, real).split(sep)[0] === BACKEND_SOURCE
|
|
73
|
+
? real
|
|
74
|
+
: undefined;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/** `path` with `/` separators, the form Vite gives an importer, so a boundary error names both paths alike on every OS. */
|
|
78
78
|
function forwardSlashes(path: string): string {
|
|
79
|
-
|
|
79
|
+
return path.split(sep).join("/");
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -92,36 +92,36 @@ function forwardSlashes(path: string): string {
|
|
|
92
92
|
* restores it on every run: change the plugin in the pack, not here.
|
|
93
93
|
*/
|
|
94
94
|
export function backendBoundary(): VitePlugin {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
return {
|
|
96
|
+
...boundaryCheck(),
|
|
97
|
+
config: () => ({ worker: { plugins: () => [boundaryCheck()] } }),
|
|
98
|
+
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/** The check alone, as a worker build runs it. */
|
|
102
102
|
function boundaryCheck(): VitePlugin {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
103
|
+
return {
|
|
104
|
+
name: `${BACKEND_PACKAGE}:backend-boundary`,
|
|
105
|
+
enforce: "pre",
|
|
106
|
+
async resolveId(source, importer, options) {
|
|
107
|
+
const resolved = await this.resolve(source, importer, {
|
|
108
|
+
...options,
|
|
109
|
+
skipSelf: true,
|
|
110
|
+
});
|
|
111
|
+
if (resolved === null) {
|
|
112
|
+
return resolved;
|
|
113
|
+
}
|
|
114
|
+
const file = backendSourceFile(resolved.id);
|
|
115
|
+
if (file === undefined) {
|
|
116
|
+
return resolved;
|
|
117
|
+
}
|
|
118
|
+
const from =
|
|
119
|
+
importer === undefined
|
|
120
|
+
? "an entry point"
|
|
121
|
+
: forwardSlashes(importer.replace(QUERY_OR_HASH, ""));
|
|
122
|
+
return this.error(
|
|
123
|
+
`Backend boundary: ${from} imports ${forwardSlashes(file)}, which is under the src of ${BACKEND_PACKAGE}. The frontend reaches the backend only through its HTTP interface.`,
|
|
124
|
+
);
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
127
|
}
|
|
@@ -168,10 +168,10 @@ computeResetState createActionValidator createFieldValueComparer
|
|
|
168
168
|
createTableViewDeleteShortcut createTableViewEscapeShortcut
|
|
169
169
|
createTableViewMetaRShortcut createTableViewShiftAShortcut
|
|
170
170
|
createTableViewShiftFShortcut createTableViewShiftNShortcut
|
|
171
|
-
createTrailingDeduper currentRegionalPreferences describeApiError
|
|
171
|
+
createTrailingDeduper crumbLabel currentRegionalPreferences describeApiError
|
|
172
172
|
describeFieldErrors detectDatetimeBuckets detectKeyboardPlatform
|
|
173
173
|
dispatchQuickActionTarget distributionMap downloadFile ensureApexLocale
|
|
174
|
-
evaluateRowActionRule extractRouteParams fieldErrorId
|
|
174
|
+
evaluateRowActionRule extractRouteParams fieldErrorId fieldErrorMessage
|
|
175
175
|
fieldValuesOfSubmitDefaults fillRouteParams findCascaderNode
|
|
176
176
|
findNavigableCategory findPageRoute firstAccessiblePagePath
|
|
177
177
|
flattenCascaderTree focusFirstFormError foldBreadcrumb formIssueMessage
|