41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
diff --git a/packages/@n8n/backend-common/src/license-state.ts b/packages/@n8n/backend-common/src/license-state.ts
|
|
index b2ad56f84..4db90066e 100644
|
|
--- a/packages/@n8n/backend-common/src/license-state.ts
|
|
+++ b/packages/@n8n/backend-common/src/license-state.ts
|
|
@@ -4,6 +4,8 @@ import { UnexpectedError } from 'n8n-workflow';
|
|
|
|
import type { FeatureReturnType, LicenseProvider } from './types';
|
|
|
|
+import { LICENSE_FEATURES, LICENSE_QUOTAS } from '@n8n/constants';
|
|
+
|
|
class ProviderNotSetError extends UnexpectedError {
|
|
constructor() {
|
|
super('Cannot query license state because license provider has not been set');
|
|
@@ -27,15 +29,20 @@ export class LicenseState {
|
|
// --------------------
|
|
|
|
isLicensed(feature: BooleanLicenseFeature) {
|
|
- this.assertProvider();
|
|
-
|
|
- return this.licenseProvider.isLicensed(feature);
|
|
+ if(feature == "feat:showNonProdBanner") { return false; }
|
|
+ if(feature == "feat:apiDisabled") { return false; }
|
|
+ return true;
|
|
}
|
|
|
|
getValue<T extends keyof FeatureReturnType>(feature: T): FeatureReturnType[T] {
|
|
- this.assertProvider();
|
|
-
|
|
- return this.licenseProvider.getValue(feature);
|
|
+ if(feature == "planName") { return "PatchedLicenseCheck" as FeatureReturnType[T]; }
|
|
+ if(feature in LICENSE_FEATURES || feature.startsWith("feat:")) {
|
|
+ return this.isLicensed(feature as BooleanLicenseFeature) as FeatureReturnType[T];
|
|
+ }
|
|
+ if(feature in LICENSE_QUOTAS || feature.startsWith("quota:")) {
|
|
+ return UNLIMITED_LICENSE_QUOTA as FeatureReturnType[T];
|
|
+ }
|
|
+ return undefined;
|
|
}
|
|
|
|
// --------------------
|