create-windy 0.2.33 → 0.3.0
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/dist/cli.js +173 -17
- package/package.json +1 -1
- package/template/.agents/skills/windy-business-module/SKILL.md +10 -1
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +9 -0
- package/template/README.md +3 -1
- package/template/apps/agent-server/Dockerfile +1 -0
- package/template/apps/agent-server/README.md +28 -5
- package/template/apps/agent-server/adk_web_agents/__init__.py +1 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +3 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +40 -0
- package/template/apps/agent-server/pyproject.toml +1 -1
- package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +191 -16
- package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +13 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +225 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +76 -0
- package/template/apps/agent-server/src/southwind_agent_server/app.py +63 -3
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +35 -0
- package/template/apps/agent-server/src/southwind_agent_server/engine.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +31 -3
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +22 -9
- package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +144 -0
- package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +227 -0
- package/template/apps/agent-server/src/southwind_agent_server/service.py +1 -0
- package/template/apps/agent-server/tests/test_adk_adapter.py +305 -0
- package/template/apps/agent-server/tests/test_adk_web_agent.py +12 -0
- package/template/apps/agent-server/tests/test_api.py +16 -1
- package/template/apps/agent-server/tests/test_openai_provider.py +79 -0
- package/template/apps/agent-server/tests/test_provider_governance.py +215 -0
- package/template/apps/server/package.json +4 -1
- package/template/apps/server/src/agent/provider-input-governance.test.ts +82 -0
- package/template/apps/server/src/agent/provider-input-governance.ts +140 -0
- package/template/apps/server/src/agent/remote-runtime.test.ts +22 -0
- package/template/apps/server/src/agent/remote-runtime.ts +1 -0
- package/template/apps/server/src/agent/run-contracts.ts +2 -0
- package/template/apps/server/src/agent/run-facade.test.ts +52 -2
- package/template/apps/server/src/agent/run-facade.ts +38 -9
- package/template/apps/server/src/agent/tool-registry.ts +2 -6
- package/template/apps/server/src/application-services.ts +50 -0
- package/template/apps/server/src/audit/drizzle-log-store.ts +25 -0
- package/template/apps/server/src/audit/search-summary.ts +2 -6
- package/template/apps/server/src/auth/credential-restriction.ts +1 -0
- package/template/apps/server/src/auth/password.ts +30 -21
- package/template/apps/server/src/auth/routes.test.ts +44 -3
- package/template/apps/server/src/auth/routes.ts +6 -1
- package/template/apps/server/src/auth/runtime.ts +4 -1
- package/template/apps/server/src/auth/service.ts +25 -7
- package/template/apps/server/src/configuration/bootstrap.ts +20 -1
- package/template/apps/server/src/configuration/definition.test.ts +71 -0
- package/template/apps/server/src/configuration/definition.ts +242 -12
- package/template/apps/server/src/configuration/drizzle-repository.ts +36 -2
- package/template/apps/server/src/configuration/repository.ts +27 -2
- package/template/apps/server/src/configuration/routes.ts +4 -1
- package/template/apps/server/src/configuration/service.test.ts +100 -0
- package/template/apps/server/src/configuration/service.ts +50 -10
- package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +3 -2
- package/template/apps/server/src/data-governance/export/service.ts +2 -6
- package/template/apps/server/src/example-modules.ts +4 -1
- package/template/apps/server/src/guards.ts +18 -5
- package/template/apps/server/src/http/request-source.test.ts +85 -0
- package/template/apps/server/src/http/request-source.ts +90 -0
- package/template/apps/server/src/index.ts +45 -45
- package/template/apps/server/src/license/routes.ts +2 -0
- package/template/apps/server/src/license/runtime-service.ts +10 -11
- package/template/apps/server/src/module-bootstrap.ts +2 -2
- package/template/apps/server/src/module-host/initialize-contracts.ts +6 -0
- package/template/apps/server/src/module-host/initialize.ts +30 -44
- package/template/apps/server/src/module-host/request-context.ts +29 -23
- package/template/apps/server/src/module-host/resource-file-policies.test.ts +197 -0
- package/template/apps/server/src/module-host/resource-file-policies.ts +108 -0
- package/template/apps/server/src/module-host/route-declaration.ts +45 -0
- package/template/apps/server/src/module-host/route-installer.ts +27 -3
- package/template/apps/server/src/module-host/storage-port.test.ts +170 -1
- package/template/apps/server/src/module-host/storage-port.ts +134 -1
- package/template/apps/server/src/module-host/storage-scope.ts +89 -0
- package/template/apps/server/src/module-host/tool-handlers.test.ts +305 -0
- package/template/apps/server/src/module-host/tool-handlers.ts +38 -4
- package/template/apps/server/src/module-host/user-directory-composition.test.ts +126 -0
- package/template/apps/server/src/module-host/user-directory-port.test.ts +238 -0
- package/template/apps/server/src/module-host/user-directory-port.ts +139 -0
- package/template/apps/server/src/module-host.ts +4 -0
- package/template/apps/server/src/notification/channel-adapter.ts +46 -0
- package/template/apps/server/src/notification/delivery-policy.test.ts +59 -0
- package/template/apps/server/src/notification/delivery-policy.ts +37 -0
- package/template/apps/server/src/notification/delivery-repository.ts +198 -0
- package/template/apps/server/src/notification/delivery-worker.test.ts +87 -0
- package/template/apps/server/src/notification/delivery-worker.ts +88 -0
- package/template/apps/server/src/notification/drizzle-management.ts +180 -0
- package/template/apps/server/src/notification/drizzle-query.ts +160 -0
- package/template/apps/server/src/notification/drizzle-repository.integration.test.ts +301 -0
- package/template/apps/server/src/notification/drizzle-repository.ts +156 -90
- package/template/apps/server/src/notification/extension-routes.test.ts +119 -0
- package/template/apps/server/src/notification/extension-routes.ts +111 -0
- package/template/apps/server/src/notification/memory-delivery-repository.ts +137 -0
- package/template/apps/server/src/notification/memory-support.ts +72 -0
- package/template/apps/server/src/notification/preference-repository.ts +95 -0
- package/template/apps/server/src/notification/recipient-directory.ts +104 -0
- package/template/apps/server/src/notification/repository.test.ts +171 -0
- package/template/apps/server/src/notification/repository.ts +179 -32
- package/template/apps/server/src/notification/revision-routes.test.ts +186 -0
- package/template/apps/server/src/notification/route-support.ts +225 -0
- package/template/apps/server/src/notification/routes.test.ts +182 -0
- package/template/apps/server/src/notification/routes.ts +225 -132
- package/template/apps/server/src/notification/service.test.ts +104 -0
- package/template/apps/server/src/notification/service.ts +140 -0
- package/template/apps/server/src/notification/smtp-adapter.test.ts +65 -0
- package/template/apps/server/src/notification/smtp-adapter.ts +68 -0
- package/template/apps/server/src/persistence.integration.test.ts +41 -2
- package/template/apps/server/src/route-guards.ts +1 -0
- package/template/apps/server/src/runtime-audit-list.test.ts +39 -0
- package/template/apps/server/src/runtime-development.ts +2 -0
- package/template/apps/server/src/runtime.test.ts +23 -9
- package/template/apps/server/src/runtime.ts +39 -2
- package/template/apps/server/src/scheduler/audit.ts +2 -11
- package/template/apps/server/src/scheduler/definitions.test.ts +6 -0
- package/template/apps/server/src/scheduler/definitions.ts +7 -0
- package/template/apps/server/src/scheduler/recovery-service.ts +2 -11
- package/template/apps/server/src/scheduler/routes.ts +2 -7
- package/template/apps/server/src/search/opensearch-client.test.ts +45 -0
- package/template/apps/server/src/search/opensearch-client.ts +145 -0
- package/template/apps/server/src/search/service.ts +2 -6
- package/template/apps/server/src/settings/routes.ts +15 -3
- package/template/apps/server/src/settings/runtime.ts +10 -1
- package/template/apps/server/src/storage/runtime.ts +13 -0
- package/template/apps/server/src/system/audit-query.ts +33 -4
- package/template/apps/server/src/system/audit-routes.test.ts +58 -4
- package/template/apps/server/src/system/audit-routes.ts +6 -5
- package/template/apps/server/src/system/built-in-roles.ts +1 -0
- package/template/apps/server/src/system/department-organization.ts +320 -0
- package/template/apps/server/src/system/department-routes.test.ts +207 -48
- package/template/apps/server/src/system/department-routes.ts +114 -33
- package/template/apps/server/src/system/drizzle-repository.ts +15 -7
- package/template/apps/server/src/system/drizzle-scoped-repository.ts +5 -3
- package/template/apps/server/src/system/drizzle-system.ts +37 -9
- package/template/apps/server/src/system/drizzle-transaction-context.ts +14 -0
- package/template/apps/server/src/system/identity-route-config.ts +7 -2
- package/template/apps/server/src/system/mutation-runner.ts +23 -0
- package/template/apps/server/src/system/organization-postgres.integration.test.ts +176 -0
- package/template/apps/server/src/system/resource-access-response.ts +12 -6
- package/template/apps/server/src/system/role-department-scope-policy.ts +55 -0
- package/template/apps/server/src/system/route-helpers.ts +2 -5
- package/template/apps/server/src/system/route-types.ts +12 -3
- package/template/apps/server/src/system/routes-validation.test.ts +26 -0
- package/template/apps/server/src/system/routes.test.ts +10 -2
- package/template/apps/server/src/system/routes.ts +70 -36
- package/template/apps/server/src/system/seed.ts +7 -0
- package/template/apps/server/src/work-order/data-scope.integration.test.ts +9 -2
- package/template/apps/server/src/work-order/opensearch-index.test.ts +97 -0
- package/template/apps/server/src/work-order/opensearch-index.ts +313 -0
- package/template/apps/server/src/work-order/search-provider.ts +60 -1
- package/template/apps/server/src/work-order/service.ts +42 -10
- package/template/apps/web/src/app/error-pages.ts +9 -0
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +16 -11
- package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +14 -0
- package/template/apps/web/src/components/common/FormDialog.vue +16 -2
- package/template/apps/web/src/components/common/ModalLayout.webtest.ts +20 -1
- package/template/apps/web/src/composables/useGlobalSearch.ts +68 -0
- package/template/apps/web/src/composables/usePlatformSettings.ts +8 -7
- package/template/apps/web/src/layout/GlobalSearchResults.vue +58 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +42 -6
- package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +71 -0
- package/template/apps/web/src/layout/NotificationMenu.vue +73 -31
- package/template/apps/web/src/layout/NotificationMenu.webtest.ts +44 -1
- package/template/apps/web/src/layout/NotificationMenuItem.vue +61 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.vue +181 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.webtest.ts +80 -0
- package/template/apps/web/src/lib/date-time.ts +22 -10
- package/template/apps/web/src/lib/date-time.webtest.ts +9 -1
- package/template/apps/web/src/main.ts +14 -1
- package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +16 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +10 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +37 -6
- package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +115 -0
- package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +44 -0
- package/template/apps/web/src/pages/errors/error-page-extension.ts +26 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +136 -68
- package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +224 -12
- package/template/apps/web/src/pages/system/audit-log-presenter.ts +86 -0
- package/template/apps/web/src/pages/system/audit-time-range.ts +28 -0
- package/template/apps/web/src/pages/system/components/AuditActionCell.vue +10 -69
- package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +20 -27
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.vue +134 -0
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts +76 -0
- package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +116 -52
- package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +52 -15
- package/template/apps/web/src/pages/system/components/NotificationHistoryDialog.vue +129 -0
- package/template/apps/web/src/pages/system/components/NotificationManagementCard.vue +91 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishDialog.vue +121 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +162 -1
- package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +74 -0
- package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +3 -4
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +91 -98
- package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +20 -1
- package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +28 -7
- package/template/apps/web/src/pages/system/components/department/DepartmentOrganizationForm.vue +210 -0
- package/template/apps/web/src/pages/system/components/department/DepartmentTransitionDialog.vue +112 -0
- package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +17 -4
- package/template/apps/web/src/pages/system/composables/useDepartmentTransitions.ts +79 -0
- package/template/apps/web/src/pages/system/composables/useNotificationPermissions.ts +14 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.ts +2 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +15 -2
- package/template/apps/web/src/pages/system/resource-config.ts +12 -4
- package/template/apps/web/src/router/error-navigation.ts +50 -0
- package/template/apps/web/src/router/error-navigation.webtest.ts +106 -0
- package/template/apps/web/src/router/index.ts +71 -0
- package/template/apps/web/src/router/index.webtest.ts +29 -0
- package/template/apps/web/src/router/manifest-routes.webtest.ts +4 -0
- package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
- package/template/apps/web/src/services/auth-api.ts +5 -0
- package/template/apps/web/src/services/http.ts +43 -6
- package/template/apps/web/src/services/http.webtest.ts +70 -0
- package/template/apps/web/src/services/notification-api.ts +85 -2
- package/template/apps/web/src/services/notification-api.webtest.ts +110 -0
- package/template/apps/web/src/services/search-api.ts +39 -0
- package/template/apps/web/src/services/system-api.ts +18 -0
- package/template/apps/web/vitest.config.ts +1 -0
- package/template/docker-compose.yml +68 -0
- package/template/docs/architecture/ai-egress.md +49 -7
- package/template/docs/architecture/ai-runtime.md +34 -6
- package/template/docs/architecture/data-scope-query-enforcement.md +4 -0
- package/template/docs/architecture/object-storage.md +22 -2
- package/template/docs/architecture/search-provider-protocol.md +38 -2
- package/template/docs/development/custom-error-pages.md +78 -0
- package/template/docs/development/custom-login-page.md +3 -3
- package/template/docs/platform/agent-runtime.md +76 -7
- package/template/docs/platform/audit-reliability.md +46 -2
- package/template/docs/platform/business-user-directory.md +82 -0
- package/template/docs/platform/module-configuration.md +13 -4
- package/template/docs/platform/notifications.md +67 -11
- package/template/docs/platform/organization-membership.md +17 -3
- package/template/docs/platform/system-crud-api.md +16 -0
- package/template/docs/platform/web-system-crud.md +6 -2
- package/template/package.json +4 -0
- package/template/packages/config/index.test.ts +45 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/config/src/platform.ts +169 -48
- package/template/packages/database/drizzle/0035_material_nightshade.sql +10 -0
- package/template/packages/database/drizzle/0036_hesitant_speed.sql +35 -0
- package/template/packages/database/drizzle/0037_absent_nick_fury.sql +2 -0
- package/template/packages/database/drizzle/0038_uneven_wasp.sql +38 -0
- package/template/packages/database/drizzle/meta/0035_snapshot.json +7331 -0
- package/template/packages/database/drizzle/meta/0036_snapshot.json +7436 -0
- package/template/packages/database/drizzle/meta/0037_snapshot.json +7457 -0
- package/template/packages/database/drizzle/meta/0038_snapshot.json +7749 -0
- package/template/packages/database/drizzle/meta/_journal.json +28 -0
- package/template/packages/database/package.json +1 -1
- package/template/packages/database/src/schema/identity.ts +7 -0
- package/template/packages/database/src/schema/notifications.ts +135 -0
- package/template/packages/database/src/schema-notification-delivery.test.ts +54 -0
- package/template/packages/database/src/schema-workflow-notification.test.ts +40 -1
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/ai-operation-composition.test.ts +68 -0
- package/template/packages/modules/src/ai-operation-composition.ts +115 -0
- package/template/packages/modules/src/manifest.ts +26 -0
- package/template/packages/modules/src/provider-data-policy-composition.test.ts +74 -0
- package/template/packages/modules/src/system-api-permissions.ts +54 -0
- package/template/packages/modules/src/system-audit-actions.ts +15 -0
- package/template/packages/modules/src/system-features.ts +6 -1
- package/template/packages/modules/src/system-module-catalog.test.ts +16 -0
- package/template/packages/modules/src/system-module-catalog.ts +28 -4
- package/template/packages/modules/src/system-modules.test.ts +13 -1
- package/template/packages/modules/src/system-modules.ts +12 -0
- package/template/packages/modules/src/system-permissions.ts +11 -5
- package/template/packages/server-sdk/index.ts +11 -0
- package/template/packages/server-sdk/package.json +3 -2
- package/template/packages/server-sdk/src/ai-operation-registration.ts +2 -1
- package/template/packages/server-sdk/src/module-host.ts +8 -0
- package/template/packages/server-sdk/src/request-context.ts +2 -0
- package/template/packages/server-sdk/src/storage-port.ts +66 -0
- package/template/packages/server-sdk/src/tool-registration.ts +6 -0
- package/template/packages/server-sdk/src/user-directory-port.ts +42 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/audit.ts +25 -0
- package/template/packages/shared/src/module-configuration.ts +5 -0
- package/template/packages/shared/src/notification.ts +92 -1
- package/template/packages/shared/src/password.ts +7 -2
- package/template/packages/shared/src/platform-settings.ts +2 -0
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage/src/upload-service.test.ts +16 -0
- package/template/packages/storage/src/upload-service.ts +5 -1
- package/template/scripts/notification-postgres-regression.ts +27 -0
|
@@ -5,8 +5,11 @@ export type ModuleConfigApplyStatus =
|
|
|
5
5
|
| "applying"
|
|
6
6
|
| "effective"
|
|
7
7
|
| "failed"
|
|
8
|
+
| "pending-restart"
|
|
8
9
|
| "superseded";
|
|
9
10
|
|
|
11
|
+
export type ModuleConfigApplyMode = "live" | "restart";
|
|
12
|
+
|
|
10
13
|
export interface ModuleConfigDiffEntry {
|
|
11
14
|
path: string;
|
|
12
15
|
before?: ModuleConfigValue;
|
|
@@ -18,6 +21,7 @@ export interface ModuleConfigFieldDescriptor {
|
|
|
18
21
|
label: string;
|
|
19
22
|
description: string;
|
|
20
23
|
input: "boolean" | "integer" | "text";
|
|
24
|
+
applyMode?: ModuleConfigApplyMode;
|
|
21
25
|
minimum?: number;
|
|
22
26
|
maximum?: number;
|
|
23
27
|
}
|
|
@@ -42,6 +46,7 @@ export interface ModuleConfigSummary {
|
|
|
42
46
|
label: string;
|
|
43
47
|
fields: ModuleConfigFieldDescriptor[];
|
|
44
48
|
effectiveValues: ModuleConfigValues;
|
|
49
|
+
pendingValues?: ModuleConfigValues;
|
|
45
50
|
effectiveSource: "environment" | "version";
|
|
46
51
|
effectiveVersion?: number;
|
|
47
52
|
latestVersion?: number;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ISODateTime } from "./primitives.js";
|
|
2
2
|
import type { TargetRef } from "./workflow.js";
|
|
3
3
|
|
|
4
|
-
export type NotificationStatus = "published" | "archived";
|
|
4
|
+
export type NotificationStatus = "scheduled" | "published" | "archived";
|
|
5
|
+
export type ExternalNotificationChannel = "email" | "sms";
|
|
6
|
+
export type NotificationDeliveryStatus =
|
|
7
|
+
| "pending"
|
|
8
|
+
| "processing"
|
|
9
|
+
| "retrying"
|
|
10
|
+
| "delivered"
|
|
11
|
+
| "dead";
|
|
5
12
|
|
|
6
13
|
export interface PlatformNotification {
|
|
7
14
|
id: string;
|
|
@@ -11,6 +18,7 @@ export interface PlatformNotification {
|
|
|
11
18
|
category: string;
|
|
12
19
|
status: NotificationStatus;
|
|
13
20
|
publishedAt: ISODateTime;
|
|
21
|
+
scheduledFor?: ISODateTime;
|
|
14
22
|
createdAt: ISODateTime;
|
|
15
23
|
createdBy: string;
|
|
16
24
|
updatedAt: ISODateTime;
|
|
@@ -19,13 +27,29 @@ export interface PlatformNotification {
|
|
|
19
27
|
archivedBy?: string;
|
|
20
28
|
target?: TargetRef;
|
|
21
29
|
recipientUserId?: string;
|
|
30
|
+
recipientUserIds?: string[];
|
|
22
31
|
recipientRoleCodes?: string[];
|
|
32
|
+
recipientDepartmentIds?: string[];
|
|
33
|
+
includeChildDepartments?: boolean;
|
|
34
|
+
deliveryChannels?: ExternalNotificationChannel[];
|
|
23
35
|
sourceKey?: string;
|
|
36
|
+
revision: number;
|
|
24
37
|
}
|
|
25
38
|
|
|
26
39
|
export interface NotificationInboxItem extends PlatformNotification {
|
|
27
40
|
read: boolean;
|
|
28
41
|
readAt?: ISODateTime;
|
|
42
|
+
favorite: boolean;
|
|
43
|
+
favoritedAt?: ISODateTime;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type NotificationReadFilter = "read" | "unread";
|
|
47
|
+
|
|
48
|
+
export interface NotificationInboxFilters {
|
|
49
|
+
q?: string;
|
|
50
|
+
category?: string;
|
|
51
|
+
read?: NotificationReadFilter;
|
|
52
|
+
favorite?: boolean;
|
|
29
53
|
}
|
|
30
54
|
|
|
31
55
|
export interface PublishNotificationInput {
|
|
@@ -35,12 +59,79 @@ export interface PublishNotificationInput {
|
|
|
35
59
|
category: string;
|
|
36
60
|
target?: TargetRef;
|
|
37
61
|
recipientUserId?: string;
|
|
62
|
+
recipientUserIds?: string[];
|
|
38
63
|
recipientRoleCodes?: string[];
|
|
64
|
+
recipientDepartmentIds?: string[];
|
|
65
|
+
includeChildDepartments?: boolean;
|
|
66
|
+
deliveryChannels?: ExternalNotificationChannel[];
|
|
67
|
+
scheduledFor?: ISODateTime;
|
|
39
68
|
sourceKey?: string;
|
|
40
69
|
}
|
|
41
70
|
|
|
71
|
+
export interface NotificationPreference {
|
|
72
|
+
userId: string;
|
|
73
|
+
enabledChannels: ExternalNotificationChannel[];
|
|
74
|
+
disabledCategories: string[];
|
|
75
|
+
updatedAt?: ISODateTime;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type UpdateNotificationPreferenceInput = Pick<
|
|
79
|
+
NotificationPreference,
|
|
80
|
+
"enabledChannels" | "disabledCategories"
|
|
81
|
+
>;
|
|
82
|
+
|
|
83
|
+
export interface NotificationAudienceOption {
|
|
84
|
+
id: string;
|
|
85
|
+
label: string;
|
|
86
|
+
code?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface NotificationAudienceOptions {
|
|
90
|
+
users: NotificationAudienceOption[];
|
|
91
|
+
roles: NotificationAudienceOption[];
|
|
92
|
+
departments: NotificationAudienceOption[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface NotificationDelivery {
|
|
96
|
+
id: string;
|
|
97
|
+
notificationId: string;
|
|
98
|
+
userId: string;
|
|
99
|
+
channel: ExternalNotificationChannel;
|
|
100
|
+
status: NotificationDeliveryStatus;
|
|
101
|
+
attemptCount: number;
|
|
102
|
+
nextAttemptAt: ISODateTime;
|
|
103
|
+
deliveredAt?: ISODateTime;
|
|
104
|
+
lastErrorCode?: string;
|
|
105
|
+
createdAt: ISODateTime;
|
|
106
|
+
updatedAt: ISODateTime;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type UpdateNotificationInput = Pick<
|
|
110
|
+
PublishNotificationInput,
|
|
111
|
+
"title" | "summary" | "content" | "category"
|
|
112
|
+
>;
|
|
113
|
+
|
|
114
|
+
export interface NotificationRevision extends UpdateNotificationInput {
|
|
115
|
+
notificationId: string;
|
|
116
|
+
revision: number;
|
|
117
|
+
editedAt: ISODateTime;
|
|
118
|
+
editedBy: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface UpdateNotificationResult {
|
|
122
|
+
notification: PlatformNotification;
|
|
123
|
+
changed: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
42
126
|
export interface MarkNotificationReadResult {
|
|
43
127
|
success: true;
|
|
44
128
|
alreadyRead: boolean;
|
|
45
129
|
readAt: ISODateTime;
|
|
46
130
|
}
|
|
131
|
+
|
|
132
|
+
export interface SetNotificationFavoriteResult {
|
|
133
|
+
success: true;
|
|
134
|
+
favorite: boolean;
|
|
135
|
+
changed: boolean;
|
|
136
|
+
favoritedAt?: ISODateTime;
|
|
137
|
+
}
|
|
@@ -2,6 +2,8 @@ export interface PlatformBrandingSettings {
|
|
|
2
2
|
softwareName: string;
|
|
3
3
|
logoUrl?: string;
|
|
4
4
|
description?: string;
|
|
5
|
+
/** Runtime display timezone. It is managed by platform.runtime, not branding storage. */
|
|
6
|
+
timeZone?: string;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
export const WATERMARK_DENSITIES = ["low", "medium", "high"] as const;
|
|
@@ -191,6 +191,22 @@ describe("UploadService", () => {
|
|
|
191
191
|
service.appendPart(partInput(session.id, 1, 1, bytes("{}"))),
|
|
192
192
|
).rejects.toMatchObject({ code: "UPLOAD_OFFSET_CONFLICT" });
|
|
193
193
|
});
|
|
194
|
+
|
|
195
|
+
test("运行时更新用途策略只影响后续上传会话", async () => {
|
|
196
|
+
const { service } = fixture();
|
|
197
|
+
const original = policies[0]!;
|
|
198
|
+
service.setPolicy({ ...original, maxByteSize: 1 });
|
|
199
|
+
|
|
200
|
+
await expect(
|
|
201
|
+
service.create({
|
|
202
|
+
ownerId: "user_1",
|
|
203
|
+
purpose: "bulk-data",
|
|
204
|
+
filename: "data.json",
|
|
205
|
+
mimeType: "application/json",
|
|
206
|
+
expectedByteSize: 2,
|
|
207
|
+
}),
|
|
208
|
+
).rejects.toMatchObject({ code: "UPLOAD_TOO_LARGE" });
|
|
209
|
+
});
|
|
194
210
|
});
|
|
195
211
|
|
|
196
212
|
function fixture() {
|
|
@@ -37,7 +37,7 @@ export interface CleanupResult {
|
|
|
37
37
|
export class UploadService {
|
|
38
38
|
private readonly now: () => Date;
|
|
39
39
|
private readonly createId: (prefix: "upload" | "file") => string;
|
|
40
|
-
private readonly policies:
|
|
40
|
+
private readonly policies: Map<string, UploadPolicy>;
|
|
41
41
|
|
|
42
42
|
constructor(private readonly options: UploadServiceOptions) {
|
|
43
43
|
this.now = options.now ?? (() => new Date());
|
|
@@ -47,6 +47,10 @@ export class UploadService {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
setPolicy(policy: UploadPolicy): void {
|
|
51
|
+
this.policies.set(policy.purpose, { ...policy });
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
async create(input: CreateUploadInput): Promise<UploadSession> {
|
|
51
55
|
const policy = this.requirePolicy(input.purpose);
|
|
52
56
|
const filename = validFilename(input.filename);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PostgresRegressionHarness,
|
|
3
|
+
runCommand,
|
|
4
|
+
} from "./lib/postgres-regression.js";
|
|
5
|
+
|
|
6
|
+
const postgres = new PostgresRegressionHarness("windy-notification-test");
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
await postgres.start();
|
|
10
|
+
await runCommand(
|
|
11
|
+
[
|
|
12
|
+
"bun",
|
|
13
|
+
"test",
|
|
14
|
+
"apps/server/src/notification/drizzle-repository.integration.test.ts",
|
|
15
|
+
],
|
|
16
|
+
{
|
|
17
|
+
stdout: "inherit",
|
|
18
|
+
stderr: "inherit",
|
|
19
|
+
env: {
|
|
20
|
+
...process.env,
|
|
21
|
+
NOTIFICATION_TEST_DATABASE_URL: postgres.databaseUrl(),
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
} finally {
|
|
26
|
+
await postgres.close();
|
|
27
|
+
}
|