Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
r4zendev committed Jan 22, 2025
1 parent 01f5716 commit c1f300f
Show file tree
Hide file tree
Showing 39 changed files with 1,462 additions and 2,033 deletions.
1,920 changes: 980 additions & 940 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions services/workflows-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"@ballerine/common": "0.9.68",
"@ballerine/workflow-core": "0.6.87",
"@ballerine/workflow-node-sdk": "0.6.87",
"@bull-board/api": "^6.7.1",
"@bull-board/express": "^6.7.1",
"@bull-board/nestjs": "^6.7.1",
"@faker-js/faker": "^7.6.0",
"@nestjs/axios": "^2.0.0",
"@nestjs/bullmq": "^10.2.1",
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
19 changes: 4 additions & 15 deletions services/workflows-service/src/alert/alert.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@ import { AlertRepository } from '@/alert/alert.repository';
import { AlertService } from '@/alert/alert.service';
import { AlertControllerExternal } from '@/alert/alert.controller.external';
import { PrismaModule } from '@/prisma/prisma.module';
import {
WebhookHttpService,
WebhookManagerService,
} from '@/alert/webhook-manager/webhook-manager.service';
import { HttpModule, HttpService } from '@nestjs/axios';
import { AppLoggerService } from '@/common/app-logger/app-logger.service';
import axiosRetry from 'axios-retry';
import { isAxiosError } from 'axios';
import { getHttpStatusFromAxiosError, interceptAxiosRequests } from '@/common/http-service/utils';
import { WebhookEventEmitterService } from './webhook-manager/webhook-event-emitter.service';
import { ProjectModule } from '@/project/project.module';
import { UserRepository } from '@/user/user.repository';
import { AlertDefinitionModule } from '@/alert-definition/alert-definition.module';
import { SentryModule } from '@/sentry/sentry.module';
import { BullMqModule } from '@/bull-mq/bull-mq.module';
import { OutgoingWebhooksModule } from '@/webhooks/outgoing-webhooks/outgoing-webhooks.module';
import { WebhookModule } from '@/webhooks/webhook.module';

