Files
immich/server/libs/domain/src/domain.module.ts
Jason Rasmussen 42a3149fe3 refactor(server): move asset upload job to domain (#1434)
* refactor: move to domain

* refactor: rename method

* Update comments

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-01-27 23:57:37 -06:00

39 lines
1.0 KiB
TypeScript

import { DynamicModule, Global, Module, ModuleMetadata, Provider } from '@nestjs/common';
import { APIKeyService } from './api-key';
import { AuthService } from './auth';
import { JobService } from './job';
import { OAuthService } from './oauth';
import { ShareService } from './share';
import { INITIAL_SYSTEM_CONFIG, SystemConfigService } from './system-config';
import { UserService } from './user';
const providers: Provider[] = [
APIKeyService,
AuthService,
JobService,
OAuthService,
SystemConfigService,
UserService,
ShareService,
{
provide: INITIAL_SYSTEM_CONFIG,
inject: [SystemConfigService],
useFactory: async (configService: SystemConfigService) => {
return configService.getConfig();
},
},
];
@Global()
@Module({})
export class DomainModule {
static register(options: Pick<ModuleMetadata, 'imports'>): DynamicModule {
return {
module: DomainModule,
imports: options.imports,
providers: [...providers],
exports: [...providers],
};
}
}