From d648c619deaef717bcdadfd5ea7f0a39cc081850 Mon Sep 17 00:00:00 2001 From: "rinkal.bhojani" Date: Tue, 10 Sep 2024 17:33:44 +0530 Subject: [PATCH] fix: removed duplicate code and other changes which got merged in resolving conflicts --- apps/agent-service/src/agent-service.service.ts | 12 ------------ .../src/connection/dtos/question-answer.dto.ts | 11 ----------- apps/connection/src/connection.module.ts | 1 - apps/connection/src/connection.service.ts | 16 +--------------- apps/organization/src/organization.module.ts | 2 -- libs/common/src/nats.config.ts | 1 - 6 files changed, 1 insertion(+), 42 deletions(-) diff --git a/apps/agent-service/src/agent-service.service.ts b/apps/agent-service/src/agent-service.service.ts index 175dca42b..337c1bbdc 100644 --- a/apps/agent-service/src/agent-service.service.ts +++ b/apps/agent-service/src/agent-service.service.ts @@ -1915,16 +1915,4 @@ export class AgentServiceService { } } - async sendBasicMessage(questionPayload: IBasicMessage, url: string, orgId: string): Promise { - try { - const getApiKey = await this.getOrgAgentApiKey(orgId); - const sendQuestionRes = await this.commonService - .httpPost(url, questionPayload, { headers: { authorization: getApiKey } }) - .then(async (response) => response); - return sendQuestionRes; - } catch (error) { - this.logger.error(`Error in sendBasicMessage in agent service : ${JSON.stringify(error)}`); - throw error; - } - } } diff --git a/apps/api-gateway/src/connection/dtos/question-answer.dto.ts b/apps/api-gateway/src/connection/dtos/question-answer.dto.ts index 2189baa05..d9deb3dfc 100644 --- a/apps/api-gateway/src/connection/dtos/question-answer.dto.ts +++ b/apps/api-gateway/src/connection/dtos/question-answer.dto.ts @@ -102,15 +102,4 @@ export class QuestionAnswerWebhookDto { @IsOptional() type: string; -} - -export class BasicMessageDto { - @ApiPropertyOptional() - @IsOptional() - @IsString({ message: 'content must be a string' }) - @IsNotEmpty({ message: 'please provide valid content' }) - content: string; - - orgId: string; - connectionId: string; } \ No newline at end of file diff --git a/apps/connection/src/connection.module.ts b/apps/connection/src/connection.module.ts index d3084bec8..bd711711c 100644 --- a/apps/connection/src/connection.module.ts +++ b/apps/connection/src/connection.module.ts @@ -11,7 +11,6 @@ import { getNatsOptions } from '@credebl/common/nats.config'; import { UserActivityRepository } from 'libs/user-activity/repositories'; import { CommonConstants } from '@credebl/common/common.constant'; // import { nkeyAuthenticator } from 'nats'; -import { CommonConstants } from '@credebl/common/common.constant'; @Module({ imports: [ diff --git a/apps/connection/src/connection.service.ts b/apps/connection/src/connection.service.ts index 9d6d72e1f..6b4138a7c 100644 --- a/apps/connection/src/connection.service.ts +++ b/apps/connection/src/connection.service.ts @@ -649,22 +649,8 @@ export class ConnectionService { if (!agentDetails) { throw new NotFoundException(ResponseMessages.connection.error.agentEndPointNotFound); } - - let legacyinvitationDid; - if (IsReuseConnection) { - const data: agent_invitations[] = await this.connectionRepository.getInvitationDidByOrgId(orgId); - if (data && 0 < data.length) { - const [firstElement] = data; - legacyinvitationDid = firstElement?.invitationDid ?? undefined; - - this.logger.log('legacyinvitationDid:', legacyinvitationDid); - } - } - const connectionInvitationDid = invitationDid ? invitationDid : legacyinvitationDid; - - this.logger.log('connectionInvitationDid:', connectionInvitationDid); - + this.logger.log(`logoUrl:::, ${organisation.logoUrl}`); let legacyinvitationDid; if (IsReuseConnection) { const data: agent_invitations[] = await this.connectionRepository.getInvitationDidByOrgId(orgId); diff --git a/apps/organization/src/organization.module.ts b/apps/organization/src/organization.module.ts index cc52a210a..a7d0aae8c 100644 --- a/apps/organization/src/organization.module.ts +++ b/apps/organization/src/organization.module.ts @@ -17,8 +17,6 @@ import { CacheModule } from '@nestjs/cache-manager'; import { getNatsOptions } from '@credebl/common/nats.config'; import { ClientRegistrationService } from '@credebl/client-registration'; import { KeycloakUrlService } from '@credebl/keycloak-url'; -import { CommonConstants } from '@credebl/common/common.constant'; - import { AwsService } from '@credebl/aws'; import { CommonConstants } from '@credebl/common/common.constant'; @Module({ diff --git a/libs/common/src/nats.config.ts b/libs/common/src/nats.config.ts index caf658dc3..331256866 100644 --- a/libs/common/src/nats.config.ts +++ b/libs/common/src/nats.config.ts @@ -1,6 +1,5 @@ import { NATSReconnects } from '@credebl/enum/enum'; import { Authenticator, nkeyAuthenticator } from 'nats'; -import { CommonConstants } from './common.constant'; export const getNatsOptions = ( serviceName: string, nkeySeed?: string