import { Context, DAL, FilterableWorkflowExecutionProps, FindConfig, InferEntityType, InternalModuleDeclaration, ModulesSdkTypes, WorkflowExecutionDTO, WorkflowsSdkTypes } from "@victorhugosilva30/framework/types"; import { ModulesSdkUtils } from "@victorhugosilva30/framework/utils"; import type { ReturnWorkflow, UnwrapWorkflowInputDataType } from "@victorhugosilva30/framework/workflows-sdk"; import { SqlEntityManager } from "@mikro-orm/postgresql"; import { WorkflowExecution } from "../models"; import { WorkflowOrchestratorService } from "."; import { WorkflowOrchestratorCancelOptions } from "../types"; type InjectedDependencies = { manager: SqlEntityManager; baseRepository: DAL.RepositoryService; workflowExecutionService: ModulesSdkTypes.IMedusaInternalService; workflowOrchestratorService: WorkflowOrchestratorService; }; declare const WorkflowsModuleService_base: ModulesSdkUtils.MedusaServiceReturnType<{ WorkflowExecution: { dto: InferEntityType; }; }>; export declare class WorkflowsModuleService = InferEntityType> extends WorkflowsModuleService_base { protected readonly moduleDeclaration: InternalModuleDeclaration; protected baseRepository_: DAL.RepositoryService; protected workflowExecutionService_: ModulesSdkTypes.IMedusaInternalService; protected workflowOrchestratorService_: WorkflowOrchestratorService; protected manager_: SqlEntityManager; constructor({ manager, baseRepository, workflowExecutionService, workflowOrchestratorService, }: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration); __hooks: { onApplicationStart: () => Promise; onApplicationShutdown: () => Promise; }; static prepareFilters(filters: T & { q?: string; }): (T & { q?: string; }) | { $or: ({ transaction_id: { $ilike: string; }; workflow_id?: undefined; state?: undefined; execution?: undefined; } | { workflow_id: { $ilike: string; }; transaction_id?: undefined; state?: undefined; execution?: undefined; } | { state: { $ilike: string; }; transaction_id?: undefined; workflow_id?: undefined; execution?: undefined; } | { execution: { runId: { $ilike: string; }; }; transaction_id?: undefined; workflow_id?: undefined; state?: undefined; })[]; } | { $and: ((T & { q?: string; }) | { $or: ({ transaction_id: { $ilike: string; }; workflow_id?: undefined; state?: undefined; execution?: undefined; } | { workflow_id: { $ilike: string; }; transaction_id?: undefined; state?: undefined; execution?: undefined; } | { state: { $ilike: string; }; transaction_id?: undefined; workflow_id?: undefined; execution?: undefined; } | { execution: { runId: { $ilike: string; }; }; transaction_id?: undefined; workflow_id?: undefined; state?: undefined; })[]; })[]; }; listWorkflowExecutions(filters?: FilterableWorkflowExecutionProps, config?: FindConfig, sharedContext?: Context): Promise<{ id: string; workflow_id: string; transaction_id: string; run_id: string; execution: Record | null; context: Record | null; state: import("@victorhugosilva30/framework/utils").TransactionState; retention_time: number | null; raw_retention_time: Record | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }[]>; listAndCountWorkflowExecutions(filters?: FilterableWorkflowExecutionProps, config?: FindConfig, sharedContext?: Context): Promise<[{ id: string; workflow_id: string; transaction_id: string; run_id: string; execution: Record | null; context: Record | null; state: import("@victorhugosilva30/framework/utils").TransactionState; retention_time: number | null; raw_retention_time: Record | null; created_at: Date; updated_at: Date; deleted_at: Date | null; }[], number]>; run>(workflowIdOrWorkflow: TWorkflow, options?: WorkflowsSdkTypes.WorkflowOrchestratorRunDTO ? UnwrapWorkflowInputDataType : unknown>, context?: Context): Promise; getRunningTransaction(workflowId: string, transactionId: string, context?: Context): Promise; setStepSuccess({ idempotencyKey, stepResponse, options, }: { idempotencyKey: string | object; stepResponse: unknown; options?: Record; }, context?: Context): Promise; setStepFailure({ idempotencyKey, stepResponse, options, }: { idempotencyKey: string | object; stepResponse: unknown; options?: Record; }, context?: Context): Promise; subscribe(args: { workflowId: string; transactionId?: string; subscriber: Function; subscriberId?: string; }, context?: Context): Promise; unsubscribe(args: { workflowId: string; transactionId?: string; subscriberOrId: string | Function; }, context?: Context): Promise; cancel>(workflowIdOrWorkflow: TWorkflow, options: WorkflowOrchestratorCancelOptions, context?: Context): Promise; } export {}; //# sourceMappingURL=workflows-module.d.ts.map