From 0e6719b32fcaefcbee85c3e443e648f3638a3590 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 21 Aug 2025 17:08:30 +0200 Subject: [PATCH] spreads RecordKeySchema across zod validations --- .../Users/Teams/TeamsForm/Options/ITeamOptionsState.ts | 6 +++--- .../src/ConnectionForm/Options/IConnectionNetworkHanler.ts | 6 +++--- .../OriginInfo/IConnectionFormOriginInfoState.ts | 4 ++-- webapp/packages/plugin-sql-editor/src/ISqlEditorTabState.ts | 6 +++--- .../UserInfoPart/IUserProfileFormInfoState.ts | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/TeamsForm/Options/ITeamOptionsState.ts b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/TeamsForm/Options/ITeamOptionsState.ts index b3decca015..157240549d 100644 --- a/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/TeamsForm/Options/ITeamOptionsState.ts +++ b/webapp/packages/plugin-authentication-administration/src/Administration/Users/Teams/TeamsForm/Options/ITeamOptionsState.ts @@ -1,18 +1,18 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2024 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import { schema } from '@cloudbeaver/core-utils'; +import { RecordKeySchema, schema } from '@cloudbeaver/core-utils'; const TEAM_OPTIONS_STATE = schema.object({ teamId: schema.string(), teamName: schema.string(), teamPermissions: schema.array(schema.string()), description: schema.string(), - metaParameters: schema.record(schema.string(), schema.any()), + metaParameters: schema.record(RecordKeySchema, schema.any()), }); export type ITeamOptionsState = schema.infer; diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/Options/IConnectionNetworkHanler.ts b/webapp/packages/plugin-connections/src/ConnectionForm/Options/IConnectionNetworkHanler.ts index 3747bd9259..43c280a689 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/Options/IConnectionNetworkHanler.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/Options/IConnectionNetworkHanler.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ import { NetworkHandlerAuthType } from '@cloudbeaver/core-sdk'; -import { schema } from '@cloudbeaver/core-utils'; +import { RecordKeySchema, schema } from '@cloudbeaver/core-utils'; export const CONNECTION_NETWORK_HANDLER_SCHEMA = schema.object({ id: schema.string(), @@ -14,9 +14,9 @@ export const CONNECTION_NETWORK_HANDLER_SCHEMA = schema.object({ enabled: schema.boolean().optional(), key: schema.string().optional(), password: schema.string().optional(), - properties: schema.record(schema.string(), schema.any()).optional(), + properties: schema.record(RecordKeySchema, schema.any()).optional(), savePassword: schema.boolean().optional(), - secureProperties: schema.record(schema.string(), schema.any()).optional(), + secureProperties: schema.record(RecordKeySchema, schema.any()).optional(), userName: schema.string().optional(), }); diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/OriginInfo/IConnectionFormOriginInfoState.ts b/webapp/packages/plugin-connections/src/ConnectionForm/OriginInfo/IConnectionFormOriginInfoState.ts index da5bfadc43..c8d95fb27a 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/OriginInfo/IConnectionFormOriginInfoState.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/OriginInfo/IConnectionFormOriginInfoState.ts @@ -5,10 +5,10 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import { schema } from '@cloudbeaver/core-utils'; +import { schema, RecordKeySchema } from '@cloudbeaver/core-utils'; const CONNECTION_FORM_ORIGIN_INFO_SCHEMA = schema.record( - schema.string(), + RecordKeySchema, schema.object({ id: schema.string().optional(), required: schema.boolean(), diff --git a/webapp/packages/plugin-sql-editor/src/ISqlEditorTabState.ts b/webapp/packages/plugin-sql-editor/src/ISqlEditorTabState.ts index 0e0affa24b..2790838091 100644 --- a/webapp/packages/plugin-sql-editor/src/ISqlEditorTabState.ts +++ b/webapp/packages/plugin-sql-editor/src/ISqlEditorTabState.ts @@ -5,7 +5,7 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import { schema } from '@cloudbeaver/core-utils'; +import { RecordKeySchema, schema } from '@cloudbeaver/core-utils'; import { OUTPUT_LOG_TYPES } from './SqlResultTabs/OutputLogs/IOutputLogTypes.js'; @@ -49,7 +49,7 @@ export const EXECUTION_PLAN_TAB_SCHEMA = schema.object({ tabId: schema.string(), order: schema.number(), query: schema.string(), - options: schema.record(schema.string(), schema.any()).optional(), + options: schema.record(RecordKeySchema, schema.any()).optional(), }); export type IExecutionPlanTab = schema.infer; @@ -74,7 +74,7 @@ export const SQL_EDITOR_TAB_STATE_SCHEMA = schema.object({ outputLogsTab: OUTPUT_LOGS_TAB_SCHEMA.optional(), currentModeId: schema.string().optional(), modeState: schema.array(schema.tuple([schema.string(), schema.any()])), - metadata: schema.record(schema.string(), schema.any()).optional(), + metadata: schema.record(RecordKeySchema, schema.any()).optional(), }); export type ISqlEditorTabState = schema.infer; diff --git a/webapp/packages/plugin-user-profile/src/UserProfileForm/UserInfoPart/IUserProfileFormInfoState.ts b/webapp/packages/plugin-user-profile/src/UserProfileForm/UserInfoPart/IUserProfileFormInfoState.ts index 7e9af386ec..da89b49f66 100644 --- a/webapp/packages/plugin-user-profile/src/UserProfileForm/UserInfoPart/IUserProfileFormInfoState.ts +++ b/webapp/packages/plugin-user-profile/src/UserProfileForm/UserInfoPart/IUserProfileFormInfoState.ts @@ -5,14 +5,14 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ -import { schema } from '@cloudbeaver/core-utils'; +import { RecordKeySchema, schema } from '@cloudbeaver/core-utils'; export const USER_PROFILE_FORM_INFO_PART_STATE_SCHEMA = schema .object({ userId: schema.string(), displayName: schema.string().trim(), authRole: schema.string().optional(), - metaParameters: schema.record(schema.string(), schema.union([schema.string().trim(), schema.any()])).optional(), + metaParameters: schema.record(RecordKeySchema, schema.union([schema.string().trim(), schema.any()])).optional(), }) .required();