create-windy 0.2.6 → 0.2.8
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/README.md +14 -3
- package/dist/cli.js +191 -87
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/README.md +8 -0
- package/template/apps/server/Dockerfile +2 -0
- package/template/apps/server/package.json +10 -8
- package/template/apps/server/src/access-guards.ts +1 -1
- package/template/apps/server/src/admin/routes.test.ts +10 -0
- package/template/apps/server/src/admin/routes.ts +4 -2
- package/template/apps/server/src/agent/routes.test.ts +1 -1
- package/template/apps/server/src/agent/routes.ts +2 -2
- package/template/apps/server/src/application-services.ts +3 -0
- package/template/apps/server/src/audit/drizzle-log-store.ts +2 -2
- package/template/apps/server/src/audit/policy.ts +1 -1
- package/template/apps/server/src/audit/recovery-queue.test.ts +1 -1
- package/template/apps/server/src/audit/recovery-queue.ts +1 -1
- package/template/apps/server/src/audit/redaction.ts +1 -1
- package/template/apps/server/src/audit/reliable-writer.test.ts +1 -1
- package/template/apps/server/src/audit/reliable-writer.ts +1 -1
- package/template/apps/server/src/audit/search-summary.ts +1 -1
- package/template/apps/server/src/auth/authentication-provider.test.ts +1 -1
- package/template/apps/server/src/auth/credential-service.ts +1 -1
- package/template/apps/server/src/auth/drizzle-repository.ts +2 -2
- package/template/apps/server/src/auth/drizzle-session-operations.ts +1 -1
- package/template/apps/server/src/auth/own-session-routes.test.ts +1 -1
- package/template/apps/server/src/auth/password.ts +2 -4
- package/template/apps/server/src/auth/repository.ts +1 -1
- package/template/apps/server/src/auth/routes.test.ts +1 -1
- package/template/apps/server/src/auth/service.ts +1 -1
- package/template/apps/server/src/bulk-data/artifact-store.ts +1 -1
- package/template/apps/server/src/bulk-data/dictionary-handler.ts +1 -1
- package/template/apps/server/src/bulk-data/drizzle-repository.ts +3 -3
- package/template/apps/server/src/bulk-data/repository.ts +1 -1
- package/template/apps/server/src/bulk-data/routes.test.ts +1 -1
- package/template/apps/server/src/bulk-data/routes.ts +1 -1
- package/template/apps/server/src/bulk-data/service.test.ts +1 -1
- package/template/apps/server/src/bulk-data/service.ts +1 -1
- package/template/apps/server/src/bulk-data/types.ts +1 -1
- package/template/apps/server/src/configuration/bootstrap.ts +2 -2
- package/template/apps/server/src/configuration/definition.ts +2 -2
- package/template/apps/server/src/configuration/drizzle-repository.ts +2 -2
- package/template/apps/server/src/configuration/repository.ts +1 -1
- package/template/apps/server/src/configuration/routes.ts +1 -1
- package/template/apps/server/src/configuration/service.ts +1 -1
- package/template/apps/server/src/data-access/context.ts +2 -2
- package/template/apps/server/src/data-access/query-specification.test.ts +1 -1
- package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +1 -1
- package/template/apps/server/src/data-access/scoped-repository.ts +1 -1
- package/template/apps/server/src/data-access/scoped-resource.test.ts +1 -1
- package/template/apps/server/src/data-access/scoped-resource.ts +1 -1
- package/template/apps/server/src/data-governance/export/approval-port.ts +1 -1
- package/template/apps/server/src/data-governance/export/drizzle-repository.ts +1 -1
- package/template/apps/server/src/data-governance/export/job-runtime.test.ts +2 -2
- package/template/apps/server/src/data-governance/export/job-runtime.ts +2 -3
- package/template/apps/server/src/data-governance/export/postgres-api-fixture.ts +2 -2
- package/template/apps/server/src/data-governance/export/postgres-api.integration.test.ts +1 -1
- package/template/apps/server/src/data-governance/export/routes-test-fixture.ts +3 -3
- package/template/apps/server/src/data-governance/export/routes.ts +1 -1
- package/template/apps/server/src/data-governance/export/scope-snapshot.ts +1 -1
- package/template/apps/server/src/data-governance/export/service.ts +2 -2
- package/template/apps/server/src/data-governance/export/source.ts +1 -1
- package/template/apps/server/src/data-governance/export/types.ts +1 -1
- package/template/apps/server/src/data-governance/plaintext-access.test.ts +1 -1
- package/template/apps/server/src/data-governance/plaintext-access.ts +1 -1
- package/template/apps/server/src/data-governance/plaintext-postgres.integration.test.ts +1 -1
- package/template/apps/server/src/data-governance/user-plaintext-routes.ts +1 -1
- package/template/apps/server/src/data-governance/user-projection.ts +2 -2
- package/template/apps/server/src/example-modules.ts +25 -1
- package/template/apps/server/src/feature/manifest-feature-repository.test.ts +1 -1
- package/template/apps/server/src/feature/manifest-feature-repository.ts +1 -1
- package/template/apps/server/src/feature/routes.ts +3 -6
- package/template/apps/server/src/foundation-access.test.ts +1 -1
- package/template/apps/server/src/foundation-access.ts +1 -1
- package/template/apps/server/src/foundation.ts +21 -7
- package/template/apps/server/src/guards.test.ts +1 -1
- package/template/apps/server/src/guards.ts +3 -3
- package/template/apps/server/src/index.ts +27 -3
- package/template/{packages/modules → apps/server}/src/installed-business-modules.ts +2 -2
- package/template/apps/server/src/jobs/artifact-service.test.ts +1 -1
- package/template/apps/server/src/jobs/artifact-service.ts +2 -2
- package/template/apps/server/src/jobs/drizzle-artifact.ts +2 -2
- package/template/apps/server/src/jobs/drizzle-claim.ts +1 -1
- package/template/apps/server/src/jobs/drizzle-execution-repository.ts +2 -2
- package/template/apps/server/src/jobs/drizzle-execution.integration.test.ts +1 -1
- package/template/apps/server/src/jobs/drizzle-lease.ts +2 -2
- package/template/apps/server/src/jobs/drizzle-mappers.ts +3 -3
- package/template/apps/server/src/jobs/drizzle-recovery-repository.ts +1 -1
- package/template/apps/server/src/jobs/drizzle-repository.integration.test.ts +1 -1
- package/template/apps/server/src/jobs/drizzle-repository.ts +3 -3
- package/template/apps/server/src/jobs/execution-repository.ts +1 -1
- package/template/apps/server/src/jobs/execution.test.ts +2 -2
- package/template/apps/server/src/jobs/in-memory-claim.ts +1 -1
- package/template/apps/server/src/jobs/in-memory-execution.ts +1 -1
- package/template/apps/server/src/jobs/in-memory-lease.ts +1 -1
- package/template/apps/server/src/jobs/legacy-adapter.integration.test.ts +1 -1
- package/template/apps/server/src/jobs/legacy-adapter.test.ts +1 -1
- package/template/apps/server/src/jobs/legacy-adapter.ts +1 -1
- package/template/apps/server/src/jobs/legacy-service-runtime.ts +4 -2
- package/template/apps/server/src/jobs/repository.ts +2 -2
- package/template/apps/server/src/jobs/service.ts +2 -2
- package/template/apps/server/src/jobs/worker.ts +3 -2
- package/template/apps/server/src/license/legacy-license-resolver.ts +1 -1
- package/template/apps/server/src/license/license-resolver.test.ts +1 -1
- package/template/apps/server/src/license/license-resolver.ts +3 -3
- package/template/apps/server/src/license/routes-offline-code.test.ts +2 -2
- package/template/apps/server/src/license/routes.ts +1 -1
- package/template/apps/server/src/license/runtime-audit-reliability.test.ts +2 -2
- package/template/apps/server/src/license/runtime-reminder.test.ts +2 -2
- package/template/apps/server/src/license/runtime-service.test.ts +2 -2
- package/template/apps/server/src/license/runtime-service.ts +2 -2
- package/template/apps/server/src/module-composition.test.ts +1 -1
- package/template/apps/server/src/module-composition.ts +1 -1
- package/template/apps/server/src/module-host.test.ts +145 -0
- package/template/apps/server/src/module-host.ts +110 -0
- package/template/apps/server/src/notification/drizzle-repository.ts +2 -2
- package/template/apps/server/src/notification/repository.ts +1 -1
- package/template/apps/server/src/notification/routes.ts +1 -1
- package/template/apps/server/src/pagination.ts +1 -1
- package/template/apps/server/src/persistence.integration.test.ts +1 -1
- package/template/apps/server/src/persistence.ts +1 -1
- package/template/apps/server/src/profile/routes.ts +1 -1
- package/template/apps/server/src/route-guards.test.ts +1 -1
- package/template/apps/server/src/route-guards.ts +1 -1
- package/template/apps/server/src/runtime-feature.ts +125 -0
- package/template/apps/server/src/runtime-license.ts +1 -1
- package/template/apps/server/src/runtime.test.ts +48 -1
- package/template/apps/server/src/runtime.ts +17 -64
- package/template/apps/server/src/scheduler/audit.ts +1 -1
- package/template/apps/server/src/scheduler/definitions.test.ts +1 -1
- package/template/apps/server/src/scheduler/definitions.ts +2 -2
- package/template/apps/server/src/scheduler/drizzle-durable-links.ts +1 -1
- package/template/apps/server/src/scheduler/drizzle-mappers.ts +1 -1
- package/template/apps/server/src/scheduler/drizzle-repository.ts +1 -1
- package/template/apps/server/src/scheduler/execution-recorder.ts +1 -1
- package/template/apps/server/src/scheduler/history.ts +1 -1
- package/template/apps/server/src/scheduler/overview.ts +1 -1
- package/template/apps/server/src/scheduler/recovery-service.test.ts +1 -1
- package/template/apps/server/src/scheduler/recovery-service.ts +1 -1
- package/template/apps/server/src/scheduler/repository.ts +1 -1
- package/template/apps/server/src/scheduler/routes.ts +1 -1
- package/template/apps/server/src/scheduler/service-idle.test.ts +1 -1
- package/template/apps/server/src/scheduler/service.test.ts +1 -1
- package/template/apps/server/src/scheduler/service.ts +1 -1
- package/template/apps/server/src/scheduler/types.ts +1 -1
- package/template/apps/server/src/search/contracts.ts +2 -2
- package/template/apps/server/src/search/host.ts +1 -1
- package/template/apps/server/src/search/registry.ts +1 -1
- package/template/apps/server/src/search/routes.test.ts +1 -1
- package/template/apps/server/src/search/routes.ts +1 -1
- package/template/apps/server/src/search/service.ts +2 -2
- package/template/apps/server/src/search/test-support.ts +2 -2
- package/template/apps/server/src/session/routes.ts +1 -1
- package/template/apps/server/src/settings/drizzle-repository.ts +2 -2
- package/template/apps/server/src/settings/repository.ts +1 -1
- package/template/apps/server/src/settings/routes.test.ts +1 -1
- package/template/apps/server/src/settings/routes.ts +1 -1
- package/template/apps/server/src/settings/runtime.ts +1 -1
- package/template/apps/server/src/storage/blob-reference-registry.test.ts +1 -1
- package/template/apps/server/src/storage/blob-reference-registry.ts +1 -1
- package/template/apps/server/src/storage/drizzle-upload-repository.integration.test.ts +1 -1
- package/template/apps/server/src/storage/drizzle-upload-repository.ts +2 -2
- package/template/apps/server/src/storage/route-support.ts +1 -1
- package/template/apps/server/src/storage/routes.test.ts +1 -1
- package/template/apps/server/src/storage/routes.ts +2 -2
- package/template/apps/server/src/storage/runtime.ts +6 -4
- package/template/apps/server/src/system/audit-routes.ts +1 -1
- package/template/apps/server/src/system/department-routes.ts +1 -1
- package/template/apps/server/src/system/drizzle-repository.ts +1 -1
- package/template/apps/server/src/system/drizzle-scoped-repository.ts +1 -1
- package/template/apps/server/src/system/drizzle-system.ts +1 -1
- package/template/apps/server/src/system/entities.ts +1 -1
- package/template/apps/server/src/system/identity-route-config.ts +1 -1
- package/template/apps/server/src/system/interface-catalog.test.ts +3 -3
- package/template/apps/server/src/system/interface-catalog.ts +2 -2
- package/template/apps/server/src/system/menu-registry.ts +1 -1
- package/template/apps/server/src/system/menu-routes.ts +1 -1
- package/template/apps/server/src/system/operations.test.ts +1 -1
- package/template/apps/server/src/system/operations.ts +1 -1
- package/template/apps/server/src/system/redis-health.ts +1 -1
- package/template/apps/server/src/system/repository.ts +1 -1
- package/template/apps/server/src/system/resource-route-support.ts +1 -1
- package/template/apps/server/src/system/route-helpers.ts +1 -1
- package/template/apps/server/src/system/route-types.ts +1 -1
- package/template/apps/server/src/system/routes.test.ts +1 -1
- package/template/apps/server/src/system/routes.ts +1 -1
- package/template/apps/server/src/system/user-projection.ts +1 -1
- package/template/apps/server/src/work-order/data-scope.integration.test.ts +1 -1
- package/template/apps/server/src/work-order/drizzle-repository.integration.test.ts +1 -1
- package/template/apps/server/src/work-order/drizzle-repository.ts +2 -2
- package/template/apps/server/src/work-order/foundation-modules.test.ts +15 -5
- package/template/apps/server/src/work-order/repository.ts +1 -1
- package/template/apps/server/src/work-order/routes.test.ts +2 -2
- package/template/apps/server/src/work-order/routes.ts +2 -2
- package/template/apps/server/src/work-order/search-api.test.ts +3 -3
- package/template/apps/server/src/work-order/search-provider.test.ts +3 -3
- package/template/apps/server/src/work-order/service.ts +1 -1
- package/template/apps/server/src/work-order/task.test.ts +1 -1
- package/template/apps/server/src/work-order/task.ts +2 -2
- package/template/apps/server/src/workflow/drizzle-repository.integration.test.ts +2 -2
- package/template/apps/server/src/workflow/drizzle-repository.ts +3 -3
- package/template/apps/server/src/workflow/effects.test.ts +1 -1
- package/template/apps/server/src/workflow/effects.ts +1 -1
- package/template/apps/server/src/workflow/repository.ts +2 -2
- package/template/apps/server/src/workflow/routes.ts +3 -3
- package/template/apps/server/src/workflow/service.ts +1 -1
- package/template/apps/server/src/workflow/timeout-runtime.test.ts +1 -1
- package/template/apps/server/src/workflow/timeout-runtime.ts +2 -2
- package/template/apps/web/Dockerfile +2 -0
- package/template/apps/web/package.json +4 -4
- package/template/apps/web/runtime-server.ts +1 -1
- package/template/apps/web/src/app/layouts/AppLayout.vue +6 -0
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +52 -7
- package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +43 -0
- package/template/apps/web/src/components/common/DataPagination.vue +1 -1
- package/template/apps/web/src/components/license/LicenseActivationCodeForm.vue +1 -1
- package/template/apps/web/src/components/license/LicenseFlow.webtest.ts +2 -2
- package/template/apps/web/src/composables/useModuleConfigurations.ts +1 -1
- package/template/apps/web/src/composables/useWatermarkSettings.ts +1 -0
- package/template/apps/web/src/composables/watermark-settings.ts +6 -0
- package/template/apps/web/src/composables/watermark-settings.webtest.ts +27 -1
- package/template/apps/web/src/layout/AppSidebar.vue +12 -3
- package/template/apps/web/src/layout/AppSidebar.webtest.ts +11 -0
- package/template/apps/web/src/layout/GlobalWatermark.vue +25 -8
- package/template/apps/web/src/layout/GlobalWatermark.webtest.ts +109 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +1 -1
- package/template/apps/web/src/layout/NotificationMenu.vue +1 -1
- package/template/apps/web/src/layout/navigation.ts +5 -1
- package/template/apps/web/src/layout/navigation.webtest.ts +1 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigRollbackDialog.vue +1 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +1 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.webtest.ts +1 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +1 -1
- package/template/apps/web/src/pages/dashboard/dashboard-presenter.webtest.ts +1 -1
- package/template/apps/web/src/pages/settings/WatermarkSettingsSection.vue +21 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +2 -2
- package/template/apps/web/src/pages/system/components/AuditActionCell.vue +7 -2
- package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +7 -2
- package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerOperationsPanel.vue +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerOperationsPanel.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerRunTable.vue +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerRunTable.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerStaleRecoveryForm.vue +1 -1
- package/template/apps/web/src/pages/system/components/SchedulerStaleRecoveryForm.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +1 -1
- package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +10 -3
- package/template/apps/web/src/pages/system/components/role-policy/RolePermissionTree.vue +1 -1
- package/template/apps/web/src/pages/system/components/role-policy/RolePermissionTree.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/components/role-policy/RolePolicyForm.vue +1 -1
- package/template/apps/web/src/pages/system/components/role-policy/permission-tree.ts +1 -1
- package/template/apps/web/src/pages/system/components/role-policy/permission-tree.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/composables/useSchedulerOperations.ts +2 -2
- package/template/apps/web/src/pages/system/composables/useSchedulerOperations.webtest.ts +1 -1
- package/template/apps/web/src/pages/system/composables/useSystemResource.ts +1 -1
- package/template/apps/web/src/router/manifest-routes.ts +1 -1
- package/template/apps/web/src/router/manifest-routes.webtest.ts +1 -1
- package/template/apps/web/src/services/access-api.ts +10 -1
- package/template/apps/web/src/services/configuration-api.ts +1 -1
- package/template/apps/web/src/services/license-api.ts +1 -1
- package/template/apps/web/src/services/notification-api.ts +2 -2
- package/template/apps/web/src/services/operations-api.ts +1 -1
- package/template/apps/web/src/services/platform-settings-api.ts +2 -2
- package/template/apps/web/src/services/profile-api.ts +2 -2
- package/template/docs/architecture/durable-jobs.md +5 -0
- package/template/docs/architecture/module-manifest-composition.md +14 -7
- package/template/docs/architecture/object-storage.md +1 -1
- package/template/docs/development/crud-generator.md +4 -1
- package/template/docs/platform/audit-reliability.md +1 -1
- package/template/package.json +2 -1
- package/template/packages/config/package.json +15 -4
- package/template/packages/config/src/platform.ts +1 -1
- package/template/packages/crud-generator/package.json +1 -1
- package/template/packages/crud-generator/src/generator.test.ts +16 -0
- package/template/packages/crud-generator/src/templates/domain.ts +1 -1
- package/template/packages/crud-generator/src/templates/manifest.ts +2 -2
- package/template/packages/crud-generator/src/templates/project.ts +3 -3
- package/template/packages/crud-generator/src/templates/repository.ts +1 -1
- package/template/packages/crud-generator/src/templates/routes.ts +2 -2
- package/template/packages/crud-generator/src/validation.ts +22 -1
- package/template/packages/database/package.json +15 -5
- package/template/packages/database/src/bundle-validation.ts +218 -0
- package/template/packages/database/src/dialects.ts +1 -1
- package/template/packages/database/src/runner.test.ts +160 -13
- package/template/packages/database/src/runner.ts +95 -77
- package/template/packages/database/src/schema/governed-exports.ts +1 -1
- package/template/packages/database/src/schema/identity.ts +1 -1
- package/template/packages/database/src/schema/license-v1.ts +1 -1
- package/template/packages/database/src/schema/notifications.ts +1 -1
- package/template/packages/database/src/schema/platform-settings.ts +1 -1
- package/template/packages/database/src/schema/workflow.ts +1 -1
- package/template/packages/database/src/sql-store.ts +1 -1
- package/template/packages/database/src/store.ts +1 -1
- package/template/packages/example-work-order/index.ts +1 -0
- package/template/packages/example-work-order/package.json +4 -3
- package/template/packages/example-work-order/src/contract.ts +1 -1
- package/template/packages/example-work-order/src/manifest.ts +8 -3
- package/template/packages/example-work-order/src/migration-bundle.test.ts +43 -0
- package/template/packages/example-work-order/src/migration-bundle.ts +64 -0
- package/template/packages/jobs/index.ts +2 -0
- package/template/packages/jobs/package.json +29 -0
- package/template/packages/jobs/src/handlers.test.ts +72 -0
- package/template/{apps/server/src/jobs/handler-registry.ts → packages/jobs/src/handlers.ts} +4 -4
- package/template/{apps/server/src/jobs → packages/jobs/src}/types.ts +7 -1
- package/template/packages/{license-sdk → jobs}/tsconfig.json +0 -1
- package/template/packages/modules/index.ts +1 -1
- package/template/packages/modules/package.json +15 -5
- package/template/packages/modules/src/catalog-validation.ts +123 -0
- package/template/packages/modules/src/composition.test.ts +75 -2
- package/template/packages/modules/src/composition.ts +4 -2
- package/template/packages/modules/src/manifest.ts +7 -12
- package/template/packages/modules/src/menu-composition.ts +1 -1
- package/template/packages/modules/src/system-api-binding.ts +1 -1
- package/template/packages/modules/src/system-api-data-governance.ts +1 -1
- package/template/packages/modules/src/system-api-permissions.ts +1 -1
- package/template/packages/modules/src/system-data-governance.ts +1 -1
- package/template/packages/modules/src/system-features.ts +1 -1
- package/template/packages/modules/src/system-governed-export-bindings.ts +1 -1
- package/template/packages/modules/src/system-module-catalog.ts +1 -1
- package/template/packages/server-sdk/index.ts +5 -0
- package/template/packages/server-sdk/package.json +25 -0
- package/template/packages/server-sdk/src/module-host.ts +29 -0
- package/template/packages/server-sdk/tsconfig.json +16 -0
- package/template/packages/shared/index.ts +3 -0
- package/template/packages/shared/package.json +14 -3
- package/template/packages/shared/src/audit.ts +22 -1
- package/template/packages/shared/src/license-catalog.test.ts +17 -0
- package/template/packages/shared/src/license-catalog.ts +33 -0
- package/template/packages/shared/src/migration.ts +39 -0
- package/template/packages/shared/src/password.ts +4 -0
- package/template/packages/storage/package.json +14 -3
- package/template/packages/license-sdk/index.ts +0 -13
- package/template/packages/license-sdk/package.json +0 -18
- package/template/packages/license-sdk/src/bounded-json-body.test.ts +0 -65
- package/template/packages/license-sdk/src/bounded-json-body.ts +0 -135
- package/template/packages/license-sdk/src/canonical-json.test.ts +0 -28
- package/template/packages/license-sdk/src/canonical-json.ts +0 -104
- package/template/packages/license-sdk/src/client.test.ts +0 -82
- package/template/packages/license-sdk/src/client.ts +0 -86
- package/template/packages/license-sdk/src/device.ts +0 -46
- package/template/packages/license-sdk/src/file-storage.test.ts +0 -80
- package/template/packages/license-sdk/src/file-storage.ts +0 -77
- package/template/packages/license-sdk/src/installation.test.ts +0 -241
- package/template/packages/license-sdk/src/installation.ts +0 -150
- package/template/packages/license-sdk/src/license-parser.ts +0 -56
- package/template/packages/license-sdk/src/offline-code-base32.ts +0 -57
- package/template/packages/license-sdk/src/offline-code-decompression.ts +0 -55
- package/template/packages/license-sdk/src/offline-code-limits.ts +0 -10
- package/template/packages/license-sdk/src/offline-code-wire.ts +0 -72
- package/template/packages/license-sdk/src/offline-code.test.ts +0 -172
- package/template/packages/license-sdk/src/offline-code.ts +0 -319
- package/template/packages/license-sdk/src/payload.test.ts +0 -72
- package/template/packages/license-sdk/src/payload.ts +0 -201
- package/template/packages/license-sdk/src/storage.ts +0 -64
- package/template/packages/license-sdk/src/test-fixtures.ts +0 -59
- package/template/packages/license-sdk/src/v1-test-vector.ts +0 -49
- package/template/packages/license-sdk/src/validation.test.ts +0 -62
- package/template/packages/license-sdk/src/validation.ts +0 -143
- package/template/packages/license-sdk/src/verification.test.ts +0 -97
- package/template/packages/license-sdk/src/verification.ts +0 -199
|
@@ -2,11 +2,13 @@ import type { WebAccessActor } from "@/layout/navigation";
|
|
|
2
2
|
|
|
3
3
|
export interface WatermarkSettings {
|
|
4
4
|
enabled: boolean;
|
|
5
|
+
businessPagesEnabled: boolean;
|
|
5
6
|
customContent: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export const defaultWatermarkSettings: WatermarkSettings = {
|
|
9
10
|
enabled: true,
|
|
11
|
+
businessPagesEnabled: false,
|
|
10
12
|
customContent: "",
|
|
11
13
|
};
|
|
12
14
|
|
|
@@ -34,6 +36,10 @@ export function parseWatermarkSettings(
|
|
|
34
36
|
typeof parsed.enabled === "boolean"
|
|
35
37
|
? parsed.enabled
|
|
36
38
|
: defaultWatermarkSettings.enabled,
|
|
39
|
+
businessPagesEnabled:
|
|
40
|
+
typeof parsed.businessPagesEnabled === "boolean"
|
|
41
|
+
? parsed.businessPagesEnabled
|
|
42
|
+
: defaultWatermarkSettings.businessPagesEnabled,
|
|
37
43
|
customContent:
|
|
38
44
|
typeof parsed.customContent === "string"
|
|
39
45
|
? parsed.customContent.slice(0, 80)
|
|
@@ -27,12 +27,38 @@ describe("水印设置", () => {
|
|
|
27
27
|
test("损坏或越界的浏览器设置安全回退", () => {
|
|
28
28
|
expect(parseWatermarkSettings("broken")).toEqual({
|
|
29
29
|
enabled: true,
|
|
30
|
+
businessPagesEnabled: false,
|
|
30
31
|
customContent: "",
|
|
31
32
|
});
|
|
32
33
|
expect(
|
|
33
34
|
parseWatermarkSettings(
|
|
34
35
|
JSON.stringify({ enabled: false, customContent: "x".repeat(100) }),
|
|
35
36
|
),
|
|
36
|
-
).toEqual({
|
|
37
|
+
).toEqual({
|
|
38
|
+
enabled: false,
|
|
39
|
+
businessPagesEnabled: false,
|
|
40
|
+
customContent: "x".repeat(80),
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test("业务页面覆盖默认关闭并兼容已保存的范围开关", () => {
|
|
45
|
+
expect(parseWatermarkSettings(null)).toEqual({
|
|
46
|
+
enabled: true,
|
|
47
|
+
businessPagesEnabled: false,
|
|
48
|
+
customContent: "",
|
|
49
|
+
});
|
|
50
|
+
expect(
|
|
51
|
+
parseWatermarkSettings(
|
|
52
|
+
JSON.stringify({
|
|
53
|
+
enabled: true,
|
|
54
|
+
businessPagesEnabled: true,
|
|
55
|
+
customContent: "内部资料",
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
).toEqual({
|
|
59
|
+
enabled: true,
|
|
60
|
+
businessPagesEnabled: true,
|
|
61
|
+
customContent: "内部资料",
|
|
62
|
+
});
|
|
37
63
|
});
|
|
38
64
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { MenuNode } from "@
|
|
2
|
+
import type { MenuNode } from "@southwind-ai/shared";
|
|
3
3
|
import {
|
|
4
4
|
ActivityIcon,
|
|
5
5
|
BellIcon,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ChevronDownIcon,
|
|
10
10
|
ClipboardListIcon,
|
|
11
11
|
FlagIcon,
|
|
12
|
+
HouseIcon,
|
|
12
13
|
KeyRoundIcon,
|
|
13
14
|
LayoutDashboardIcon,
|
|
14
15
|
PanelLeftIcon,
|
|
@@ -241,9 +242,9 @@ function findMenu(menus: MenuNode[], key: string): MenuNode | undefined {
|
|
|
241
242
|
</SidebarGroupContent>
|
|
242
243
|
</SidebarGroup>
|
|
243
244
|
</SidebarContent>
|
|
244
|
-
<SidebarFooter
|
|
245
|
+
<SidebarFooter class="border-t">
|
|
245
246
|
<SidebarMenu>
|
|
246
|
-
<SidebarMenuItem>
|
|
247
|
+
<SidebarMenuItem v-if="settingsMenu?.path">
|
|
247
248
|
<SidebarMenuButton
|
|
248
249
|
as-child
|
|
249
250
|
:is-active="route.path === settingsMenu.path"
|
|
@@ -255,6 +256,14 @@ function findMenu(menus: MenuNode[], key: string): MenuNode | undefined {
|
|
|
255
256
|
</RouterLink>
|
|
256
257
|
</SidebarMenuButton>
|
|
257
258
|
</SidebarMenuItem>
|
|
259
|
+
<SidebarMenuItem>
|
|
260
|
+
<SidebarMenuButton as-child tooltip="访问首页">
|
|
261
|
+
<a href="/" target="_blank" rel="noopener noreferrer">
|
|
262
|
+
<HouseIcon />
|
|
263
|
+
<span>访问首页</span>
|
|
264
|
+
</a>
|
|
265
|
+
</SidebarMenuButton>
|
|
266
|
+
</SidebarMenuItem>
|
|
258
267
|
</SidebarMenu>
|
|
259
268
|
</SidebarFooter>
|
|
260
269
|
<SidebarRail />
|
|
@@ -140,6 +140,17 @@ describe("AppSidebar", () => {
|
|
|
140
140
|
expect(router.currentRoute.value.path).toBe("/admin/system/roles");
|
|
141
141
|
wrapper.unmount();
|
|
142
142
|
});
|
|
143
|
+
|
|
144
|
+
test("左下角始终提供新标签页访问业务首页的入口", async () => {
|
|
145
|
+
state.access.value.menus = [];
|
|
146
|
+
const { wrapper } = await mountSidebar(true);
|
|
147
|
+
const homeLink = wrapper.get('a[href="/"]');
|
|
148
|
+
|
|
149
|
+
expect(homeLink.text()).toContain("访问首页");
|
|
150
|
+
expect(homeLink.attributes("target")).toBe("_blank");
|
|
151
|
+
expect(homeLink.attributes("rel")).toBe("noopener noreferrer");
|
|
152
|
+
wrapper.unmount();
|
|
153
|
+
});
|
|
143
154
|
});
|
|
144
155
|
|
|
145
156
|
async function mountSidebar(defaultOpen: boolean) {
|
|
@@ -5,23 +5,40 @@ import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
|
5
5
|
import { useWatermarkSettings } from "@/composables/useWatermarkSettings";
|
|
6
6
|
import { evaluateWebAccess } from "./navigation";
|
|
7
7
|
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
scope?: "admin" | "business";
|
|
11
|
+
}>(),
|
|
12
|
+
{
|
|
13
|
+
scope: "admin",
|
|
14
|
+
},
|
|
15
|
+
);
|
|
8
16
|
const auth = useAuthSession();
|
|
9
17
|
const access = useAccessSnapshot();
|
|
10
18
|
const watermark = useWatermarkSettings(auth.actor);
|
|
11
|
-
const allowed = computed(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const allowed = computed(
|
|
20
|
+
() =>
|
|
21
|
+
props.scope === "business" ||
|
|
22
|
+
(access.snapshot.value
|
|
23
|
+
? evaluateWebAccess(access.snapshot.value, {
|
|
24
|
+
permissionKey: "system.watermark.read",
|
|
25
|
+
featureKey: "system.watermark",
|
|
26
|
+
}).allowed
|
|
27
|
+
: false),
|
|
28
|
+
);
|
|
29
|
+
const scopeEnabled = computed(
|
|
30
|
+
() =>
|
|
31
|
+
props.scope === "admin" || watermark.settings.value.businessPagesEnabled,
|
|
18
32
|
);
|
|
19
33
|
</script>
|
|
20
34
|
|
|
21
35
|
<template>
|
|
22
36
|
<div
|
|
23
37
|
v-if="
|
|
24
|
-
allowed &&
|
|
38
|
+
allowed &&
|
|
39
|
+
scopeEnabled &&
|
|
40
|
+
watermark.settings.value.enabled &&
|
|
41
|
+
watermark.content.value
|
|
25
42
|
"
|
|
26
43
|
class="pointer-events-none fixed inset-0 z-30 grid grid-cols-3 grid-rows-6 overflow-hidden opacity-[0.075] dark:opacity-[0.11]"
|
|
27
44
|
aria-hidden="true"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils";
|
|
2
|
+
import { beforeEach, describe, expect, test, vi } from "vitest";
|
|
3
|
+
import GlobalWatermark from "./GlobalWatermark.vue";
|
|
4
|
+
|
|
5
|
+
const state = vi.hoisted(() => ({
|
|
6
|
+
access: {
|
|
7
|
+
value: {
|
|
8
|
+
actor: {
|
|
9
|
+
id: "user_1",
|
|
10
|
+
type: "user" as const,
|
|
11
|
+
name: "张三",
|
|
12
|
+
roleCodes: [],
|
|
13
|
+
permissionKeys: ["system.watermark.read"],
|
|
14
|
+
},
|
|
15
|
+
menus: [],
|
|
16
|
+
permissions: [],
|
|
17
|
+
features: [
|
|
18
|
+
{
|
|
19
|
+
key: "system.watermark",
|
|
20
|
+
enabled: true,
|
|
21
|
+
visible: "visible" as const,
|
|
22
|
+
allowed: true,
|
|
23
|
+
reason: "enabled",
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
actor: {
|
|
29
|
+
value: {
|
|
30
|
+
id: "user_1",
|
|
31
|
+
type: "user" as const,
|
|
32
|
+
name: "张三",
|
|
33
|
+
roleCodes: [],
|
|
34
|
+
permissionKeys: ["system.watermark.read"],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
settings: {
|
|
38
|
+
value: {
|
|
39
|
+
enabled: true,
|
|
40
|
+
businessPagesEnabled: false,
|
|
41
|
+
customContent: "",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
content: { value: "zhangsan · 张三" },
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
vi.mock("@/composables/useAccessSnapshot", () => ({
|
|
48
|
+
useAccessSnapshot: () => ({ snapshot: state.access }),
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
vi.mock("@/composables/useAuthSession", () => ({
|
|
52
|
+
useAuthSession: () => ({ actor: state.actor }),
|
|
53
|
+
}));
|
|
54
|
+
|
|
55
|
+
vi.mock("@/composables/useWatermarkSettings", () => ({
|
|
56
|
+
useWatermarkSettings: () => ({
|
|
57
|
+
settings: state.settings,
|
|
58
|
+
content: state.content,
|
|
59
|
+
}),
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
beforeEach(() => {
|
|
63
|
+
state.settings.value = {
|
|
64
|
+
enabled: true,
|
|
65
|
+
businessPagesEnabled: false,
|
|
66
|
+
customContent: "",
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe("GlobalWatermark", () => {
|
|
71
|
+
test("Admin 水印沿用原有总开关且不受业务页面范围影响", () => {
|
|
72
|
+
const wrapper = mount(GlobalWatermark);
|
|
73
|
+
|
|
74
|
+
expect(wrapper.find('[data-testid="global-watermark"]').exists()).toBe(
|
|
75
|
+
true,
|
|
76
|
+
);
|
|
77
|
+
wrapper.unmount();
|
|
78
|
+
|
|
79
|
+
state.settings.value = { ...state.settings.value, enabled: false };
|
|
80
|
+
const disabledWrapper = mount(GlobalWatermark);
|
|
81
|
+
|
|
82
|
+
expect(
|
|
83
|
+
disabledWrapper.find('[data-testid="global-watermark"]').exists(),
|
|
84
|
+
).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test("业务页面水印默认关闭并由持久化范围开关启用", () => {
|
|
88
|
+
const wrapper = mount(GlobalWatermark, {
|
|
89
|
+
props: { scope: "business" },
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
expect(wrapper.find('[data-testid="global-watermark"]').exists()).toBe(
|
|
93
|
+
false,
|
|
94
|
+
);
|
|
95
|
+
wrapper.unmount();
|
|
96
|
+
|
|
97
|
+
state.settings.value = {
|
|
98
|
+
...state.settings.value,
|
|
99
|
+
businessPagesEnabled: true,
|
|
100
|
+
};
|
|
101
|
+
const enabledWrapper = mount(GlobalWatermark, {
|
|
102
|
+
props: { scope: "business" },
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
expect(
|
|
106
|
+
enabledWrapper.get('[data-testid="global-watermark"]').text(),
|
|
107
|
+
).toContain("zhangsan · 张三");
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { NotificationInboxItem } from "@
|
|
2
|
+
import type { NotificationInboxItem } from "@southwind-ai/shared";
|
|
3
3
|
import { BellIcon } from "@lucide/vue";
|
|
4
4
|
import { computed, onMounted, shallowRef } from "vue";
|
|
5
5
|
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AuditActionDefinition,
|
|
2
3
|
CredentialState,
|
|
4
|
+
LicenseCatalogDefinition,
|
|
3
5
|
MenuNode,
|
|
4
6
|
PermissionDefinition,
|
|
5
|
-
} from "@
|
|
7
|
+
} from "@southwind-ai/shared";
|
|
6
8
|
|
|
7
9
|
export interface WebAccessActor {
|
|
8
10
|
id: string;
|
|
@@ -31,6 +33,8 @@ export interface WebAccessSnapshot {
|
|
|
31
33
|
menus: MenuNode[];
|
|
32
34
|
features: WebFeatureAccess[];
|
|
33
35
|
permissions: PermissionDefinition[];
|
|
36
|
+
auditActionCatalog?: readonly AuditActionDefinition[];
|
|
37
|
+
licenseCatalog?: readonly LicenseCatalogDefinition[];
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
export interface AccessRequirement {
|
package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.webtest.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mount } from "@vue/test-utils";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import type { ModuleConfigSummary } from "@
|
|
3
|
+
import type { ModuleConfigSummary } from "@southwind-ai/shared";
|
|
4
4
|
import ModuleConfigurationEditor from "./ModuleConfigurationEditor.vue";
|
|
5
5
|
|
|
6
6
|
const summary: ModuleConfigSummary = {
|
package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { ModuleConfigValues, ModuleConfigVersion } from "@
|
|
2
|
+
import type { ModuleConfigValues, ModuleConfigVersion } from "@southwind-ai/shared";
|
|
3
3
|
import { computed, onBeforeUnmount, onMounted, shallowRef } from "vue";
|
|
4
4
|
import { onBeforeRouteLeave } from "vue-router";
|
|
5
5
|
import UnsavedChangesDialog from "@/components/common/UnsavedChangesDialog.vue";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
|
-
import type { MenuNode } from "@
|
|
2
|
+
import type { MenuNode } from "@southwind-ai/shared";
|
|
3
3
|
import type { WebAccessSnapshot } from "@/layout/navigation";
|
|
4
4
|
import { buildDashboardModel } from "./dashboard-presenter";
|
|
5
5
|
|
|
@@ -14,6 +14,9 @@ const access = useAccessSnapshot();
|
|
|
14
14
|
const toast = useAppToast();
|
|
15
15
|
const watermark = useWatermarkSettings(auth.actor);
|
|
16
16
|
const enabled = shallowRef(watermark.settings.value.enabled);
|
|
17
|
+
const businessPagesEnabled = shallowRef(
|
|
18
|
+
watermark.settings.value.businessPagesEnabled,
|
|
19
|
+
);
|
|
17
20
|
const customContent = shallowRef(watermark.settings.value.customContent);
|
|
18
21
|
const saving = shallowRef(false);
|
|
19
22
|
const baseline = shallowRef(serializeForm());
|
|
@@ -36,6 +39,7 @@ async function save(): Promise<boolean> {
|
|
|
36
39
|
try {
|
|
37
40
|
watermark.update({
|
|
38
41
|
enabled: enabled.value,
|
|
42
|
+
businessPagesEnabled: businessPagesEnabled.value,
|
|
39
43
|
customContent: customContent.value,
|
|
40
44
|
});
|
|
41
45
|
customContent.value = watermark.settings.value.customContent;
|
|
@@ -54,6 +58,7 @@ async function save(): Promise<boolean> {
|
|
|
54
58
|
|
|
55
59
|
function reset() {
|
|
56
60
|
enabled.value = true;
|
|
61
|
+
businessPagesEnabled.value = false;
|
|
57
62
|
customContent.value = "";
|
|
58
63
|
toast.success("已恢复为默认值,保存后生效");
|
|
59
64
|
}
|
|
@@ -61,6 +66,7 @@ function reset() {
|
|
|
61
66
|
function serializeForm() {
|
|
62
67
|
return JSON.stringify({
|
|
63
68
|
enabled: enabled.value,
|
|
69
|
+
businessPagesEnabled: businessPagesEnabled.value,
|
|
64
70
|
customContent: customContent.value.trim(),
|
|
65
71
|
});
|
|
66
72
|
}
|
|
@@ -90,6 +96,21 @@ defineExpose({
|
|
|
90
96
|
aria-label="显示页面水印"
|
|
91
97
|
/>
|
|
92
98
|
</label>
|
|
99
|
+
<label
|
|
100
|
+
class="flex items-center justify-between gap-4 text-sm font-medium"
|
|
101
|
+
>
|
|
102
|
+
<span>
|
|
103
|
+
<span class="block">覆盖业务页面</span>
|
|
104
|
+
<span class="mt-1 block text-xs font-normal text-muted-foreground">
|
|
105
|
+
开启后,首页及使用业务布局的页面也会显示水印。
|
|
106
|
+
</span>
|
|
107
|
+
</span>
|
|
108
|
+
<Switch
|
|
109
|
+
v-model="businessPagesEnabled"
|
|
110
|
+
:disabled="!canManage || !enabled"
|
|
111
|
+
aria-label="在业务页面显示水印"
|
|
112
|
+
/>
|
|
113
|
+
</label>
|
|
93
114
|
<label class="grid gap-2 text-sm font-medium">
|
|
94
115
|
<span>自定义内容</span>
|
|
95
116
|
<Input
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
PlatformNotification,
|
|
4
4
|
PublishNotificationInput,
|
|
5
|
-
} from "@
|
|
6
|
-
import { DEFAULT_PAGE_SIZE } from "@
|
|
5
|
+
} from "@southwind-ai/shared";
|
|
6
|
+
import { DEFAULT_PAGE_SIZE } from "@southwind-ai/shared";
|
|
7
7
|
import { ArchiveIcon, RefreshCwIcon, SendIcon } from "@lucide/vue";
|
|
8
8
|
import { onMounted, shallowRef } from "vue";
|
|
9
9
|
import ConfirmDialog from "@/components/common/ConfirmDialog.vue";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import { AUDIT_ACTION_DEFINITIONS } from "@
|
|
3
|
+
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip,
|
|
6
6
|
TooltipContent,
|
|
7
7
|
TooltipTrigger,
|
|
8
8
|
} from "@/components/ui/tooltip";
|
|
9
|
+
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
9
10
|
import type { SystemRecord } from "@/services/system-api";
|
|
10
11
|
|
|
11
12
|
const props = defineProps<{
|
|
@@ -14,8 +15,12 @@ const props = defineProps<{
|
|
|
14
15
|
}>();
|
|
15
16
|
|
|
16
17
|
const key = computed(() => String(props.actionKey || "unknown"));
|
|
18
|
+
const access = useAccessSnapshot();
|
|
19
|
+
const actionCatalog = computed(
|
|
20
|
+
() => access.snapshot.value?.auditActionCatalog || AUDIT_ACTION_DEFINITIONS,
|
|
21
|
+
);
|
|
17
22
|
const definition = computed(() =>
|
|
18
|
-
|
|
23
|
+
actionCatalog.value.find((item) => item.key === props.actionKey),
|
|
19
24
|
);
|
|
20
25
|
const target = computed(() => record(props.item.target));
|
|
21
26
|
const metadata = computed(() => record(props.item.metadata));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onMounted, shallowRef, watch } from "vue";
|
|
3
|
-
import { AUDIT_ACTION_DEFINITIONS } from "@
|
|
3
|
+
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
4
4
|
import {
|
|
5
5
|
Select,
|
|
6
6
|
SelectContent,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
SelectValue,
|
|
10
10
|
} from "@/components/ui/select";
|
|
11
11
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
12
|
+
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
12
13
|
import { listSystemResource, type SystemRecord } from "@/services/system-api";
|
|
13
14
|
|
|
14
15
|
const emit = defineEmits<{
|
|
@@ -23,6 +24,10 @@ const action = shallowRef("all");
|
|
|
23
24
|
const timeRange = shallowRef("all");
|
|
24
25
|
const optionSource = shallowRef<SystemRecord[]>([]);
|
|
25
26
|
const includeScheduler = shallowRef(false);
|
|
27
|
+
const access = useAccessSnapshot();
|
|
28
|
+
const actionCatalog = computed(
|
|
29
|
+
() => access.snapshot.value?.auditActionCatalog || AUDIT_ACTION_DEFINITIONS,
|
|
30
|
+
);
|
|
26
31
|
|
|
27
32
|
const actors = computed(() => {
|
|
28
33
|
const options = new Map<string, string>();
|
|
@@ -87,7 +92,7 @@ function timeRangeStart(value: string) {
|
|
|
87
92
|
<SelectContent>
|
|
88
93
|
<SelectItem value="all">全部动作</SelectItem>
|
|
89
94
|
<SelectItem
|
|
90
|
-
v-for="definition in
|
|
95
|
+
v-for="definition in actionCatalog"
|
|
91
96
|
:key="definition.key"
|
|
92
97
|
:value="definition.key"
|
|
93
98
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { PublishNotificationInput } from "@
|
|
2
|
+
import type { PublishNotificationInput } from "@southwind-ai/shared";
|
|
3
3
|
import { Input } from "@/components/ui/input";
|
|
4
4
|
|
|
5
5
|
const model = defineModel<PublishNotificationInput>({ required: true });
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
SchedulerOperationsSnapshot,
|
|
7
7
|
SchedulerOperationsTask,
|
|
8
8
|
SchedulerRunHistoryItem,
|
|
9
|
-
} from "@
|
|
9
|
+
} from "@southwind-ai/shared";
|
|
10
10
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
|
11
11
|
import { Badge } from "@/components/ui/badge";
|
|
12
12
|
import { Button } from "@/components/ui/button";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { flushPromises, mount } from "@vue/test-utils";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import type { SchedulerOperationsSnapshot } from "@
|
|
3
|
+
import type { SchedulerOperationsSnapshot } from "@southwind-ai/shared";
|
|
4
4
|
import SchedulerOperationsPanel from "./SchedulerOperationsPanel.vue";
|
|
5
5
|
|
|
6
6
|
describe("SchedulerOperationsPanel", () => {
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
SchedulerRunHistoryItem,
|
|
6
6
|
SchedulerRunStatus,
|
|
7
7
|
SchedulerRunTrigger,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@southwind-ai/shared";
|
|
9
9
|
import DataPagination from "@/components/common/DataPagination.vue";
|
|
10
10
|
import { Badge } from "@/components/ui/badge";
|
|
11
11
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mount } from "@vue/test-utils";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import type { PageResult, SchedulerRunHistoryItem } from "@
|
|
3
|
+
import type { PageResult, SchedulerRunHistoryItem } from "@southwind-ai/shared";
|
|
4
4
|
import SchedulerRunTable from "./SchedulerRunTable.vue";
|
|
5
5
|
|
|
6
6
|
describe("SchedulerRunTable", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, shallowRef, type DeepReadonly } from "vue";
|
|
3
|
-
import type { SchedulerOperationsTask } from "@
|
|
3
|
+
import type { SchedulerOperationsTask } from "@southwind-ai/shared";
|
|
4
4
|
import { Button } from "@/components/ui/button";
|
|
5
5
|
import ModalBody from "@/components/common/ModalBody.vue";
|
|
6
6
|
import {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mount } from "@vue/test-utils";
|
|
2
2
|
import { describe, expect, test } from "vitest";
|
|
3
|
-
import type { SchedulerOperationsTask } from "@
|
|
3
|
+
import type { SchedulerOperationsTask } from "@southwind-ai/shared";
|
|
4
4
|
import SchedulerStaleRecoveryForm from "./SchedulerStaleRecoveryForm.vue";
|
|
5
5
|
|
|
6
6
|
const slotStub = { template: "<div><slot /></div>" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onMounted, shallowRef, useTemplateRef } from "vue";
|
|
3
|
-
import type { PermissionDefinition } from "@
|
|
3
|
+
import type { PermissionDefinition } from "@southwind-ai/shared";
|
|
4
4
|
import ConfirmDialog from "@/components/common/ConfirmDialog.vue";
|
|
5
5
|
import DataPagination from "@/components/common/DataPagination.vue";
|
|
6
6
|
import FormDialog from "@/components/common/FormDialog.vue";
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
import type { ResourceColumn, ResourceInlineToggle } from "../resource-config";
|
|
16
16
|
import type { SystemRecord } from "@/services/system-api";
|
|
17
17
|
import { formatDateTime } from "@/lib/date-time";
|
|
18
|
-
import { AUDIT_ACTION_DEFINITIONS } from "@
|
|
18
|
+
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
19
|
+
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
19
20
|
import {
|
|
20
21
|
Tooltip,
|
|
21
22
|
TooltipContent,
|
|
@@ -46,6 +47,7 @@ const emit = defineEmits<{
|
|
|
46
47
|
}>();
|
|
47
48
|
|
|
48
49
|
const hasRows = computed(() => props.items.length > 0);
|
|
50
|
+
const access = useAccessSnapshot();
|
|
49
51
|
|
|
50
52
|
function formatValue(item: SystemRecord, column: ResourceColumn): string {
|
|
51
53
|
if (column.format === "license-policy") return formatLicensePolicy(item);
|
|
@@ -88,7 +90,9 @@ function formatGovernedValue(value: unknown): string {
|
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
function auditAction(value: unknown) {
|
|
91
|
-
|
|
93
|
+
const catalog =
|
|
94
|
+
access.snapshot.value?.auditActionCatalog || AUDIT_ACTION_DEFINITIONS;
|
|
95
|
+
return catalog.find(({ key }) => key === value);
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
function formatLicensePolicy(item: SystemRecord): string {
|
|
@@ -104,7 +108,10 @@ function formatLicensePolicy(item: SystemRecord): string {
|
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
function licenseVersionLabel(version: string): string {
|
|
107
|
-
return
|
|
111
|
+
return (
|
|
112
|
+
access.snapshot.value?.licenseCatalog?.find(({ key }) => key === version)
|
|
113
|
+
?.label || version
|
|
114
|
+
);
|
|
108
115
|
}
|
|
109
116
|
</script>
|
|
110
117
|
|
package/template/apps/web/src/pages/system/components/role-policy/RolePermissionTree.webtest.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
2
|
import { mount } from "@vue/test-utils";
|
|
3
|
-
import type { PermissionDefinition } from "@
|
|
3
|
+
import type { PermissionDefinition } from "@southwind-ai/shared";
|
|
4
4
|
import RolePermissionTree from "./RolePermissionTree.vue";
|
|
5
5
|
|
|
6
6
|
const permissions: PermissionDefinition[] = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { shallowRef, watch } from "vue";
|
|
3
|
-
import type { DataScope, PermissionDefinition } from "@
|
|
3
|
+
import type { DataScope, PermissionDefinition } from "@southwind-ai/shared";
|
|
4
4
|
import { Input } from "@/components/ui/input";
|
|
5
5
|
import {
|
|
6
6
|
Select,
|