3239 create a command to do a partial sync with the gmail api using the historyid (#3405)
* create utils service * getLastSyncHistoryId * getHistory * add historyTypes messageAdded and messageDeleted * getMessageIdsAndThreadIdsNotInDatabase * wip * fix messageThreadId null * no need to fetch threads anymore * get messagesAdded in partial sync * adding errors * save lastSyncHistoryId * improve * renaming * create partial sync job * improve partial sync * adding messages with partial sync is working * now adding messages with partial sync is working * deleting messages and empty threads is working * wip * wip * fix bug to delete threads * update partial sync to cover edge cases * renaming * modify ambiguous naming * renaming
This commit is contained in:
@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
|
||||
import { FetchAllMessagesFromConnectedAccountJob } from 'src/workspace/messaging/jobs/fetch-all-messages-from-connected-account.job';
|
||||
import { GmailFullSyncJob } from 'src/workspace/messaging/jobs/gmail-full-sync.job';
|
||||
import { CallWebhookJobsJob } from 'src/workspace/workspace-query-runner/jobs/call-webhook-jobs.job';
|
||||
import { CallWebhookJob } from 'src/workspace/workspace-query-runner/jobs/call-webhook.job';
|
||||
import { WorkspaceDataSourceModule } from 'src/workspace/workspace-datasource/workspace-datasource.module';
|
||||
@ -10,6 +10,7 @@ import { ObjectMetadataModule } from 'src/metadata/object-metadata/object-metada
|
||||
import { DataSourceModule } from 'src/metadata/data-source/data-source.module';
|
||||
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
|
||||
import { FetchWorkspaceMessagesModule } from 'src/workspace/messaging/services/fetch-workspace-messages.module';
|
||||
import { GmailPartialSyncJob } from 'src/workspace/messaging/jobs/gmail-partial-sync.job';
|
||||
import { EmailSenderJob } from 'src/integrations/email/email-sender.job';
|
||||
|
||||
@Module({
|
||||
@ -23,8 +24,12 @@ import { EmailSenderJob } from 'src/integrations/email/email-sender.job';
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: FetchAllMessagesFromConnectedAccountJob.name,
|
||||
useClass: FetchAllMessagesFromConnectedAccountJob,
|
||||
provide: GmailFullSyncJob.name,
|
||||
useClass: GmailFullSyncJob,
|
||||
},
|
||||
{
|
||||
provide: GmailPartialSyncJob.name,
|
||||
useClass: GmailPartialSyncJob,
|
||||
},
|
||||
{
|
||||
provide: CallWebhookJobsJob.name,
|
||||
|
||||
Reference in New Issue
Block a user