import { NextContextBase } from ".."; import { CurrentArgsSource, WorkflowExecuteContext } from "./WorkflowExecuteContext"; import { WorkflowExecutionResult } from "./WorkflowExecutionResult"; import { WorkflowRouteAction } from "./WorkflowRouteAction"; import { WorkflowRouteActionResult } from "./WorkflowRouteActionResult"; import { WorkflowRouter } from "./WorkflowRouter"; import * as yup from 'yup'; import { IfCondition, IfElse, IfThen } from "./actions/IfAction"; import { ActionBuilder } from "./actions/ParallelAction"; import { CacheMode } from "./actions/CacheAction"; type WorkflowHttpMethod = "POST" | "GET" | "PUT" | "PATCH" | "DELETE"; type ValidatePresetType = 'list'; type ValidatePresetOptions = { list?: { maxPageSize?: number; minPageSize?: number; paginationRequired?: boolean; }; }; export declare class WorkflowRoute { router: WorkflowRouter; path: string; actions: WorkflowRouteAction[]; httpMethod: string[]; description: string; summary: string; tags: string; isDeprecated?: boolean; id?: string; performanceMetricsEnabled: boolean; private metricsDbPlugin?; private metricsDbTable?; constructor(router: WorkflowRouter, path: string); desc(description: string): this; sum(summary: string): this; tag(tags: string): this; deprecated(): this; method(method: WorkflowHttpMethod): this; methods(...methods: WorkflowHttpMethod[]): this; action(a: WorkflowRouteAction): this; enableMetrics(dbPlugin?: any, tableName?: string): this; authorize(options?: { anonymous?: boolean; custom?: Function; }): this; anonymous(): this; storedProcedure(options: { db?: string; name: string; args?: any; firstArg?: any; }): this; map(options: { source: CurrentArgsSource; map: any; }): this; create(options: { db?: string; table: string; args: any; returns?: any; }): this; update(options: { db?: string; table: string; where: any; args: any; returns?: any; }): this; delete(options: { db?: string; table: string; where: any; returns?: any; field?: string; deletedValue?: any; }): this; retrieveOne(options: { db?: string; table: string; where: any; projection?: string[]; customWhere?: (context: WorkflowExecuteContext, query: any, args?: any) => any | Promise; }): this; custom(func: (ctx: WorkflowExecuteContext) => Promise): this; retrieveMany(options: { db?: string; table: string; projection?: string[]; searchColumns?: string[]; searchField?: string; filterField?: string; sortByField?: string; sortDirField?: string; pageIndexField?: string; pageSizeField?: string; where?: any; customWhere?: (context: WorkflowExecuteContext, query: any, args?: any) => any | Promise; }): this; if(condition: IfCondition, isTrue?: IfThen, isFalse?: IfElse): this; validate(schema: yup.AnySchema): this; validatePreset(preset: ValidatePresetType, presetOptions?: ValidatePresetOptions): this; log(options?: { message?: string; logLevel?: 'info' | 'warn' | 'error' | 'debug'; includeContext?: boolean; contextPath?: string; }): this; retry(options: { action: (route: WorkflowRoute) => WorkflowRoute; maxAttempts?: number; delayMs?: number; retryCondition?: (result: WorkflowRouteActionResult) => boolean; }): this; transform(options: { source: CurrentArgsSource; transformFn: ((data: any, context: WorkflowExecuteContext) => any | Promise) | Array<(data: any, context: WorkflowExecuteContext) => any | Promise>; sourceKey?: string; }): this; parallel(options: { actions: ActionBuilder[]; failFast?: boolean; maxConcurrent?: number; }): this; switch(expression: string | ((ctx: WorkflowExecuteContext) => string | number | boolean | Promise), source?: CurrentArgsSource): this; cache(options: { key: string | ((ctx: WorkflowExecuteContext) => string); mode?: CacheMode; ttlMs?: number; action?: (route: WorkflowRoute) => WorkflowRoute; fallbackValue?: any; }): this; limit(options: { key: string | ((ctx: WorkflowExecuteContext) => string); limit: number; windowMs: number; action?: (route: WorkflowRoute) => WorkflowRoute; errorMessage?: string; errorStatus?: number; }): this; getPath(): string; execute(nextContext: NextContextBase, currentContext?: WorkflowExecuteContext): Promise; private savePerformanceMetrics; private generateUuid; buildExecutionResult(actionResult: WorkflowRouteActionResult): WorkflowExecutionResult; buildActionResult(result: WorkflowExecutionResult): WorkflowRouteActionResult; } export {}; //# sourceMappingURL=WorkflowRoute.d.ts.map