diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 092a06d133a97..ddbfce8abfa84 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -542,6 +542,7 @@ export interface IN8nUISettings { logStreaming: boolean; advancedExecutionFilters: boolean; variables: boolean; + versionControl: boolean; }; hideUsagePage: boolean; license: { diff --git a/packages/cli/src/License.ts b/packages/cli/src/License.ts index e57625720c94a..18673887ac302 100644 --- a/packages/cli/src/License.ts +++ b/packages/cli/src/License.ts @@ -128,6 +128,10 @@ export class License { return this.isFeatureEnabled(LICENSE_FEATURES.VARIABLES); } + isVersionControlEnabled() { + return this.isFeatureEnabled(LICENSE_FEATURES.VERSION_CONTROL); + } + getCurrentEntitlements() { return this.manager?.getCurrentEntitlements() ?? []; } diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 29439a72a33d4..217ba6b9c076d 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -160,6 +160,7 @@ import { variablesController } from './environments/variables.controller'; import { LdapManager } from './Ldap/LdapManager.ee'; import { getVariablesLimit, isVariablesEnabled } from '@/environments/enviromentHelpers'; import { getCurrentAuthenticationMethod } from './sso/ssoHelpers'; +import { isVersionControlEnabled } from './environment/versionControl/versionControlHelper'; const exec = promisify(callbackExec); @@ -320,6 +321,7 @@ class Server extends AbstractServer { logStreaming: false, advancedExecutionFilters: false, variables: false, + versionControl: false, }, hideUsagePage: config.getEnv('hideUsagePage'), license: { @@ -354,6 +356,7 @@ class Server extends AbstractServer { saml: isSamlLicensed(), advancedExecutionFilters: isAdvancedExecutionFiltersEnabled(), variables: isVariablesEnabled(), + versionControl: isVersionControlEnabled(), }); if (isLdapEnabled()) { diff --git a/packages/cli/src/api/e2e.api.ts b/packages/cli/src/api/e2e.api.ts index 0de1f207bafbf..73adae880dbf9 100644 --- a/packages/cli/src/api/e2e.api.ts +++ b/packages/cli/src/api/e2e.api.ts @@ -29,6 +29,7 @@ const enabledFeatures = { [LICENSE_FEATURES.SAML]: false, [LICENSE_FEATURES.LOG_STREAMING]: false, [LICENSE_FEATURES.ADVANCED_EXECUTION_FILTERS]: false, + [LICENSE_FEATURES.VERSION_CONTROL]: false, }; type Feature = keyof typeof enabledFeatures; diff --git a/packages/cli/src/constants.ts b/packages/cli/src/constants.ts index 938739069aa2a..913f37381fea2 100644 --- a/packages/cli/src/constants.ts +++ b/packages/cli/src/constants.ts @@ -75,6 +75,7 @@ export enum LICENSE_FEATURES { LOG_STREAMING = 'feat:logStreaming', ADVANCED_EXECUTION_FILTERS = 'feat:advancedExecutionFilters', VARIABLES = 'feat:variables', + VERSION_CONTROL = 'feat:versionControl', } export enum LICENSE_QUOTAS { diff --git a/packages/cli/src/environment/versionControl/versionControlHelper.ts b/packages/cli/src/environment/versionControl/versionControlHelper.ts new file mode 100644 index 0000000000000..295e24526afdd --- /dev/null +++ b/packages/cli/src/environment/versionControl/versionControlHelper.ts @@ -0,0 +1,7 @@ +import Container from 'typedi'; +import { License } from '../../License'; + +export function isVersionControlEnabled() { + const license = Container.get(License); + return license.isVersionControlEnabled(); +} diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index b74bc5bbf87b2..d9a8d156f7727 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -461,6 +461,7 @@ export enum EnterpriseEditionFeature { LogStreaming = 'logStreaming', Variables = 'variables', Saml = 'saml', + VersionControl = 'versionControl', } export const MAIN_NODE_PANEL_WIDTH = 360;