import type { BooleanLicenseFeature } from '@n8n/constants'; import type { AuthenticatedRequest } from '@n8n/db'; import type { ApiKeyScope, Scope } from '@n8n/permissions'; import type express from 'express'; import type { NextFunction, Request, Response } from 'express'; export type ProjectScopeResource = 'workflow' | 'credential' | 'dataTable'; export declare const globalScope: (scopes: Scope | Scope[]) => (req: AuthenticatedRequest<{ id?: string; dataTableId?: string; }>, res: express.Response, next: express.NextFunction) => Promise; export declare const projectScope: (scopes: Scope | Scope[], resource: ProjectScopeResource) => (req: AuthenticatedRequest<{ id?: string; dataTableId?: string; }>, res: express.Response, next: express.NextFunction) => Promise; export declare const validCursor: (req: Request, res: express.Response, next: express.NextFunction) => express.Response | void; export type ScopeTaggedMiddleware = Middleware & { __apiKeyScope: ApiKeyScope; }; export type Middleware = (req: Request, res: Response, next: NextFunction) => unknown; export declare const publicApiScope: (apiKeyScope: ApiKeyScope) => ScopeTaggedMiddleware; export declare const apiKeyHasScopeWithGlobalScopeFallback: (config: { scope: ApiKeyScope & Scope; } | { apiKeyScope: ApiKeyScope; globalScope: Scope; }) => ScopeTaggedMiddleware; export declare const validLicenseWithUserQuota: (_: express.Request, res: express.Response, next: express.NextFunction) => express.Response | void; export declare const isLicensed: (feature: BooleanLicenseFeature) => (_: AuthenticatedRequest, res: express.Response, next: express.NextFunction) => Promise>>;