@nestjs/microservices
Version:
Microservices for NestJS: message and event handlers over Kafka, RabbitMQ, NATS, Redis, MQTT, gRPC or TCP.
25 lines (24 loc) • 1.1 kB
TypeScript
import { MsPattern } from '../interfaces/index.js';
/**
* Checks whether the route of a client pattern would only say which of its
* limits it exceeds, without building the route. It stops at the first
* violation and never lists the items of a long array, so its cost does not
* depend on the size of the pattern.
*
* @param pattern - client pattern
* @returns boolean
*/
export declare function exceedsPatternLimits(pattern: unknown): boolean;
/**
* Transforms the Pattern to Route safely.
*
* @param pattern - client pattern
* @param depth - current recursion depth
* @param maxDepth - maximum allowed recursion depth
* @param maxKeys - maximum allowed keys per object
* @param maxKeyLength - maximum allowed length of a key
* @param maxValueLength - maximum allowed length of a string value
* @param maxTotalKeys - maximum allowed keys in the whole pattern
* @returns string
*/
export declare function transformPatternToRoute(pattern: MsPattern, depth?: number, maxDepth?: number, maxKeys?: number, maxKeyLength?: number, maxValueLength?: number, maxTotalKeys?: number): string;