@nestjs/common#forwardRef TypeScript Examples

The following examples show how to use @nestjs/common#forwardRef. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: user.service.ts    From 42_checkIn with GNU General Public License v3.0 7 votes vote down vote up
constructor(
    private readonly authService: AuthService,
    private readonly userRepository: UserRepository,
    private readonly cardRepository: CardRepository,
    @Inject(forwardRef(() => CardService))
    private readonly cardServcie: CardService,
    private readonly logService: LogService,
    private readonly logger: MyLogger,
    private readonly configService: ConfigService,
    private readonly httpService: HttpService,
    private readonly waitingService: WaitingService,
    private readonly waitingRepository: WaitingRepository,
  ) {}
Example #2
Source File: module.base.template.ts    From amplication with Apache License 2.0 6 votes vote down vote up
@Module({
  imports: [
    ACLModule,
    forwardRef(() => AuthModule),
    MorganModule,
    PrismaModule,
  ],

  exports: [ACLModule, AuthModule, MorganModule, PrismaModule],
})
export class MODULE_BASE {}
Example #3
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    LanguageModule,
    forwardRef(() => UserModule),
    TypeOrmModule.forFeature([
      MessageRepository,
      MessageTemplateRepository,
      MessageKeyRepository,
    ]),
  ],
  controllers: [MessageController],
  exports: [MessageService, MessageKeyService, MessageTemplateService],
  providers: [MessageService, MessageKeyService, MessageTemplateService],
})
export class MessageModule {}
Example #4
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    HttpModule,
    forwardRef(() => UserModule),
    forwardRef(() => TransactionModule),
    forwardRef(() => BillModule),
    TypeOrmModule.forFeature([CurrencyRepository]),
  ],
  controllers: [CurrencyController],
  exports: [CurrencyService, CurrencyCron],
  providers: [CurrencyService, CurrencyCron],
})
export class CurrencyModule {}
Example #5
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    MessageModule,
    LanguageModule,
    forwardRef(() => TransactionModule),
    forwardRef(() => UserModule),
    forwardRef(() => CurrencyModule),
    TypeOrmModule.forFeature([
      BillRepository,
      CurrencyRepository,
      TransactionRepository,
    ]),
  ],
  controllers: [BillController],
  exports: [BillService],
  providers: [BillService, BillSubscriber],
})
export class BillModule {}
Example #6
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    forwardRef(() => UserModule),
    PassportModule.register({ defaultStrategy: 'jwt' }),
  ],
  controllers: [AuthController],
  providers: [AuthService, JwtStrategy, JwtResetPasswordStrategy],
  exports: [PassportModule.register({ defaultStrategy: 'jwt' }), AuthService],
})
export class AuthModule {}
Example #7
Source File: tasks.module.ts    From codeclannigeria-backend with MIT License 6 votes vote down vote up
@Module({
  imports: [
    TaskModel,
    forwardRef(() => StagesModule),
    CoursesModule,
    TrackMentorModel,
    SubmissionModel,
    TracksModule,
    UsersModule,
    UserStageModel,
    MentorMenteeModel
  ],
  providers: [TasksService, MailService, baseService],
  controllers: [TasksController],
  exports: [TaskModel, TasksService, baseService]
})
export class TasksModule {}
Example #8
Source File: build.service.ts    From amplication with Apache License 2.0 6 votes vote down vote up
constructor(
    private readonly configService: ConfigService,
    private readonly prisma: PrismaService,
    private readonly storageService: StorageService,
    private readonly entityService: EntityService,
    private readonly appRoleService: AppRoleService,
    private readonly actionService: ActionService,
    private readonly containerBuilderService: ContainerBuilderService,
    private readonly localDiskService: LocalDiskService,
    private readonly deploymentService: DeploymentService,
    private readonly gitService: GitService,
    @Inject(forwardRef(() => AppService))
    private readonly appService: AppService,
    private readonly appSettingsService: AppSettingsService,
    private readonly userService: UserService,

    @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: winston.Logger
  ) {
    /** @todo move this to storageService config once possible */
    this.storageService.registerDriver('gcs', GoogleCloudStorage);
  }
Example #9
Source File: build.module.ts    From amplication with Apache License 2.0 6 votes vote down vote up
// eslint-disable-next-line import/no-cycle

@Module({
  imports: [
    ConfigModule,
    ExceptionFiltersModule,
    GqlAuthModule,
    EntityModule,
    PrismaModule,
    PermissionsModule,
    UserModule,
    RootStorageModule,
    AppRoleModule,
    ActionModule,
    ContainerBuilderRootModule,
    StorageOptionsModule,
    DeploymentModule,
    GitModule,
    forwardRef(() => AppModule),
    AppSettingsModule
  ],
  providers: [BuildService, BuildResolver],
  exports: [BuildService, BuildResolver],
  controllers: [BuildController]
})
export class BuildModule {}
Example #10
Source File: auth.service.ts    From amplication with Apache License 2.0 6 votes vote down vote up
constructor(
    private readonly jwtService: JwtService,
    private readonly passwordService: PasswordService,
    private readonly prismaService: PrismaService,
    private readonly accountService: AccountService,
    private readonly userService: UserService,
    @Inject(forwardRef(() => WorkspaceService))
    private readonly workspaceService: WorkspaceService
  ) {}
