diff --git a/packages/backend/src/services/IngestionService.ts b/packages/backend/src/services/IngestionService.ts index 1814329..4011b3c 100644 --- a/packages/backend/src/services/IngestionService.ts +++ b/packages/backend/src/services/IngestionService.ts @@ -161,7 +161,7 @@ export class IngestionService { if (connector.listAllUsers) { // For multi-mailbox providers, dispatch a job for each user for await (const user of connector.listAllUsers()) { - const userEmail = (user as any).primaryEmail; + const userEmail = user.primaryEmail; if (userEmail) { await ingestionQueue.add('process-mailbox', { ingestionSourceId: source.id, diff --git a/packages/backend/src/services/ingestion-connectors/ImapConnector.ts b/packages/backend/src/services/ingestion-connectors/ImapConnector.ts index fa5a3f6..b3aba80 100644 --- a/packages/backend/src/services/ingestion-connectors/ImapConnector.ts +++ b/packages/backend/src/services/ingestion-connectors/ImapConnector.ts @@ -114,7 +114,7 @@ export class ImapConnector implements IEmailConnector { public async *fetchEmails(userEmail: string, syncState?: SyncState | null): AsyncGenerator { try { const mailboxes = await this.withRetry(() => this.client.list()); - console.log('fetched mailboxes:', mailboxes); + // console.log('fetched mailboxes:', mailboxes); const processableMailboxes = mailboxes.filter(mailbox => { // filter out trash and all mail emails if (mailbox.specialUse) { @@ -209,122 +209,3 @@ export class ImapConnector implements IEmailConnector { } - -/** - * Gmail: - * fetched mailboxes: [ -[0] { -[0] path: 'INBOX', -[0] pathAsListed: 'INBOX', -[0] flags: Set(1) { '\\HasNoChildren' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '', -[0] parent: [], -[0] name: 'INBOX', -[0] subscribed: true, -[0] specialUse: '\\Inbox', -[0] specialUseSource: 'name' -[0] }, -[0] { -[0] path: '[Gmail]/Starred', -[0] pathAsListed: '[Gmail]/Starred', -[0] flags: Set(2) { '\\Flagged', '\\HasNoChildren' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Starred', -[0] subscribed: true, -[0] specialUse: '\\Flagged', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]/Sent Mail', -[0] pathAsListed: '[Gmail]/Sent Mail', -[0] flags: Set(2) { '\\HasNoChildren', '\\Sent' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Sent Mail', -[0] subscribed: true, -[0] specialUse: '\\Sent', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]/Drafts', -[0] pathAsListed: '[Gmail]/Drafts', -[0] flags: Set(2) { '\\Drafts', '\\HasNoChildren' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Drafts', -[0] subscribed: true, -[0] specialUse: '\\Drafts', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]/All Mail', -[0] pathAsListed: '[Gmail]/All Mail', -[0] flags: Set(2) { '\\All', '\\HasNoChildren' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'All Mail', -[0] subscribed: true, -[0] specialUse: '\\All', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]/Spam', -[0] pathAsListed: '[Gmail]/Spam', -[0] flags: Set(2) { '\\HasNoChildren', '\\Junk' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Spam', -[0] subscribed: true, -[0] specialUse: '\\Junk', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]/Trash', -[0] pathAsListed: '[Gmail]/Trash', -[0] flags: Set(2) { '\\HasNoChildren', '\\Trash' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Trash', -[0] subscribed: true, -[0] specialUse: '\\Trash', -[0] specialUseSource: 'extension' -[0] }, -[0] { -[0] path: '[Gmail]', -[0] pathAsListed: '[Gmail]', -[0] flags: Set(2) { '\\HasChildren', '\\Noselect' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '', -[0] parent: [], -[0] name: '[Gmail]', -[0] subscribed: true -[0] }, -[0] { -[0] path: '[Gmail]/Important', -[0] pathAsListed: '[Gmail]/Important', -[0] flags: Set(2) { '\\HasNoChildren', '\\Important' }, -[0] delimiter: '/', -[0] listed: true, -[0] parentPath: '[Gmail]', -[0] parent: [ '[Gmail]' ], -[0] name: 'Important', -[0] subscribed: true -[0] } -[0] ] - */ diff --git a/packages/backend/src/services/ingestion-connectors/MicrosoftConnector.ts b/packages/backend/src/services/ingestion-connectors/MicrosoftConnector.ts index d14096f..602e15b 100644 --- a/packages/backend/src/services/ingestion-connectors/MicrosoftConnector.ts +++ b/packages/backend/src/services/ingestion-connectors/MicrosoftConnector.ts @@ -203,7 +203,7 @@ export class MicrosoftConnector implements IEmailConnector { const response = await this.graphClient.api(requestUrl).get(); for (const message of response.value) { - if (message.id && !(message as any)['@removed']) { + if (message.id && !(message)['@removed']) { const rawEmail = await this.getRawEmail(userEmail, message.id); if (rawEmail) { yield await this.parseEmail(rawEmail, message.id, userEmail); diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 9a36b40..2b3476a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ +# Defines the pnpm workspace for the monorepo packages: - 'packages/*'