@antelopejs/dms 0.25.8 → 0.25.9-next.1183.ga9db169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -48
- package/E2E.md +138 -0
- package/README.md +2 -2
- package/data/mockup-example/spec.json +13 -0
- package/data/mockup-spec.schema.json +399 -16
- package/dist/e2e/index.d.mts +2 -1
- package/dist/implementations/dms/live-pages.d.ts +6 -0
- package/dist/implementations/dms/live-pages.js +139 -0
- package/dist/implementations/dms/live-pages.js.map +1 -0
- package/dist/implementations/dms/page/notifications.js +2 -0
- package/dist/implementations/dms/page/notifications.js.map +1 -1
- package/dist/implementations/dms/page/registry.js +19 -4
- package/dist/implementations/dms/page/registry.js.map +1 -1
- package/dist/implementations/dms/registry-snapshot.d.ts +32 -0
- package/dist/implementations/dms/registry-snapshot.js +55 -0
- package/dist/implementations/dms/registry-snapshot.js.map +1 -0
- package/dist/implementations/dms/services.d.ts +2 -0
- package/dist/implementations/dms/services.js +2 -0
- package/dist/implementations/dms/services.js.map +1 -1
- package/dist/implementations/dms/tenant-access.d.ts +1 -0
- package/dist/implementations/dms/tenant-access.js +7 -0
- package/dist/implementations/dms/tenant-access.js.map +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js +1 -1
- package/dist/implementations/dms-builder/engine/compose-page.js.map +1 -1
- package/dist/implementations/dms-builder/engine/map-resources-pages.js +1 -1
- package/dist/implementations/dms-builder/engine/map-resources-pages.js.map +1 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.d.ts +2 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js +12 -1
- package/dist/implementations/dms-builder/engine/ops-blocks.js.map +1 -1
- package/dist/implementations/dms-builder/engine/table-view-settings.js +9 -33
- package/dist/implementations/dms-builder/engine/table-view-settings.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/mockup-export/capture.d.ts +19 -0
- package/dist/mcp/mockup-export/capture.js +99 -0
- package/dist/mcp/mockup-export/capture.js.map +1 -0
- package/dist/mcp/mockup-export/document.d.ts +4 -0
- package/dist/mcp/mockup-export/document.js +199 -0
- package/dist/mcp/mockup-export/document.js.map +1 -0
- package/dist/mcp/mockup-export/index.d.ts +20 -0
- package/dist/mcp/mockup-export/index.js +112 -0
- package/dist/mcp/mockup-export/index.js.map +1 -0
- package/dist/mcp/mockup-export/jobs.d.ts +32 -0
- package/dist/mcp/mockup-export/jobs.js +49 -0
- package/dist/mcp/mockup-export/jobs.js.map +1 -0
- package/dist/mcp/mockup-export/plan.d.ts +78 -0
- package/dist/mcp/mockup-export/plan.js +296 -0
- package/dist/mcp/mockup-export/plan.js.map +1 -0
- package/dist/mcp/mockup-export/route.d.ts +23 -0
- package/dist/mcp/mockup-export/route.js +91 -0
- package/dist/mcp/mockup-export/route.js.map +1 -0
- package/dist/mcp/page-verify/index.d.ts +15 -0
- package/dist/mcp/page-verify/index.js +16 -6
- package/dist/mcp/page-verify/index.js.map +1 -1
- package/dist/mcp/page-verify/mockup.d.ts +3 -1
- package/dist/mcp/page-verify/mockup.js +2 -0
- package/dist/mcp/page-verify/mockup.js.map +1 -1
- package/dist/mcp/page-verify/modules.d.ts +1 -0
- package/dist/mcp/page-verify/modules.js +22 -0
- package/dist/mcp/page-verify/modules.js.map +1 -0
- package/dist/mcp/page-verify/page-probe.d.ts +5 -0
- package/dist/mcp/page-verify/page-probe.js +2 -0
- package/dist/mcp/page-verify/page-probe.js.map +1 -1
- package/dist/mcp/page-verify/playwright.d.ts +22 -4
- package/dist/mcp/page-verify/playwright.js.map +1 -1
- package/dist/mcp/page-verify/report.d.ts +1 -0
- package/dist/mcp/tools/builder-compose.js +4 -1
- package/dist/mcp/tools/builder-compose.js.map +1 -1
- package/dist/mcp/tools/builder-pages.js +1 -1
- package/dist/mcp/tools/builder-pages.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.js +6 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/mockup-export-pdf.d.ts +1 -0
- package/dist/mcp/tools/mockup-export-pdf.js +69 -0
- package/dist/mcp/tools/mockup-export-pdf.js.map +1 -0
- package/dist/mcp/tools/mockup-install-modules.d.ts +9 -0
- package/dist/mcp/tools/mockup-install-modules.js +122 -0
- package/dist/mcp/tools/mockup-install-modules.js.map +1 -0
- package/dist/mcp/tools/mockup-module-catalog.d.ts +3 -0
- package/dist/mcp/tools/mockup-module-catalog.js +52 -0
- package/dist/mcp/tools/mockup-module-catalog.js.map +1 -0
- 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-read-spec.js +8 -6
- package/dist/mcp/tools/mockup-read-spec.js.map +1 -1
- package/dist/mcp/tools/mockup-support.js +18 -5
- package/dist/mcp/tools/mockup-support.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/mcp/tools/mockup.js +6 -0
- package/dist/mcp/tools/mockup.js.map +1 -1
- package/dist/mcp/tools/page-verify.d.ts +1 -0
- package/dist/mcp/tools/page-verify.js +6 -2
- package/dist/mcp/tools/page-verify.js.map +1 -1
- package/dist/mcp/tools/pages.d.ts +1 -0
- package/dist/mcp/tools/pages.js +9 -3
- package/dist/mcp/tools/pages.js.map +1 -1
- package/dist/mockup/annotations.js +2 -2
- package/dist/mockup/annotations.js.map +1 -1
- package/dist/mockup/apply-notes.js +1 -1
- package/dist/mockup/apply-notes.js.map +1 -1
- package/dist/mockup/compile-layouts.d.ts +5 -0
- package/dist/mockup/compile-layouts.js +74 -0
- package/dist/mockup/compile-layouts.js.map +1 -0
- package/dist/mockup/compile-modules.d.ts +5 -0
- package/dist/mockup/compile-modules.js +40 -0
- package/dist/mockup/compile-modules.js.map +1 -0
- package/dist/mockup/compile-nodes.d.ts +11 -0
- package/dist/mockup/compile-nodes.js +119 -0
- package/dist/mockup/compile-nodes.js.map +1 -0
- package/dist/mockup/compile-pages.d.ts +20 -0
- package/dist/mockup/compile-pages.js +272 -0
- package/dist/mockup/compile-pages.js.map +1 -0
- package/dist/mockup/compile.d.ts +10 -12
- package/dist/mockup/compile.js +36 -292
- package/dist/mockup/compile.js.map +1 -1
- package/dist/mockup/controller-blocks.js +2 -0
- package/dist/mockup/controller-blocks.js.map +1 -1
- package/dist/mockup/create.d.ts +16 -0
- package/dist/mockup/create.js +78 -0
- package/dist/mockup/create.js.map +1 -0
- package/dist/mockup/created-watch.d.ts +18 -0
- package/dist/mockup/created-watch.js +110 -0
- package/dist/mockup/created-watch.js.map +1 -0
- package/dist/mockup/database-routes.d.ts +15 -0
- package/dist/mockup/database-routes.js +58 -0
- package/dist/mockup/database-routes.js.map +1 -0
- package/dist/mockup/database-schema.d.ts +17 -0
- package/dist/mockup/database-schema.js +41 -0
- package/dist/mockup/database-schema.js.map +1 -0
- package/dist/mockup/entities.d.ts +20 -0
- package/dist/mockup/entities.js +213 -0
- package/dist/mockup/entities.js.map +1 -0
- package/dist/mockup/etag.d.ts +1 -0
- package/dist/mockup/etag.js +10 -0
- package/dist/mockup/etag.js.map +1 -0
- package/dist/mockup/extensions.d.ts +34 -0
- package/dist/mockup/extensions.js +107 -0
- package/dist/mockup/extensions.js.map +1 -0
- package/dist/mockup/files.d.ts +2 -1
- package/dist/mockup/files.js +2 -1
- package/dist/mockup/files.js.map +1 -1
- package/dist/mockup/fixture-answers.d.ts +3 -2
- package/dist/mockup/fixture-answers.js +13 -4
- package/dist/mockup/fixture-answers.js.map +1 -1
- package/dist/mockup/fixture-batch.d.ts +21 -0
- package/dist/mockup/fixture-batch.js +111 -0
- package/dist/mockup/fixture-batch.js.map +1 -0
- package/dist/mockup/fixture-routes.d.ts +21 -0
- package/dist/mockup/fixture-routes.js +136 -0
- package/dist/mockup/fixture-routes.js.map +1 -0
- package/dist/mockup/fixtures.d.ts +2 -29
- package/dist/mockup/fixtures.js +0 -111
- package/dist/mockup/fixtures.js.map +1 -1
- package/dist/mockup/from-page.js +2 -9
- package/dist/mockup/from-page.js.map +1 -1
- package/dist/mockup/generate.js +4 -1
- package/dist/mockup/generate.js.map +1 -1
- package/dist/mockup/history-routes.d.ts +2 -4
- package/dist/mockup/history-routes.js +30 -39
- package/dist/mockup/history-routes.js.map +1 -1
- package/dist/mockup/history.js +7 -3
- package/dist/mockup/history.js.map +1 -1
- package/dist/mockup/index.d.ts +14 -0
- package/dist/mockup/index.js +14 -0
- package/dist/mockup/index.js.map +1 -1
- package/dist/mockup/json-schema-entities.d.ts +5 -0
- package/dist/mockup/json-schema-entities.js +141 -0
- package/dist/mockup/json-schema-entities.js.map +1 -0
- package/dist/mockup/json-schema-layout.d.ts +1 -0
- package/dist/mockup/json-schema-layout.js +95 -2
- package/dist/mockup/json-schema-layout.js.map +1 -1
- package/dist/mockup/json-schema.d.ts +1 -1
- package/dist/mockup/json-schema.js +41 -20
- package/dist/mockup/json-schema.js.map +1 -1
- package/dist/mockup/json.d.ts +8 -0
- package/dist/mockup/json.js +20 -0
- package/dist/mockup/json.js.map +1 -0
- package/dist/mockup/layout-model.d.ts +156 -0
- package/dist/mockup/layout-model.js +96 -0
- package/dist/mockup/layout-model.js.map +1 -0
- package/dist/mockup/layouts.d.ts +9 -0
- package/dist/mockup/layouts.js +40 -0
- package/dist/mockup/layouts.js.map +1 -0
- package/dist/mockup/manage-routes.d.ts +3 -1
- package/dist/mockup/manage-routes.js +38 -1
- package/dist/mockup/manage-routes.js.map +1 -1
- package/dist/mockup/manage.js +1 -1
- package/dist/mockup/manage.js.map +1 -1
- package/dist/mockup/model.d.ts +145 -99
- package/dist/mockup/model.js +101 -86
- package/dist/mockup/model.js.map +1 -1
- package/dist/mockup/module-context.d.ts +25 -0
- package/dist/mockup/module-context.js +83 -0
- package/dist/mockup/module-context.js.map +1 -0
- package/dist/mockup/module-install.d.ts +22 -0
- package/dist/mockup/module-install.js +71 -0
- package/dist/mockup/module-install.js.map +1 -0
- package/dist/mockup/module-states.d.ts +17 -0
- package/dist/mockup/module-states.js +167 -0
- package/dist/mockup/module-states.js.map +1 -0
- package/dist/mockup/modules-schema.d.ts +2 -0
- package/dist/mockup/modules-schema.js +38 -0
- package/dist/mockup/modules-schema.js.map +1 -0
- package/dist/mockup/modules.d.ts +9 -10
- package/dist/mockup/modules.js +104 -25
- package/dist/mockup/modules.js.map +1 -1
- package/dist/mockup/page-capture-routes.d.ts +19 -0
- package/dist/mockup/page-capture-routes.js +92 -0
- package/dist/mockup/page-capture-routes.js.map +1 -0
- package/dist/mockup/page-captures.d.ts +61 -0
- package/dist/mockup/page-captures.js +252 -0
- package/dist/mockup/page-captures.js.map +1 -0
- package/dist/mockup/page-descriptions.d.ts +2 -0
- package/dist/mockup/page-descriptions.js +18 -0
- package/dist/mockup/page-descriptions.js.map +1 -0
- package/dist/mockup/parse-spec.d.ts +10 -0
- package/dist/mockup/parse-spec.js +62 -0
- package/dist/mockup/parse-spec.js.map +1 -0
- package/dist/mockup/places.d.ts +17 -0
- package/dist/mockup/places.js +75 -0
- package/dist/mockup/places.js.map +1 -0
- package/dist/mockup/presence-board.js +1 -1
- package/dist/mockup/presence-board.js.map +1 -1
- package/dist/mockup/presence-routes.js +2 -2
- package/dist/mockup/presence-routes.js.map +1 -1
- package/dist/mockup/refusals.d.ts +6 -0
- package/dist/mockup/refusals.js +17 -0
- package/dist/mockup/refusals.js.map +1 -1
- package/dist/mockup/routes.d.ts +3 -5
- package/dist/mockup/routes.js +24 -163
- package/dist/mockup/routes.js.map +1 -1
- package/dist/mockup/sketch-limits.d.ts +1 -0
- package/dist/mockup/sketch-limits.js +2 -1
- package/dist/mockup/sketch-limits.js.map +1 -1
- package/dist/mockup/sketch.d.ts +2 -2
- package/dist/mockup/sketch.js +2 -1
- package/dist/mockup/sketch.js.map +1 -1
- package/dist/mockup/slug.d.ts +3 -0
- package/dist/mockup/slug.js +7 -0
- package/dist/mockup/slug.js.map +1 -0
- package/dist/mockup/source-routes.d.ts +5 -4
- package/dist/mockup/source-routes.js +26 -17
- package/dist/mockup/source-routes.js.map +1 -1
- package/dist/mockup/source.d.ts +3 -3
- package/dist/mockup/source.js +4 -3
- package/dist/mockup/source.js.map +1 -1
- package/dist/mockup/state-patch.d.ts +22 -0
- package/dist/mockup/state-patch.js +76 -0
- package/dist/mockup/state-patch.js.map +1 -0
- package/dist/mockup/state.d.ts +163 -0
- package/dist/mockup/state.js +24 -0
- package/dist/mockup/state.js.map +1 -0
- package/dist/mockup/store-list.d.ts +28 -0
- package/dist/mockup/store-list.js +89 -0
- package/dist/mockup/store-list.js.map +1 -0
- package/dist/mockup/store.d.ts +25 -38
- package/dist/mockup/store.js +126 -203
- package/dist/mockup/store.js.map +1 -1
- package/dist/mockup/table-archive.d.ts +0 -1
- package/dist/mockup/table-archive.js +0 -16
- package/dist/mockup/table-archive.js.map +1 -1
- package/dist/mockup/tenancy.d.ts +19 -0
- package/dist/mockup/tenancy.js +73 -0
- package/dist/mockup/tenancy.js.map +1 -0
- package/dist/mockup/tenant-rows.d.ts +4 -0
- package/dist/mockup/tenant-rows.js +19 -0
- package/dist/mockup/tenant-rows.js.map +1 -0
- package/dist/mockup/unknown-keys.d.ts +2 -2
- package/dist/mockup/unknown-keys.js +8 -4
- package/dist/mockup/unknown-keys.js.map +1 -1
- package/dist/mockup/validate.d.ts +2 -2
- package/dist/mockup/validate.js.map +1 -1
- package/dist/store/catalog.d.ts +5 -1
- package/dist/store/catalog.js +12 -1
- package/dist/store/catalog.js.map +1 -1
- package/dist/store/changes.d.ts +3 -0
- package/dist/store/changes.js +22 -0
- package/dist/store/changes.js.map +1 -0
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.js +2 -0
- package/dist/store/index.js.map +1 -1
- package/dist/store/listing.js +5 -5
- package/dist/store/listing.js.map +1 -1
- package/dist/store/operations.d.ts +8 -0
- package/dist/store/operations.js +27 -3
- package/dist/store/operations.js.map +1 -1
- package/dist/store/registry.d.ts +1 -0
- package/dist/store/registry.js +9 -0
- package/dist/store/registry.js.map +1 -1
- package/dist/store/types.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/live-pages.d.ts +41 -0
- package/dist/types/live-pages.js +3 -0
- package/dist/types/live-pages.js.map +1 -0
- package/dist/validation/store.schema.d.ts +1 -0
- package/dist/validation/store.schema.js +4 -4
- package/dist/validation/store.schema.js.map +1 -1
- package/e2e/index.mjs +3 -2
- package/frontend-vue/build/viewer-chunks.ts +181 -0
- package/frontend-vue/dms.frontend.build.ts +2 -1
- package/frontend-vue/dms.frontend.ts +7 -0
- package/frontend-vue/eslint-globals.generated.mjs +27 -24
- package/frontend-vue/layers/dms-core/app/build/utils/asyncDataScope.ts +3 -31
- package/frontend-vue/layers/dms-core/app/build/utils/previewFrame.ts +6 -1
- package/frontend-vue/layers/dms-core/app/composables/auth/useAuthFetch.ts +8 -2
- package/frontend-vue/layers/dms-core/app/utils/localFetchAnswers.ts +124 -0
- package/frontend-vue/layers/dms-core/app/utils/textDigest.ts +29 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +4 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +4 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +89 -31
- package/frontend-vue/layers/dms-layout/app/build/components/layout/MockupSidebarMenu.vue +21 -6
- package/frontend-vue/layers/dms-layout/app/build/components/layout/SidebarUserMenu.vue +61 -8
- package/frontend-vue/layers/dms-layout/app/build/components/layout/mockupMenu.ts +79 -9
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsNav.vue +57 -8
- package/frontend-vue/layers/dms-layout/app/build/components/pages/settings/shell/SettingsShell.vue +12 -0
- package/frontend-vue/layers/dms-layout/app/build/composables/settings/useSettingsNavigation.ts +42 -62
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-mockups.ts +12 -2
- package/frontend-vue/layers/dms-layout/app/build/mockups/created-toast.ts +9 -1
- package/frontend-vue/layers/dms-layout/app/composables/page/useMockupStoreInstaller.ts +85 -0
- package/frontend-vue/layers/dms-layout/app/custom-layouts/MockupLayout.vue +0 -2
- package/frontend-vue/layers/dms-layout/app/custom-layouts/PreviewLayout.vue +53 -6
- package/frontend-vue/layers/dms-layout/app/plugins/mockup-store-installer.ts +10 -0
- package/frontend-vue/layers/dms-layout/app/plugins/registered-sidebar-widgets.ts +10 -0
- package/frontend-vue/layers/dms-layout/app/plugins/seo.ts +7 -0
- package/frontend-vue/layers/dms-layout/app/theme/actions.ts +11 -7
- package/frontend-vue/layers/dms-onboarding/app/middleware/onboarding.global.ts +3 -3
- package/frontend-vue/layers/dms-onboarding/app/plugins/onboarding-preload.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/BlockPreviewSketch.vue +31 -5
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupCanvasChrome.vue +2 -2
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabase.vue +204 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseData.vue +288 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseDiagram.vue +91 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseRelationEdge.vue +40 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupDatabaseTableNode.vue +133 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupEmptyState.vue +23 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModuleStore.vue +240 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverview.vue +54 -33
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSectionLabel.vue +52 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewSlot.vue +65 -12
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPagesList.vue +21 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinCard.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupPinLayer.vue +1 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupReconnecting.vue +17 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTenantBanner.vue +48 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTitle.vue +24 -15
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupToolbar.vue +196 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupTopBar.vue +200 -179
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWarningsMenu.vue +59 -0
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkbench.vue +152 -57
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupWorkspaceSwitcher.vue +142 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewAdmission.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewCapture.ts +71 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewNavigation.ts +44 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/previewSwapHold.ts +157 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/registeredSidebarWidgets.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/storeModuleInstaller.ts +32 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockInspector.ts +14 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useBlockPreviewEmbed.ts +309 -41
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useFixtureBatches.ts +154 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupActivation.ts +182 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupConnectionTables.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupDatabase.ts +212 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupEditing.ts +13 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameRender.ts +126 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupFrameSize.ts +10 -5
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupOverview.ts +50 -23
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageFrame.ts +103 -29
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPageZoom.ts +146 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPdfExport.ts +124 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupPins.ts +1 -1
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRealData.ts +11 -4
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupRoutePage.ts +60 -14
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSession.ts +8 -3
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupSpec.ts +6 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupTenancy.ts +36 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupToolModes.ts +5 -7
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerActivation.ts +59 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerExport.ts +46 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerPages.ts +44 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupViewerShortcuts.ts +13 -2
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useMockupWarningFocus.ts +145 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/useOverviewCaptures.ts +39 -10
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePersistedCaptures.ts +151 -0
- package/frontend-vue/layers/dms-ui/app/build/composables/block-preview/usePreviewFrame.ts +41 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCards.vue +37 -3
- package/frontend-vue/layers/dms-ui/app/build/mockups/MockupCreateModal.vue +130 -0
- package/frontend-vue/layers/dms-ui/app/build/mockups/manage.ts +20 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreview.ts +137 -78
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewChannel.ts +1 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewMessages.ts +165 -103
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewNavigation.ts +321 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/blockPreviewRects.ts +22 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockup.ts +112 -175
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupActivation.ts +120 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupAnnotations.ts +146 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupCaptures.ts +118 -9
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupDiagram.ts +330 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupEntities.ts +80 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupFrame.ts +123 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupLinks.ts +11 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModuleNavigation.ts +215 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupModules.ts +240 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverview.ts +21 -3
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupOverviewSections.ts +66 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPageTree.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupPins.ts +6 -8
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRealData.ts +23 -5
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupRows.ts +83 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSchema.ts +173 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSettings.ts +218 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupShortcuts.ts +17 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupSpec.ts +20 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStatePatch.ts +180 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupStream.ts +17 -2
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenancy.ts +148 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTenants.ts +23 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupTitles.ts +33 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/mockupVersions.ts +2 -7
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixtureAnswers.ts +156 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewFixturesOnly.ts +37 -19
- package/frontend-vue/layers/dms-ui/app/build/utils/previewOptionRules.ts +129 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageLayout.ts +108 -6
- package/frontend-vue/layers/dms-ui/app/build/utils/previewPageQuery.ts +5 -1
- package/frontend-vue/layers/dms-ui/app/build/utils/previewRows.ts +400 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/recordGuards.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/settingsGroups.ts +73 -0
- package/frontend-vue/layers/dms-ui/app/build/utils/sketch.ts +68 -12
- package/frontend-vue/layers/dms-ui/app/build/utils/urlVariables.ts +15 -0
- package/frontend-vue/layers/dms-ui/app/components/block-preview/BlockPreview.vue +61 -12
- package/frontend-vue/layers/dms-ui/app/components/block-preview/MockupViewer.vue +4 -1
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupModuleStore.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupTenantBanner.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/components/block-preview/MockupWorkspaceSwitcher.ts +2 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/registeredSidebarWidgets.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/storeModuleInstaller.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useFixtureBatches.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupActivation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupOverview.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupPdfExport.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupRoutePage.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupSession.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/useMockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/composables/block-preview/usePersistedCaptures.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/blockPreview.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/json.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupActivation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupAnnotations.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupDiagram.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupModuleNavigation.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupOverviewSections.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupRows.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSchema.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupSettings.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupStatePatch.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenancy.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTenants.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/mockupTitles.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewFixtureAnswers.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/previewRows.ts +1 -0
- package/frontend-vue/layers/dms-ui/app/entries/utils/settingsGroups.ts +1 -0
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-en-GB.json +85 -7
- package/frontend-vue/layers/dms-ui/i18n/locales/ui-fr-FR.json +85 -7
- package/frontend-vue/package.json +2 -2
- package/frontend-vue/scripts/test-dms-components.mjs +1 -1
- package/package.json +6 -5
- package/dist/mockup/row-filters.d.ts +0 -8
- package/dist/mockup/row-filters.js +0 -107
- package/dist/mockup/row-filters.js.map +0 -1
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupModules.vue +0 -47
- package/frontend-vue/layers/dms-ui/app/build/components/block-preview/MockupOverviewZoom.vue +0 -67
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.startExport = startExport;
|
|
18
|
+
const node_path_1 = require("node:path");
|
|
19
|
+
const mockup_1 = require("../../mockup");
|
|
20
|
+
const capture_1 = require("./capture");
|
|
21
|
+
const jobs_1 = require("./jobs");
|
|
22
|
+
const document_1 = require("./document");
|
|
23
|
+
const plan_1 = require("./plan");
|
|
24
|
+
__exportStar(require("./document"), exports);
|
|
25
|
+
__exportStar(require("./jobs"), exports);
|
|
26
|
+
__exportStar(require("./plan"), exports);
|
|
27
|
+
async function startExport(request) {
|
|
28
|
+
try {
|
|
29
|
+
return await startPrinting(request);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return {
|
|
33
|
+
ok: false,
|
|
34
|
+
reason: "failed",
|
|
35
|
+
message: `The export could not run: ${error instanceof Error ? error.message : String(error)}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function startPrinting(request) {
|
|
40
|
+
const { name, mockupsDir, options } = request;
|
|
41
|
+
const text = await (0, mockup_1.readSpecText)(mockupsDir, name);
|
|
42
|
+
if (text === undefined) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
reason: "no_mockup",
|
|
46
|
+
message: `Mockup "${name}" does not exist: no mockups/${name}/spec.json.`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const read = (0, mockup_1.parseSpec)(text);
|
|
50
|
+
if (!read.ok) {
|
|
51
|
+
return {
|
|
52
|
+
ok: false,
|
|
53
|
+
reason: "invalid",
|
|
54
|
+
message: `The spec of "${name}" does not parse: ${read.issues.map((issue) => `${issue.path || "/"} ${issue.message}`).join("; ")}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const notes = (await (0, mockup_1.listAnnotationsInSpec)(name, mockupsDir)) ?? [];
|
|
58
|
+
const listed = read.spec.modules ?? [];
|
|
59
|
+
const modules = (0, mockup_1.moduleStates)(listed, await (0, mockup_1.loadModuleContext)(listed));
|
|
60
|
+
const planned = (0, plan_1.planExport)(read.spec, notes, options, new Date(), modules);
|
|
61
|
+
if (!planned.ok) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
reason: "invalid",
|
|
65
|
+
message: (0, plan_1.describeRefusal)(planned.refusal),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const { plan } = planned;
|
|
69
|
+
const printed = (0, plan_1.planScreens)(plan);
|
|
70
|
+
const screens = printed.map((screen) => screen.pageId);
|
|
71
|
+
const job = jobs_1.exportJobs.start(name, screens.length, async (onDrawn, signal) => {
|
|
72
|
+
let drawn = new Set();
|
|
73
|
+
const pdf = await (0, capture_1.captureAndPrint)({
|
|
74
|
+
name,
|
|
75
|
+
pages: printed.map((screen) => ({
|
|
76
|
+
id: screen.pageId,
|
|
77
|
+
hasBlocks: screen.blocks.length > 0,
|
|
78
|
+
})),
|
|
79
|
+
...(plan.tenant && { saasTenant: plan.tenant.id }),
|
|
80
|
+
origin: request.origin,
|
|
81
|
+
}, (shots) => {
|
|
82
|
+
drawn = new Set(shots.keys());
|
|
83
|
+
return {
|
|
84
|
+
html: (0, document_1.exportDocument)(plan, name, shots),
|
|
85
|
+
pdf: {
|
|
86
|
+
format: "A4",
|
|
87
|
+
printBackground: true,
|
|
88
|
+
displayHeaderFooter: true,
|
|
89
|
+
headerTemplate: "<span></span>",
|
|
90
|
+
footerTemplate: (0, document_1.exportFooter)(plan),
|
|
91
|
+
preferCSSPageSize: true,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}, { onDrawn, signal });
|
|
95
|
+
signal.throwIfAborted();
|
|
96
|
+
await (0, mockup_1.writeAtomically)((0, node_path_1.join)((0, mockup_1.mockupDirectory)(mockupsDir, name), mockup_1.EXPORT_PDF_FILE), pdf);
|
|
97
|
+
return {
|
|
98
|
+
screens,
|
|
99
|
+
undrawn: screens.filter((id) => !drawn.has(id)),
|
|
100
|
+
schema: plan.schema !== undefined,
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
if (job === undefined) {
|
|
104
|
+
return {
|
|
105
|
+
ok: false,
|
|
106
|
+
reason: "running",
|
|
107
|
+
message: `An export of "${name}" already runs. Wait for it to end, then export again.`,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return { ok: true, ...job };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAiC;AACjC,yCAUsB;AACtB,uCAA4C;AAC5C,iCAAqD;AACrD,yCAA0D;AAC1D,iCAKgB;AAEhB,6CAA2B;AAC3B,yCAAuB;AACvB,yCAAuB;AA8BhB,KAAK,sBACV,OAAsB;IAEtB,IAAI,CAAC;QACH,OAAO,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SAC/F,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,OAAsB;IACjD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;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C,cAAc,EAAE,CAAC;QACxB,MAAM,IAAA,wBAAe,EACnB,IAAA,gBAAI,EAAC,IAAA,wBAAe,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,wBAAe,CAAC,EACxD,GAAG,CACJ,CAAC;QACF,OAAO;YACL,OAAO;YACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS;SAClC,CAAC;IACJ,CAAC,CACF,CAAC;IACF,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,iBAAiB,IAAI,wDAAwD;SACvF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MockupName } from "../../mockup";
|
|
2
|
+
export interface PrintedExport {
|
|
3
|
+
screens: string[];
|
|
4
|
+
undrawn: string[];
|
|
5
|
+
schema: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type FinishedJobView = ({
|
|
8
|
+
status: "done";
|
|
9
|
+
} & PrintedExport) | {
|
|
10
|
+
status: "failed";
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
export type ExportJobView = {
|
|
14
|
+
status: "running";
|
|
15
|
+
drawn: number;
|
|
16
|
+
total: number;
|
|
17
|
+
} | FinishedJobView;
|
|
18
|
+
export type ExportWork = (onDrawn: (drawn: number) => void, signal: AbortSignal) => Promise<PrintedExport>;
|
|
19
|
+
export interface StartedJob {
|
|
20
|
+
id: string;
|
|
21
|
+
finished: Promise<FinishedJobView>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createExportJobs(): {
|
|
24
|
+
start: (name: MockupName, total: number, work: ExportWork) => StartedJob | undefined;
|
|
25
|
+
status: (name: MockupName, id: string) => ExportJobView | undefined;
|
|
26
|
+
stop(): Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export declare const exportJobs: {
|
|
29
|
+
start: (name: MockupName, total: number, work: ExportWork) => StartedJob | undefined;
|
|
30
|
+
status: (name: MockupName, id: string) => ExportJobView | undefined;
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportJobs = void 0;
|
|
4
|
+
exports.createExportJobs = createExportJobs;
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
function createExportJobs() {
|
|
7
|
+
const jobs = new Map();
|
|
8
|
+
function start(name, total, work) {
|
|
9
|
+
if (jobs.get(name)?.view.status === "running")
|
|
10
|
+
return undefined;
|
|
11
|
+
const running = {
|
|
12
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
13
|
+
view: { status: "running", drawn: 0, total },
|
|
14
|
+
abort: new AbortController(),
|
|
15
|
+
};
|
|
16
|
+
const finished = work((drawn) => {
|
|
17
|
+
if (running.view.status === "running") {
|
|
18
|
+
running.view = { ...running.view, drawn };
|
|
19
|
+
}
|
|
20
|
+
}, running.abort.signal)
|
|
21
|
+
.then((printed) => ({ status: "done", ...printed }), (error) => ({
|
|
22
|
+
status: "failed",
|
|
23
|
+
message: `The export could not run: ${error instanceof Error ? error.message : String(error)}`,
|
|
24
|
+
}))
|
|
25
|
+
.then((last) => {
|
|
26
|
+
running.view = last;
|
|
27
|
+
return last;
|
|
28
|
+
});
|
|
29
|
+
const job = Object.assign(running, { finished });
|
|
30
|
+
jobs.set(name, job);
|
|
31
|
+
return { id: job.id, finished };
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
start,
|
|
35
|
+
status: (name, id) => {
|
|
36
|
+
const job = jobs.get(name);
|
|
37
|
+
return job?.id === id ? job.view : undefined;
|
|
38
|
+
},
|
|
39
|
+
async stop() {
|
|
40
|
+
const running = [...jobs.values()];
|
|
41
|
+
jobs.clear();
|
|
42
|
+
for (const job of running)
|
|
43
|
+
job.abort.abort();
|
|
44
|
+
await Promise.all(running.map((job) => job.finished));
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.exportJobs = createExportJobs();
|
|
49
|
+
//# sourceMappingURL=jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/jobs.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC;AA4CzC;IACE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAmB,CAAC;IAExC,SAAS,KAAK,CACZ,IAAgB,EAChB,KAAa,EACb,IAAgB;QAEhB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAChE,MAAM,OAAO,GAA0B;YACrC,EAAE,EAAE,IAAA,wBAAU,GAAE;YAChB,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;YAC5C,KAAK,EAAE,IAAI,eAAe,EAAE;SAC7B,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACtC,OAAO,CAAC,IAAI,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YAC5C,CAAC;QACH,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;aACrB,IAAI,CACH,CAAC,OAAO,EAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG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AC;AACJ,CAAC;AAGY,QAAA,UAAU,GAAG,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type AnnotationInSpec, type MockupModule, type MockupSpec } from "../../mockup";
|
|
3
|
+
export declare const exportOptionsSchema: z.ZodObject<{
|
|
4
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
+
annotations: z.ZodBoolean;
|
|
6
|
+
saasTenant: z.ZodOptional<z.ZodString>;
|
|
7
|
+
includeSchema: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type ExportOptions = z.infer<typeof exportOptionsSchema>;
|
|
10
|
+
type GroupKind = "app" | "custom" | "catalog";
|
|
11
|
+
export interface ExportGroup {
|
|
12
|
+
number: number;
|
|
13
|
+
title: string;
|
|
14
|
+
kind: GroupKind;
|
|
15
|
+
screens: ExportScreen[];
|
|
16
|
+
}
|
|
17
|
+
export interface ExportNote {
|
|
18
|
+
number: number;
|
|
19
|
+
text: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ExportScreen {
|
|
22
|
+
number: string;
|
|
23
|
+
pageId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
path: string[];
|
|
26
|
+
mode: string[];
|
|
27
|
+
blocks: string[];
|
|
28
|
+
notes: ExportNote[];
|
|
29
|
+
}
|
|
30
|
+
export interface ExportField {
|
|
31
|
+
name: string;
|
|
32
|
+
type: string;
|
|
33
|
+
to?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ExportEntity {
|
|
36
|
+
name: string;
|
|
37
|
+
tenantScoped: boolean;
|
|
38
|
+
fields: ExportField[];
|
|
39
|
+
}
|
|
40
|
+
export interface ExportPlan {
|
|
41
|
+
title: string;
|
|
42
|
+
date: string;
|
|
43
|
+
counts: {
|
|
44
|
+
pages: number;
|
|
45
|
+
modules: number;
|
|
46
|
+
entities: number;
|
|
47
|
+
};
|
|
48
|
+
groups: ExportGroup[];
|
|
49
|
+
tenant?: {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
53
|
+
schema?: ExportEntity[];
|
|
54
|
+
}
|
|
55
|
+
export type PlanRefusal = {
|
|
56
|
+
kind: "unknown_pages";
|
|
57
|
+
ids: string[];
|
|
58
|
+
known: string[];
|
|
59
|
+
} | {
|
|
60
|
+
kind: "no_saas";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "unknown_tenant";
|
|
63
|
+
id: string;
|
|
64
|
+
known: string[];
|
|
65
|
+
} | {
|
|
66
|
+
kind: "no_pages";
|
|
67
|
+
};
|
|
68
|
+
export type PlanResult = {
|
|
69
|
+
ok: true;
|
|
70
|
+
plan: ExportPlan;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
refusal: PlanRefusal;
|
|
74
|
+
};
|
|
75
|
+
export declare function planExport(spec: MockupSpec, notes: readonly AnnotationInSpec[], options: ExportOptions, now: Date, modules: readonly MockupModule[]): PlanResult;
|
|
76
|
+
export declare function planScreens(plan: ExportPlan): ExportScreen[];
|
|
77
|
+
export declare function describeRefusal(refusal: PlanRefusal): string;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportOptionsSchema = void 0;
|
|
4
|
+
exports.planExport = planExport;
|
|
5
|
+
exports.planScreens = planScreens;
|
|
6
|
+
exports.describeRefusal = describeRefusal;
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const mockup_1 = require("../../mockup");
|
|
9
|
+
exports.exportOptionsSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
pages: zod_1.z
|
|
12
|
+
.array(zod_1.z.string().min(1))
|
|
13
|
+
.min(1)
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("The page ids to print. Default: every page."),
|
|
16
|
+
annotations: zod_1.z
|
|
17
|
+
.boolean()
|
|
18
|
+
.describe("Print each page's open annotations under its screen."),
|
|
19
|
+
saasTenant: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("The id of a tenant of the spec's fixtures.tenants to draw every page as, in SaaS mode. Needs a module that provides tenancy, such as saas, to be installed in the project. Default: the first tenant, when one is."),
|
|
24
|
+
includeSchema: zod_1.z
|
|
25
|
+
.boolean()
|
|
26
|
+
.describe("End with the data model (ERD and entity table) when the spec has entities."),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
const APP_GROUP = "App";
|
|
30
|
+
const SETTINGS_SECTION = "Settings";
|
|
31
|
+
const SKETCH_TYPE = "sketch";
|
|
32
|
+
const CUSTOM_PAGE_BLOCK = "Custom page (sketch)";
|
|
33
|
+
const DATE_FORMAT = new Intl.DateTimeFormat("en-GB", {
|
|
34
|
+
day: "numeric",
|
|
35
|
+
month: "short",
|
|
36
|
+
year: "numeric",
|
|
37
|
+
timeZone: "UTC",
|
|
38
|
+
});
|
|
39
|
+
function nodeLabel(node) {
|
|
40
|
+
if (node.type === SKETCH_TYPE)
|
|
41
|
+
return "Sketch";
|
|
42
|
+
return node.componentName ?? node.type ?? "Block";
|
|
43
|
+
}
|
|
44
|
+
function blockList(pages) {
|
|
45
|
+
const counts = new Map();
|
|
46
|
+
const count = (label) => {
|
|
47
|
+
counts.set(label, (counts.get(label) ?? 0) + 1);
|
|
48
|
+
};
|
|
49
|
+
const visit = (nodes) => {
|
|
50
|
+
for (const node of nodes) {
|
|
51
|
+
count(nodeLabel(node));
|
|
52
|
+
visit(node.children ?? []);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
for (const page of pages) {
|
|
56
|
+
if (page.custom === true)
|
|
57
|
+
count(CUSTOM_PAGE_BLOCK);
|
|
58
|
+
else
|
|
59
|
+
visit(page.tree);
|
|
60
|
+
}
|
|
61
|
+
return [...counts].map(([label, total]) => total > 1 ? `${label} ×${total}` : label);
|
|
62
|
+
}
|
|
63
|
+
function rootPage(page, byId) {
|
|
64
|
+
let root = page;
|
|
65
|
+
const seen = new Set([page.id]);
|
|
66
|
+
for (let parent = page.parent ? byId.get(page.parent) : undefined; parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
67
|
+
seen.add(parent.id);
|
|
68
|
+
root = parent;
|
|
69
|
+
}
|
|
70
|
+
return root;
|
|
71
|
+
}
|
|
72
|
+
function categoryTitle(spec, page) {
|
|
73
|
+
return spec.categories?.find((category) => category.id === page.category)
|
|
74
|
+
?.title;
|
|
75
|
+
}
|
|
76
|
+
function sectionTitle(spec, root, group, isSettings) {
|
|
77
|
+
if (group.kind !== "app")
|
|
78
|
+
return group.title;
|
|
79
|
+
if (isSettings)
|
|
80
|
+
return SETTINGS_SECTION;
|
|
81
|
+
return categoryTitle(spec, root) ?? group.title;
|
|
82
|
+
}
|
|
83
|
+
function parentTitles(page, byId) {
|
|
84
|
+
const titles = [];
|
|
85
|
+
const seen = new Set();
|
|
86
|
+
for (let parent = page.parent && byId.get(page.parent); parent && !seen.has(parent.id); parent = parent.parent ? byId.get(parent.parent) : undefined) {
|
|
87
|
+
seen.add(parent.id);
|
|
88
|
+
titles.unshift(parent.title);
|
|
89
|
+
}
|
|
90
|
+
return titles;
|
|
91
|
+
}
|
|
92
|
+
function rootsOf(pages) {
|
|
93
|
+
const byId = new Map(pages.map((page) => [page.id, page]));
|
|
94
|
+
return new Map(pages.map((page) => [page.id, rootPage(page, byId).id]));
|
|
95
|
+
}
|
|
96
|
+
function withSubPages(tops, pages, roots, placed) {
|
|
97
|
+
const taken = [];
|
|
98
|
+
for (const page of tops.flatMap((top) => [
|
|
99
|
+
top,
|
|
100
|
+
...pages.filter((under) => under.id !== top.id && roots.get(under.id) === top.id),
|
|
101
|
+
])) {
|
|
102
|
+
if (placed.has(page.id))
|
|
103
|
+
continue;
|
|
104
|
+
placed.add(page.id);
|
|
105
|
+
taken.push(page);
|
|
106
|
+
}
|
|
107
|
+
return taken;
|
|
108
|
+
}
|
|
109
|
+
function menuOrder(tops, categories) {
|
|
110
|
+
const known = new Set(categories.map((category) => category.id));
|
|
111
|
+
const sectionOf = (page) => page.category !== undefined && known.has(page.category)
|
|
112
|
+
? page.category
|
|
113
|
+
: undefined;
|
|
114
|
+
return [
|
|
115
|
+
...tops.filter((page) => sectionOf(page) === undefined),
|
|
116
|
+
...categories.flatMap((category) => tops.filter((page) => sectionOf(page) === category.id)),
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
function screensOf(spec) {
|
|
120
|
+
return (0, mockup_1.placePages)(spec.modules ?? [], spec.pages).map((entry) => {
|
|
121
|
+
const page = (0, mockup_1.leadOf)(entry);
|
|
122
|
+
if (entry.kind === "page") {
|
|
123
|
+
return {
|
|
124
|
+
page,
|
|
125
|
+
contributors: [page],
|
|
126
|
+
isSettings: entry.place.kind === "settings",
|
|
127
|
+
...(entry.place.kind === "module" && { module: entry.place.module }),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const module = (0, mockup_1.menuModule)(entry.menu);
|
|
131
|
+
return {
|
|
132
|
+
page,
|
|
133
|
+
contributors: entry.pages,
|
|
134
|
+
isSettings: entry.menu === "settings",
|
|
135
|
+
...(module !== undefined && { module }),
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const I18N_KEY_PREFIX = "$";
|
|
140
|
+
function printedTitle(module) {
|
|
141
|
+
return module.title.startsWith(I18N_KEY_PREFIX) ? module.id : module.title;
|
|
142
|
+
}
|
|
143
|
+
function draftGroups(spec, installed, screened) {
|
|
144
|
+
const pages = screened.map((entry) => entry.page);
|
|
145
|
+
const roots = rootsOf(pages);
|
|
146
|
+
const tops = (module) => {
|
|
147
|
+
const own = screened.filter((entry) => entry.module === module);
|
|
148
|
+
const ids = new Set(own.map((entry) => entry.page.id));
|
|
149
|
+
return own
|
|
150
|
+
.map((entry) => entry.page)
|
|
151
|
+
.filter((page) => page.parent === undefined || !ids.has(page.parent));
|
|
152
|
+
};
|
|
153
|
+
const listed = installed.map((module) => ({
|
|
154
|
+
module,
|
|
155
|
+
tops: tops(module.id),
|
|
156
|
+
}));
|
|
157
|
+
const placed = new Set(listed.flatMap((entry) => entry.tops.map((page) => page.id)));
|
|
158
|
+
const app = {
|
|
159
|
+
title: APP_GROUP,
|
|
160
|
+
kind: "app",
|
|
161
|
+
pages: withSubPages(menuOrder(tops(undefined), spec.categories ?? []), pages, roots, placed),
|
|
162
|
+
};
|
|
163
|
+
for (const entry of listed)
|
|
164
|
+
for (const page of entry.tops)
|
|
165
|
+
placed.delete(page.id);
|
|
166
|
+
const modules = listed.map(({ module, tops: moduleTops }) => ({
|
|
167
|
+
title: printedTitle(module),
|
|
168
|
+
kind: module.kind,
|
|
169
|
+
pages: withSubPages(moduleTops, pages, roots, placed),
|
|
170
|
+
}));
|
|
171
|
+
return [app, ...modules].filter((group) => group.pages.length > 0);
|
|
172
|
+
}
|
|
173
|
+
function refuseUnknownPages(groups, asked) {
|
|
174
|
+
if (asked === undefined)
|
|
175
|
+
return undefined;
|
|
176
|
+
const known = groups.flatMap((group) => group.pages.map((page) => page.id));
|
|
177
|
+
const ids = asked.filter((id) => !known.includes(id));
|
|
178
|
+
return ids.length ? { kind: "unknown_pages", ids, known } : undefined;
|
|
179
|
+
}
|
|
180
|
+
function schemaOf(spec) {
|
|
181
|
+
return Object.entries(spec.entities ?? {}).map(([name, entity]) => ({
|
|
182
|
+
name,
|
|
183
|
+
tenantScoped: entity.tenantScoped === true,
|
|
184
|
+
fields: Object.entries(entity.fields).map(([field, type]) => ({
|
|
185
|
+
name: field,
|
|
186
|
+
type: type.type,
|
|
187
|
+
...(type.type === "ref" && { to: type.to }),
|
|
188
|
+
})),
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
function tenantOf(spec, modules, id) {
|
|
192
|
+
const tenancy = (0, mockup_1.hasTenancy)(modules);
|
|
193
|
+
if (id !== undefined && !tenancy)
|
|
194
|
+
return { kind: "no_saas" };
|
|
195
|
+
if (!tenancy)
|
|
196
|
+
return { ok: true };
|
|
197
|
+
const tenants = spec.fixtures?.tenants ?? [];
|
|
198
|
+
if (id === undefined) {
|
|
199
|
+
const first = tenants[0];
|
|
200
|
+
return first
|
|
201
|
+
? { ok: true, tenant: { id: first.id, name: first.name } }
|
|
202
|
+
: { ok: true };
|
|
203
|
+
}
|
|
204
|
+
const found = tenants.find((tenant) => tenant.id === id);
|
|
205
|
+
if (!found)
|
|
206
|
+
return {
|
|
207
|
+
kind: "unknown_tenant",
|
|
208
|
+
id,
|
|
209
|
+
known: tenants.map((tenant) => tenant.id),
|
|
210
|
+
};
|
|
211
|
+
return { ok: true, tenant: { id: found.id, name: found.name } };
|
|
212
|
+
}
|
|
213
|
+
function planExport(spec, notes, options, now, modules) {
|
|
214
|
+
const tenant = tenantOf(spec, modules, options.saasTenant);
|
|
215
|
+
if (!("ok" in tenant))
|
|
216
|
+
return { ok: false, refusal: tenant };
|
|
217
|
+
const screened = screensOf(spec);
|
|
218
|
+
const drafts = draftGroups(spec, modules, screened);
|
|
219
|
+
const unknown = refuseUnknownPages(drafts, options.pages);
|
|
220
|
+
if (unknown)
|
|
221
|
+
return { ok: false, refusal: unknown };
|
|
222
|
+
const asked = options.pages && new Set(options.pages);
|
|
223
|
+
const byId = new Map(spec.pages.map((page) => [page.id, page]));
|
|
224
|
+
const contributors = new Map(screened.map((entry) => [entry.page.id, entry.contributors]));
|
|
225
|
+
const settings = new Set(screened.flatMap((entry) => (entry.isSettings ? [entry.page.id] : [])));
|
|
226
|
+
const groups = drafts
|
|
227
|
+
.map((draft) => ({
|
|
228
|
+
...draft,
|
|
229
|
+
pages: draft.pages.filter((page) => !asked || asked.has(page.id)),
|
|
230
|
+
}))
|
|
231
|
+
.filter((draft) => draft.pages.length > 0)
|
|
232
|
+
.map((draft, index) => ({
|
|
233
|
+
number: index + 1,
|
|
234
|
+
title: draft.title,
|
|
235
|
+
kind: draft.kind,
|
|
236
|
+
screens: draft.pages.map((page, at) => ({
|
|
237
|
+
number: `${index + 1}.${at + 1}`,
|
|
238
|
+
pageId: page.id,
|
|
239
|
+
title: page.title,
|
|
240
|
+
path: [
|
|
241
|
+
sectionTitle(spec, rootPage(page, byId), draft, settings.has(page.id)),
|
|
242
|
+
...parentTitles(page, byId),
|
|
243
|
+
page.title,
|
|
244
|
+
],
|
|
245
|
+
mode: [
|
|
246
|
+
{
|
|
247
|
+
app: "App page",
|
|
248
|
+
custom: "Custom module",
|
|
249
|
+
catalog: "Catalog module",
|
|
250
|
+
}[draft.kind],
|
|
251
|
+
page.custom === true ? "custom page" : "fixtures",
|
|
252
|
+
...(tenant.tenant ? [`SaaS mode: ${tenant.tenant.name}`] : []),
|
|
253
|
+
],
|
|
254
|
+
blocks: blockList(contributors.get(page.id) ?? [page]),
|
|
255
|
+
notes: options.annotations
|
|
256
|
+
? notes.flatMap((note, at) => (contributors.get(page.id) ?? [page]).some((own) => own.id === note.page) && note.status === "open"
|
|
257
|
+
? [{ number: at + 1, text: note.text }]
|
|
258
|
+
: [])
|
|
259
|
+
: [],
|
|
260
|
+
})),
|
|
261
|
+
}));
|
|
262
|
+
if (groups.length === 0)
|
|
263
|
+
return { ok: false, refusal: { kind: "no_pages" } };
|
|
264
|
+
const schema = schemaOf(spec);
|
|
265
|
+
return {
|
|
266
|
+
ok: true,
|
|
267
|
+
plan: {
|
|
268
|
+
title: spec.title ?? "Mockup",
|
|
269
|
+
date: DATE_FORMAT.format(now),
|
|
270
|
+
counts: {
|
|
271
|
+
pages: groups.reduce((sum, group) => sum + group.screens.length, 0),
|
|
272
|
+
modules: spec.modules?.length ?? 0,
|
|
273
|
+
entities: schema.length,
|
|
274
|
+
},
|
|
275
|
+
groups,
|
|
276
|
+
...(tenant.tenant && { tenant: tenant.tenant }),
|
|
277
|
+
...(options.includeSchema && schema.length > 0 && { schema }),
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function planScreens(plan) {
|
|
282
|
+
return plan.groups.flatMap((group) => group.screens);
|
|
283
|
+
}
|
|
284
|
+
function describeRefusal(refusal) {
|
|
285
|
+
switch (refusal.kind) {
|
|
286
|
+
case "unknown_pages":
|
|
287
|
+
return `No page of the mockup has the id ${refusal.ids.map((id) => `"${id}"`).join(", ")}. Its pages: ${refusal.known.join(", ") || "none"}.`;
|
|
288
|
+
case "no_saas":
|
|
289
|
+
return 'saasTenant draws a page in SaaS mode, which a mockup has once a module that provides tenancy, such as "saas", is installed in the project.';
|
|
290
|
+
case "unknown_tenant":
|
|
291
|
+
return `No tenant of the spec's fixtures.tenants has the id "${refusal.id}". Its tenants: ${refusal.known.join(", ") || "none"}.`;
|
|
292
|
+
case "no_pages":
|
|
293
|
+
return "The mockup has no page to export.";
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/mcp/mockup-export/plan.ts"],"names":[],"mappings":";;;;;;AAAA,6BAAwB;AACxB,yCAUsB;AAGT,QAAA,mBAAmB,GAAG,OAAC;KACjC,MAAM,CAAC;IACN,KAAK,EAAE,OAAC;SACL,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,WAAW,EAAE,OAAC;SACX,OAAO,EAAE;SACT,QAAQ,CAAC,sDAAsD,CAAC;IACnE,UAAU,EAAE,OAAC;SACV,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,oNAAoN,CACrN;IACH,aAAa,EAAE,OAAC;SACb,OAAO,EAAE;SACT,QAAQ,CACP,4EAA4E,CAC7E;CACJ,CAAC;KACD,MAAM,EAAE,C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CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC;QAChJ,KAAK,SAAS;YACZ,OAAO,4IAA4I,CAAC;QACtJ,KAAK,gBAAgB;YACnB,OAAO,wDAAwD,OAAO,CAAC,EAAE,mBAAmB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC;QACpI,KAAK,UAAU;YACb,OAAO,mCAAmC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ExportJobView } from ".";
|
|
2
|
+
export type ExportStartAnswer = {
|
|
3
|
+
ok: true;
|
|
4
|
+
id: string;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function registerMockupExportRoute(mockupsDir: string): {
|
|
10
|
+
new (...args: any[]): {
|
|
11
|
+
assertOwner(): Promise<void>;
|
|
12
|
+
owner(): Promise<import("../../mockup").Who>;
|
|
13
|
+
start(rawName: string, body: unknown): Promise<ExportStartAnswer>;
|
|
14
|
+
status(rawName: string, id: string): Promise<ExportJobView>;
|
|
15
|
+
download(rawName: string, id: string): Promise<void>;
|
|
16
|
+
requestContext: import("@antelopejs/interface-api").RequestContext;
|
|
17
|
+
roleModel: import("@antelopejs/interface-dms/db").RoleModel;
|
|
18
|
+
memberModel: import("@antelopejs/interface-dms/db").TenantMemberModel;
|
|
19
|
+
user: import("@antelopejs/interface-dms/auth/db").User | undefined;
|
|
20
|
+
};
|
|
21
|
+
extend: <T extends import("@antelopejs/interface-api").ControllerClass>(this: T, location: string) => T;
|
|
22
|
+
location: string;
|
|
23
|
+
};
|