refactor(services): rename module services

This commit is contained in:
Aleksandr Bukhalo 2020-01-12 10:53:45 +03:00
parent b67b859810
commit ec99dcd65f
5 changed files with 11 additions and 15 deletions

View File

@ -1 +1 @@
export * from './invalid-configuration.exeption';
export * from './invalid-configuration.exeption'

View File

@ -1,5 +1,5 @@
export * from './telegraf.module'
export * from './interfaces'
export * from './decorators'
export * from './telegraf-bot.service'
export * from './telegraf-telegram-client.service'
export * from './telegraf.service'
export * from './telegraf-telegram.service'

View File

@ -5,7 +5,7 @@ import { TokenInjectionToken } from './telegraf.constants'
import { TelegrafOptionsFactory } from './interfaces'
@Injectable()
export class TelegrafTelegramClientService {
export class TelegrafTelegramService {
private telegram: any
public constructor(

View File

@ -1,11 +1,7 @@
import { Module, DynamicModule, Provider } from '@nestjs/common'
import { TelegrafBotService } from './telegraf-bot.service'
import {
TelegrafModuleAsyncOptions,
TelegrafOptionsFactory,
} from './interfaces'
import { TelegrafModuleAsyncOptions, TelegrafOptionsFactory } from './interfaces'
import { TELEGRAF_MODULE_OPTIONS, TokenInjectionToken } from './telegraf.constants'
import { TelegrafTelegramClientService } from './telegraf-telegram-client.service'
import { TelegrafService, TelegrafTelegramService } from './'
@Module({})
export class TelegrafModule {
@ -15,14 +11,14 @@ export class TelegrafModule {
imports: options.imports || [],
providers: [
...this.createAsyncProviders(options),
TelegrafBotService,
TelegrafTelegramClientService,
TelegrafService,
TelegrafTelegramService,
{
provide: TokenInjectionToken,
useClass: options.useClass,
},
],
exports: [TelegrafBotService, TelegrafTelegramClientService],
exports: [TelegrafService, TelegrafTelegramService],
}
}

View File

@ -14,8 +14,8 @@ import {
import { InvalidConfigurationException } from './exeptions'
@Injectable()
export class TelegrafBotService {
private readonly logger = new Logger(TelegrafBotService.name, true)
export class TelegrafService {
private readonly logger = new Logger(TelegrafService.name, true)
private readonly sitePublicUrl?: string
private readonly bot: Telegraf<ContextMessageUpdate>
private ref: ModuleRef