From de2161000ccdbc56cc2114ca0d6113d7d8e09fcc Mon Sep 17 00:00:00 2001 From: Wroud Date: Fri, 5 Aug 2022 17:16:18 +0300 Subject: [PATCH] feat(plugin-connections): CB-2366 ConfigurationType --- .../core-connections/src/locales/en.ts | 1 + .../core-connections/src/locales/it.ts | 1 + .../core-connections/src/locales/ru.ts | 1 + .../core-connections/src/locales/zh.ts | 1 + .../queries/fragments/DatabaseConnection.gql | 1 + .../src/queries/fragments/DatabaseDriver.gql | 1 + webapp/packages/core-sdk/src/sdk.ts | 68 +++---- .../Options/ConnectionOptionsTabService.ts | 18 +- .../src/ConnectionForm/Options/Options.tsx | 173 ++++++++++++------ .../src/ConnectionForm/Options/useOptions.ts | 10 +- 10 files changed, 178 insertions(+), 97 deletions(-) diff --git a/webapp/packages/core-connections/src/locales/en.ts b/webapp/packages/core-connections/src/locales/en.ts index ee102e855a..a0184a1ddb 100644 --- a/webapp/packages/core-connections/src/locales/en.ts +++ b/webapp/packages/core-connections/src/locales/en.ts @@ -40,6 +40,7 @@ export default [ ['connections_connection_access_admin_info', 'Administrators see all connections.'], ['connections_connection_description', 'Description'], ['connections_connection_driver', 'Driver'], + ['connections_connection_configuration', 'Configuration'], ['connections_connection_host', 'Host'], ['connections_connection_port', 'Port'], ['connections_connection_template', 'Template'], diff --git a/webapp/packages/core-connections/src/locales/it.ts b/webapp/packages/core-connections/src/locales/it.ts index 437374a0f5..e5e162ae56 100644 --- a/webapp/packages/core-connections/src/locales/it.ts +++ b/webapp/packages/core-connections/src/locales/it.ts @@ -42,6 +42,7 @@ export default [ ['connections_connection_access_admin_info', 'Gli amministratori vedono tutte le connessioni.'], ['connections_connection_description', 'Descrizione'], ['connections_connection_driver', 'Driver'], + ['connections_connection_configuration', 'Configuration'], ['connections_connection_host', 'Host'], ['connections_connection_port', 'Porta'], ['connections_connection_template', 'Template'], diff --git a/webapp/packages/core-connections/src/locales/ru.ts b/webapp/packages/core-connections/src/locales/ru.ts index 2b9e2c5d75..56f153f42d 100644 --- a/webapp/packages/core-connections/src/locales/ru.ts +++ b/webapp/packages/core-connections/src/locales/ru.ts @@ -37,6 +37,7 @@ export default [ ['connections_connection_access_admin_info', 'Администраторы видят все подключения.'], ['connections_connection_description', 'Описание'], ['connections_connection_driver', 'Драйвер'], + ['connections_connection_configuration', 'Конфигурация'], ['connections_connection_host', 'Хост'], ['connections_connection_port', 'Порт'], ['connections_connection_template', 'Шаблон'], diff --git a/webapp/packages/core-connections/src/locales/zh.ts b/webapp/packages/core-connections/src/locales/zh.ts index f2f376efa0..1be926f601 100644 --- a/webapp/packages/core-connections/src/locales/zh.ts +++ b/webapp/packages/core-connections/src/locales/zh.ts @@ -40,6 +40,7 @@ export default [ ['connections_connection_access_admin_info', '管理员查看所有连接。'], ['connections_connection_description', '描述'], ['connections_connection_driver', '驱动'], + ['connections_connection_configuration', 'Configuration'], ['connections_connection_host', '主机'], ['connections_connection_port', '端口'], ['connections_connection_template', '模板'], diff --git a/webapp/packages/core-sdk/src/queries/fragments/DatabaseConnection.gql b/webapp/packages/core-sdk/src/queries/fragments/DatabaseConnection.gql index 186a63eeef..c50afc1a1c 100644 --- a/webapp/packages/core-sdk/src/queries/fragments/DatabaseConnection.gql +++ b/webapp/packages/core-sdk/src/queries/fragments/DatabaseConnection.gql @@ -25,6 +25,7 @@ fragment DatabaseConnection on ConnectionInfo { features supportedDataFormats + configurationType origin @include(if: $includeOrigin) { ...ObjectOriginInfo diff --git a/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql b/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql index ed30241450..505b9508fc 100644 --- a/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql +++ b/webapp/packages/core-sdk/src/queries/fragments/DatabaseDriver.gql @@ -17,6 +17,7 @@ fragment DatabaseDriver on DriverInfo { defaultAuthModel applicableAuthModels applicableNetworkHandlers + configurationTypes providerProperties @include(if: $includeProviderProperties) { id diff --git a/webapp/packages/core-sdk/src/sdk.ts b/webapp/packages/core-sdk/src/sdk.ts index 6c16e626ab..24a7fabbb9 100644 --- a/webapp/packages/core-sdk/src/sdk.ts +++ b/webapp/packages/core-sdk/src/sdk.ts @@ -153,6 +153,7 @@ export enum AuthStatus { export interface ConnectionConfig { authModelId?: InputMaybe; + configurationType?: InputMaybe; connectionId?: InputMaybe; credentials?: InputMaybe; dataSourceId?: InputMaybe; @@ -190,6 +191,7 @@ export interface ConnectionInfo { canEdit: Scalars['Boolean']; canViewSettings: Scalars['Boolean']; clientVersion?: Maybe; + configurationType?: Maybe; connectTime?: Maybe; connected: Scalars['Boolean']; connectionError?: Maybe; @@ -294,12 +296,16 @@ export interface DatabaseStructContainers { supportsSchemaChange: Scalars['Boolean']; } +export enum DriverConfigurationType { + Extended = 'EXTENDED', + Url = 'URL' +} + export interface DriverInfo { - /** @deprecated Field no longer supported */ - allowsEmptyPassword?: Maybe; anonymousAccess?: Maybe; applicableAuthModels: Array; applicableNetworkHandlers: Array>; + configurationTypes: Array>; custom?: Maybe; defaultAuthModel: Scalars['ID']; defaultDatabase?: Maybe; @@ -343,8 +349,6 @@ export interface Mutation { asyncSqlExplainExecutionPlanResult: SqlExecutionPlan; asyncTaskCancel?: Maybe; asyncTaskInfo: AsyncTaskInfo; - /** @deprecated Field no longer supported */ - asyncTaskStatus: AsyncTaskInfo; changeSessionLanguage?: Maybe; closeConnection: ConnectionInfo; closeSession?: Maybe; @@ -358,8 +362,6 @@ export interface Mutation { navDeleteNodes?: Maybe; navMoveNodesToFolder?: Maybe; navRenameNode?: Maybe; - /** @deprecated Field no longer supported */ - openConnection: ConnectionInfo; openSession: SessionInfo; readLobValue: Scalars['String']; refreshSessionConnections?: Maybe; @@ -436,11 +438,6 @@ export interface MutationAsyncTaskInfoArgs { } -export interface MutationAsyncTaskStatusArgs { - id: Scalars['String']; -} - - export interface MutationChangeSessionLanguageArgs { locale?: InputMaybe; } @@ -517,11 +514,6 @@ export interface MutationNavRenameNodeArgs { } -export interface MutationOpenConnectionArgs { - config: ConnectionConfig; -} - - export interface MutationOpenSessionArgs { defaultLocale?: InputMaybe; } @@ -831,8 +823,6 @@ export interface Query { configureServer: Scalars['Boolean']; connectionFolders: Array; connectionInfo: ConnectionInfo; - /** @deprecated Field no longer supported */ - connectionState: ConnectionInfo; copyConnectionConfiguration: ConnectionInfo; createConnectionConfiguration: ConnectionInfo; createRole: AdminRoleInfo; @@ -947,12 +937,6 @@ export interface QueryConnectionInfoArgs { } -export interface QueryConnectionStateArgs { - id: Scalars['ID']; - projectId?: InputMaybe; -} - - export interface QueryCopyConnectionConfigurationArgs { config?: InputMaybe; nodePath: Scalars['String']; @@ -1444,8 +1428,6 @@ export interface SqlScriptQuery { export interface ServerConfig { adminCredentialsSaveEnabled?: Maybe; anonymousAccessEnabled?: Maybe; - /** @deprecated Field no longer supported */ - authenticationEnabled?: Maybe; configurationMode?: Maybe; defaultNavigatorSettings: NavigatorSettings; developmentMode?: Maybe; @@ -1823,7 +1805,7 @@ export type CreateConnectionConfigurationQueryVariables = Exact<{ }>; -export type CreateConnectionConfigurationQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CreateConnectionConfigurationQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type CreateConnectionConfigurationFromNodeQueryVariables = Exact<{ nodePath: Scalars['String']; @@ -1835,7 +1817,7 @@ export type CreateConnectionConfigurationFromNodeQueryVariables = Exact<{ }>; -export type CreateConnectionConfigurationFromNodeQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CreateConnectionConfigurationFromNodeQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type DeleteConnectionConfigurationQueryVariables = Exact<{ id: Scalars['ID']; @@ -1861,7 +1843,7 @@ export type GetConnectionsQueryVariables = Exact<{ }>; -export type GetConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; +export type GetConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; export type GetSubjectConnectionAccessQueryVariables = Exact<{ subjectId?: InputMaybe; @@ -1904,7 +1886,7 @@ export type UpdateConnectionConfigurationQueryVariables = Exact<{ }>; -export type UpdateConnectionConfigurationQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type UpdateConnectionConfigurationQuery = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type CloseConnectionMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -1916,7 +1898,7 @@ export type CloseConnectionMutationVariables = Exact<{ }>; -export type CloseConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CloseConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type CreateConnectionMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -1928,7 +1910,7 @@ export type CreateConnectionMutationVariables = Exact<{ }>; -export type CreateConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CreateConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type CreateConnectionFolderMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -1950,7 +1932,7 @@ export type CreateConnectionFromNodeMutationVariables = Exact<{ }>; -export type CreateConnectionFromNodeMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CreateConnectionFromNodeMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type CreateConnectionFromTemplateMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -1963,7 +1945,7 @@ export type CreateConnectionFromTemplateMutationVariables = Exact<{ }>; -export type CreateConnectionFromTemplateMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type CreateConnectionFromTemplateMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type DeleteConnectionMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -1989,7 +1971,7 @@ export type DriverListQueryVariables = Exact<{ }>; -export type DriverListQuery = { drivers: Array<{ id: string; name?: string; icon?: string; description?: string; defaultPort?: string; defaultDatabase?: string; defaultServer?: string; defaultUser?: string; sampleURL?: string; embedded?: boolean; enabled: boolean; requiresServerName?: boolean; anonymousAccess?: boolean; promotedScore?: number; defaultAuthModel: string; applicableAuthModels: Array; applicableNetworkHandlers: Array; driverParameters?: any; providerProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; length: ObjectPropertyLength; features: Array; order: number }>; driverProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array }> }> }; +export type DriverListQuery = { drivers: Array<{ id: string; name?: string; icon?: string; description?: string; defaultPort?: string; defaultDatabase?: string; defaultServer?: string; defaultUser?: string; sampleURL?: string; embedded?: boolean; enabled: boolean; requiresServerName?: boolean; anonymousAccess?: boolean; promotedScore?: number; defaultAuthModel: string; applicableAuthModels: Array; applicableNetworkHandlers: Array; configurationTypes: Array; driverParameters?: any; providerProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; length: ObjectPropertyLength; features: Array; order: number }>; driverProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array }> }> }; export type ExecutionContextCreateMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -2052,7 +2034,7 @@ export type GetTemplateConnectionsQueryVariables = Exact<{ }>; -export type GetTemplateConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; +export type GetTemplateConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; export type GetUserConnectionsQueryVariables = Exact<{ projectId?: InputMaybe; @@ -2064,7 +2046,7 @@ export type GetUserConnectionsQueryVariables = Exact<{ }>; -export type GetUserConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; +export type GetUserConnectionsQuery = { connections: Array<{ id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }> }; export type InitConnectionMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -2079,7 +2061,7 @@ export type InitConnectionMutationVariables = Exact<{ }>; -export type InitConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type InitConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type RefreshSessionConnectionsMutationVariables = Exact<{ [key: string]: never }>; @@ -2097,7 +2079,7 @@ export type SetConnectionNavigatorSettingsMutationVariables = Exact<{ }>; -export type SetConnectionNavigatorSettingsMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type SetConnectionNavigatorSettingsMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type TestConnectionMutationVariables = Exact<{ projectId: Scalars['ID']; @@ -2124,7 +2106,7 @@ export type UpdateConnectionMutationVariables = Exact<{ }>; -export type UpdateConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; +export type UpdateConnectionMutation = { connection: { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } } }; export type ExportDataFromContainerQueryVariables = Exact<{ projectId: Scalars['ID']; @@ -2185,9 +2167,9 @@ export type AuthTokenFragment = { authProvider: string; authConfiguration?: stri export type ConnectionFolderInfoFragment = { id: string; projectId: string; description?: string }; -export type DatabaseConnectionFragment = { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }; +export type DatabaseConnectionFragment = { id: string; projectId: string; name: string; description?: string; driverId: string; template: boolean; connected: boolean; provided: boolean; useUrl: boolean; readOnly: boolean; saveCredentials: boolean; folder?: string; nodePath?: string; host?: string; port?: string; serverName?: string; databaseName?: string; url?: string; properties?: any; providerProperties: any; features: Array; supportedDataFormats: Array; configurationType?: DriverConfigurationType; authNeeded: boolean; authModel?: string; canViewSettings: boolean; canEdit: boolean; canDelete: boolean; origin?: { type: string; subType?: string; displayName: string; icon?: string; details?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; value?: any; length: ObjectPropertyLength; features: Array; order: number }> }; authProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; value?: any; validValues?: Array; defaultValue?: any; length: ObjectPropertyLength; features: Array; order: number }>; networkHandlersConfig: Array<{ id: string; enabled: boolean; authType: NetworkHandlerAuthType; userName?: string; password?: string; key?: string; savePassword: boolean; properties?: any }>; navigatorSettings: { showSystemObjects: boolean; showUtilityObjects: boolean; showOnlyEntities: boolean; mergeEntities: boolean; hideFolders: boolean; hideSchemas: boolean; hideVirtualModel: boolean } }; -export type DatabaseDriverFragment = { id: string; name?: string; icon?: string; description?: string; defaultPort?: string; defaultDatabase?: string; defaultServer?: string; defaultUser?: string; sampleURL?: string; embedded?: boolean; enabled: boolean; requiresServerName?: boolean; anonymousAccess?: boolean; promotedScore?: number; defaultAuthModel: string; applicableAuthModels: Array; applicableNetworkHandlers: Array; driverParameters?: any; providerProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; length: ObjectPropertyLength; features: Array; order: number }>; driverProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array }> }; +export type DatabaseDriverFragment = { id: string; name?: string; icon?: string; description?: string; defaultPort?: string; defaultDatabase?: string; defaultServer?: string; defaultUser?: string; sampleURL?: string; embedded?: boolean; enabled: boolean; requiresServerName?: boolean; anonymousAccess?: boolean; promotedScore?: number; defaultAuthModel: string; applicableAuthModels: Array; applicableNetworkHandlers: Array; configurationTypes: Array; driverParameters?: any; providerProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array; length: ObjectPropertyLength; features: Array; order: number }>; driverProperties?: Array<{ id?: string; displayName?: string; description?: string; category?: string; dataType?: string; defaultValue?: any; validValues?: Array }> }; export type ExecutionContextInfoFragment = { id: string; projectId: string; connectionId: string; defaultCatalog?: string; defaultSchema?: string }; @@ -2728,6 +2710,7 @@ export const DatabaseConnectionFragmentDoc = ` providerProperties features supportedDataFormats + configurationType origin @include(if: $includeOrigin) { ...ObjectOriginInfo } @@ -2775,6 +2758,7 @@ export const DatabaseDriverFragmentDoc = ` defaultAuthModel applicableAuthModels applicableNetworkHandlers + configurationTypes providerProperties @include(if: $includeProviderProperties) { id displayName diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/Options/ConnectionOptionsTabService.ts b/webapp/packages/plugin-connections/src/ConnectionForm/Options/ConnectionOptionsTabService.ts index 60b38c7056..7ca6fc86d2 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/Options/ConnectionOptionsTabService.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/Options/ConnectionOptionsTabService.ts @@ -8,10 +8,10 @@ import { action, makeObservable, runInAction, toJS } from 'mobx'; -import { CONNECTION_FOLDER_NAME_VALIDATION, createConnectionParam, DatabaseAuthModelsResource, DatabaseConnection, DBDriverResource, isJDBCConnection } from '@cloudbeaver/core-connections'; +import { createConnectionParam, DatabaseAuthModelsResource, DatabaseConnection, DBDriverResource, isJDBCConnection } from '@cloudbeaver/core-connections'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import type { IExecutionContextProvider } from '@cloudbeaver/core-executor'; -import { CachedMapAllKey, isObjectPropertyInfoStateEqual, ObjectPropertyInfo } from '@cloudbeaver/core-sdk'; +import { CachedMapAllKey, DriverConfigurationType, isObjectPropertyInfoStateEqual, ObjectPropertyInfo } from '@cloudbeaver/core-sdk'; import { getUniqueName, isValuesEqual } from '@cloudbeaver/core-utils'; import { connectionFormConfigureContext } from '../connectionFormConfigureContext'; @@ -123,6 +123,14 @@ export class ConnectionOptionsTabService extends Bootstrap { validation.error("Field 'name' can't be empty"); } + if (state.config.driverId && state.config.configurationType) { + const driver = await this.dbDriverResource.load(state.config.driverId, ['includeProviderProperties']); + + if (!driver.configurationTypes.includes(state.config.configurationType)) { + validation.error('Configuration is not supported'); + } + } + // if (state.config.folder && !state.config.folder.match(CONNECTION_FOLDER_NAME_VALIDATION)) { // validation.error('connections_connection_folder_validation'); // } @@ -150,6 +158,7 @@ export class ConnectionOptionsTabService extends Bootstrap { } state.config.connectionId = state.info.id; + state.config.configurationType = state.info.configurationType; state.config.name = state.info.name; state.config.description = state.info.description; @@ -206,6 +215,8 @@ export class ConnectionOptionsTabService extends Bootstrap { tempConfig.connectionId = state.config.connectionId; } + tempConfig.configurationType = state.config.configurationType; + tempConfig.name = state.config.name?.trim(); if (tempConfig.name && state.mode === 'create') { @@ -222,7 +233,7 @@ export class ConnectionOptionsTabService extends Bootstrap { tempConfig.folder = state.config.folder; } - if (isJDBCConnection(driver, state.info)) { + if (tempConfig.configurationType === DriverConfigurationType.Url) { tempConfig.url = state.config.url; } else { if (!driver.embedded) { @@ -286,6 +297,7 @@ export class ConnectionOptionsTabService extends Bootstrap { if ( !isValuesEqual(config.name, data.info.name, '') + || !isValuesEqual(config.configurationType, data.info.configurationType, DriverConfigurationType.Extended) || !isValuesEqual(config.description, data.info.description, '') || !isValuesEqual(config.template, data.info.template, true) || !isValuesEqual(config.folder, data.info.folder, undefined) diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/Options/Options.tsx b/webapp/packages/plugin-connections/src/ConnectionForm/Options/Options.tsx index 544f3d3c1c..aad23b0860 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/Options/Options.tsx +++ b/webapp/packages/plugin-connections/src/ConnectionForm/Options/Options.tsx @@ -26,14 +26,16 @@ import { Combobox, Container, useFormValidator, - Loader, getComputed, + Radio, + RadioGroup, + FormFieldDescription, } from '@cloudbeaver/core-blocks'; -import { DatabaseAuthModelsResource, DBDriverResource, isJDBCConnection, isLocalConnection } from '@cloudbeaver/core-connections'; +import { DatabaseAuthModelsResource, DBDriverResource, isLocalConnection } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; import { useTranslate } from '@cloudbeaver/core-localization'; import { usePermission } from '@cloudbeaver/core-root'; -import { CachedMapEmptyKey, resourceKeyList } from '@cloudbeaver/core-sdk'; +import { CachedMapEmptyKey, DriverConfigurationType, resourceKeyList } from '@cloudbeaver/core-sdk'; import { useStyles } from '@cloudbeaver/core-theming'; import type { TabContainerPanelComponent } from '@cloudbeaver/core-ui'; import { useAuthenticationAction } from '@cloudbeaver/core-ui'; @@ -50,6 +52,24 @@ const styles = css` } `; +interface IDriverConfiguration { + name: string; + value: DriverConfigurationType; + description?: string; + icon?: string; +} + +const driverConfiguration: IDriverConfiguration[] = [ + { + name: 'Manual', + value: DriverConfigurationType.Extended, + }, + { + name: 'URL', + value: DriverConfigurationType.Url, + }, +]; + export const Options: TabContainerPanelComponent = observer(function Options({ state, }) { @@ -109,6 +129,8 @@ export const Options: TabContainerPanelComponent = observe ); const driver = driverMap.data; + const configurationTypes = driverConfiguration + .filter(conf => driver?.configurationTypes.includes(conf.value)); function handleFormChange(value?: unknown, name?: string) { if (name !== 'name') { @@ -135,12 +157,12 @@ export const Options: TabContainerPanelComponent = observe } ); - const JDBC = isJDBCConnection(driver, info); - const admin = state.type === 'admin'; + const isURLConfiguration = config.configurationType === DriverConfigurationType.Url; const edit = state.mode === 'edit'; const originLocal = !info || isLocalConnection(info); - const availableAuthModels = applicableAuthModels.filter(model => !!model && (adminPermission + const availableAuthModels = applicableAuthModels.filter(model => !!model && ( + adminPermission || !model.requiresLocalConfiguration )); const drivers = driverMap.resource.values @@ -178,12 +200,83 @@ export const Options: TabContainerPanelComponent = observe searchable={drivers.length > 10} readOnly={readonly || edit || drivers.length < 2} disabled={disabled} + loading={driverMap.isLoading()} tiny fill onSelect={handleDriverSelect} > {translate('connections_connection_driver')} + {configurationTypes.length > 1 && ( + <> + {/* conf.value} + valueSelector={conf => conf.name} + titleSelector={conf => conf.description} + readOnly={readonly || configurationTypes.length < 2} + disabled={disabled} + tiny + fill + > + {translate('connections_connection_configuration')} + */} + + + + {driverConfiguration.map(conf => ( + + {conf.name} + + ))} + + + + + )} + + {isURLConfiguration ? ( + + {translate('customConnection_url_JDBC')} + + ) : ( + + )} + + + = observe > {translate('connections_connection_name')} - - - {JDBC ? ( - - {translate('customConnection_url_JDBC')} - - ) : ( - - )} - {admin && originLocal && ( - - {translate('connections_connection_template')} - - )} - {admin && !config.template && ( + {!config.template && ( {translate('customConnection_folder')} )} - - + {translate('connections_connection_template')} + + )} + diff --git a/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts b/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts index d8f4077bb0..1086b0640f 100644 --- a/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts +++ b/webapp/packages/plugin-connections/src/ConnectionForm/Options/useOptions.ts @@ -10,7 +10,7 @@ import { runInAction } from 'mobx'; import { useObjectRef } from '@cloudbeaver/core-blocks'; import { DBDriver, isJDBCConnection } from '@cloudbeaver/core-connections'; -import type { DatabaseAuthModel } from '@cloudbeaver/core-sdk'; +import { DatabaseAuthModel, DriverConfigurationType } from '@cloudbeaver/core-sdk'; import type { IConnectionFormState } from '../IConnectionFormProps'; @@ -76,6 +76,14 @@ export function useOptions(state: IConnectionFormState) { return; } + if (!config.configurationType || !driver?.configurationTypes.includes(config.configurationType)) { + config.configurationType = ( + driver?.configurationTypes.includes(DriverConfigurationType.Extended) + ? DriverConfigurationType.Extended + : DriverConfigurationType.Url + ); + } + if ((!prevDriver && config.host === undefined) || config.host === prevDriver?.defaultServer) { config.host = driver?.defaultServer || 'localhost'; }