Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(root): Remove logs #7168

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/api/admin/remove-organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
EnforceEnvOrOrgIds,
FeedRepository,
LayoutRepository,
LogRepository,
MessageRepository,
MessageTemplateRepository,
NotificationGroupRepository,
Expand Down Expand Up @@ -89,7 +88,6 @@ connect(async () => {
await removeData(new IntegrationRepository(), 'integrations', organization._id, envIds);
// await removeData(new JobRepository(), 'jobs', organization._id, envIds);
await removeData(new LayoutRepository(), 'layouts', organization._id, envIds);
await removeData(new LogRepository(), 'logs', organization._id, envIds);
await removeData(new MessageRepository(), 'messages', organization._id, envIds);
await removeData(new MessageTemplateRepository(), 'messagetemplates', organization._id, envIds);
await removeData(new NotificationGroupRepository(), 'notificationgroups', organization._id, envIds);
Expand Down
14 changes: 14 additions & 0 deletions apps/api/migrations/deleteLogs/dropLogsCollection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DalService } from '@novu/dal';

(async function dropLogsCollection() {
const dalService = new DalService();
try {
const connection = await dalService.connect(process.env.MONGO_URL);
await connection.db.collection('logs').drop();
console.log('Collection "logs" was dropped successfully.');
} catch (error) {
console.error('Error dropping "logs" collection:', error);
} finally {
await dalService.disconnect();
}
})();
9 changes: 1 addition & 8 deletions apps/api/src/app/events/e2e/trigger-event-topic.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
LogRepository,
MessageRepository,
NotificationRepository,
NotificationTemplateEntity,
SubscriberEntity,
} from '@novu/dal';
import { MessageRepository, NotificationRepository, NotificationTemplateEntity, SubscriberEntity } from '@novu/dal';
import {
ChannelTypeEnum,
StepTypeEnum,
Expand Down Expand Up @@ -310,7 +304,6 @@ describe('Topic Trigger Event', () => {
let to: TriggerRecipients;
const notificationRepository = new NotificationRepository();
const messageRepository = new MessageRepository();
const logRepository = new LogRepository();

beforeEach(async () => {
session = new UserSession();
Expand Down
2 changes: 0 additions & 2 deletions apps/api/src/app/events/events.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { SharedModule } from '../shared/shared.module';
import { WidgetsModule } from '../widgets/widgets.module';
import { AuthModule } from '../auth/auth.module';
import { SubscribersModule } from '../subscribers/subscribers.module';
import { LogsModule } from '../logs/logs.module';
import { ContentTemplatesModule } from '../content-templates/content-templates.module';
import { IntegrationModule } from '../integrations/integrations.module';
import { ExecutionDetailsModule } from '../execution-details/execution-details.module';
Expand All @@ -32,7 +31,6 @@ const PROVIDERS = [GetNovuProviderCredentials, StorageHelperService, EventsDistr
WidgetsModule,
AuthModule,
SubscribersModule,
LogsModule,
ContentTemplatesModule,
IntegrationModule,
ExecutionDetailsModule,
Expand Down
5 changes: 0 additions & 5 deletions apps/api/src/app/logs/logs.controller.ts

This file was deleted.

12 changes: 0 additions & 12 deletions apps/api/src/app/logs/logs.module.ts

This file was deleted.

43 changes: 0 additions & 43 deletions apps/api/src/app/logs/usecases/create-log/create-log.command.ts

This file was deleted.

34 changes: 0 additions & 34 deletions apps/api/src/app/logs/usecases/create-log/create-log.usecase.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/api/src/app/logs/usecases/create-log/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions apps/api/src/app/logs/usecases/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/api/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
IntegrationRepository,
JobRepository,
LayoutRepository,
LogRepository,
MemberRepository,
MessageRepository,
MessageTemplateRepository,
Expand Down Expand Up @@ -74,7 +73,6 @@ const DAL_MODELS = [
NotificationGroupRepository,
MemberRepository,
LayoutRepository,
LogRepository,
IntegrationRepository,
ChangeRepository,
JobRepository,
Expand Down
Empty file added apps/web/env-config.js
Empty file.
43 changes: 0 additions & 43 deletions apps/worker/src/app/shared/logs/create-log.command.ts

This file was deleted.

35 changes: 0 additions & 35 deletions apps/worker/src/app/shared/logs/create-log.usecase.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/worker/src/app/shared/logs/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions apps/worker/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
IntegrationRepository,
JobRepository,
LayoutRepository,
LogRepository,
MessageRepository,
MessageTemplateRepository,
NotificationGroupRepository,
Expand All @@ -54,7 +53,6 @@ import { JobTopicNameEnum } from '@novu/shared';
import packageJson from '../../../package.json';
import { UNIQUE_WORKER_DEPENDENCIES } from '../../config/worker-init.config';
import { ActiveJobsMetricService } from '../workflow/services';
import { CreateLog } from './logs';

const DAL_MODELS = [
EnvironmentRepository,
Expand All @@ -66,7 +64,6 @@ const DAL_MODELS = [
MessageTemplateRepository,
NotificationGroupRepository,
LayoutRepository,
LogRepository,
IntegrationRepository,
JobRepository,
TopicRepository,
Expand All @@ -93,7 +90,6 @@ const PROVIDERS = [
cacheService,
ComputeJobWaitDurationService,
CreateExecutionDetails,
CreateLog,
CreateNotificationJobs,
CreateSubscriber,
dalService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
import { GetDigestEventsRegular } from './get-digest-events-regular.usecase';
import { GetDigestEventsBackoff } from './get-digest-events-backoff.usecase';

import { CreateLog } from '../../../../shared/logs';
import { PlatformException } from '../../../../shared/utils';

import { SendMessageCommand } from '../send-message.command';
Expand All @@ -32,14 +31,13 @@ const LOG_CONTEXT = 'Digest';
export class Digest extends SendMessageType {
constructor(
protected messageRepository: MessageRepository,
protected createLogUsecase: CreateLog,
protected executionLogRoute: ExecutionLogRoute,
protected jobRepository: JobRepository,
private getDigestEventsRegular: GetDigestEventsRegular,
private getDigestEventsBackoff: GetDigestEventsBackoff,
private getFeatureFlag: GetFeatureFlag
) {
super(messageRepository, createLogUsecase, executionLogRoute);
super(messageRepository, executionLogRoute);
}

public async execute(command: SendMessageCommand) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
} from '@novu/application-generic';
import { ChatOutput, ExecuteOutput } from '@novu/framework/internal';

import { CreateLog } from '../../../shared/logs';
import { SendMessageCommand } from './send-message.command';
import { SendMessageBase } from './send-message.base';
import { PlatformException } from '../../../shared/utils';
Expand All @@ -47,7 +46,6 @@ export class SendMessageChat extends SendMessageBase {
constructor(
protected subscriberRepository: SubscriberRepository,
protected messageRepository: MessageRepository,
protected createLogUsecase: CreateLog,
private compileTemplate: CompileTemplate,
protected selectIntegration: SelectIntegration,
protected getNovuProviderCredentials: GetNovuProviderCredentials,
Expand All @@ -57,7 +55,6 @@ export class SendMessageChat extends SendMessageBase {
) {
super(
messageRepository,
createLogUsecase,
executionLogRoute,
subscriberRepository,
selectIntegration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import { ExecutionDetailsSourceEnum, ExecutionDetailsStatusEnum } from '@novu/sh
import { InstrumentUsecase, DetailEnum, ExecutionLogRoute, ExecutionLogRouteCommand } from '@novu/application-generic';

import { SendMessageType } from './send-message-type.usecase';
import { CreateLog } from '../../../shared/logs';
import { SendMessageCommand } from './send-message.command';

@Injectable()
export class SendMessageDelay extends SendMessageType {
constructor(
protected messageRepository: MessageRepository,
protected createLogUsecase: CreateLog,
protected executionLogRoute: ExecutionLogRoute
) {
super(messageRepository, createLogUsecase, executionLogRoute);
super(messageRepository, executionLogRoute);
}

@InstrumentUsecase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
} from '@novu/application-generic';
import { EmailOutput } from '@novu/framework/internal';

import { CreateLog } from '../../../shared/logs';
import { SendMessageCommand } from './send-message.command';
import { SendMessageBase } from './send-message.base';
import { PlatformException } from '../../../shared/utils';
Expand All @@ -54,7 +53,6 @@ export class SendMessageEmail extends SendMessageBase {
protected subscriberRepository: SubscriberRepository,
protected messageRepository: MessageRepository,
protected layoutRepository: LayoutRepository,
protected createLogUsecase: CreateLog,
protected executionLogRoute: ExecutionLogRoute,
private compileEmailTemplateUsecase: CompileEmailTemplate,
protected selectIntegration: SelectIntegration,
Expand All @@ -65,7 +63,6 @@ export class SendMessageEmail extends SendMessageBase {
) {
super(
messageRepository,
createLogUsecase,
executionLogRoute,
subscriberRepository,
selectIntegration,
Expand Down
Loading
Loading