Commit e86d2d88 authored by Revant Nandgaonkar's avatar Revant Nandgaonkar

update: root and packages

Merge branch 'update-dependencies' into 'develop'

See merge request castlecraft/building-blocks!304
parents e31de672 a4ceb9f3
This diff is collapsed.
......@@ -20,29 +20,29 @@
"test:e2e": "export NODE_ENV=test-e2e && jest --config ./tests/jest-e2e.json --detectOpenHandles --forceExit"
},
"dependencies": {
"@nestjs/common": "^6.2.4",
"@nestjs/core": "^6.2.4",
"@nestjs/common": "^6.3.1",
"@nestjs/core": "^6.3.1",
"@nestjs/cqrs": "^6.0.0",
"@nestjs/microservices": "^6.2.4",
"@nestjs/microservices": "^6.3.1",
"@nestjs/mongoose": "^6.1.2",
"@nestjs/platform-express": "^6.2.4",
"@nestjs/platform-express": "^6.3.1",
"@nestjs/swagger": "^3.0.2",
"@nestjs/websockets": "^6.2.4",
"bull": "^3.9.1",
"@nestjs/websockets": "^6.3.1",
"bull": "^3.10.0",
"class-transformer": "^0.2.3",
"class-validator": "^0.9.1",
"connect-mongo": "^2.0.3",
"cookie-parser": "^1.4.4",
"dotenv": "^8.0.0",
"express": "^4.17.1",
"express-rate-limit": "^4.0.2",
"express-rate-limit": "^5.0.0",
"express-session": "^1.16.1",
"hbs": "^4.0.4",
"helmet": "^3.18.0",
"i18n": "^0.8.3",
"joi": "^14.3.1",
"mongodb": "^3.2.6",
"mongoose": "^5.5.11",
"mongodb": "^3.2.7",
"mongoose": "^5.5.14",
"node-jose": "^1.1.3",
"oauth2orize": "^1.11.0",
"oauth2orize-openid": "^0.4.0",
......@@ -57,32 +57,32 @@
"reflect-metadata": "^0.1.13",
"rxjs": "^6.5.2",
"speakeasy": "^2.0.0",
"swagger-ui-express": "^4.0.5",
"swagger-ui-express": "^4.0.6",
"uuid": "^3.3.2"
},
"devDependencies": {
"@nestjs/testing": "^6.2.4",
"@nestjs/testing": "^6.3.1",
"@types/bull": "^3.5.14",
"@types/connect-mongo": "0.0.42",
"@types/express": "^4.16.1",
"@types/express": "^4.17.0",
"@types/jest": "^24.0.13",
"@types/joi": "^14.3.3",
"@types/mongoose": "^5.5.3",
"@types/node": "^12.0.3",
"@types/mongoose": "^5.5.5",
"@types/node": "^12.0.7",
"@types/oauth": "^0.9.1",
"@types/passport-local": "^1.0.33",
"@types/supertest": "^2.0.7",
"jest": "^24.8.0",
"nodemon": "^1.19.1",
"prettier": "^1.17.1",
"prettier": "^1.18.2",
"prettier-check": "^2.0.0",
"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"ts-loader": "^6.0.1",
"ts-loader": "^6.0.2",
"ts-node": "^8.2.0",
"tsconfig-paths": "^3.8.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "^5.17.0",
"typescript": "^3.5.1"
},
"jest": {
"testEnvironment": "node",
......
import { Module, NestModule, MiddlewareConsumer, Global } from '@nestjs/common';
import {
Module,
NestModule,
MiddlewareConsumer,
Global,
HttpModule,
} from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import { OAuth2orizeSetup } from './middlewares/oauth2orize.setup';
import { OAuth2ConfirmationMiddleware } from './middlewares/oauth2-confirmation.middleware';
......@@ -28,7 +34,13 @@ import { OAuth2ErrorFilter } from '../common/filters/oauth2-error.filter';
@Global()
@Module({
imports: [CqrsModule, AuthEntitiesModule, OAuth2Module, PassportModule],
imports: [
CqrsModule,
AuthEntitiesModule,
OAuth2Module,
PassportModule,
HttpModule,
],
providers: [
...authServices,
......
import { Module, HttpModule } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { AuthorizationCodeService } from './authorization-code/authorization-code.service';
import {
AuthorizationCode,
AUTHORIZATION_CODE,
} from './authorization-code/authorization-code.schema';
import { BearerToken, BEARER_TOKEN } from './bearer-token/bearer-token.schema';
import { BearerTokenService } from './bearer-token/bearer-token.service';
import { OIDCKey, OIDC_KEY } from './oidc-key/oidc-key.schema';
import { OIDCKeyService } from './oidc-key/oidc-key.service';
import { SocialLogin, SOCIAL_LOGIN } from './social-login/social-login.schema';
import { SocialLoginService } from './social-login/social-login.service';
import { SessionService } from './session/session.service';
import { Session, SESSION } from './session/session.schema';
import { AuthModuleEntities } from './entities';
@Module({
imports: [
MongooseModule.forFeature([
{ name: AUTHORIZATION_CODE, schema: AuthorizationCode },
{ name: BEARER_TOKEN, schema: BearerToken },
{ name: OIDC_KEY, schema: OIDCKey },
{ name: SOCIAL_LOGIN, schema: SocialLogin },
{ name: SESSION, schema: Session },
]),
HttpModule,
],
imports: [MongooseModule.forFeature(AuthModuleEntities), HttpModule],
providers: [
AuthorizationCodeService,
BearerTokenService,
......@@ -33,6 +17,7 @@ import { Session, SESSION } from './session/session.schema';
SessionService,
],
exports: [
MongooseModule.forFeature(AuthModuleEntities),
AuthorizationCodeService,
BearerTokenService,
OIDCKeyService,
......
import {
AuthorizationCode,
AUTHORIZATION_CODE,
} from './authorization-code/authorization-code.schema';
import { BearerToken, BEARER_TOKEN } from './bearer-token/bearer-token.schema';
import { OIDCKey, OIDC_KEY } from './oidc-key/oidc-key.schema';
import { SocialLogin, SOCIAL_LOGIN } from './social-login/social-login.schema';
import { Session, SESSION } from './session/session.schema';
export const AuthModuleEntities = [
{ name: AUTHORIZATION_CODE, schema: AuthorizationCode },
{ name: BEARER_TOKEN, schema: BearerToken },
{ name: OIDC_KEY, schema: OIDCKey },
{ name: SOCIAL_LOGIN, schema: SocialLogin },
{ name: SESSION, schema: Session },
];
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { Client, CLIENT } from './client/client.schema';
import { ClientService } from './client/client.service';
import { SCOPE, Scope } from './scope/scope.schema';
import { ScopeService } from './scope/scope.service';
import { ClientManagementModuleEntities } from './entities';
@Module({
imports: [
MongooseModule.forFeature([
{ name: CLIENT, schema: Client },
{ name: SCOPE, schema: Scope },
]),
],
imports: [MongooseModule.forFeature(ClientManagementModuleEntities)],
providers: [ClientService, ScopeService],
exports: [ClientService, ScopeService],
exports: [
ClientService,
ScopeService,
MongooseModule.forFeature(ClientManagementModuleEntities),
],
})
export class ClientManagementEntitiesModule {}
import { Client, CLIENT } from './client/client.schema';
import { SCOPE, Scope } from './scope/scope.schema';
export const ClientManagementModuleEntities = [
{ name: CLIENT, schema: Client },
{ name: SCOPE, schema: Scope },
];
import { Module, HttpModule } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import {
SERVER_SETTINGS,
ServerSettings,
} from './server-settings/server-settings.schema';
import { ServerSettingsService } from './server-settings/server-settings.service';
import { SystemSettingsModuleEntites } from './entities';
@Module({
imports: [
MongooseModule.forFeature([
{ name: SERVER_SETTINGS, schema: ServerSettings },
]),
HttpModule,
],
imports: [MongooseModule.forFeature(SystemSettingsModuleEntites), HttpModule],
providers: [ServerSettingsService],
exports: [ServerSettingsService],
exports: [
ServerSettingsService,
MongooseModule.forFeature(SystemSettingsModuleEntites),
],
})
export class SystemSettingsEntitiesModule {}
import {
SERVER_SETTINGS,
ServerSettings,
} from './server-settings/server-settings.schema';
export const SystemSettingsModuleEntites = [
{ name: SERVER_SETTINGS, schema: ServerSettings },
];
......@@ -7,10 +7,11 @@ import { SystemSettingsManagementService } from './aggregates/system-settings-ma
import { SystemSettingsCommandHandlers } from './commands';
import { SystemSettingsEventHandlers } from './events';
import { AuthEntitiesModule } from '../auth/entities/entities.module';
import { CqrsModule } from '@nestjs/cqrs';
@Global()
@Module({
imports: [SystemSettingsEntitiesModule, AuthEntitiesModule],
imports: [SystemSettingsEntitiesModule, AuthEntitiesModule, CqrsModule],
exports: [SystemSettingsEntitiesModule],
providers: [
SetupService,
......
import { Module, HttpModule } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { USER, User } from './user/user.schema';
import { UserService } from './user/user.service';
import { ROLE, Role } from './role/role.schema';
import { AUTH_DATA, AuthData } from './auth-data/auth-data.schema';
import { RoleService } from './role/role.service';
import { SignupService } from '../aggregates/signup/signup.service';
import { AuthDataService } from './auth-data/auth-data.service';
import { UserManagementModuleEntities } from './entities';
@Module({
imports: [
MongooseModule.forFeature([
{ name: ROLE, schema: Role },
{ name: USER, schema: User },
{ name: AUTH_DATA, schema: AuthData },
]),
MongooseModule.forFeature(UserManagementModuleEntities),
HttpModule,
],
providers: [RoleService, UserService, AuthDataService, SignupService],
exports: [RoleService, UserService, AuthDataService, SignupService],
exports: [
RoleService,
UserService,
AuthDataService,
SignupService,
MongooseModule.forFeature(UserManagementModuleEntities),
],
})
export class UserManagementEntitiesModule {}
import { USER, User } from './user/user.schema';
import { ROLE, Role } from './role/role.schema';
import { AUTH_DATA, AuthData } from './auth-data/auth-data.schema';
export const UserManagementModuleEntities = [
{ name: ROLE, schema: Role },
{ name: USER, schema: User },
{ name: AUTH_DATA, schema: AuthData },
];
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import { UserManagementEntitiesModule } from './entities/entities.module';
import { UserManagementEventHandlers } from './events';
......@@ -14,6 +14,7 @@ import { UserManagementQueryHandlers } from './queries';
@Module({
imports: [
CqrsModule,
HttpModule,
// Entities
UserManagementEntitiesModule,
],
......
......@@ -230,9 +230,12 @@ describe('OAuth2Controller (e2e)', () => {
});
it('/GET /oauth2/confirmation (OIDC IDToken Grant)', done => {
const authRequest = `/oauth2/confirmation?scope=openid&response_type=id_token&client_id=${clientId}&redirect_uri=${
redirectUris[0]
}&state=420&nonce=tHc_Cbd`;
let authRequest = '/oauth2/confirmation?scope=openid';
authRequest += '&response_type=id_token';
authRequest += '&client_id=' + clientId;
authRequest += '&redirect_uri=' + redirectUris[0];
authRequest += '&state=420&nonce=tHc_Cbd';
const req = request(app.getHttpServer()).get(authRequest);
req.cookies = Cookies;
return req.end((err, response) => {
......@@ -249,9 +252,12 @@ describe('OAuth2Controller (e2e)', () => {
});
it('/GET /oauth2/confirmation (OIDC IDToken Token Grant)', done => {
const authRequest = `/oauth2/confirmation?scope=openid&response_type=id_token%20token&client_id=${clientId}&redirect_uri=${
redirectUris[0]
}&state=420&nonce=tHc_Cbd`;
let authRequest = '/oauth2/confirmation?scope=openid';
authRequest += '&response_type=id_token%20token';
authRequest += '&client_id=' + clientId;
authRequest += '&redirect_uri=' + redirectUris[0];
authRequest += '&state=420&nonce=tHc_Cbd';
const req = request(app.getHttpServer()).get(authRequest);
req.cookies = Cookies;
return req.expect(302).end((err, response) => {
......@@ -273,9 +279,12 @@ describe('OAuth2Controller (e2e)', () => {
});
it('/GET /oauth2/confirmation (OIDC Code IDToken Grant)', done => {
const authRequest = `/oauth2/confirmation?scope=openid&response_type=code%20id_token&client_id=${clientId}&redirect_uri=${
redirectUris[0]
}&state=420&nonce=tHc_Cbd`;
let authRequest = '/oauth2/confirmation?scope=openid';
authRequest += '&response_type=code%20id_token';
authRequest += '&client_id=' + clientId;
authRequest += '&redirect_uri=' + redirectUris[0];
authRequest += '&state=420&nonce=tHc_Cbd';
const req = request(app.getHttpServer()).get(authRequest);
req.cookies = Cookies;
return req.expect(302).end((err, response) => {
......@@ -294,9 +303,12 @@ describe('OAuth2Controller (e2e)', () => {
});
it('/GET /oauth2/confirmation (OIDC Code Token Grant)', done => {
const authRequest = `/oauth2/confirmation?scope=openid&response_type=code%20token&client_id=${clientId}&redirect_uri=${
redirectUris[0]
}&state=420&nonce=tHc_Cbd`;
let authRequest = '/oauth2/confirmation?scope=openid';
authRequest += '&response_type=code%20token';
authRequest += '&client_id=' + clientId;
authRequest += '&redirect_uri=' + redirectUris[0];
authRequest += '&state=420&nonce=tHc_Cbd';
const req = request(app.getHttpServer()).get(authRequest);
req.cookies = Cookies;
return req.expect(302).end((err, response) => {
......@@ -315,9 +327,12 @@ describe('OAuth2Controller (e2e)', () => {
});
it('/GET /oauth2/confirmation (OIDC Code IDToken Token Grant)', done => {
const authRequest = `/oauth2/confirmation?scope=openid&response_type=code%20id_token%20token&client_id=${clientId}&redirect_uri=${
redirectUris[0]
}&state=420&nonce=tHc_Cbd`;
let authRequest = '/oauth2/confirmation?scope=openid';
authRequest += '&response_type=code%20id_token%20token';
authRequest += '&client_id=' + clientId;
authRequest += '&redirect_uri=' + redirectUris[0];
authRequest += '&state=420&nonce=tHc_Cbd';
const req = request(app.getHttpServer()).get(authRequest);
req.cookies = Cookies;
return req.expect(302).end((err, response) => {
......
This diff is collapsed.
......@@ -15,45 +15,45 @@
},
"private": true,
"dependencies": {
"@nestjs/common": "^6.2.4",
"@nestjs/core": "^6.2.4",
"@nestjs/common": "^6.3.1",
"@nestjs/core": "^6.3.1",
"@nestjs/cqrs": "^6.0.0",
"@nestjs/microservices": "^6.2.4",
"@nestjs/platform-express": "^6.2.4",
"@nestjs/microservices": "^6.3.1",
"@nestjs/platform-express": "^6.3.1",
"@nestjs/swagger": "^3.0.2",
"@nestjs/typeorm": "^6.1.1",
"aws-sdk": "^2.464.0",
"@nestjs/typeorm": "^6.1.2",
"aws-sdk": "^2.471.0",
"class-transformer": "^0.2.3",
"class-validator": "^0.9.1",
"cron": "^1.7.1",
"express": "^4.17.1",
"fastify-formbody": "^3.1.0",
"joi": "^14.3.1",
"mongodb": "^3.2.6",
"mongodb": "^3.2.7",
"nodemailer": "^6.2.1",
"nodemailer-express-handlebars": "^3.0.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^6.5.2",
"swagger-ui-express": "^4.0.5",
"typeorm": "^0.2.17"
"swagger-ui-express": "^4.0.6",
"typeorm": "^0.2.18"
},
"devDependencies": {
"@nestjs/testing": "^6.2.4",
"@types/express": "^4.16.1",
"@nestjs/testing": "^6.3.1",
"@types/express": "^4.17.0",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.3",
"@types/node": "^12.0.7",
"@types/supertest": "^2.0.7",
"jest": "^24.8.0",
"nodemon": "^1.19.1",
"prettier": "^1.17.1",
"prettier": "^1.18.2",
"prettier-check": "^2.0.0",
"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"ts-loader": "^6.0.1",
"ts-loader": "^6.0.2",
"ts-node": "^8.2.0",
"tsconfig-paths": "^3.8.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "^5.17.0",
"typescript": "^3.5.1"
},
"jest": {
"moduleDirectories": [
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import { CloudStorageEntitiesModule } from './entities/entities.module';
import { CloudStorageAggregates } from './aggregates';
......@@ -9,7 +9,7 @@ import { ModifyCloudStorageAggregateService } from './aggregates/modify-cloud-st
@Global()
@Module({
imports: [CloudStorageEntitiesModule, CqrsModule],
imports: [CloudStorageEntitiesModule, CqrsModule, HttpModule],
providers: [
...CloudStorageAggregates,
...CloudStorageCommands,
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { CqrsModule } from '@nestjs/cqrs';
import { EmailEntitiesModule } from './entities/entities.module';
import { EmailController } from './controllers/email/email.controller';
......@@ -9,7 +9,7 @@ import { EmailCommandHandlers } from './commands';
@Global()
@Module({
imports: [CqrsModule, EmailEntitiesModule],
imports: [CqrsModule, EmailEntitiesModule, HttpModule],
providers: [
EmailService,
...EmailAggregates,
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Oauth2ProviderController } from './controllers/oauth2-provider/oauth2-provider.controller';
import { OAuth2Provider } from './entities/oauth2-provider/oauth2-provider.entity';
......@@ -8,10 +8,15 @@ import { OAuth2ClientCommandHandlers } from './commands';
import { OAuth2ClientQueryHandlers } from './queries';
import { OAuth2ClientEventHandlers } from './events';
import { OAuth2Token } from './entities/oauth2-token/oauth2-token.entity';
import { CqrsModule } from '@nestjs/cqrs';
Global();
@Module({
imports: [TypeOrmModule.forFeature([OAuth2Provider, OAuth2Token])],
imports: [
TypeOrmModule.forFeature([OAuth2Provider, OAuth2Token]),
CqrsModule,
HttpModule,
],
providers: [
...OAuth2ClientEntityProviders,
...OAuth2ClientAggregates,
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { SystemSettingsEntitiesModule } from './entities/entities.module';
import { SettingsController } from './controllers/settings/settings.controller';
import { SetupController } from './controllers/setup/setup.controller';
......@@ -7,7 +7,7 @@ import { SetupService } from './aggregates/setup.service';
@Global()
@Module({
imports: [SystemSettingsEntitiesModule],
imports: [SystemSettingsEntitiesModule, HttpModule],
controllers: [SettingsController, SetupController],
providers: [SettingsService, SetupService],
exports: [SystemSettingsEntitiesModule, SetupService],
......
This diff is collapsed.
......@@ -19,12 +19,12 @@
},
"private": true,
"dependencies": {
"@nestjs/common": "^6.2.4",
"@nestjs/core": "^6.2.4",
"@nestjs/common": "^6.3.1",
"@nestjs/core": "^6.3.1",
"@nestjs/cqrs": "^6.0.0",
"@nestjs/platform-express": "^6.2.4",
"@nestjs/platform-express": "^6.3.1",
"@nestjs/swagger": "^3.0.2",
"@nestjs/typeorm": "^6.1.1",
"@nestjs/typeorm": "^6.1.2",
"class-transformer": "^0.2.3",
"class-validator": "^0.9.1",
"cron": "^1.7.1",
......@@ -32,29 +32,29 @@
"fastify-formbody": "^3.1.0",
"form-data": "^2.3.3",
"joi": "^14.3.1",
"mongodb": "^3.2.6",
"mongodb": "^3.2.7",
"reflect-metadata": "^0.1.13",
"rxjs": "^6.5.2",
"swagger-ui-express": "^4.0.5",
"typeorm": "^0.2.17"
"swagger-ui-express": "^4.0.6",
"typeorm": "^0.2.18"
},
"devDependencies": {
"@nestjs/testing": "^6.2.4",
"@types/express": "^4.16.1",
"@nestjs/testing": "^6.3.1",
"@types/express": "^4.17.0",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.3",
"@types/node": "^12.0.7",
"@types/supertest": "^2.0.7",
"jest": "^24.8.0",
"nodemon": "^1.19.1",
"prettier": "^1.17.1",
"prettier": "^1.18.2",
"prettier-check": "^2.0.0",
"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"ts-loader": "^6.0.1",
"ts-loader": "^6.0.2",
"ts-node": "^8.2.0",
"tsconfig-paths": "^3.8.0",
"tslint": "^5.16.0",
"typescript": "^3.4.5"
"tslint": "^5.17.0",
"typescript": "^3.5.1"
},
"jest": {
"moduleDirectories": [
......
......@@ -14,7 +14,7 @@ import {
UploadedFile,
Delete,
} from '@nestjs/common';
import { QueryBus } from '@nestjs/cqrs';
import { QueryBus, CommandBus } from '@nestjs/cqrs';
import { FileInterceptor } from '@nestjs/platform-express';
import { ProfileService } from '../../../profile-management/entities/profile/profile.service';
import { PersonalDetailsDTO } from './personal-details-dto';
......@@ -23,12 +23,14 @@ import { ProfileDetailsDTO } from './profile-details-dto';
import { TokenGuard } from '../../../auth/guards/token.guard';
import { multerAvatarConnection } from './multer-avatar.connection';
import { GetUserInfoQuery } from 'profile-management/queries/get-user-info/get-user-info.query';
import { UploadNewAvatarCommand } from 'profile-management/commands/upload-new-avatar/upload-new-avatar.command';
@Controller('profile')
export class ProfileController {
constructor(
private readonly profileService: ProfileService,
private readonly queryBus: QueryBus,
private readonly commandBus: CommandBus,
) {}
@Post('v1/update_profile_details')
......@@ -100,14 +102,9 @@ export class ProfileController {
@Post('v1/upload_avatar')
@UseGuards(TokenGuard)
@UseInterceptors(FileInterceptor('file', multerAvatarConnection))
public async uploadAndSetAvatar(file, clientHttpRequest) {}
async uploadFile(@Req() req, @Res() res, @UploadedFile('file') file) {
if (req.token.active) {
const uploadResponse = await this.profileService.uploadAndSetAvatar(
file,
req,
);
res.json(uploadResponse);
}
return this.commandBus.execute(new UploadNewAvatarCommand(file, req));
}
@Delete('v1/delete_avatar')
......
......@@ -5,15 +5,12 @@ import { Profile } from './profile.entity';
import { AVATAR_IMAGE_FOLDER } from '../../../constants/filesystem';
import { unlink } from 'fs';
import { from } from 'rxjs';
import { CommandBus } from '@nestjs/cqrs';
import { UploadNewAvatarCommand } from '../../../profile-management/commands/upload-new-avatar/upload-new-avatar.command';
@Injectable()
export class ProfileService {
constructor(
@InjectRepository(Profile)
private readonly profileRepository: MongoRepository<Profile>,
private readonly commandBus: CommandBus,
) {}
public async save(profile) {
......@@ -32,12 +29,6 @@ export class ProfileService {
return await this.profileRepository.find();
}
public async uploadAndSetAvatar(file, clientHttpRequest) {
return this.commandBus.execute(
new UploadNewAvatarCommand(file, clientHttpRequest),
);
}
public deleteAvatarFile(pictureFile) {
unlink(AVATAR_IMAGE_FOLDER + '/' + pictureFile, () => {});
}
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { ProfileManagementEntitiesModule } from './entities/profile-management-entities.module';
import { ProfileController } from './controllers/profile/profile.controller';
import { ProfileAggregate } from './aggregates';
......@@ -10,7 +10,7 @@ import { ProfileManagementQueryHandlers } from './queries';
@Global()
@Module({
imports: [ProfileManagementEntitiesModule, CqrsModule],
imports: [ProfileManagementEntitiesModule, CqrsModule, HttpModule],
exports: [ProfileManagementEntitiesModule],
controllers: [ProfileController],
providers: [
......
import { Module, Global } from '@nestjs/common';
import { Module, Global, HttpModule } from '@nestjs/common';
import { SystemSettingsEntitiesModule } from './entities/system-entities.module';
import { SettingsController } from './controllers/settings/settings.controller';