Example #11
Source File: app.module.ts    From amplication with Apache License 2.0 6 votes vote down vote up
@Module({
  imports: [
    PrismaModule,
    PermissionsModule,
    UserModule,
    EntityModule,
    forwardRef(() => BuildModule),
    EnvironmentModule,
    CommitModule,
    BlockModule,
    GitModule
  ],
  providers: [AppService, AppResolver],
  exports: [AppService, AppResolver]
})
export class AppModule {}
Example #12
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    LanguageModule,
    forwardRef(() => UserModule),
    forwardRef(() => CurrencyModule),
    forwardRef(() => BillModule),
    TypeOrmModule.forFeature([
      TransactionRepository,
      BillRepository,
      CurrencyRepository,
    ]),
  ],
  controllers: [TransactionController],
  exports: [TransactionService],
  providers: [TransactionService],
})
export class TransactionModule {}
Example #13
Source File: index.ts    From bank-server with MIT License 6 votes vote down vote up
@Module({
  imports: [
    forwardRef(() => MessageModule),
    forwardRef(() => CurrencyModule),
    forwardRef(() => BillModule),
    forwardRef(() => AuthModule),
    forwardRef(() => TransactionModule),
    TypeOrmModule.forFeature([
      UserRepository,
      UserAuthRepository,
      UserConfigRepository,
      UserAuthForgottenPasswordRepository,
      BillRepository,
      CurrencyRepository,
      TransactionRepository,
    ]),
  ],
  controllers: [UserController],
  exports: [
    UserAuthService,
    UserConfigService,
    UserService,
    UserAuthForgottenPasswordService,
  ],
  providers: [
    UserAuthService,
    UserConfigService,
    UserService,
    UserAuthForgottenPasswordService,
  ],
})
export class UserModule {}
Example #14
Source File: default-scan-worker.service.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(
    private readonly projectAttributionService: ProjectAttributionService,
    private readonly projectService: ProjectService,
    private readonly scanService: ScanService,
    private readonly scanLogService: ScanLogService,
    @Inject(forwardRef(() => ScanCodeService))
    private readonly scanCodeService: ScanCodeService,
    @Inject(forwardRef(() => LicenseCheckerService))
    private readonly licenseCheckerService: LicenseCheckerService,
    @Inject(forwardRef(() => LicenseMavenService))
    private readonly licenseMavenService: LicenseMavenService,
    @Inject(forwardRef(() => LicenseNugetService))
    private readonly licenseNugetService: LicenseNugetService,
    @Inject(forwardRef(() => DependencyCheckService))
    private readonly dependencyCheckService: DependencyCheckService,
    @Inject(forwardRef(() => NvdCheckService))
    private readonly nvdCheckService: NvdCheckService,
    private readonly golangService: GolangService,
    private readonly mavenService: MavenService,
    private readonly npmService: NpmService,
    private readonly nugetService: NugetService,
    private readonly python3Service: Python3PipService,
    private readonly python3PipLicensesService: Python3PipLicensesService,
    private readonly goLicenseService: GoLicensesService,
  ) {}
Example #15
Source File: services.module.ts    From barista with Apache License 2.0 6 votes vote down vote up
@Module({
  imports: [
    forwardRef(() => AppOrmModule),
    AppQueueModule,
    PassportModule,
    CqrsModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: '28800s' },
    }),
  ],
  exports: services,
  providers: [...services, ...CommandHandlers],
  controllers: [],
})
export class ServicesModule {}
Example #16
Source File: scan.service.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(
    @Inject(forwardRef(() => LicenseScanResultService))
    private readonly licenseScanResultService: LicenseScanResultService,
    @Inject(forwardRef(() => LicenseScanResultItemService))
    private licenseScanResultItemService: LicenseScanResultItemService,
    @Inject(forwardRef(() => SecurityScanResultService))
    private readonly securityScanResultService: SecurityScanResultService,
    @Inject(forwardRef(() => SecurityScanResultItemService))
    private readonly securityScanResultItemService: SecurityScanResultItemService,
    @Inject(forwardRef(() => BomManualLicenseService))
    private readonly bomManualLicenseService: BomManualLicenseService,
    @Inject(forwardRef(() => BomLicenseExceptionService))
    private readonly bomLicenseExceptionService: BomLicenseExceptionService,
    @Inject(forwardRef(() => BomSecurityExceptionService))
    private readonly bomSecurityExceptionService: BomSecurityExceptionService,
    @Inject(forwardRef(() => ProjectService))
    @Inject(forwardRef(() => ProjectAttributionService))
    private readonly projectService: ProjectService,
    @InjectRepository(Scan) repo,
    @InjectQueue('scan-queue') readonly queue: Queue,
  ) {
    super(repo);
  }
