@remit/data-ports 0.0.70 → 0.0.72
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/mailbox.ts +2 -1
- package/src/interfaces/thread-message.ts +5 -4
- package/src/mutation-events.ts +5 -2
- package/src/types.ts +4 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
CreateMailboxInput,
|
|
3
|
+
CreateMailboxResult,
|
|
3
4
|
MailboxItem,
|
|
4
5
|
MailboxSubtreeTransitionIntent,
|
|
5
6
|
MailboxTransitionIntent,
|
|
@@ -8,7 +9,7 @@ import type {
|
|
|
8
9
|
} from "../types.js";
|
|
9
10
|
|
|
10
11
|
export interface IMailboxRepository {
|
|
11
|
-
create(input: CreateMailboxInput): Promise<
|
|
12
|
+
create(input: CreateMailboxInput): Promise<CreateMailboxResult>;
|
|
12
13
|
get(accountId: string, mailboxId: string): Promise<MailboxItem>;
|
|
13
14
|
get(accountId: string, mailboxIds: string[]): Promise<MailboxItem[]>;
|
|
14
15
|
/**
|
|
@@ -58,11 +58,12 @@ export interface IThreadMessageRepository {
|
|
|
58
58
|
},
|
|
59
59
|
): Promise<ResultList<ThreadMessageItem>>;
|
|
60
60
|
/**
|
|
61
|
-
* Search rows for a config across every mailbox in `mailboxIds
|
|
62
|
-
*
|
|
61
|
+
* Search rows for a config across every mailbox in `mailboxIds` — the
|
|
62
|
+
* cross-account, cross-folder counterpart of `searchByMailbox`. A row whose
|
|
63
|
+
* From matches any `query` term ranks above one that only mentions the
|
|
64
|
+
* terms, and each tier runs in date order.
|
|
63
65
|
*
|
|
64
|
-
*
|
|
65
|
-
* supplies the mailbox scope, so a search reaching Archive, Sent, Spam and
|
|
66
|
+
* The caller supplies the mailbox scope, so a search reaching Archive, Sent, Spam and
|
|
66
67
|
* custom folders is a matter of which set is passed. An empty or absent
|
|
67
68
|
* `mailboxIds` means no narrowing (every mailbox of the config), which is why
|
|
68
69
|
* handlers pass an explicitly built set rather than relying on the default.
|
package/src/mutation-events.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const MUTATION_EVENT_SCHEMA_VERSION = 2;
|
|
11
11
|
|
|
12
|
+
export const PATHLESS_MUTATION_EVENT_SCHEMA_VERSION = 3;
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
15
|
* Queue payloads are `JSON.parse`d and cast with no validation, so the declared
|
|
14
16
|
* type is a promise the queue cannot keep. A handler that cannot vouch for an
|
|
@@ -16,5 +18,6 @@ export const MUTATION_EVENT_SCHEMA_VERSION = 2;
|
|
|
16
18
|
* makes the unverified expunge the default for every event we cannot vouch for,
|
|
17
19
|
* including any future producer that forgets the field.
|
|
18
20
|
*/
|
|
19
|
-
export const
|
|
20
|
-
value === MUTATION_EVENT_SCHEMA_VERSION
|
|
21
|
+
export const isAcceptedSchemaVersion = (value: unknown): boolean =>
|
|
22
|
+
value === MUTATION_EVENT_SCHEMA_VERSION ||
|
|
23
|
+
value === PATHLESS_MUTATION_EVENT_SCHEMA_VERSION;
|
package/src/types.ts
CHANGED
|
@@ -386,6 +386,10 @@ export type CreateMailboxInput = Omit<
|
|
|
386
386
|
syncStatus?: MailboxItem["syncStatus"];
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
+
export type CreateMailboxResult =
|
|
390
|
+
| { outcome: "Created"; mailbox: MailboxItem }
|
|
391
|
+
| { outcome: "PathTaken" };
|
|
392
|
+
|
|
389
393
|
/**
|
|
390
394
|
* Everything about a mailbox that is not its mutation state.
|
|
391
395
|
*
|