import type { CommandAdapterFactory, Messages, Snapshot, State } from "../types"; /** * Validates and and adapts messages from external systems into internal command invocations * * **Note:** Can be used as webhooks and anti-corruption layers * * @param factory the command adapter factory * @param payload the message payload * @returns last snapshot */ export default function invoke
(factory: CommandAdapterFactory
, payload: P): Promise