@remit/drizzle-service 0.0.90 → 0.0.91

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/drizzle-service",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "description": "Drizzle ORM service over SQLite",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -8,7 +8,7 @@ import type {
8
8
  UpdateAccountInput,
9
9
  } from "@remit/data-ports";
10
10
  import { AccountService, SyncPhase } from "@remit/domain-enums";
11
- import { and, asc, eq, gt, inArray, or, sql } from "drizzle-orm";
11
+ import { and, asc, eq, gt, inArray, like, or, sql } from "drizzle-orm";
12
12
  import type { Db } from "../db.js";
13
13
  import { NotFoundError } from "../error.js";
14
14
  import { randomId } from "../id.js";
@@ -291,6 +291,21 @@ export class AccountRepo implements IAccountRepository {
291
291
  return rows.map(rowToAccount);
292
292
  }
293
293
 
294
+ async listMailSourcesByAccountConfig(
295
+ accountConfigId: string,
296
+ ): Promise<AccountItem[]> {
297
+ const rows = await this.db
298
+ .select()
299
+ .from(accountTable)
300
+ .where(
301
+ and(
302
+ eq(accountTable.accountConfigId, accountConfigId),
303
+ like(accountTable.syncedServices, `%"${AccountService.Mail}"%`),
304
+ ),
305
+ );
306
+ return rows.map(rowToAccount);
307
+ }
308
+
294
309
  async describe(accountId: string): Promise<AccountDescription> {
295
310
  const [accounts, mailboxes] = await Promise.all([
296
311
  this.db