mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-09-26 19:51:42 +02:00
16 lines
536 B
TypeScript
16 lines
536 B
TypeScript
import type { BooleanLicenseFeature } from '@n8n/constants';
|
|
import { Container } from '@n8n/di';
|
|
|
|
import { ControllerRegistryMetadata } from './controller-registry-metadata';
|
|
import type { Controller } from './types';
|
|
|
|
export const Licensed =
|
|
(licenseFeature: BooleanLicenseFeature): MethodDecorator =>
|
|
(target, handlerName) => {
|
|
const routeMetadata = Container.get(ControllerRegistryMetadata).getRouteMetadata(
|
|
target.constructor as Controller,
|
|
String(handlerName),
|
|
);
|
|
routeMetadata.licenseFeature = licenseFeature;
|
|
};
|