mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix chage duplicate message
This commit is contained in:
@@ -132,15 +132,14 @@ registerLocaleData(localePt, 'pt');
|
|||||||
})
|
})
|
||||||
|
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'info',
|
||||||
|
message: event.exception.values[0].value,
|
||||||
payload: {
|
payload: {
|
||||||
message: event.exception.values[0].value,
|
|
||||||
object: {
|
object: {
|
||||||
sentry: true,
|
sentry: true,
|
||||||
error: event
|
error: event
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
spanContext: null
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Return event to send it to Sentry
|
// Return event to send it to Sentry
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const MemberSchema = z.object({
|
|||||||
export const RoomEntitySchema = z.object({
|
export const RoomEntitySchema = z.object({
|
||||||
$id: z.string(),
|
$id: z.string(),
|
||||||
id: z.string().uuid().optional(),
|
id: z.string().uuid().optional(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: z.object({
|
createdBy: z.object({
|
||||||
wxUserId: z.number(),
|
wxUserId: z.number(),
|
||||||
wxFullName: z.string(),
|
wxFullName: z.string(),
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export const MessageEntitySchema = z.object({
|
|||||||
wxUserId: z.number(),
|
wxUserId: z.number(),
|
||||||
wxFullName: z.string(),
|
wxFullName: z.string(),
|
||||||
wxeMail: z.string(),
|
wxeMail: z.string(),
|
||||||
userPhoto: z.string().nullable(),
|
userPhoto: z.string().nullable().optional(),
|
||||||
}).nullable(),
|
}).nullable(),
|
||||||
reactions: z.object({
|
reactions: z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
@@ -67,7 +67,8 @@ export const MessageEntitySchema = z.object({
|
|||||||
origin: z.enum(['history', 'local', 'incoming']).optional(),
|
origin: z.enum(['history', 'local', 'incoming']).optional(),
|
||||||
requestId: z.string().nullable().optional(),
|
requestId: z.string().nullable().optional(),
|
||||||
sendAttemp: z.number().optional(),
|
sendAttemp: z.number().optional(),
|
||||||
hasAttachment: z.boolean().optional()
|
hasAttachment: z.boolean().optional(),
|
||||||
|
deviceId: z.string().nullable().optional()
|
||||||
})
|
})
|
||||||
|
|
||||||
export type IMessage = z.infer<typeof MessageEntitySchema>;
|
export type IMessage = z.infer<typeof MessageEntitySchema>;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { MessageEntity, IMessage } from "../entity/message";
|
import { MessageEntity, IMessage } from "../entity/message";
|
||||||
import { MessageOutPutDataDTO } from "src/app/core/chat/repository/dto/messageOutputDTO";
|
import { MessageOutPutDataDTO } from "src/app/core/chat/repository/dto/messageOutputDTO";
|
||||||
import { MessageInputDTO } from "../usecase/message/message-create-use-case.service";
|
import { MessageInputDTO } from "../usecase/message/message-create-use-case.service";
|
||||||
|
import { getInstanceId } from "src/app/module/chat/domain/chat-service.service";
|
||||||
|
|
||||||
export class MessageMapper {
|
export class MessageMapper {
|
||||||
static toDomain(DTO: MessageOutPutDataDTO) : MessageEntity {
|
static toDomain(DTO: MessageOutPutDataDTO) : MessageEntity {
|
||||||
@@ -27,8 +28,8 @@ export class MessageMapper {
|
|||||||
docId: Number(e.docId) || 0,
|
docId: Number(e.docId) || 0,
|
||||||
mimeType: e.mimeType,
|
mimeType: e.mimeType,
|
||||||
description: e.description
|
description: e.description
|
||||||
}))[0] || {}
|
})) || [],
|
||||||
|
deviceId: getInstanceId()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export const MessageOutPutDataDTOSchema = z.object({
|
|||||||
applicationId: z.number().optional(),
|
applicationId: z.number().optional(),
|
||||||
docId: z.number().optional(),
|
docId: z.number().optional(),
|
||||||
id: z.string().optional()
|
id: z.string().optional()
|
||||||
}))
|
})),
|
||||||
|
deviceId: z.string().nullable().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
export type MessageOutPutDataDTO = z.infer<typeof MessageOutPutDataDTOSchema>
|
export type MessageOutPutDataDTO = z.infer<typeof MessageOutPutDataDTOSchema>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { z } from "zod";
|
|||||||
|
|
||||||
const SocketRoomUpdateOutPutSchema = z.object({
|
const SocketRoomUpdateOutPutSchema = z.object({
|
||||||
id: z.string().uuid(),
|
id: z.string().uuid(),
|
||||||
roomName: z.string().min(1),
|
roomName: z.string().nullable(),
|
||||||
createdBy: z.string().nullable(), // Allowing null for createdBy
|
createdBy: z.string().nullable(), // Allowing null for createdBy
|
||||||
createdAt: z.string().datetime(),
|
createdAt: z.string().datetime(),
|
||||||
expirationDate: z.string().nullable().optional(), // Allowing null and making it optional
|
expirationDate: z.string().nullable().optional(), // Allowing null and making it optional
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
||||||
import { MessageEntity } from '../../entity/message';
|
import { MessageEntity } from '../../entity/message';
|
||||||
import { InstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||||
|
|
||||||
|
|
||||||
export const ListenMessageByRoomIdNewInputDTOSchema = z.object({
|
export const ListenMessageByRoomIdNewInputDTOSchema = z.object({
|
||||||
@@ -25,8 +25,10 @@ export class ListenMessageByRoomIdNewUseCase {
|
|||||||
|
|
||||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||||
map(message => message.data),
|
map(message => message.data),
|
||||||
filter((message) => !message?.requestId?.startsWith(InstanceId) && message?.roomId == data.roomId),
|
filter((message) => message.deviceId != getInstanceId()),
|
||||||
map(message => Object.assign(new MessageEntity(), message))
|
map(message => {
|
||||||
|
return Object.assign(new MessageEntity(), message)
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MessageSocketRepositoryService } from 'src/app/module/chat/data/repository/message/message-live-signalr-data-source.service'
|
import { MessageSocketRepositoryService } from 'src/app/module/chat/data/repository/message/message-live-signalr-data-source.service'
|
||||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
|
||||||
import { filter, map } from 'rxjs/operators';
|
import { filter, map } from 'rxjs/operators';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
||||||
|
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||||
|
|
||||||
export const ListenSendMessageInputDTOSchema = z.object({
|
export const ListenSendMessageInputDTOSchema = z.object({
|
||||||
roomId: z.string(),
|
roomId: z.string(),
|
||||||
@@ -25,10 +25,7 @@ export class ListenSendMessageUseCase {
|
|||||||
|
|
||||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||||
map(message => message.data),
|
map(message => message.data),
|
||||||
filter((message) => {
|
filter((message) => message.deviceId != getInstanceId()),
|
||||||
|
|
||||||
return message?.requestId?.startsWith(InstanceId) && message?.roomId == roomId
|
|
||||||
}),
|
|
||||||
map(message => message)
|
map(message => message)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
|
||||||
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
||||||
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
||||||
import { Logger } from 'src/app/services/logger/main/service';
|
import { Logger } from 'src/app/services/logger/main/service';
|
||||||
@@ -105,7 +104,7 @@ export class MessageCreateUseCaseService {
|
|||||||
if(validation.isOk()) {
|
if(validation.isOk()) {
|
||||||
message.sendAttemp++;
|
message.sendAttemp++;
|
||||||
|
|
||||||
message.requestId = InstanceId +'@'+ uuidv4();
|
message.requestId = uuidv4();
|
||||||
message.sending = true;
|
message.sending = true;
|
||||||
|
|
||||||
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
|
||||||
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
||||||
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
||||||
import { Logger } from 'src/app/services/logger/main/service';
|
import { Logger } from 'src/app/services/logger/main/service';
|
||||||
@@ -38,7 +37,8 @@ export const MessageInputDTOSchema = z.object({
|
|||||||
docId: z.number().optional(),
|
docId: z.number().optional(),
|
||||||
mimeType: z.string().nullable().optional(),
|
mimeType: z.string().nullable().optional(),
|
||||||
description: z.string().optional()
|
description: z.string().optional()
|
||||||
}).optional()
|
}).array(),
|
||||||
|
deviceId: z.string().optional()
|
||||||
});
|
});
|
||||||
export type MessageInputDTO = z.infer<typeof MessageInputDTOSchema>
|
export type MessageInputDTO = z.infer<typeof MessageInputDTOSchema>
|
||||||
|
|
||||||
@@ -105,14 +105,11 @@ export class MessageCreateUseCaseService {
|
|||||||
if(validation.isOk()) {
|
if(validation.isOk()) {
|
||||||
message.sendAttemp++;
|
message.sendAttemp++;
|
||||||
|
|
||||||
message.requestId = InstanceId +'@'+ uuidv4();
|
|
||||||
|
|
||||||
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
||||||
|
|
||||||
createMessageLocally.then((value) => {
|
createMessageLocally.then((value) => {
|
||||||
if(value.isOk()) {
|
if(value.isOk()) {
|
||||||
|
|
||||||
console.log("set image")
|
|
||||||
message.$id = value.value
|
message.$id = value.value
|
||||||
|
|
||||||
if(message.hasAttachment) {
|
if(message.hasAttachment) {
|
||||||
|
|||||||
+2
-1
@@ -5,6 +5,7 @@ import { MessageSocketRepositoryService } from 'src/app/module/chat/data/reposit
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { IMessageLocalRepository } from '../../repository/message/message-local-repository';
|
import { IMessageLocalRepository } from '../../repository/message/message-local-repository';
|
||||||
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
const MessageMarkAllMessageAsReadByRoomIdInputSchema = z.object({
|
const MessageMarkAllMessageAsReadByRoomIdInputSchema = z.object({
|
||||||
roomId: z.string(),
|
roomId: z.string(),
|
||||||
@@ -36,7 +37,7 @@ export class MessageMarkAllMessageAsReadByRoomIdService {
|
|||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
roomId: input.roomId,
|
roomId: input.roomId,
|
||||||
requestId: 'uuid'
|
requestId: uuidv4()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MessageLocalDataSourceService } from '../../../../module/chat/data/repository/message/message-local-data-source.service';
|
import { MessageLocalDataSourceService } from '../../../../module/chat/data/repository/message/message-local-data-source.service';
|
||||||
import { MessageSocketRepositoryService } from '../../../../module/chat/data/repository/message/message-live-signalr-data-source.service';
|
import { MessageSocketRepositoryService } from '../../../../module/chat/data/repository/message/message-live-signalr-data-source.service';
|
||||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
|
||||||
import { MessageMapper } from '../../mapper/messageMapper';
|
import { MessageMapper } from '../../mapper/messageMapper';
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { AttachmentLocalDataSource } from '../../../../module/chat/data/repository/attachment/attachment-local-repository.service';
|
import { AttachmentLocalDataSource } from '../../../../module/chat/data/repository/attachment/attachment-local-repository.service';
|
||||||
@@ -65,8 +64,6 @@ export class SendLocalMessagesUseCaseService {
|
|||||||
description: e.description,
|
description: e.description,
|
||||||
file: e.base64.split(',')[1]
|
file: e.base64.split(',')[1]
|
||||||
}))
|
}))
|
||||||
console.log('to upload', messages)
|
|
||||||
const requestId = InstanceId +'@'+ uuidv4();
|
|
||||||
|
|
||||||
await this.messageLocalDataSourceService.update(message.$id, { sending: true })
|
await this.messageLocalDataSourceService.update(message.$id, { sending: true })
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/m
|
|||||||
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
||||||
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
|
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
|
||||||
import { IMessageLocalRepository } from 'src/app/core/chat/repository/message/message-local-repository';
|
import { IMessageLocalRepository } from 'src/app/core/chat/repository/message/message-local-repository';
|
||||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
|
||||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||||
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
||||||
import { IMessageGetAllByRoomIdOutPut } from 'src/app/core/chat/usecase/message/message-get-all-by-room-Id';
|
import { IMessageGetAllByRoomIdOutPut } from 'src/app/core/chat/usecase/message/message-get-all-by-room-Id';
|
||||||
|
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -37,7 +37,7 @@ export class RoomBoldSyncUseCaseService {
|
|||||||
private listenToIncomingMessage() {
|
private listenToIncomingMessage() {
|
||||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||||
map(message => message.data),
|
map(message => message.data),
|
||||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
filter((message) => message.deviceId != getInstanceId()),
|
||||||
map(message => Object.assign(new MessageEntity(), message)),
|
map(message => Object.assign(new MessageEntity(), message)),
|
||||||
filter((message) => !message.meSender())
|
filter((message) => !message.meSender())
|
||||||
).subscribe(async (message) => {
|
).subscribe(async (message) => {
|
||||||
@@ -59,7 +59,7 @@ export class RoomBoldSyncUseCaseService {
|
|||||||
*/
|
*/
|
||||||
private listenToUpdateMessages() {
|
private listenToUpdateMessages() {
|
||||||
return this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
return this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
||||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
filter((message) => message.deviceId != getInstanceId()),
|
||||||
map(message => Object.assign(new MessageEntity(), message))
|
map(message => Object.assign(new MessageEntity(), message))
|
||||||
).subscribe(async (message) => {
|
).subscribe(async (message) => {
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const RoomOutPutDTOSchema = z.object({
|
|||||||
message: z.string(),
|
message: z.string(),
|
||||||
data: z.object({
|
data: z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: z.any().nullable(),
|
createdBy: z.any().nullable(),
|
||||||
createdAt: z.string(),
|
createdAt: z.string(),
|
||||||
expirationDate: z.string().nullable(),
|
expirationDate: z.string().nullable(),
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export const RoomByIdOutputDTOSchema = z.object({
|
|||||||
message: z.string(),
|
message: z.string(),
|
||||||
data: z.object({
|
data: z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: UserSchema,
|
createdBy: UserSchema,
|
||||||
createdAt: z.string(),
|
createdAt: z.string(),
|
||||||
expirationDate: z.string().nullable(),
|
expirationDate: z.string().nullable(),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const CreatedBySchema = z.object({
|
|||||||
|
|
||||||
const roomListItemSchema = z.object({
|
const roomListItemSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: CreatedBySchema,
|
createdBy: CreatedBySchema,
|
||||||
createdAt: z.string(),
|
createdAt: z.string(),
|
||||||
expirationDate: z.string().nullable(), // api check
|
expirationDate: z.string().nullable(), // api check
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const RoomUpdateOutputDTOSchema = z.object({
|
|||||||
message: z.string(),
|
message: z.string(),
|
||||||
data: z.object({
|
data: z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: UserSchema,
|
createdBy: UserSchema,
|
||||||
createdAt: z.string(),
|
createdAt: z.string(),
|
||||||
expirationDate: z.string().nullable(),
|
expirationDate: z.string().nullable(),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const MemberTableSchema = z.object({
|
|||||||
wxUserId: z.number(),
|
wxUserId: z.number(),
|
||||||
wxFullName: z.string(),
|
wxFullName: z.string(),
|
||||||
wxeMail: z.string(),
|
wxeMail: z.string(),
|
||||||
userPhoto: z.string().nullable(),
|
userPhoto: z.string().nullable().optional(),
|
||||||
joinAt: z.string(),
|
joinAt: z.string(),
|
||||||
status: z.string().optional(), // useless
|
status: z.string().optional(), // useless
|
||||||
isAdmin: z.boolean()
|
isAdmin: z.boolean()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { IDBoolean } from "../../../type";
|
|||||||
export const RoomTableSchema = z.object({
|
export const RoomTableSchema = z.object({
|
||||||
$id: z.string().optional(),
|
$id: z.string().optional(),
|
||||||
id: z.string().optional(),
|
id: z.string().optional(),
|
||||||
roomName: z.string(),
|
roomName: z.string().nullable(),
|
||||||
createdBy: z.object({
|
createdBy: z.object({
|
||||||
wxUserId: z.number(),
|
wxUserId: z.number(),
|
||||||
wxFullName: z.string(),
|
wxFullName: z.string(),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
private excludedDomains = [ 'Login', environment.apiChatUrl, 'http://localhost:8019']; // Add the domains you want to exclude
|
private excludedDomains = [ 'Login', 'http://localhost:8019']; // Add the domains you want to exclude
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
@@ -58,7 +58,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|||||||
}
|
}
|
||||||
else if (error instanceof HttpErrorResponse && error.status === 401) {
|
else if (error instanceof HttpErrorResponse && error.status === 401) {
|
||||||
return this.handle401Error(request, next);
|
return this.handle401Error(request, next);
|
||||||
} else if (error.url.includes('https://gdapi-dev.dyndns.info/stage/api/v2') && error.status === 0){
|
} else if (error.url.includes(`${environment.apiURL.slice(0, -1)}`) && error.status === 0){
|
||||||
return this.handle401Error(request, next);
|
return this.handle401Error(request, next);
|
||||||
} else {
|
} else {
|
||||||
return throwError(error);
|
return throwError(error);
|
||||||
@@ -119,7 +119,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.http
|
return this.http
|
||||||
.post<UserLoginOutputResponse>('https://gdapi-dev.dyndns.info/stage/api/v2/Users/RefreshToken', {
|
.post<UserLoginOutputResponse>(`${environment.apiURL}Users/RefreshToken`, {
|
||||||
authorization: SessionStore.user.Authorization,
|
authorization: SessionStore.user.Authorization,
|
||||||
refreshToken: SessionStore.user.RefreshToken,
|
refreshToken: SessionStore.user.RefreshToken,
|
||||||
channelId
|
channelId
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { switchMap } from 'rxjs/operators';
|
|||||||
import { err, Result } from 'neverthrow';
|
import { err, Result } from 'neverthrow';
|
||||||
import { HubConnection } from '@microsoft/signalr';
|
import { HubConnection } from '@microsoft/signalr';
|
||||||
import { ISignalRInput, ISignalROutput } from '../type';
|
import { ISignalRInput, ISignalROutput } from '../type';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
const { App } = Plugins;
|
const { App } = Plugins;
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ export class SignalRService {
|
|||||||
async establishConnection(): Promise<Result<HubConnection, false>> {
|
async establishConnection(): Promise<Result<HubConnection, false>> {
|
||||||
|
|
||||||
// const connection = new SignalRConnection({url:'https://41e3-41-63-166-54.ngrok-free.app/api/v2/chathub'})
|
// const connection = new SignalRConnection({url:'https://41e3-41-63-166-54.ngrok-free.app/api/v2/chathub'})
|
||||||
const connection = new SignalRConnection({url:'https://gdapi-dev.dyndns.info/stage/api/v2/chathub'})
|
const connection = new SignalRConnection({url:`${environment.apiURLStage}chathub`})
|
||||||
const attempConnection = await connection.establishConnection()
|
const attempConnection = await connection.establishConnection()
|
||||||
|
|
||||||
if(attempConnection.isOk()) {
|
if(attempConnection.isOk()) {
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-title d-flex justify-space-between align-center width-100">
|
<!-- <div class="profile-title d-flex justify-space-between align-center width-100">
|
||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<div>Tema</div>
|
<div>Tema</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
export interface Environment {
|
export interface Environment {
|
||||||
id: string;
|
id: string;
|
||||||
apiURL: string;
|
apiURL: string;
|
||||||
apiChatUrl: string;
|
apiURLStage: String
|
||||||
apiWsChatUrl: string;
|
|
||||||
apiPCURL: string;
|
apiPCURL: string;
|
||||||
logoLabel: string;
|
logoLabel: string;
|
||||||
production: boolean;
|
production: boolean;
|
||||||
|
|||||||
@@ -11,13 +11,14 @@ import { HttpService } from 'src/app/services/http.service';
|
|||||||
import { TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
import { TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||||
import { IGetDraftListByProcessIdOutput, IGetDraftListByProcessIdSchema } from '../../domain/usecase/getDraft-list-by-process-id.service';
|
import { IGetDraftListByProcessIdOutput, IGetDraftListByProcessIdSchema } from '../../domain/usecase/getDraft-list-by-process-id.service';
|
||||||
import { IDraftSaveByIdInput } from '../../domain/usecase/draft-save-by-id-use-case.service';
|
import { IDraftSaveByIdInput } from '../../domain/usecase/draft-save-by-id-use-case.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AgendaDataService {
|
export class AgendaDataService {
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
|
|||||||
+2
-1
@@ -3,11 +3,12 @@ import { IAttachmentRemoteRepository } from 'src/app/core/chat/repository/attach
|
|||||||
import { HttpService } from 'src/app/services/http.service';
|
import { HttpService } from 'src/app/services/http.service';
|
||||||
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
||||||
import { HttpAdapter } from 'src/app/infra/http/adapter'
|
import { HttpAdapter } from 'src/app/infra/http/adapter'
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AttachmentRemoteDataSourceService implements IAttachmentRemoteRepository {
|
export class AttachmentRemoteDataSourceService implements IAttachmentRemoteRepository {
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService,
|
private httpService: HttpService,
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ import { IMemberRemoteRepository } from 'src/app/core/chat/repository/member/mem
|
|||||||
import { UserRemoveListInputDTOSchema, UserRemoveListInputDTO } from '../../../../../core/chat/usecase/room/room-leave-by-id-use-case.service';
|
import { UserRemoveListInputDTOSchema, UserRemoveListInputDTO } from '../../../../../core/chat/usecase/room/room-leave-by-id-use-case.service';
|
||||||
import { AddMemberToRoomInputDTOSchema, AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
import { AddMemberToRoomInputDTOSchema, AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
||||||
import { MemberSetAdminDTO } from 'src/app/core/chat/usecase/member/member-admin-use-case.service';
|
import { MemberSetAdminDTO } from 'src/app/core/chat/usecase/member/member-admin-use-case.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class MemberListRemoteRepository implements IMemberRemoteRepository {
|
export class MemberListRemoteRepository implements IMemberRemoteRepository {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/Chat`; // Your base URL
|
||||||
|
|
||||||
constructor(private httpService: HttpService) { }
|
constructor(private httpService: HttpService) { }
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||||
import { IMemberSocketRepository } from 'src/app/core/chat/repository/member/member-socket-repository';
|
import { IMemberSocketRepository } from 'src/app/core/chat/repository/member/member-socket-repository';
|
||||||
import { InstanceId } from '../../../domain/chat-service.service';
|
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { filter, map, tap } from 'rxjs/operators';
|
import { filter, map, tap } from 'rxjs/operators';
|
||||||
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
||||||
@@ -19,11 +18,12 @@ export class MemberSocketRepositoryService implements IMemberSocketRepository {
|
|||||||
}
|
}
|
||||||
async removeMember(data: RemoveRoomMemberInput) {
|
async removeMember(data: RemoveRoomMemberInput) {
|
||||||
|
|
||||||
|
const id = uuidv4();
|
||||||
const result = await this.socket.sendData<any>({
|
const result = await this.socket.sendData<any>({
|
||||||
method: 'RemoveRoomMember',
|
method: 'RemoveRoomMember',
|
||||||
data: {
|
data: {
|
||||||
...data,
|
...data,
|
||||||
requestId: InstanceId +'@'+ uuidv4()
|
requestId: id
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -1,6 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { InstanceId } from '../../../domain/chat-service.service';
|
|
||||||
import { MessageUpdateInput } from '../../../../../core/chat/usecase/message/message-update-by-id-use-case.service';
|
import { MessageUpdateInput } from '../../../../../core/chat/usecase/message/message-update-by-id-use-case.service';
|
||||||
import { MessageReactionInput } from '../../../../../core/chat/usecase/message/message-reaction-by-id-use-case.service';
|
import { MessageReactionInput } from '../../../../../core/chat/usecase/message/message-reaction-by-id-use-case.service';
|
||||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||||
@@ -43,7 +42,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
|||||||
async sendGroupMessage(data: MessageInputDTO) {
|
async sendGroupMessage(data: MessageInputDTO) {
|
||||||
|
|
||||||
if(!data.requestId) {
|
if(!data.requestId) {
|
||||||
data.requestId = InstanceId +'@'+ uuidv4();
|
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
data['requestId'] = uuidv4();
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.socket.sendData<MessageCreateOutPutDataDTO>({
|
const result = await this.socket.sendData<MessageCreateOutPutDataDTO>({
|
||||||
@@ -62,7 +62,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
|||||||
async sendDirectMessage(data: MessageInputDTO) {
|
async sendDirectMessage(data: MessageInputDTO) {
|
||||||
|
|
||||||
if(!data.requestId) {
|
if(!data.requestId) {
|
||||||
data.requestId = InstanceId +'@'+ uuidv4();
|
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
data['requestId'] = uuidv4();
|
||||||
}
|
}
|
||||||
const result = await this.socket.sendData<MessageOutPutDataDTO>({
|
const result = await this.socket.sendData<MessageOutPutDataDTO>({
|
||||||
method: 'SendDirectMessage',
|
method: 'SendDirectMessage',
|
||||||
@@ -140,7 +141,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
|||||||
|
|
||||||
|
|
||||||
reactToMessageSocket(data: MessageReactionInput) {
|
reactToMessageSocket(data: MessageReactionInput) {
|
||||||
data['requestId'] = InstanceId +'@'+ uuidv4();
|
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
data['requestId'] = uuidv4();
|
||||||
|
|
||||||
return this.socket.sendData({
|
return this.socket.sendData({
|
||||||
method: 'ReactMessage',
|
method: 'ReactMessage',
|
||||||
@@ -149,7 +151,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateMessage(input: MessageUpdateInput) {
|
updateMessage(input: MessageUpdateInput) {
|
||||||
input['requestId'] = InstanceId +'@'+ uuidv4();
|
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
input['requestId'] = uuidv4();
|
||||||
|
|
||||||
this.socket.sendData({
|
this.socket.sendData({
|
||||||
method: 'EditMessage',
|
method: 'EditMessage',
|
||||||
@@ -160,7 +163,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
|||||||
|
|
||||||
sendMessageDelete(data: MessageDeleteInputDTO) {
|
sendMessageDelete(data: MessageDeleteInputDTO) {
|
||||||
|
|
||||||
data['requestId'] = InstanceId +'@'+ uuidv4();
|
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||||
|
data['requestId'] = uuidv4();
|
||||||
|
|
||||||
const result = this.socket.sendData<any>({
|
const result = this.socket.sendData<any>({
|
||||||
method: 'DeleteMessage',
|
method: 'DeleteMessage',
|
||||||
|
|||||||
@@ -8,13 +8,14 @@ import { IGetMessagesFromRoomParams, IMessageRemoteRepository } from 'src/app/co
|
|||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { Result } from 'neverthrow';
|
import { Result } from 'neverthrow';
|
||||||
import { HttpResult } from 'src/app/infra/http/type';
|
import { HttpResult } from 'src/app/infra/http/type';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class MessageRemoteDataSourceService implements IMessageRemoteRepository {
|
export class MessageRemoteDataSourceService implements IMessageRemoteRepository {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
private baseUrl = `${environment.apiURLStage}Chat`; // Your base URL
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService,
|
private httpService: HttpService,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { RoomListItemOutPutDTO, RoomListItemSchema, RoomListOutPutDTO } from '..
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||||
import { AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
import { AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
const RoomByIdInputDTOSchema = z.string()
|
const RoomByIdInputDTOSchema = z.string()
|
||||||
type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
||||||
@@ -23,7 +24,7 @@ type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
|||||||
})
|
})
|
||||||
export class RoomRemoteDataSourceService implements IRoomRemoteRepository {
|
export class RoomRemoteDataSourceService implements IRoomRemoteRepository {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
private baseUrl = `${environment.apiURLStage}chat`; // Your base URL
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService,
|
private httpService: HttpService,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { filter, map } from 'rxjs/operators';
|
|||||||
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
||||||
import { ITypingRemoteRepository } from 'src/app/core/chat/repository/typing/typing-remote-repository';
|
import { ITypingRemoteRepository } from 'src/app/core/chat/repository/typing/typing-remote-repository';
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import { InstanceId } from '../../../domain/chat-service.service';
|
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
export const UserTypingDTOSchema = z.object({
|
export const UserTypingDTOSchema = z.object({
|
||||||
@@ -28,13 +27,14 @@ export class UserTypingRemoteRepositoryService implements ITypingRemoteRepositor
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
sendTyping(roomId: string) {
|
sendTyping(roomId: string) {
|
||||||
|
const id = uuidv4();
|
||||||
return this.socket.sendData({
|
return this.socket.sendData({
|
||||||
method: 'Typing',
|
method: 'Typing',
|
||||||
data: {
|
data: {
|
||||||
roomId,
|
roomId,
|
||||||
UserName:SessionStore.user.FullName,
|
UserName:SessionStore.user.FullName,
|
||||||
userId:SessionStore.user.UserId,
|
userId:SessionStore.user.UserId,
|
||||||
requestId: InstanceId +'@'+ uuidv4(),
|
requestId: id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ import { IMessageLocalGetByIdServiceInput, MessageLocalGetByIdService } from 'sr
|
|||||||
import { ContactListService } from 'src/app/core/chat/usecase/contact/contact-list.service';
|
import { ContactListService } from 'src/app/core/chat/usecase/contact/contact-list.service';
|
||||||
import { IRoomGetLocalByIdServiceInput, RoomGetLocalByIdService } from '../../../core/chat/usecase/room/room-getlocal-by-id.service';
|
import { IRoomGetLocalByIdServiceInput, RoomGetLocalByIdService } from '../../../core/chat/usecase/room/room-getlocal-by-id.service';
|
||||||
|
|
||||||
|
|
||||||
export const getInstanceId = (): string => {
|
export const getInstanceId = (): string => {
|
||||||
const storageKey = 'instanceId'; // Key for localStorage
|
const storageKey = 'instanceId'; // Key for localStorage
|
||||||
let instanceId = localStorage.getItem(storageKey);
|
let instanceId = localStorage.getItem(storageKey);
|
||||||
@@ -66,8 +65,6 @@ export const getInstanceId = (): string => {
|
|||||||
return instanceId;
|
return instanceId;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const InstanceId = getInstanceId();
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -129,9 +126,7 @@ export class ChatServiceService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
||||||
filter((message) => {
|
filter((message) => message.deviceId != getInstanceId())
|
||||||
return !message?.requestId?.startsWith(InstanceId)
|
|
||||||
})
|
|
||||||
).subscribe(async (message) => {
|
).subscribe(async (message) => {
|
||||||
if(message?.id) {
|
if(message?.id) {
|
||||||
this.SocketMessageUpdateUseCaseService.execute(message)
|
this.SocketMessageUpdateUseCaseService.execute(message)
|
||||||
@@ -140,12 +135,7 @@ export class ChatServiceService {
|
|||||||
|
|
||||||
this.MessageSocketRepositoryService.listenToMessages().pipe(
|
this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||||
map(message => message.data),
|
map(message => message.data),
|
||||||
filter((message) => {
|
filter((message) => message.deviceId != getInstanceId())
|
||||||
if(!message?.requestId?.startsWith(InstanceId) == false) {
|
|
||||||
// console.log('exclude my message---')
|
|
||||||
}
|
|
||||||
return !message?.requestId?.startsWith(InstanceId)
|
|
||||||
})
|
|
||||||
).subscribe(async (message) => {
|
).subscribe(async (message) => {
|
||||||
if(message?.id) {
|
if(message?.id) {
|
||||||
this.SocketMessageCreateUseCaseService.execute(message)
|
this.SocketMessageCreateUseCaseService.execute(message)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { filter, map } from 'rxjs/operators';
|
import { filter, map } from 'rxjs/operators';
|
||||||
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
||||||
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
||||||
import { InstanceId } from '../chat-service.service';
|
import { getInstanceId } from '../chat-service.service';
|
||||||
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -20,7 +20,7 @@ export class RoomLastMessageService {
|
|||||||
listenToIncomingMessage() {
|
listenToIncomingMessage() {
|
||||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||||
map(message => message.data),
|
map(message => message.data),
|
||||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
filter((message) => message.deviceId != getInstanceId()),
|
||||||
map(message => Object.assign(new MessageEntity(), message))
|
map(message => Object.assign(new MessageEntity(), message))
|
||||||
).subscribe(async (message) => {
|
).subscribe(async (message) => {
|
||||||
this.roomLocalRepository.update(message.roomId, {
|
this.roomLocalRepository.update(message.roomId, {
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ import { HttpService } from 'src/app/services/http.service';
|
|||||||
import { NotificationInputDTO } from '../dto/NotificationInputDTO';
|
import { NotificationInputDTO } from '../dto/NotificationInputDTO';
|
||||||
import { NotificationOutputDTO, NotificationOutputDTOSchema } from '../dto/NotificationOutputDTO';
|
import { NotificationOutputDTO, NotificationOutputDTOSchema } from '../dto/NotificationOutputDTO';
|
||||||
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RemoteNotificationService {
|
export class RemoteNotificationService {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2';
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService
|
private httpService: HttpService
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
})
|
})
|
||||||
export class UserRemoteRepositoryService {
|
export class UserRemoteRepositoryService {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private httpService: HttpService,
|
private httpService: HttpService,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
||||||
import { HttpService } from 'src/app/services/http.service';
|
import { HttpService } from 'src/app/services/http.service';
|
||||||
import { ContactCombinedOutputDTO, EventListDataOutputDTOSchema } from '../DTO/contactsCombined';
|
import { ContactCombinedOutputDTO, EventListDataOutputDTOSchema } from '../DTO/contactsCombined';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
export interface UserContacts {
|
export interface UserContacts {
|
||||||
wxUserId: number;
|
wxUserId: number;
|
||||||
@@ -26,7 +27,7 @@ export interface UserList {
|
|||||||
})
|
})
|
||||||
export class ContactsDataSourceService {
|
export class ContactsDataSourceService {
|
||||||
|
|
||||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||||
|
|
||||||
constructor(private httpService: HttpService) {}
|
constructor(private httpService: HttpService) {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import CryptoJS from 'crypto-js';
|
import CryptoJS from 'crypto-js';
|
||||||
|
import { Logger } from './logger/main/service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|||||||
@@ -39,23 +39,20 @@ export class Logger {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'info',
|
||||||
spanContext: null,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
object: {
|
||||||
...obj,
|
...obj,
|
||||||
spanId: null,
|
|
||||||
name,
|
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
device_name: device?.name || device?.model,
|
device_name: device?.name || device?.model,
|
||||||
commit_date: environment.version.lastCommitTime,
|
commit_date: environment.version.lastCommitTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static debug(message: string, obj = {}): void {
|
static debug(message: string, obj = {}): void {
|
||||||
@@ -65,23 +62,20 @@ export class Logger {
|
|||||||
Object.assign(obj, {createdAt: getCurrentTime(), message })
|
Object.assign(obj, {createdAt: getCurrentTime(), message })
|
||||||
);
|
);
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'debug',
|
||||||
spanContext: null,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
object: {
|
||||||
...obj,
|
...obj,
|
||||||
spanId: null,
|
|
||||||
name,
|
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
device_name: device?.name || device?.model,
|
device_name: device?.name || device?.model,
|
||||||
commit_date: environment.version.lastCommitTime,
|
commit_date: environment.version.lastCommitTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static info(message: string, obj = {}): void {
|
static info(message: string, obj = {}): void {
|
||||||
@@ -94,23 +88,20 @@ export class Logger {
|
|||||||
'\n',
|
'\n',
|
||||||
);
|
);
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'info',
|
||||||
spanContext: null,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
object: {
|
||||||
...obj,
|
...obj,
|
||||||
spanId: null,
|
|
||||||
name,
|
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
device_name: device?.name || device?.model,
|
device_name: device?.name || device?.model,
|
||||||
commit_date: environment.version.lastCommitTime,
|
commit_date: environment.version.lastCommitTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static warn(message: string, obj = {}): void {
|
static warn(message: string, obj = {}): void {
|
||||||
@@ -123,23 +114,20 @@ export class Logger {
|
|||||||
'\n',
|
'\n',
|
||||||
);
|
);
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'warn',
|
||||||
spanContext: null,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
object: {
|
||||||
...obj,
|
...obj,
|
||||||
spanId: null,
|
|
||||||
name,
|
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
device_name: device?.name || device?.model,
|
device_name: device?.name || device?.model,
|
||||||
commit_date: environment.version.lastCommitTime,
|
commit_date: environment.version.lastCommitTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static error(message?: string, obj = {}): void {
|
static error(message?: string, obj = {}): void {
|
||||||
@@ -153,23 +141,20 @@ export class Logger {
|
|||||||
'\n',
|
'\n',
|
||||||
);
|
);
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'error',
|
||||||
spanContext: null,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
object: {
|
||||||
...obj,
|
...obj,
|
||||||
spanId: null,
|
|
||||||
name,
|
|
||||||
user: SessionStore?.user?.FullName,
|
user: SessionStore?.user?.FullName,
|
||||||
device_name: device?.name || device?.model,
|
device_name: device?.name || device?.model,
|
||||||
commit_date: environment.version.lastCommitTime,
|
commit_date: environment.version.lastCommitTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal(error?: any, message?: string, context?: string): void {}
|
fatal(error?: any, message?: string, context?: string): void {}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|||||||
import { WebSocketGraylogService } from "../socket/socket";
|
import { WebSocketGraylogService } from "../socket/socket";
|
||||||
import { Span } from "@opentelemetry/sdk-trace-web";
|
import { Span } from "@opentelemetry/sdk-trace-web";
|
||||||
import { environment } from "src/environments/environment";
|
import { environment } from "src/environments/environment";
|
||||||
|
import { getInstanceId } from "src/app/module/chat/domain/chat-service.service";
|
||||||
|
|
||||||
|
|
||||||
export class OpenTelemetryLogging {
|
export class OpenTelemetryLogging {
|
||||||
@@ -17,13 +18,53 @@ export class OpenTelemetryLogging {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: Object & { type: string; payload: any, spanContext:any }): void {
|
async send({
|
||||||
// this.socket.send({
|
level,
|
||||||
// type: data.type,
|
message,
|
||||||
// payload: data.payload,
|
payload
|
||||||
// requestId: uuidv4(),
|
}: {
|
||||||
// spanContext: data.spanContext
|
level: string,
|
||||||
// });
|
message: string,
|
||||||
|
payload: Record<string, any>,
|
||||||
|
}): Promise<void> {
|
||||||
|
const nanoTimestamp = (Date.now() * 1_000_000).toString();
|
||||||
|
|
||||||
|
const logMessage = {
|
||||||
|
message,
|
||||||
|
details: { ...payload },
|
||||||
|
};
|
||||||
|
|
||||||
|
const logData = {
|
||||||
|
streams: [
|
||||||
|
{
|
||||||
|
stream: {
|
||||||
|
level,
|
||||||
|
k2: "true",
|
||||||
|
app: "angular-app",
|
||||||
|
instanceId: getInstanceId(),
|
||||||
|
},
|
||||||
|
values: [[nanoTimestamp, JSON.stringify(logMessage)]], // ✅ FIXED
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch("https://logs.petermaquiran.xyz/loki/api/v1/push", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(logData),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status !== 204) {
|
||||||
|
// Optional: handle failed log delivery
|
||||||
|
console.warn(`Failed to send log: ${response.status}`);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Optional: handle fetch error
|
||||||
|
console.error("Log sending error:", error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,21 +16,25 @@ function createProvider(serviceName) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
|
// provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
|
||||||
// provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
|
provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
|
||||||
// //url: 'https://5-180-182-151.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
//url: 'https://5-180-182-151.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
||||||
// url: 'https://185-229-224-75.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
//url: 'https://dev-obs01.doneit.co.ao/api/v2/spans',
|
||||||
// serviceName: serviceName,
|
url: 'https://tracing.petermaquiran.xyz/api/v2/spans',
|
||||||
// getExportRequestHeaders: () => {
|
serviceName: serviceName,
|
||||||
// return {
|
getExportRequestHeaders: () => {
|
||||||
// 'Authorization': 'Basic ' + btoa('tabteste@006:tabteste@006'),
|
return {
|
||||||
// };
|
'Authorization': `Basic ${btoa('doneit:Tabteste@006')}`,
|
||||||
// }
|
};
|
||||||
// })));
|
},
|
||||||
|
headers: {
|
||||||
provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({
|
'Authorization': `Basic ${btoa('doneit:Tabteste@006')}`,
|
||||||
url: 'https://185-229-224-75.cloud-xip.com:85/collector2/v1/traces',
|
}
|
||||||
})));
|
})));
|
||||||
|
|
||||||
|
// provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({
|
||||||
|
// url: 'https://ip-2-56-212-253-123420.vps.hosted-by-mvps.net:85/collector/v1/traces',
|
||||||
|
// })));
|
||||||
|
|
||||||
provider.register();
|
provider.register();
|
||||||
return provider;
|
return provider;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,25 +111,18 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish, waitNThrow =
|
|||||||
const _tracer = OpentelemetryLogging.getTracer('logging')
|
const _tracer = OpentelemetryLogging.getTracer('logging')
|
||||||
const spanContext = _tracer.startSpan(name)
|
const spanContext = _tracer.startSpan(name)
|
||||||
|
|
||||||
dataObject = convertAttributesToString(dataObject)
|
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
|
||||||
openTelemetryLogging.send({
|
openTelemetryLogging.send({
|
||||||
type: 'graylog',
|
level: 'info',
|
||||||
spanContext,
|
message,
|
||||||
payload: {
|
payload: {
|
||||||
message: message,
|
|
||||||
object: {
|
|
||||||
...dataObject,
|
...dataObject,
|
||||||
spanId,
|
// user: SessionStore?.user?.FullName,
|
||||||
name,
|
// device_name: device?.name || device?.model,
|
||||||
user: SessionStore?.user?.FullName,
|
// commit_date: environment.version.lastCommitTime,
|
||||||
device_name: device?.name || device?.model,
|
|
||||||
commit_date: environment.version.lastCommitTime,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
|
|
||||||
data.logs.push(dataObject)
|
data.logs.push(dataObject)
|
||||||
|
|
||||||
@@ -146,7 +139,7 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish, waitNThrow =
|
|||||||
|
|
||||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||||
span.setAttribute('error.list', data.errors.join(','))
|
span.setAttribute('error.list', data.errors.join(','))
|
||||||
// span.end();
|
span.end();
|
||||||
UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name})
|
UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ export class EditGroupPage implements OnInit {
|
|||||||
|
|
||||||
async changeGroupName() {
|
async changeGroupName() {
|
||||||
|
|
||||||
|
if(this.groupName == "" || this.groupName == null) {
|
||||||
|
this.toastService._badRequest("O nome do grupo não pode estar vazio.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.showLoader = true
|
this.showLoader = true
|
||||||
const result = await this.chatServiceService.updateRoomById({
|
const result = await this.chatServiceService.updateRoomById({
|
||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ import { whatsappDate } from 'src/app/ui/shared/utils/whatappdate';
|
|||||||
import { IDBoolean } from 'src/app/infra/database/dexie/type';
|
import { IDBoolean } from 'src/app/infra/database/dexie/type';
|
||||||
import { Result } from 'neverthrow';
|
import { Result } from 'neverthrow';
|
||||||
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
templateUrl: './messages.page.html',
|
templateUrl: './messages.page.html',
|
||||||
@@ -450,7 +452,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.chatServiceService.sendReadAt({
|
this.chatServiceService.sendReadAt({
|
||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
requestId: '',
|
requestId: uuidv4(),
|
||||||
roomId: this.room.id
|
roomId: this.room.id
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -47,6 +47,12 @@ export class EditGroupPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async changeGroupName() {
|
async changeGroupName() {
|
||||||
|
|
||||||
|
if(this.groupName == "" || this.groupName == null) {
|
||||||
|
this.toastService._badRequest("O nome do grupo não pode estar vazio.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.showLoader = true
|
this.showLoader = true
|
||||||
const result = await this.chatServiceService.updateRoomById({
|
const result = await this.chatServiceService.updateRoomById({
|
||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { UserTypingLocalRepository } from 'src/app/module/chat/data/repository/t
|
|||||||
import { Result } from 'neverthrow';
|
import { Result } from 'neverthrow';
|
||||||
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
||||||
import { UserTypingRemoteRepositoryService } from 'src/app/module/chat/data/repository/typing/user-typing-live-data-source.service';
|
import { UserTypingRemoteRepositoryService } from 'src/app/module/chat/data/repository/typing/user-typing-live-data-source.service';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -227,7 +227,7 @@ export class RoomStore {
|
|||||||
this.chatServiceService.sendReadAt({
|
this.chatServiceService.sendReadAt({
|
||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
requestId: '',
|
requestId: uuidv4(),
|
||||||
roomId: this.room.id
|
roomId: this.room.id
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ export class RoomStore {
|
|||||||
this.chatServiceService.sendReadAt({
|
this.chatServiceService.sendReadAt({
|
||||||
memberId: SessionStore.user.UserId,
|
memberId: SessionStore.user.UserId,
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
requestId: '',
|
requestId: uuidv4(),
|
||||||
roomId: this.room.id
|
roomId: this.room.id
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -241,6 +241,9 @@
|
|||||||
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ion-icon
|
||||||
|
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="(profilePictureSubject | async) as calendarData" class="profile-image">
|
<div *ngIf="(profilePictureSubject | async) as calendarData" class="profile-image">
|
||||||
<img class="profile-image font-45-em image-prety" src={{calendarData.base64}}>
|
<img class="profile-image font-45-em image-prety" src={{calendarData.base64}}>
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ export class HeaderPage implements OnInit {
|
|||||||
this.profilePictureSubject = this.UserRepositoryService.getProfilePictureLive() as any
|
this.profilePictureSubject = this.UserRepositoryService.getProfilePictureLive() as any
|
||||||
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
|
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
|
||||||
|
|
||||||
|
this.UserRepositoryService.getProfilePictureLive().subscribe((e) => {
|
||||||
|
console.log(`nice job ${e}`);
|
||||||
|
});
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
router.events.subscribe((val) => {
|
router.events.subscribe((val) => {
|
||||||
this.hideSearch();
|
this.hideSearch();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { Environment } from './../app/models/envarioment'
|
import { Environment } from './../app/models/envarioment'
|
||||||
import { environment as oaprProd } from './suport/oapr'
|
import { environment as oaprProd } from './suport/oapr'
|
||||||
// import { environment as doneITProd } from './suport/doneIt'
|
// import { environment as doneITProd } from './suport/doneIt'
|
||||||
import { DevDev } from './suport/dev'
|
|
||||||
|
|
||||||
|
|
||||||
export const environment: Environment = DevDev;
|
export const environment: Environment = oaprProd;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Environment } from './../app/models/envarioment'
|
import { Environment } from './../app/models/envarioment'
|
||||||
import { environment as oaprDev } from './suport/oapr'
|
import { environment as oaprDev } from './suport/oapr'
|
||||||
import { doneITDev } from './suport/doneIt'
|
|
||||||
import { DevDev } from './suport/dev'
|
import { DevDev } from './suport/dev'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,58 +1,11 @@
|
|||||||
import { versionData } from '../../../version/git-version'
|
import { versionData } from '../../../version/git-version'
|
||||||
import { Environment } from './../../app/models/envarioment'
|
import { Environment } from './../../app/models/envarioment'
|
||||||
|
|
||||||
// export const environment: Environment = {
|
|
||||||
// id:'3',
|
|
||||||
// apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
|
||||||
// /* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
|
||||||
// apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
|
||||||
// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
|
||||||
// apiPCURL: 'http://gpr-dev-01:86/api/',
|
|
||||||
// /* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */
|
|
||||||
// logoLabel: 'Presidente da República',
|
|
||||||
// despachoLabel: 'Presidenciais',
|
|
||||||
// despachoLabel2: 'Despachos Presidênciais',
|
|
||||||
// production: false,
|
|
||||||
// domain: 'gabinetedigital.local',
|
|
||||||
// defaultuser: 'paulo.pinto@gabinetedigital.local',
|
|
||||||
// defaultuserpwd: 'tabteste@006',
|
|
||||||
// chatOffline: true,
|
|
||||||
// presidential: true,
|
|
||||||
// version: versionData,
|
|
||||||
// agendaPR: 'Agenda do PR',
|
|
||||||
// agendaVP: 'Agenda do MD',
|
|
||||||
// PR: 'PR',
|
|
||||||
// VP: '',
|
|
||||||
// dispatchPR: 'Despachos Presidênciais',
|
|
||||||
// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
|
||||||
// storageProduction: true,
|
|
||||||
// rejectUnauthorized: "true",
|
|
||||||
// fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
|
||||||
// /* production: true,
|
|
||||||
// domain: 'gabinetedigital.local',
|
|
||||||
// defaultuser: '',
|
|
||||||
// defaultuserpwd: '',
|
|
||||||
// chatOffline: true,
|
|
||||||
// presidential: false,
|
|
||||||
// version: versionData,
|
|
||||||
// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
|
||||||
// logoLabel: 'doneIT',
|
|
||||||
// despachoLabel: 'do Titular',
|
|
||||||
// despachoLabel2: 'Despachos do Titular',
|
|
||||||
// agendaPR: 'Agenda do Titular',
|
|
||||||
// agendaVP: 'Agenda do (MD)',
|
|
||||||
// PR: 'Titular',
|
|
||||||
// VP: '',
|
|
||||||
// dispatchPR: 'Despachos Titular',
|
|
||||||
// storageProduction: true */
|
|
||||||
// };
|
|
||||||
|
|
||||||
|
|
||||||
export const DevDev: Environment = {
|
export const DevDev: Environment = {
|
||||||
id:'3',
|
id:'3',
|
||||||
|
apiURLStage: 'https://gdapi-dev.dyndns.info/stage/api/v2/',
|
||||||
apiURL: 'https://gdapi-dev.dyndns.info/jwt/api/',
|
apiURL: 'https://gdapi-dev.dyndns.info/jwt/api/',
|
||||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
|
||||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||||
logoLabel: 'Presidente da República',
|
logoLabel: 'Presidente da República',
|
||||||
despachoLabel: 'Presidenciais',
|
despachoLabel: 'Presidenciais',
|
||||||
@@ -71,23 +24,6 @@ export const DevDev: Environment = {
|
|||||||
dispatchPR: 'Despachos Presidênciais',
|
dispatchPR: 'Despachos Presidênciais',
|
||||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||||
storageProduction: false,
|
storageProduction: false,
|
||||||
rejectUnauthorized: "true"
|
rejectUnauthorized: "true",
|
||||||
/* production: true,
|
|
||||||
domain: 'gabinetedigital.local',
|
|
||||||
defaultuser: 'paulo.pinto@gabinetedigital.local',
|
|
||||||
defaultuserpwd: 'tabteste@006',
|
|
||||||
chatOffline: true,
|
|
||||||
presidential: false,
|
|
||||||
version: versionData,
|
|
||||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
|
||||||
logoLabel: 'doneIT',
|
|
||||||
despachoLabel: 'do Titular',
|
|
||||||
despachoLabel2: 'Despachos do Titular',
|
|
||||||
agendaPR: 'Agenda do Titular',
|
|
||||||
agendaVP: 'Agenda do (MD)',
|
|
||||||
PR: 'Titular',
|
|
||||||
VP: '',
|
|
||||||
dispatchPR: 'Despachos Titular',
|
|
||||||
storageProduction: false, */,
|
|
||||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
import { versionData } from '../../../version/git-version';
|
|
||||||
import { Environment } from './../../app/models/envarioment';
|
|
||||||
|
|
||||||
export const environment: Environment = {
|
|
||||||
id:'1',
|
|
||||||
apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
|
||||||
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
|
||||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
|
||||||
apiPCURL: 'http://gpr-dev-01:86/api/',
|
|
||||||
/* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */
|
|
||||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
|
||||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
|
||||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
|
||||||
production: true,
|
|
||||||
domain: 'gabinetedigital.local',
|
|
||||||
defaultuser: '',
|
|
||||||
defaultuserpwd: '',
|
|
||||||
chatOffline: true,
|
|
||||||
presidential: false,
|
|
||||||
version: versionData,
|
|
||||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
|
||||||
logoLabel: 'doneIT',
|
|
||||||
despachoLabel: 'do Titular',
|
|
||||||
despachoLabel2: 'Despachos do Titular',
|
|
||||||
agendaPR: 'Agenda do Titular',
|
|
||||||
agendaVP: 'Agenda do (MD)',
|
|
||||||
PR: 'Titular',
|
|
||||||
VP: '',
|
|
||||||
dispatchPR: 'Despachos Titular',
|
|
||||||
storageProduction: true,
|
|
||||||
rejectUnauthorized: "true",
|
|
||||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
|
||||||
};
|
|
||||||
|
|
||||||
export const doneITDev: Environment = {
|
|
||||||
id:'1',
|
|
||||||
apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
|
||||||
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
|
||||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
|
||||||
apiPCURL: 'http://gpr-dev-01:86/api/',
|
|
||||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
|
||||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
|
||||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
|
||||||
production: true,
|
|
||||||
domain: 'gabinetedigital.local',
|
|
||||||
defaultuser: '',
|
|
||||||
defaultuserpwd: '',
|
|
||||||
chatOffline: true,
|
|
||||||
presidential: false,
|
|
||||||
version: versionData,
|
|
||||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
|
||||||
logoLabel: 'doneIT',
|
|
||||||
despachoLabel: 'do Titular',
|
|
||||||
despachoLabel2: 'Despachos do Titular',
|
|
||||||
agendaPR: 'Agenda do Titular',
|
|
||||||
agendaVP: 'Agenda do (MD)',
|
|
||||||
PR: 'Titular',
|
|
||||||
VP: '',
|
|
||||||
dispatchPR: 'Despachos Titular',
|
|
||||||
storageProduction: false,
|
|
||||||
rejectUnauthorized: "true",
|
|
||||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
|
||||||
};
|
|
||||||
@@ -4,12 +4,8 @@ import { Environment } from './../../app/models/envarioment'
|
|||||||
|
|
||||||
export const environment: Environment = {
|
export const environment: Environment = {
|
||||||
id: '0',
|
id: '0',
|
||||||
/* apiURL: 'http://gpr-dev-01:83/jwt/api/', */
|
apiURLStage: 'https://gdqas-api.oapr.gov.ao/stage/api/v2/',
|
||||||
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
||||||
/* apiChatUrl: 'http://192.168.0.29:3000/api/v1/', */
|
|
||||||
apiChatUrl: 'https://gdqas-chat.oapr.gov.ao/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://gdqas-chat.oapr.gov.ao/websocket',
|
|
||||||
/* apiPCURL: 'http://gpr-dev-01:86/api/', */
|
|
||||||
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
||||||
logoLabel: 'Presidente da República',
|
logoLabel: 'Presidente da República',
|
||||||
despachoLabel: 'Presidenciais',
|
despachoLabel: 'Presidenciais',
|
||||||
@@ -34,12 +30,8 @@ export const environment: Environment = {
|
|||||||
|
|
||||||
export const oaprDev: Environment = {
|
export const oaprDev: Environment = {
|
||||||
id: '0',
|
id: '0',
|
||||||
/* apiURL: 'http://gpr-dev-01:83/jwt/api/', */
|
apiURLStage: 'https://gdqas-api.oapr.gov.ao/stage/api/v2/',
|
||||||
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
||||||
/* apiChatUrl: 'http://192.168.0.29:3000/api/v1/', */
|
|
||||||
apiChatUrl: 'https://gdqas-chat.oapr.gov.ao/api/v1/',
|
|
||||||
apiWsChatUrl: 'wss://gdqas-chat.oapr.gov.ao/websocket',
|
|
||||||
/* apiPCURL: 'http://gpr-dev-01:86/api/', */
|
|
||||||
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
||||||
logoLabel: 'Presidente da República',
|
logoLabel: 'Presidente da República',
|
||||||
despachoLabel: 'Presidencial',
|
despachoLabel: 'Presidencial',
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "470b1e7f0",
|
"shortSHA": "cfc7330e7",
|
||||||
"SHA": "470b1e7f0e0e7a4ae7155d7b88c322e770e21f26",
|
"SHA": "cfc7330e729bb815925e687ffa74c20fe4431eb3",
|
||||||
"branch": "feature/login-v2",
|
"branch": "developer",
|
||||||
"lastCommitAuthor": "'peter.maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Tue Jun 3 09:42:08 2025 +0100'",
|
"lastCommitTime": "'Tue Jun 3 08:46:54 2025 +0000'",
|
||||||
"lastCommitMessage": "fix",
|
"lastCommitMessage": "Merged in feature/login-v2 (pull request #36)\n\nFeature/login v2",
|
||||||
"lastCommitNumber": "6141",
|
"lastCommitNumber": "6143",
|
||||||
"changeStatus": "On branch feature/login-v2\nYour branch is ahead of 'origin/feature/login-v2' by 6 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: version/git-version.ts",
|
"changeStatus": "On branch developer\nYour branch is up to date with 'origin/developer'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/core/chat/entity/group.ts\n\tmodified: src/app/core/chat/entity/message.ts\n\tmodified: src/app/core/chat/mapper/messageMapper.ts\n\tmodified: src/app/core/chat/repository/dto/messageOutputDTO.ts\n\tmodified: src/app/core/chat/repository/room/room-socket-repository.ts\n\tmodified: src/app/core/chat/usecase/message/listen-message-by-roomId.service.ts\n\tmodified: src/app/core/chat/usecase/message/listen-send-message.service.ts\n\tmodified: src/app/core/chat/usecase/message/message-create-use-case.service copy.ts\n\tmodified: src/app/core/chat/usecase/message/message-create-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/message/message-mark-all-message-as-read-by-room-id.service.ts\n\tmodified: src/app/core/chat/usecase/message/messages-send-offline-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-bold-sync-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-create-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-get-by-id-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-get-list-use-case.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-update-by-id-use-case.service.ts\n\tmodified: src/app/infra/database/dexie/instance/chat/schema/members.ts\n\tmodified: src/app/infra/database/dexie/instance/chat/schema/room.ts\n\tmodified: src/app/infra/monitoring/interceptors/token.interceptors.ts\n\tmodified: src/app/infra/socket/signalR/signal-r.service.ts\n\tmodified: src/app/modals/profile/edit-profile/edit-profile.page.html\n\tmodified: src/app/models/envarioment.ts\n\tmodified: src/app/module/agenda/data/data-source/agenda-data.service.ts\n\tmodified: src/app/module/chat/data/repository/attachment/attachment-remote-repository.service.ts\n\tmodified: src/app/module/chat/data/repository/member/member-list-remote-repository.service.ts\n\tmodified: src/app/module/chat/data/repository/member/member-socket-repository.service.ts\n\tmodified: src/app/module/chat/data/repository/message/message-live-signalr-data-source.service.ts\n\tmodified: src/app/module/chat/data/repository/message/message-remote-data-source.service.ts\n\tmodified: src/app/module/chat/data/repository/room/room-remote-repository.service.ts\n\tmodified: src/app/module/chat/data/repository/typing/user-typing-live-data-source.service.ts\n\tmodified: src/app/module/chat/domain/chat-service.service.ts\n\tmodified: src/app/module/chat/domain/service/room-last-message.service.ts\n\tmodified: src/app/module/notification/data/datasource/remote-notification.service.ts\n\tmodified: src/app/module/user/data/datasource/user-remote-repository.service.ts\n\tmodified: src/app/services/Repositorys/contacts/data-source/contacts-data-source.service.ts\n\tmodified: src/app/services/aesencrypt.service.ts\n\tmodified: src/app/services/logger/main/service.ts\n\tmodified: src/app/services/monitoring/opentelemetry/logging.ts\n\tmodified: src/app/services/monitoring/opentelemetry/opentelemetry.ts\n\tmodified: src/app/services/monitoring/opentelemetry/tracer.ts\n\tmodified: src/app/ui/chat/component/edit-group/edit-group.page.ts\n\tmodified: src/app/ui/chat/component/messages/messages.page.ts\n\tmodified: src/app/ui/chat/modal/edit-group/edit-group.page.ts\n\tmodified: src/app/ui/chat/store/roomStore.ts\n\tmodified: src/app/ui/shared/components/header/header.page.html\n\tmodified: src/app/ui/shared/components/header/header.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts\n\tmodified: src/environments/suport/dev.ts\n\tdeleted: src/environments/suport/doneIt.ts\n\tmodified: src/environments/suport/oapr.ts\n\tdeleted: workspace.code-workspace",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"folders": [
|
|
||||||
{
|
|
||||||
"path": "."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../sentry"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../sentium"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../GDoc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"settings": {
|
|
||||||
"cSpell.words": [
|
|
||||||
"Chatmessage"
|
|
||||||
],
|
|
||||||
"nuxt.isNuxtApp": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user