mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
spreads RecordKeySchema across zod validations
This commit is contained in:
+3
-3
@@ -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<typeof TEAM_OPTIONS_STATE>;
|
||||
|
||||
+3
-3
@@ -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(),
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -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(),
|
||||
|
||||
@@ -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<typeof EXECUTION_PLAN_TAB_SCHEMA>;
|
||||
@@ -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<typeof SQL_EDITOR_TAB_STATE_SCHEMA>;
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user