@remit/data-ports 0.0.6 → 0.0.8

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/data-ports",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -49,6 +49,35 @@ export interface IThreadMessageRepository {
49
49
  excludeDeleted?: boolean;
50
50
  },
51
51
  ): Promise<ResultList<ThreadMessageItem>>;
52
+ /**
53
+ * Search rows for a config across every mailbox in `mailboxIds`, newest
54
+ * first — the cross-account, cross-folder counterpart of `searchByMailbox`.
55
+ *
56
+ * Backed by the same date-ordered access pattern as `listByDate`; the caller
57
+ * supplies the mailbox scope, so a search reaching Archive, Sent, Spam and
58
+ * custom folders is a matter of which set is passed. An empty or absent
59
+ * `mailboxIds` means no narrowing (every mailbox of the config), which is why
60
+ * handlers pass an explicitly built set rather than relying on the default.
61
+ *
62
+ * Matching follows `searchByMailbox`: `query` splits on whitespace and every
63
+ * term must match subject OR From, case-insensitively. `limit` is a page size
64
+ * over MATCHES, clamped server-side, so a short page means the matches ran
65
+ * out — never that a read window was exhausted.
66
+ *
67
+ * Rows are per mailbox, not per conversation: the same mail filed in two
68
+ * folders is two rows sharing a `threadId`.
69
+ */
70
+ searchByDate(
71
+ accountConfigId: string,
72
+ search: SearchOptions,
73
+ options?: {
74
+ order?: "asc" | "desc";
75
+ limit?: number;
76
+ continuationToken?: string;
77
+ mailboxIds?: Set<string>;
78
+ excludeDeleted?: boolean;
79
+ },
80
+ ): Promise<ResultList<ThreadMessageItem>>;
52
81
  /**
53
82
  * List starred rows for a config, newest first, across every mailbox.
54
83
  *
@@ -77,6 +106,11 @@ export interface IThreadMessageRepository {
77
106
  * Every message of a thread, across all mailboxes of the account. A
78
107
  * conversation spans INBOX, Sent and any folder its messages were filed
79
108
  * in, so this listing is deliberately not scoped to a mailbox (#46).
109
+ *
110
+ * Ordered by `sentDate` with `threadMessageId` breaking ties, ascending
111
+ * unless `order` says otherwise — a conversation reads in the order it
112
+ * happened (#81). Every implementation sorts in the query, so the order
113
+ * holds across pages and not merely within one page.
80
114
  */
81
115
  listByThread(
82
116
  threadId: string,