refactor(editor): Consolidate IN8nUISettings interface (#6055)

* consolidate IN8nUISettings

* cleanup
This commit is contained in:
Michael Auerswald
2023-04-21 13:30:57 +02:00
committed by GitHub
parent 0e93fe064e
commit ac245fdb8d
11 changed files with 151 additions and 214 deletions

View File

@@ -17,7 +17,6 @@ import {
IRun,
IRunData,
ITaskData,
ITelemetrySettings,
IWorkflowSettings as IWorkflowSettingsWorkflow,
WorkflowExecuteMode,
PublicInstalledPackage,
@@ -33,6 +32,9 @@ import {
FeatureFlags,
ExecutionStatus,
ITelemetryTrackProperties,
IN8nUISettings,
IUserManagementSettings,
WorkflowSettings,
} from 'n8n-workflow';
import { SignInType } from './constants';
import { FAKE_DOOR_FEATURES, TRIGGER_NODE_FILTER, REGULAR_NODE_FILTER } from './constants';
@@ -641,13 +643,6 @@ export const enum UserManagementAuthenticationMethod {
Saml = 'saml',
}
export interface IUserManagementConfig {
enabled: boolean;
showSetupOnFirstLoad?: boolean;
smtpSetup: boolean;
authenticationMethod: UserManagementAuthenticationMethod;
}
export interface IPermissionGroup {
loginStatus?: ILogInStatus[];
role?: IRole[];
@@ -732,94 +727,14 @@ export interface ITemplatesCategory {
export type WorkflowCallerPolicyDefaultOption = 'any' | 'none' | 'workflowsFromAList';
export interface IN8nUISettings {
endpointWebhook: string;
endpointWebhookTest: string;
saveDataErrorExecution: string;
saveDataSuccessExecution: string;
saveManualExecutions: boolean;
workflowCallerPolicyDefaultOption: WorkflowCallerPolicyDefaultOption;
timezone: string;
executionTimeout: number;
maxExecutionTimeout: number;
oauthCallbackUrls: {
oauth1: string;
oauth2: string;
};
urlBaseEditor: string;
urlBaseWebhook: string;
versionCli: string;
n8nMetadata?: {
[key: string]: string | number | undefined;
};
versionNotifications: IVersionNotificationSettings;
instanceId: string;
personalizationSurveyEnabled: boolean;
userActivationSurveyEnabled: boolean;
telemetry: ITelemetrySettings;
userManagement: IUserManagementConfig;
defaultLocale: string;
workflowTagsDisabled: boolean;
logLevel: ILogLevel;
hiringBannerEnabled: boolean;
templates: {
enabled: boolean;
host: string;
};
posthog: {
enabled: boolean;
apiHost: string;
apiKey: string;
autocapture: boolean;
disableSessionRecording: boolean;
debug: boolean;
};
executionMode: string;
pushBackend: 'sse' | 'websocket';
communityNodesEnabled: boolean;
isNpmAvailable: boolean;
publicApi: {
enabled: boolean;
latestVersion: number;
path: string;
swaggerUi: {
enabled: boolean;
};
};
sso: {
saml: {
loginLabel: string;
loginEnabled: boolean;
};
ldap: {
loginLabel: string;
loginEnabled: boolean;
};
};
onboardingCallPromptEnabled: boolean;
allowedModules: {
builtIn?: string[];
external?: string[];
};
enterprise: Record<string, boolean>;
deployment?: {
type: string | 'default' | 'n8n-internal' | 'cloud' | 'desktop_mac' | 'desktop_win';
};
hideUsagePage: boolean;
license: {
environment: 'development' | 'production';
};
}
export interface IWorkflowSettings extends IWorkflowSettingsWorkflow {
errorWorkflow?: string;
saveDataErrorExecution?: string;
saveDataSuccessExecution?: string;
saveManualExecutions?: boolean;
timezone?: string;
executionTimeout?: number;
maxExecutionTimeout?: number;
callerIds?: string;
callerPolicy?: WorkflowCallerPolicyDefaultOption;
callerPolicy?: WorkflowSettings.CallerPolicy;
}
export interface ITimeoutHMS {
@@ -1177,9 +1092,6 @@ export interface UIState {
addFirstStepOnLoad: boolean;
executionSidebarAutoRefresh: boolean;
}
export type ILogLevel = 'info' | 'debug' | 'warn' | 'error' | 'verbose';
export type IFakeDoor = {
id: FAKE_DOOR_FEATURES;
featureName: string;
@@ -1221,7 +1133,7 @@ export interface INodeCreatorState {
export interface ISettingsState {
settings: IN8nUISettings;
promptsData: IN8nPrompts;
userManagement: IUserManagementConfig;
userManagement: IUserManagementSettings;
templatesEndpointHealthy: boolean;
api: {
enabled: boolean;