mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
ci: Setup biome and pre-commit hooks for formatting (no-changelog) (#10795)
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
57836cc17a
commit
6a35812f92
@@ -12,6 +12,7 @@ import { UserRepository } from '@/databases/repositories/user.repository';
|
||||
import { Patch, Post, RestController } from '@/decorators';
|
||||
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
|
||||
import type { BooleanLicenseFeature, NumericLicenseFeature } from '@/interfaces';
|
||||
import type { FeatureReturnType } from '@/license';
|
||||
import { License } from '@/license';
|
||||
import { Logger } from '@/logger';
|
||||
import { MfaService } from '@/mfa/mfa.service';
|
||||
@@ -115,10 +116,18 @@ export class E2EController {
|
||||
) {
|
||||
license.isFeatureEnabled = (feature: BooleanLicenseFeature) =>
|
||||
this.enabledFeatures[feature] ?? false;
|
||||
// @ts-expect-error Overriding method
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
license.getFeatureValue<NumericLicenseFeature> = (feature: NumericLicenseFeature) =>
|
||||
this.numericFeatures[feature] ?? UNLIMITED_LICENSE_QUOTA;
|
||||
|
||||
// Ugly hack to satisfy biome parser
|
||||
const getFeatureValue = <T extends keyof FeatureReturnType>(
|
||||
feature: T,
|
||||
): FeatureReturnType[T] => {
|
||||
if (feature in this.numericFeatures) {
|
||||
return this.numericFeatures[feature as NumericLicenseFeature] as FeatureReturnType[T];
|
||||
} else {
|
||||
return UNLIMITED_LICENSE_QUOTA as FeatureReturnType[T];
|
||||
}
|
||||
};
|
||||
license.getFeatureValue = getFeatureValue;
|
||||
|
||||
license.getPlanName = () => 'Enterprise';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user