@Module({
imports: [
Expand All @@ -34,8 +28,7 @@ import { OutgoingWebhooksModule } from '@/webhooks/outgoing-webhooks/outgoing-we
PrismaModule,
SentryModule,
ProjectModule,
BullMqModule,
OutgoingWebhooksModule,
WebhookModule,
HttpModule.register({
timeout: 5000,
maxRedirects: 10,
Expand All @@ -52,20 +45,16 @@ import { OutgoingWebhooksModule } from '@/webhooks/outgoing-webhooks/outgoing-we
],
controllers: [AlertControllerInternal, AlertControllerExternal],
providers: [
WebhookHttpService,
AlertService,
AlertRepository,
AlertDefinitionRepository,
WebhookManagerService,
WebhookEventEmitterService,
BullMqModule,
OutgoingWebhooksModule,
WebhookModule,
// TODO: Export to user module
UserService,
UserRepository,
PasswordService,
],
exports: [ACLModule, AlertRepository, AlertService, WebhookEventEmitterService],
exports: [ACLModule, AlertRepository, AlertService],
})
export class AlertModule {
constructor(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

82 changes: 42 additions & 40 deletions services/workflows-service/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
import { MiddlewareConsumer, Module } from '@nestjs/common';
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
import { UserModule } from './user/user.module';
import { ACLModule } from '@/common/access-control/acl.module';
import { AuthModule } from './auth/auth.module';
import { HealthModule } from './health/health.module';
import { PrismaModule } from './prisma/prisma.module';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { ServeStaticModule } from '@nestjs/serve-static';
import { ServeStaticOptionsService } from './serve-static-options.service';
import { EndUserModule } from './end-user/end-user.module';
import { BusinessModule } from './business/business.module';
import { StorageModule } from './storage/storage.module';
import { MulterModule } from '@nestjs/platform-express';
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { FilterModule } from '@/filter/filter.module';
import { configs, env, serverEnvSchema } from '@/env';
import { SentryModule } from '@/sentry/sentry.module';
import { RequestIdMiddleware } from '@/common/middlewares/request-id.middleware';
import { AxiosRequestErrorInterceptor } from '@/common/interceptors/axios-request-error.interceptor';
import { AppLoggerModule } from '@/common/app-logger/app-logger.module';
import { MulterModule } from '@nestjs/platform-express';
import { ScheduleModule } from '@nestjs/schedule';
import { ServeStaticModule } from '@nestjs/serve-static';
import { ClsModule } from 'nestjs-cls';
import { z } from 'zod';

import { AlertModule } from '@/alert/alert.module';
import { BusinessReportModule } from '@/business-report/business-report.module';
import { CaseManagementModule } from '@/case-management/case-management.module';
import { CollectionFlowModule } from '@/collection-flow/collection-flow.module';
import { ACLModule } from '@/common/access-control/acl.module';
import { AppLoggerModule } from '@/common/app-logger/app-logger.module';
import { FiltersModule } from '@/common/filters/filters.module';
import { SessionAuthGuard } from '@/common/guards/session-auth.guard';
import { initHttpModule } from '@/common/http-service/http-config.service';
import { AxiosRequestErrorInterceptor } from '@/common/interceptors/axios-request-error.interceptor';
import { AdminKeyMiddleware } from '@/common/middlewares/admin-key.middleware';
import { AuthKeyMiddleware } from '@/common/middlewares/auth-key.middleware';
import { RequestIdMiddleware } from '@/common/middlewares/request-id.middleware';
import { UserSessionAuditMiddleware } from '@/common/middlewares/user-session-audit.middleware';
import { MetricsModule } from '@/metrics/metrics.module';
import { multerFactory } from '@/common/multer';
import { CustomerModule } from '@/customer/customer.module';
import { AuthKeyMiddleware } from '@/common/middlewares/auth-key.middleware';
import { DataMigrationModule } from '@/data-migration/data-migration.module';
import { configs, env, serverEnvSchema } from '@/env';
import { FilterModule } from '@/filter/filter.module';
import { MetricsModule } from '@/metrics/metrics.module';
import { NoteModule } from '@/note/note.module';
import { NotionModule } from '@/notion/notion.module';
import { ProjectModule } from '@/project/project.module';
import { AdminKeyMiddleware } from '@/common/middlewares/admin-key.middleware';
import { SessionAuthGuard } from '@/common/guards/session-auth.guard';
import { CollectionFlowModule } from '@/collection-flow/collection-flow.module';
import { SalesforceModule } from '@/salesforce/salesforce.module';
import { UiDefinitionModule } from '@/ui-definition/ui-definition.module';
import { multerFactory } from '@/common/multer';
import { initHttpMoudle } from '@/common/http-service/http-config.service';
import { DataMigrationModule } from '@/data-migration/data-migration.module';
import { CaseManagementModule } from '@/case-management/case-management.module';
import { WorkflowModule } from '@/workflow/workflow.module';
import { SecretsManagerModule } from '@/secrets-manager/secrets-manager.module';
import { SentryModule } from '@/sentry/sentry.module';
import { TransactionModule } from '@/transaction/transaction.module';
import { AlertModule } from '@/alert/alert.module';
import { SwaggerController } from './swagger/swagger.controller';
import { BusinessReportModule } from '@/business-report/business-report.module';
import { ScheduleModule } from '@nestjs/schedule';
import { UiDefinitionModule } from '@/ui-definition/ui-definition.module';
import { CronModule } from '@/workflow/cron/cron.module';
import z from 'zod';
import { WorkflowModule } from '@/workflow/workflow.module';

import { AuthModule } from './auth/auth.module';
import { BusinessModule } from './business/business.module';
import { hashKey } from './customer/api-key/utils';
import { EndUserModule } from './end-user/end-user.module';
import { HealthModule } from './health/health.module';
import { PrismaModule } from './prisma/prisma.module';
import { RuleEngineModule } from './rule-engine/rule-engine.module';
import { NotionModule } from '@/notion/notion.module';
import { SecretsManagerModule } from '@/secrets-manager/secrets-manager.module';
import { NoteModule } from '@/note/note.module';
import { ServeStaticOptionsService } from './serve-static-options.service';
import { StorageModule } from './storage/storage.module';
import { SwaggerController } from './swagger/swagger.controller';
import { UserModule } from './user/user.module';
import { WebhookModule } from './webhooks/webhook.module';

export const validate = async (config: Record<string, unknown>) => {
const zodEnvSchema = z
Expand Down Expand Up @@ -90,7 +93,7 @@ export const validate = async (config: Record<string, unknown>) => {
EventEmitterModule.forRoot(),
UserModule,
WorkflowModule,
WebhooksModule,
WebhookModule,
NoteModule,
UiDefinitionModule,
StorageModule,
Expand Down Expand Up @@ -128,11 +131,10 @@ export const validate = async (config: Record<string, unknown>) => {
BusinessReportModule,
CronModule,
ScheduleModule.forRoot(),
initHttpMoudle(),
initHttpModule(),
RuleEngineModule,
NotionModule,
SecretsManagerModule,
BullMqModule,
],
providers: [
{
Expand Down
Loading

0 comments on commit c1f300f

Please sign in to comment.