Merge scheduled send

Both branches turn on where Stalwart advertises a capability, so they meet
in the same two files. The mock keeps `urn:stalwart:jmap` out of the
session-level capabilities and hands it out per-account, as a real server
does, while the submission capability it grew for scheduled send lives
per-account beside it; the client keeps both accessors, one asking whether a
capability is advertised anywhere and one reading the object itself.
This commit is contained in:
2026-08-24 22:24:13 -07:00
21 changed files with 1227 additions and 38 deletions
+10
View File
@@ -137,6 +137,16 @@ export class JmapClient {
return Object.values(this.session?.accounts ?? {}).some((a) => cap in (a.accountCapabilities ?? {}));
}
/**
* The capability object itself, for the capabilities that carry limits.
* Stalwart puts the interesting half of `urn:ietf:params:jmap:submission`
* here and leaves the session-level copy empty.
*/
accountCapability<T>(accountId: Id, cap: string): T | undefined {
const acc = this.session?.accounts[accountId];
return acc?.accountCapabilities[cap] as T | undefined;
}
primaryAccount(cap: string): Id | null {
return this.session?.primaryAccounts[cap] ?? null;
}