Creates the outbox.
The REST client of createApiClient.
Store, onFailed, tokenFor and logger.
Stores a write with a new Idempotency-Key and sends it.
The write is stored as method, path, parameters and body, so a later process sends the same request with the same key from Outbox.flush.
post, put, patch or delete.
The path template of the operation, for example /commands.
Its parameters and body as openapi-fetch takes them (plain JSON).
The thread whose order it keeps and the run.
The entry after the send attempt.
Returns every entry that failed permanently.
The failed entries in order.
Sends every pending entry again, in order per thread, threads in parallel.
When every thread was drained up to its first transient failure.
Stores a reply with a new client_msg_id and sends it (createMessage).
The thread.
The Markdown text.
Run, the message it answers, kind and components.
The entry after the send attempt (sent, failed or still pending).
Sends replies and writes in order per thread and never twice.
Example