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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import type { GovernedExportScopeSnapshot } from "@
|
|
2
|
+
import type { GovernedExportScopeSnapshot } from "@southwind-ai/database";
|
|
3
3
|
import { snapshotServerScopeContext } from "../../data-access/context.js";
|
|
4
4
|
|
|
5
5
|
export function captureGovernedExportScope(value: unknown) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GovernedExportQuerySnapshot } from "@
|
|
2
|
-
import type { AuditEvent } from "@
|
|
1
|
+
import type { GovernedExportQuerySnapshot } from "@southwind-ai/database";
|
|
2
|
+
import type { AuditEvent } from "@southwind-ai/shared";
|
|
3
3
|
import type { RequestGuardContext } from "../../guards.js";
|
|
4
4
|
import {
|
|
5
5
|
DurableArtifactError,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GovernedExportQuerySnapshot } from "@
|
|
1
|
+
import type { GovernedExportQuerySnapshot } from "@southwind-ai/database";
|
|
2
2
|
import { restoreServerScopeContext } from "../../data-access/context.js";
|
|
3
3
|
import type { RequestActor } from "../../guards.js";
|
|
4
4
|
import type { ManagedUser } from "../../system/entities.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
-
import { users } from "@
|
|
2
|
+
import { users } from "@southwind-ai/database";
|
|
3
3
|
import { drizzle, type NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
4
4
|
import { Pool } from "pg";
|
|
5
5
|
import type { DataScopeQuerySpecification } from "../data-access/query-specification.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuditOutcome } from "@
|
|
1
|
+
import type { AuditOutcome } from "@southwind-ai/shared";
|
|
2
2
|
import type { RequestGuardContext } from "../guards.js";
|
|
3
3
|
import type { ManagedUser } from "../system/entities.js";
|
|
4
4
|
import type { ResourceRouteConfig, RouteApp } from "../system/route-types.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { systemModuleManifest } from "@
|
|
1
|
+
import { systemModuleManifest } from "@southwind-ai/modules";
|
|
2
2
|
import {
|
|
3
3
|
type DataGovernancePolicyDefinition,
|
|
4
4
|
type GovernedFieldPolicy,
|
|
5
|
-
} from "@
|
|
5
|
+
} from "@southwind-ai/shared";
|
|
6
6
|
import type { ManagedUser } from "../system/entities.js";
|
|
7
7
|
import {
|
|
8
8
|
plaintextResult,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FeatureFlagDefinition } from "@
|
|
1
|
+
import type { FeatureFlagDefinition } from "@southwind-ai/shared";
|
|
2
2
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
3
|
import type { createServerRuntime } from "./runtime.js";
|
|
4
4
|
import type { ScheduledTaskDefinition } from "./scheduler/types.js";
|
|
@@ -6,12 +6,36 @@ import type { SearchProvider } from "./search/contracts.js";
|
|
|
6
6
|
import type { ManagedDepartment } from "./system/entities.js";
|
|
7
7
|
import type { EntityRepository } from "./system/repository.js";
|
|
8
8
|
import type { RouteApp } from "./system/route-types.js";
|
|
9
|
+
// @windy-module work-order begin
|
|
10
|
+
import type { ModuleInitializer } from "@southwind-ai/server-sdk";
|
|
9
11
|
import { createWorkOrderRepository } from "./work-order/repository.js";
|
|
10
12
|
import { createDrizzleWorkOrderRepository } from "./work-order/drizzle-repository.js";
|
|
11
13
|
import { registerWorkOrderRoutes } from "./work-order/routes.js";
|
|
12
14
|
import { WorkOrderService } from "./work-order/service.js";
|
|
13
15
|
import { WorkOrderSearchProvider } from "./work-order/search-provider.js";
|
|
14
16
|
import { createWorkOrderTaskDefinitions } from "./work-order/task.js";
|
|
17
|
+
// @windy-module work-order end
|
|
18
|
+
|
|
19
|
+
// @windy-module work-order begin
|
|
20
|
+
export const workOrderModuleInitializer: ModuleInitializer = {
|
|
21
|
+
moduleName: "work-order",
|
|
22
|
+
initialize(host) {
|
|
23
|
+
host.registerUploadPolicy({
|
|
24
|
+
purpose: "work-order.ticket.attachment",
|
|
25
|
+
maxByteSize: 20 * 1024 * 1024,
|
|
26
|
+
maxPartByteSize: 4 * 1024 * 1024,
|
|
27
|
+
sessionTtlMs: 2 * 60 * 60_000,
|
|
28
|
+
allowedTypes: {
|
|
29
|
+
"application/pdf": ["pdf"],
|
|
30
|
+
"image/png": ["png"],
|
|
31
|
+
"image/jpeg": ["jpg", "jpeg"],
|
|
32
|
+
"text/plain": ["txt"],
|
|
33
|
+
},
|
|
34
|
+
signature: "none",
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
// @windy-module work-order end
|
|
15
39
|
|
|
16
40
|
export interface ExampleModuleRuntimeDependencies {
|
|
17
41
|
features: FeatureFlagDefinition[];
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
featureKey,
|
|
5
5
|
licenseVersionKey,
|
|
6
6
|
type FeatureFlagDefinition,
|
|
7
|
-
} from "@
|
|
7
|
+
} from "@southwind-ai/shared";
|
|
8
8
|
import { InMemoryEntityRepository } from "../system/repository.js";
|
|
9
9
|
import type { ManagedFeature } from "../system/entities.js";
|
|
10
10
|
import { ManifestFeatureRepository } from "./manifest-feature-repository.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FeatureFlagDefinition } from "@
|
|
1
|
+
import type { FeatureFlagDefinition } from "@southwind-ai/shared";
|
|
2
2
|
import type { FeatureFlagRuntimeState } from "../runtime.js";
|
|
3
3
|
import type { RequestActor } from "../guards.js";
|
|
4
4
|
import type { ManagedFeature } from "../system/entities.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
LICENSE_CATALOG,
|
|
2
3
|
type FeatureFlagDefinition,
|
|
3
4
|
type LicenseVersionKey,
|
|
4
|
-
} from "@
|
|
5
|
+
} from "@southwind-ai/shared";
|
|
5
6
|
import { evaluateRouteGuards } from "../route-guards.js";
|
|
6
7
|
import type { createServerRuntime } from "../runtime.js";
|
|
7
8
|
import type { ManagedFeature } from "../system/entities.js";
|
|
@@ -16,11 +17,7 @@ import {
|
|
|
16
17
|
import type { RouteApp } from "../system/routes.js";
|
|
17
18
|
import type { ManifestFeatureRepository } from "./manifest-feature-repository.js";
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
const featureLicenseVersions = [
|
|
21
|
-
{ key: "standard" as LicenseVersionKey, label: "标准版" },
|
|
22
|
-
{ key: "advanced" as LicenseVersionKey, label: "高级版" },
|
|
23
|
-
] as const;
|
|
20
|
+
const featureLicenseVersions = LICENSE_CATALOG;
|
|
24
21
|
|
|
25
22
|
type ServerRuntime = ReturnType<typeof createServerRuntime>;
|
|
26
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { entitlementKey, featureKey } from "@
|
|
2
|
+
import { entitlementKey, featureKey } from "@southwind-ai/shared";
|
|
3
3
|
import { createFoundationFeatureAccess } from "./foundation-access.js";
|
|
4
4
|
import type { RequestGuardContext } from "./guards.js";
|
|
5
5
|
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { loadPlatformConfig, type PlatformConfig } from "@
|
|
1
|
+
import { loadPlatformConfig, type PlatformConfig } from "@southwind-ai/config";
|
|
2
2
|
import {
|
|
3
3
|
composeModuleMenus,
|
|
4
4
|
createModuleRegistry,
|
|
5
|
-
installedBusinessModuleFactories,
|
|
6
5
|
systemModuleFactories,
|
|
6
|
+
validateCapabilityCatalogs,
|
|
7
7
|
type ModuleManifest,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@southwind-ai/modules";
|
|
9
9
|
import type {
|
|
10
|
+
AuditActionDefinition,
|
|
10
11
|
FeatureFlagDefinition,
|
|
12
|
+
LicenseCatalogDefinition,
|
|
11
13
|
MenuNode,
|
|
12
14
|
PermissionDefinition,
|
|
13
|
-
} from "@
|
|
15
|
+
} from "@southwind-ai/shared";
|
|
16
|
+
import { installedBusinessModuleFactories } from "./installed-business-modules.js";
|
|
14
17
|
|
|
15
18
|
export interface FoundationSnapshot {
|
|
16
19
|
platform: {
|
|
@@ -28,6 +31,8 @@ export interface FoundationSnapshot {
|
|
|
28
31
|
permissions: PermissionDefinition[];
|
|
29
32
|
features: FeatureFlagDefinition[];
|
|
30
33
|
auditActions: string[];
|
|
34
|
+
auditActionCatalog: readonly AuditActionDefinition[];
|
|
35
|
+
licenseCatalog: readonly LicenseCatalogDefinition[];
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
export function loadFoundationModules(): ModuleManifest[] {
|
|
@@ -52,15 +57,22 @@ function collectFeatures(modules: ModuleManifest[]): FeatureFlagDefinition[] {
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
function collectAuditActions(modules: ModuleManifest[]): string[] {
|
|
55
|
-
return
|
|
56
|
-
new Set(
|
|
57
|
-
|
|
60
|
+
return [
|
|
61
|
+
...new Set(
|
|
62
|
+
modules.flatMap((module) =>
|
|
63
|
+
module.auditActions.map((action) =>
|
|
64
|
+
typeof action === "string" ? action : action.key,
|
|
65
|
+
),
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
].sort();
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
export function createFoundationSnapshot(
|
|
61
72
|
config: PlatformConfig = loadPlatformConfig(),
|
|
62
73
|
): FoundationSnapshot {
|
|
63
74
|
const modules = loadFoundationModules();
|
|
75
|
+
const catalogs = validateCapabilityCatalogs(modules);
|
|
64
76
|
|
|
65
77
|
return {
|
|
66
78
|
platform: {
|
|
@@ -81,5 +93,7 @@ export function createFoundationSnapshot(
|
|
|
81
93
|
permissions: collectPermissions(modules),
|
|
82
94
|
features: collectFeatures(modules),
|
|
83
95
|
auditActions: collectAuditActions(modules),
|
|
96
|
+
auditActionCatalog: catalogs.auditActions,
|
|
97
|
+
licenseCatalog: catalogs.licenseVersions,
|
|
84
98
|
};
|
|
85
99
|
}
|
|
@@ -4,9 +4,9 @@ import type {
|
|
|
4
4
|
EntitlementKey,
|
|
5
5
|
FeatureFlagDefinition,
|
|
6
6
|
LicenseVersionKey,
|
|
7
|
-
} from "@
|
|
8
|
-
import { correlationId, isLicenseVersionAllowed } from "@
|
|
9
|
-
import type { CredentialState } from "@
|
|
7
|
+
} from "@southwind-ai/shared";
|
|
8
|
+
import { correlationId, isLicenseVersionAllowed } from "@southwind-ai/shared";
|
|
9
|
+
import type { CredentialState } from "@southwind-ai/shared";
|
|
10
10
|
import { randomUUIDv7 } from "bun";
|
|
11
11
|
import type { ScopeContext } from "./data-access/context.js";
|
|
12
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadPlatformConfig } from "@
|
|
1
|
+
import { loadPlatformConfig } from "@southwind-ai/config";
|
|
2
2
|
import pino from "pino";
|
|
3
3
|
import { registerAdminBootstrapRoute } from "./admin/routes.js";
|
|
4
4
|
import { registerSessionContextRoute } from "./session/routes.js";
|
|
@@ -64,16 +64,21 @@ import { registerNotificationRoutes } from "./notification/routes.js";
|
|
|
64
64
|
import {
|
|
65
65
|
createExampleModuleRuntime,
|
|
66
66
|
registerExampleModuleRoutes,
|
|
67
|
+
workOrderModuleInitializer,
|
|
67
68
|
} from "./example-modules.js";
|
|
68
69
|
// @windy-module work-order end
|
|
69
70
|
// @windy-module system.configuration begin
|
|
70
71
|
import { bootstrapModuleConfiguration } from "./configuration/bootstrap.js";
|
|
71
72
|
// @windy-module system.configuration end
|
|
72
73
|
// @windy-module system.storage begin
|
|
73
|
-
import {
|
|
74
|
+
import {
|
|
75
|
+
createStorageRuntime,
|
|
76
|
+
platformUploadPolicies,
|
|
77
|
+
} from "./storage/runtime.js";
|
|
74
78
|
import { registerStorageRoutes } from "./storage/routes.js";
|
|
75
79
|
// @windy-module system.storage end
|
|
76
80
|
import { validateServerModuleComposition } from "./module-composition.js";
|
|
81
|
+
import { initializeModuleHosts } from "./module-host.js";
|
|
77
82
|
// @windy-module system.search begin
|
|
78
83
|
import { createSearchHost } from "./search/host.js";
|
|
79
84
|
// @windy-module system.search end
|
|
@@ -108,6 +113,19 @@ const foundationSnapshot = createFoundationSnapshot(platformConfig);
|
|
|
108
113
|
configurationRuntime.bindFoundation(foundationSnapshot);
|
|
109
114
|
// @windy-module system.configuration end
|
|
110
115
|
const foundationModules = loadFoundationModules();
|
|
116
|
+
const moduleHosts = await initializeModuleHosts({
|
|
117
|
+
modules: foundationModules,
|
|
118
|
+
initializers: [
|
|
119
|
+
// @windy-module work-order begin
|
|
120
|
+
workOrderModuleInitializer,
|
|
121
|
+
// @windy-module work-order end
|
|
122
|
+
],
|
|
123
|
+
baseUploadPolicies: [
|
|
124
|
+
// @windy-module system.storage begin
|
|
125
|
+
...platformUploadPolicies,
|
|
126
|
+
// @windy-module system.storage end
|
|
127
|
+
],
|
|
128
|
+
});
|
|
111
129
|
const systemRepositories = createSystemRepositories(foundationSnapshot, {
|
|
112
130
|
db: persistence?.db,
|
|
113
131
|
});
|
|
@@ -139,6 +157,7 @@ const runtime = createServerRuntime(process.env, {
|
|
|
139
157
|
: persistence?.licenseResolver,
|
|
140
158
|
// @windy-module system.license end
|
|
141
159
|
featureResolver: persistence ? systemRepositories.features : undefined,
|
|
160
|
+
featureCatalog: foundationSnapshot.features,
|
|
142
161
|
// @windy-module system.audit begin
|
|
143
162
|
auditReader: persistence?.auditReader,
|
|
144
163
|
auditWriter: persistence?.auditWriter,
|
|
@@ -164,7 +183,11 @@ const { authRepository, authService } = createAuthRuntime({
|
|
|
164
183
|
// @windy-module system.audit end
|
|
165
184
|
});
|
|
166
185
|
// @windy-module system.storage begin
|
|
167
|
-
const storageRuntime = createStorageRuntime(
|
|
186
|
+
const storageRuntime = createStorageRuntime(
|
|
187
|
+
process.env,
|
|
188
|
+
persistence?.db,
|
|
189
|
+
moduleHosts.uploadPolicies,
|
|
190
|
+
);
|
|
168
191
|
// @windy-module system.storage end
|
|
169
192
|
// @windy-module system.settings begin
|
|
170
193
|
const brandingSettingsRepository = createBrandingSettingsRepository(
|
|
@@ -214,6 +237,7 @@ const {
|
|
|
214
237
|
storage: storageRuntime,
|
|
215
238
|
exampleTasks: businessTaskDefinitions,
|
|
216
239
|
bulkRetentionDays: readPositiveInt(process.env.BULK_DATA_RETENTION_DAYS, 7),
|
|
240
|
+
installModuleDurableHandlers: moduleHosts.installDurableHandlers,
|
|
217
241
|
});
|
|
218
242
|
const schedulerWorker = new SchedulerWorker(
|
|
219
243
|
scheduler,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @windy-module work-order begin
|
|
2
|
-
import { workOrderModule } from "@
|
|
2
|
+
import { workOrderModule } from "@southwind-ai/example-work-order";
|
|
3
3
|
// @windy-module work-order end
|
|
4
|
-
import type { ModuleFactory } from "
|
|
4
|
+
import type { ModuleFactory } from "@southwind-ai/modules";
|
|
5
5
|
|
|
6
6
|
export const installedBusinessModuleFactories: ModuleFactory[] = [
|
|
7
7
|
// @windy-module work-order begin
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { MemoryBlobStore } from "@
|
|
2
|
+
import { MemoryBlobStore } from "@southwind-ai/storage";
|
|
3
3
|
import { DurableArtifactService } from "./artifact-service.js";
|
|
4
4
|
import { InMemoryDurableJobRepository } from "./repository.js";
|
|
5
5
|
import { DurableJobService } from "./service.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DurableJobArtifact } from "@southwind-ai/jobs";
|
|
2
|
+
import type { BlobStore, ReadableBlob } from "@southwind-ai/storage";
|
|
2
3
|
import type { DurableJobRepository } from "./repository.js";
|
|
3
|
-
import type { DurableJobArtifact } from "./types.js";
|
|
4
4
|
|
|
5
5
|
export type DurableArtifactErrorCode =
|
|
6
6
|
| "ARTIFACT_NOT_FOUND"
|
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
durableJobArtifacts,
|
|
3
3
|
durableJobLeases,
|
|
4
4
|
durableJobs,
|
|
5
|
-
} from "@
|
|
5
|
+
} from "@southwind-ai/database";
|
|
6
|
+
import type { DurableLeaseIdentity } from "@southwind-ai/jobs";
|
|
6
7
|
import { eq } from "drizzle-orm";
|
|
7
8
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
8
9
|
import type {
|
|
@@ -10,7 +11,6 @@ import type {
|
|
|
10
11
|
LeaseResult,
|
|
11
12
|
} from "./execution-repository.js";
|
|
12
13
|
import { activeLeaseWhere } from "./drizzle-lease.js";
|
|
13
|
-
import type { DurableLeaseIdentity } from "./types.js";
|
|
14
14
|
|
|
15
15
|
type Artifact = Parameters<DurableExecutionRepository["publishArtifact"]>[1];
|
|
16
16
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
durableJobLeases,
|
|
4
4
|
durableJobStages,
|
|
5
5
|
durableJobs,
|
|
6
|
-
} from "@
|
|
6
|
+
} from "@southwind-ai/database";
|
|
7
7
|
import { and, asc, desc, eq, isNull, lte } from "drizzle-orm";
|
|
8
8
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
9
9
|
import type { ClaimDurableJob } from "./execution-repository.js";
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
durableJobProgress,
|
|
6
6
|
durableJobStages,
|
|
7
7
|
durableJobs,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@southwind-ai/database";
|
|
9
|
+
import type { DurableLeaseIdentity } from "@southwind-ai/jobs";
|
|
9
10
|
import { and, eq, max, notInArray } from "drizzle-orm";
|
|
10
11
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
11
12
|
import type {
|
|
@@ -19,7 +20,6 @@ import { DrizzleDurableRecoveryRepository } from "./drizzle-recovery-repository.
|
|
|
19
20
|
import { claimDurableJob } from "./drizzle-claim.js";
|
|
20
21
|
import { publishDrizzleArtifact } from "./drizzle-artifact.js";
|
|
21
22
|
import { activeLeaseWhere } from "./drizzle-lease.js";
|
|
22
|
-
import type { DurableLeaseIdentity } from "./types.js";
|
|
23
23
|
|
|
24
24
|
export class DrizzleDurableExecutionRepository implements DurableExecutionRepository {
|
|
25
25
|
private readonly recovery: DrizzleDurableRecoveryRepository;
|
|
@@ -10,7 +10,7 @@ import { resolve } from "node:path";
|
|
|
10
10
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
11
11
|
import { migrate } from "drizzle-orm/node-postgres/migrator";
|
|
12
12
|
import { Pool } from "pg";
|
|
13
|
-
import { artifactRef } from "@
|
|
13
|
+
import { artifactRef } from "@southwind-ai/storage";
|
|
14
14
|
import { DrizzleDurableExecutionRepository } from "./drizzle-execution-repository.js";
|
|
15
15
|
import { DrizzleDurableJobRepository } from "./drizzle-repository.js";
|
|
16
16
|
import { DurableJobService } from "./service.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { durableJobLeases } from "@
|
|
1
|
+
import { durableJobLeases } from "@southwind-ai/database";
|
|
2
|
+
import type { DurableLeaseIdentity } from "@southwind-ai/jobs";
|
|
2
3
|
import { and, eq, gt } from "drizzle-orm";
|
|
3
|
-
import type { DurableLeaseIdentity } from "./types.js";
|
|
4
4
|
|
|
5
5
|
export function activeLeaseWhere(identity: DurableLeaseIdentity, now: Date) {
|
|
6
6
|
return and(
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
durableJobRecoveries,
|
|
8
8
|
durableJobStages,
|
|
9
9
|
durableJobs,
|
|
10
|
-
} from "@
|
|
11
|
-
import { artifactRef } from "@
|
|
10
|
+
} from "@southwind-ai/database";
|
|
11
|
+
import { artifactRef } from "@southwind-ai/storage";
|
|
12
12
|
import type {
|
|
13
13
|
DurableJob,
|
|
14
14
|
DurableJobArtifact,
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
DurableJobProgress,
|
|
19
19
|
DurableJobRecovery,
|
|
20
20
|
DurableJobStage,
|
|
21
|
-
} from "
|
|
21
|
+
} from "@southwind-ai/jobs";
|
|
22
22
|
|
|
23
23
|
const iso = (value: Date | null) => value?.toISOString();
|
|
24
24
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
durableJobRecoveries,
|
|
6
6
|
durableJobStages,
|
|
7
7
|
durableJobs,
|
|
8
|
-
} from "@
|
|
8
|
+
} from "@southwind-ai/database";
|
|
9
9
|
import { and, eq, lte, notInArray, or } from "drizzle-orm";
|
|
10
10
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
11
11
|
import type { ManualJobRecovery } from "./execution-repository.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
-
import { artifactRef } from "@
|
|
3
|
+
import { artifactRef } from "@southwind-ai/storage";
|
|
4
4
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
5
5
|
import { migrate } from "drizzle-orm/node-postgres/migrator";
|
|
6
6
|
import { Pool } from "pg";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
durableJobRecoveries,
|
|
8
8
|
durableJobStages,
|
|
9
9
|
durableJobs,
|
|
10
|
-
} from "@
|
|
10
|
+
} from "@southwind-ai/database";
|
|
11
11
|
import { and, asc, desc, eq, gt, isNull, or } from "drizzle-orm";
|
|
12
|
-
import { artifactRef, type ArtifactRef } from "@
|
|
12
|
+
import { artifactRef, type ArtifactRef } from "@southwind-ai/storage";
|
|
13
13
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
14
14
|
import {
|
|
15
15
|
mapArtifact,
|
|
@@ -31,7 +31,7 @@ import type {
|
|
|
31
31
|
DurableJobStage,
|
|
32
32
|
SubmitDurableJob,
|
|
33
33
|
SubmitDurableJobResult,
|
|
34
|
-
} from "
|
|
34
|
+
} from "@southwind-ai/jobs";
|
|
35
35
|
|
|
36
36
|
export class DrizzleDurableJobRepository implements DurableJobRepository {
|
|
37
37
|
constructor(private readonly db: NodePgDatabase) {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DurableHandlerRegistry } from "@southwind-ai/jobs";
|
|
3
|
+
import { artifactRef } from "@southwind-ai/storage";
|
|
4
4
|
import { InMemoryDurableExecutionRepository } from "./in-memory-execution.js";
|
|
5
5
|
import { DurableJobService } from "./service.js";
|
|
6
6
|
import { DurableJobWorker } from "./worker.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
+
import { DurableHandlerRegistry } from "@southwind-ai/jobs";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
4
5
|
import { migrate } from "drizzle-orm/node-postgres/migrator";
|
|
@@ -8,7 +9,6 @@ import type { BulkResourceHandler } from "../bulk-data/resource-handler.js";
|
|
|
8
9
|
import { BulkDataService } from "../bulk-data/service.js";
|
|
9
10
|
import { DrizzleDurableExecutionRepository } from "./drizzle-execution-repository.js";
|
|
10
11
|
import { DrizzleDurableJobRepository } from "./drizzle-repository.js";
|
|
11
|
-
import { DurableHandlerRegistry } from "./handler-registry.js";
|
|
12
12
|
import {
|
|
13
13
|
DeferredLegacyExecutor,
|
|
14
14
|
LegacyDurableAdapter,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { DurableHandlerRegistry } from "@southwind-ai/jobs";
|
|
2
3
|
import { createFoundationSnapshot } from "../foundation.js";
|
|
3
4
|
import { createServerRuntime } from "../runtime.js";
|
|
4
5
|
import { InMemorySchedulerRepository } from "../scheduler/repository.js";
|
|
@@ -7,7 +8,6 @@ import type { SchedulerClock } from "../scheduler/types.js";
|
|
|
7
8
|
import { InMemoryBulkDataRepository } from "../bulk-data/repository.js";
|
|
8
9
|
import { BulkDataService } from "../bulk-data/service.js";
|
|
9
10
|
import type { BulkResourceHandler } from "../bulk-data/resource-handler.js";
|
|
10
|
-
import { DurableHandlerRegistry } from "./handler-registry.js";
|
|
11
11
|
import { InMemoryDurableExecutionRepository } from "./in-memory-execution.js";
|
|
12
12
|
import {
|
|
13
13
|
DeferredLegacyExecutor,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { DurableHandlerRegistry } from "@southwind-ai/jobs";
|
|
1
2
|
import type { DurableRunResult } from "./worker.js";
|
|
2
|
-
import type { DurableHandlerRegistry } from "./handler-registry.js";
|
|
3
3
|
import type { DurableJobService } from "./service.js";
|
|
4
4
|
import type { DurableJobWorker } from "./worker.js";
|
|
5
5
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DurableHandlerRegistry } from "@southwind-ai/jobs";
|
|
2
|
+
import type { BlobStore } from "@southwind-ai/storage";
|
|
2
3
|
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
3
4
|
import { BulkDataService } from "../bulk-data/service.js";
|
|
4
5
|
import type { BulkDataLimits } from "../bulk-data/input-validation.js";
|
|
@@ -10,7 +11,6 @@ import { SchedulerService } from "../scheduler/service.js";
|
|
|
10
11
|
import type { ScheduledTaskDefinition } from "../scheduler/types.js";
|
|
11
12
|
import { DrizzleDurableExecutionRepository } from "./drizzle-execution-repository.js";
|
|
12
13
|
import { DrizzleDurableJobRepository } from "./drizzle-repository.js";
|
|
13
|
-
import { DurableHandlerRegistry } from "./handler-registry.js";
|
|
14
14
|
import { InMemoryDurableExecutionRepository } from "./in-memory-execution.js";
|
|
15
15
|
import {
|
|
16
16
|
DeferredLegacyExecutor,
|
|
@@ -31,6 +31,7 @@ interface LegacyServiceRuntimeInput {
|
|
|
31
31
|
taskDefinitions: ScheduledTaskDefinition[];
|
|
32
32
|
runtime: ReturnType<typeof createServerRuntime>;
|
|
33
33
|
workflow: WorkflowService;
|
|
34
|
+
installModuleDurableHandlers?: (registry: DurableHandlerRegistry) => void;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export function createLegacyServiceRuntime(input: LegacyServiceRuntimeInput) {
|
|
@@ -41,6 +42,7 @@ export function createLegacyServiceRuntime(input: LegacyServiceRuntimeInput) {
|
|
|
41
42
|
: inMemory;
|
|
42
43
|
const service = new DurableJobService(facts);
|
|
43
44
|
const registry = new DurableHandlerRegistry();
|
|
45
|
+
input.installModuleDurableHandlers?.(registry);
|
|
44
46
|
const worker = new DurableJobWorker(execution, registry);
|
|
45
47
|
const workflowTimeout = new WorkflowTimeoutRuntime(
|
|
46
48
|
service,
|
|
@@ -10,8 +10,8 @@ import type {
|
|
|
10
10
|
DurableJobStage,
|
|
11
11
|
SubmitDurableJob,
|
|
12
12
|
SubmitDurableJobResult,
|
|
13
|
-
} from "
|
|
14
|
-
import type { ArtifactRef } from "@
|
|
13
|
+
} from "@southwind-ai/jobs";
|
|
14
|
+
import type { ArtifactRef } from "@southwind-ai/storage";
|
|
15
15
|
|
|
16
16
|
export interface DurableJobRepository {
|
|
17
17
|
submit(input: SubmitDurableJob, now: Date): Promise<SubmitDurableJobResult>;
|