@remit/data-ports 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -59,6 +59,25 @@ export interface IOutboxMessageRepository {
|
|
|
59
59
|
outboxMessageId: string,
|
|
60
60
|
status: OutboxMessageItem["status"],
|
|
61
61
|
): Promise<OutboxMessageItem>;
|
|
62
|
+
/**
|
|
63
|
+
* Write `input` only while the row still holds `expected`, and answer `null`
|
|
64
|
+
* when it does not.
|
|
65
|
+
*
|
|
66
|
+
* Every status transition is a read the caller decided on followed by a
|
|
67
|
+
* write, and the SMTP worker or a second request can move the row between
|
|
68
|
+
* the two. Naming the status that decision was made against turns the write
|
|
69
|
+
* into a compare-and-set: an edit no longer pulls a row back out of `queued`
|
|
70
|
+
* while its send event is on the wire, and a settle no longer overwrites a
|
|
71
|
+
* status the worker has already reached. `null` is the caller's to read —
|
|
72
|
+
* a conflict for an action the user asked for, and nothing to do for a
|
|
73
|
+
* settle that has been overtaken.
|
|
74
|
+
*/
|
|
75
|
+
updateIfStatus(
|
|
76
|
+
accountConfigId: string,
|
|
77
|
+
outboxMessageId: string,
|
|
78
|
+
expected: OutboxMessageItem["status"],
|
|
79
|
+
input: UpdateOutboxMessageInput,
|
|
80
|
+
): Promise<OutboxMessageItem | null>;
|
|
62
81
|
markSent(
|
|
63
82
|
accountConfigId: string,
|
|
64
83
|
outboxMessageId: string,
|