@remit/data-ports 0.0.62 → 0.0.64
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 +1 -1
- package/src/index.ts +1 -0
- package/src/interfaces/thread-message.ts +37 -0
- package/src/message-settlement.ts +5 -6
- package/src/types.ts +16 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
CreateThreadMessageInput,
|
|
3
3
|
ResultList,
|
|
4
4
|
SearchOptions,
|
|
5
|
+
ThreadMessageFieldTerm,
|
|
5
6
|
ThreadMessageItem,
|
|
6
7
|
UpdateThreadMessageInput,
|
|
7
8
|
} from "../types.js";
|
|
@@ -85,6 +86,42 @@ export interface IThreadMessageRepository {
|
|
|
85
86
|
excludeDeleted?: boolean;
|
|
86
87
|
},
|
|
87
88
|
): Promise<ResultList<ThreadMessageItem>>;
|
|
89
|
+
/**
|
|
90
|
+
* Rows of a config whose sender, subject or `List-Id` column matches a set
|
|
91
|
+
* of substring terms, newest first, across every mailbox — the store-side
|
|
92
|
+
* narrowing a rule back-apply reads with.
|
|
93
|
+
*
|
|
94
|
+
* The terms are evaluated in the query, so `limit` is a page size over
|
|
95
|
+
* MATCHES and the scan reaches the whole config however old the matching
|
|
96
|
+
* mail is. Paging a date-ordered listing and filtering the rows it returned
|
|
97
|
+
* is what makes a rule for a quiet sender report a handful of matches on a
|
|
98
|
+
* mailbox holding thousands (#459).
|
|
99
|
+
*
|
|
100
|
+
* `operator` combines the terms — `"and"` requires every one, `"or"` any.
|
|
101
|
+
* An empty `terms` narrows nothing under either operator: the whole config,
|
|
102
|
+
* newest first.
|
|
103
|
+
*
|
|
104
|
+
* A term an implementation cannot evaluate faithfully is IGNORED, never
|
|
105
|
+
* approximated: the result may be wider than the terms asked for and never
|
|
106
|
+
* narrower, so the caller's own matcher stays the judge.
|
|
107
|
+
*
|
|
108
|
+
* Matching follows `searchByMailbox`: accent- and case-insensitive
|
|
109
|
+
* substring over the same folded columns.
|
|
110
|
+
*
|
|
111
|
+
* Rows are per mailbox, not per conversation: the same mail filed in two
|
|
112
|
+
* folders is two rows sharing a `threadId`.
|
|
113
|
+
*/
|
|
114
|
+
listByFieldTerms(
|
|
115
|
+
accountConfigId: string,
|
|
116
|
+
terms: readonly ThreadMessageFieldTerm[],
|
|
117
|
+
options?: {
|
|
118
|
+
operator?: "and" | "or";
|
|
119
|
+
order?: "asc" | "desc";
|
|
120
|
+
limit?: number;
|
|
121
|
+
continuationToken?: string;
|
|
122
|
+
excludeDeleted?: boolean;
|
|
123
|
+
},
|
|
124
|
+
): Promise<ResultList<ThreadMessageItem>>;
|
|
88
125
|
/**
|
|
89
126
|
* List starred rows for a config, newest first, across every mailbox.
|
|
90
127
|
*
|
|
@@ -33,13 +33,12 @@ export type MessageSettlementFields = Pick<
|
|
|
33
33
|
* those handlers `status` stays at its in-flight value (`moving`, `deleting`),
|
|
34
34
|
* which is what separates them from the pair above.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* Two give-ups this cannot see, and must not pretend to:
|
|
37
37
|
*
|
|
38
|
-
* - A MOVE that
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* actually is), so it reads as fully settled here.
|
|
38
|
+
* - A MOVE or a DELETE that exhausted its retries settles `active` + `synced`
|
|
39
|
+
* (`resolveExhaustedMessageMoveFailure` and
|
|
40
|
+
* `resolveExhaustedMessageDeleteFailure` repair the row to where the message
|
|
41
|
+
* actually is — #1098, #1005), so both read as fully settled here.
|
|
43
42
|
* - `flag-push` and `placement-move-push` never write either field at all.
|
|
44
43
|
* Their give-up state lives on their own marker rows.
|
|
45
44
|
*/
|
package/src/types.ts
CHANGED
|
@@ -488,6 +488,22 @@ export type UpdateThreadMessageInput = Partial<
|
|
|
488
488
|
Omit<CreateThreadMessageInput, "accountConfigId" | "threadId" | "messageId">
|
|
489
489
|
>;
|
|
490
490
|
|
|
491
|
+
/**
|
|
492
|
+
* One substring criterion over a text column of a ThreadMessage row, named by
|
|
493
|
+
* the column it selects on rather than by whatever rule derived it. `sender`
|
|
494
|
+
* covers the From address and display name together, the same pair
|
|
495
|
+
* `SearchOptions.from` reads.
|
|
496
|
+
*
|
|
497
|
+
* Matching is accent- and case-insensitive substring, identical to the search
|
|
498
|
+
* predicates, so a term is a NARROWING a caller refines further in memory. It
|
|
499
|
+
* may return more than the criterion it stands for and never less — a term an
|
|
500
|
+
* implementation cannot evaluate faithfully is dropped, not approximated.
|
|
501
|
+
*/
|
|
502
|
+
export type ThreadMessageFieldTerm = {
|
|
503
|
+
field: "sender" | "subject" | "listId";
|
|
504
|
+
contains: string;
|
|
505
|
+
};
|
|
506
|
+
|
|
491
507
|
export type SearchOptions = {
|
|
492
508
|
query?: string;
|
|
493
509
|
subject?: string;
|