import { ITaskEntity } from "../entities/task-entity"; import { EntityInstanceId } from "../entities/entity-instance-id"; import * as pb from "../proto/orchestrator_service_pb"; /** * Internal type representing actions collected during entity execution. * * @remarks * Values are serialized immediately when action is created (not later), * requestTime is captured at action creation time, and instanceId is * converted to string immediately. */ export type EntityAction = { type: "signalEntity"; instanceId: string; name: string; input: string | undefined; scheduledTime?: Date; requestTime: Date; } | { type: "scheduleOrchestration"; instanceId: string; name: string; input: string | undefined; scheduledTime?: Date; requestTime: Date; }; /** * Executes entity operations in batch with transactional semantics. * * @remarks * This class implements transactional behavior: * - Entity is passed to constructor and stored as field * - Shims are created and reused across operations * - Each operation is executed independently * - State is checkpointed before each operation * - On exception, state and actions are rolled back for that operation * - Other operations in the batch continue to execute */ export declare class TaskEntityShim { private readonly entity; private readonly entityId; private readonly stateShim; private readonly contextShim; private readonly operationShim; private readonly results; /** * Creates a new TaskEntityShim for executing operations on an entity. * * @param entity - The entity to execute operations on. * @param entityId - The ID of the entity. */ constructor(entity: ITaskEntity, entityId: EntityInstanceId); /** * Executes a batch of operations on the entity. * * @param request - The batch request containing operations. * @returns The batch result containing results for each operation. */ executeAsync(request: pb.EntityBatchRequest): Promise; /** * Executes a single operation with transactional semantics. */ private executeOperation; /** * Gets the serialized state string from the proto StringValue. * Does not parse - StateManager stores state as serialized string. */ private getSerializedState; /** * Converts a Date to a protobuf Timestamp. */ private dateToTimestamp; /** * Converts EntityActions to proto OperationActions. */ private convertActionsToProto; }