Example #17
Source File: project.service.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(
    @Inject(forwardRef(() => ScanService))
    private readonly scanService: ScanService,
    @Inject(forwardRef(() => BomManualLicenseService))
    private readonly bomManualLicenseService: BomManualLicenseService,
    @Inject(forwardRef(() => ProjectAttributionService))
    private readonly projectAttributionService: ProjectAttributionService,
    @InjectRepository(Project) repo,
  ) {
    super(repo);
  }
Example #18
Source File: waiting.module.ts    From 42_checkIn with GNU General Public License v3.0 6 votes vote down vote up
@Module({
  imports: [
    AuthModule,
    TypeOrmModule.forFeature([WaitingRepository]),
    forwardRef(() => UserModule),
    CardModule,
    // MailerModule,
  ],
  providers: [WaitingService],
  controllers: [WaitingController],
  exports: [WaitingService, TypeOrmModule],
})
export class WaitingModule {}
Example #19
Source File: user.module.ts    From 42_checkIn with GNU General Public License v3.0 6 votes vote down vote up
@Module({
  imports: [
    AuthModule,
    TypeOrmModule.forFeature([UserRepository]),
    forwardRef(() => CardModule),
    forwardRef(() => LogModule),
    LoggerModule,
    HttpModule,
    ConfigModule,
    forwardRef(() => WaitingModule),
  ],
  controllers: [UserController],
  providers: [UserService],
  exports: [TypeOrmModule, UserService],
})
export class UserModule {}
Example #20
Source File: log.module.ts    From 42_checkIn with GNU General Public License v3.0 6 votes vote down vote up
@Module({
  imports: [
    TypeOrmModule.forFeature([LogRepository]),
    forwardRef(() => UserModule),
    LoggerModule,
  ],
  providers: [LogService],
  controllers: [LogController],
  exports: [LogService],
})
export class LogModule {}
Example #21
Source File: card.module.ts    From 42_checkIn with GNU General Public License v3.0 6 votes vote down vote up
@Module({
  imports: [
    TypeOrmModule.forFeature([CardRepository]),
    AuthModule,
    forwardRef(() => UserModule),
    LoggerModule,
  ],
  controllers: [CardController],
  providers: [CardService],
  exports: [CardService, TypeOrmModule],
})
export class CardModule {}
Example #22
Source File: user-auth.service.ts    From bank-server with MIT License 5 votes vote down vote up
constructor(
    private readonly _userAuthRepository: UserAuthRepository,
    private readonly _userRepostiory: UserRepository,
    @Inject(forwardRef(() => UserService))
    private readonly _userService: UserService,
    private readonly _userConfigService: UserConfigService,
  ) {}
Example #23
Source File: message.service.ts    From bank-server with MIT License 5 votes vote down vote up
constructor(
    private readonly _messageRepository: MessageRepository,
    @Inject(forwardRef(() => MessageKeyService))
    private readonly _messageKeyService: MessageKeyService,
    @Inject(forwardRef(() => MessageTemplateService))
    private readonly _messageTemplateService: MessageTemplateService,
    private readonly _userService: UserService,
  ) {}
Example #24
Source File: stages.module.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@Module({
  imports: [StageModel, TracksModule, forwardRef(() => TasksModule)],
  providers: [StagesService, baseService],
  controllers: [StagesController],
  exports: [StageModel, StagesService, baseService]
})
export class StagesModule {}
Example #25
Source File: auth.module.ts    From amplication with Apache License 2.0 5 votes vote down vote up
@Module({
  imports: [
    forwardRef(() => UserModule),
    PassportModule,
    SecretsManagerModule,
    JwtModule.registerAsync({
      imports: [SecretsManagerModule],
      inject: [SecretsManagerService, ConfigService],
      useFactory: async (
        secretsService: SecretsManagerService,
        configService: ConfigService
      ) => {
        const secret = await secretsService.getSecret<string>(JWT_SECRET_KEY);
        const expiresIn = configService.get(JWT_EXPIRATION);
        if (!secret) {
          throw new Error("Didn't get a valid jwt secret");
        }
        if (!expiresIn) {
          throw new Error("Jwt expire in value is not valid");
        }
        return {
          secret: secret,
          signOptions: { expiresIn },
        };
      },
    }),
  ],
  providers: [
    AuthService,
    BasicStrategy,
    PasswordService,
    AuthResolver,
    JwtStrategy,
    jwtSecretFactory,
    TokenService,
  ],
  controllers: [AuthController],
  exports: [AuthService, PasswordService],
})
export class AuthModule {}
Example #26
Source File: dashboard.module.ts    From uniauth-backend with MIT License 5 votes vote down vote up
@Module({
  imports: [forwardRef(() => UserModule), ApplicationModule],
  controllers: [DashboardController],
  providers: [DashboardService, DashboardController],
  exports: [DashboardController],
})
export class DashboardModule {}
Example #27
Source File: card.service.ts    From 42_checkIn with GNU General Public License v3.0 5 votes vote down vote up
constructor(
    private readonly cardRepository: CardRepository,
    @Inject(forwardRef(() => UserService))
    private readonly userService: UserService,
    private readonly logger: MyLogger,
  ) {}