Skip to content

Commit

Permalink
greptile
Browse files Browse the repository at this point in the history
  • Loading branch information
guillim committed Jan 10, 2025
1 parent 61f49b2 commit 7284e96
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queu
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
import { CalendarEventListFetchCronJob } from 'src/modules/calendar/calendar-event-import-manager/crons/jobs/calendar-event-list-fetch.cron.job';

const CALENDAR_EVENTS_LIST_CRON_PATTERN = '*/5 * * * *';

@Command({
name: 'cron:calendar:calendar-event-list-fetch',
description: 'Starts a cron job to fetch the calendar event list',
Expand All @@ -23,7 +25,7 @@ export class CalendarEventListFetchCronCommand extends CommandRunner {
undefined,
{
repeat: {
pattern: '*/5 * * * *',
pattern: CALENDAR_EVENTS_LIST_CRON_PATTERN,
},
},
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';

import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
Expand Down Expand Up @@ -26,9 +25,6 @@ import { MicrosoftGetMessageListService } from './services/microsoft-get-message
MicrosoftGetMessageListService,
MicrosoftOAuth2ClientManagerService,
],
exports: [
MicrosoftGetMessageListService,
// MicrosoftClientProvider
],
exports: [MicrosoftGetMessageListService, MicrosoftClientProvider],
})
export class MessagingMicrosoftDriverModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class MicrosoftClientProvider {
public async getMicrosoftClient(
connectedAccount: Pick<
ConnectedAccountWorkspaceEntity,
'provider' | 'refreshToken' | 'id'
'refreshToken' | 'id'
>,
): Promise<Client> {
try {
Expand All @@ -23,8 +23,9 @@ export class MicrosoftClientProvider {
);
} catch (error) {
throw new Error(
'Failed to get Microsoft client: ' +
(error instanceof Error ? error.message : 'Unknown error'),
`Failed to get Microsoft client: ${
error instanceof Error ? error.message : 'Unknown error'
}`,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MicrosoftClientProvider } from 'src/modules/messaging/message-import-ma
import { GetFullMessageListResponse } from 'src/modules/messaging/message-import-manager/services/messaging-get-message-list.service';

// Microsoft API limit is 1000 messages per request on this endpoint
const MESSAGING_MICROSOFT_USERS_MESSAGES_LIST_MAX_RESULT = 1;
const MESSAGING_MICROSOFT_USERS_MESSAGES_LIST_MAX_RESULT = 1000;

@Injectable()
export class MicrosoftGetMessageListService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ On Microsoft Azure Console enable the following APIs in "Permissions":
### Authorized redirect URIs

You need to add the following redirect URIs to your project:

- `https://<your-domain>/auth/google/redirect` if you want to use Google SSO
- `https://<your-domain>/auth/google-apis/get-access-token`
- `https://<your-domain>/auth/microsoft/redirect` if you want to use Microsoft SSO
- `https://<your-domain>/auth/microsoft-apis/get-access-token`

### If your app is in test mode

Expand Down

0 comments on commit 7284e96

Please sign in to comment.