robbyson-frontend-library 1.0.108 → 1.0.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/chat.constants.js +9 -0
- package/dist/utils/chat.utils.js +2 -0
- package/dist/utils/robbyson-navigate.js +11 -8
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/models_base_repository_model.BaseRepositoryModel.html +1 -1
- package/docs/classes/models_chat_model.ChatModel.html +3 -2
- package/docs/classes/models_chat_model.ChatUser.html +2 -2
- package/docs/classes/models_user_metadata_model.UserMetadataModel.html +4 -0
- package/docs/classes/models_user_model.UserModel.html +4 -2
- package/docs/classes/models_user_session_model.UserSessionModel.html +3 -1
- package/docs/enums/constants_chat_constants.CHAT_SOCKET_SIGNALS.html +6 -0
- package/docs/functions/utils_chat_utils.generateMessageTempId.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/components_guard_permission_guard_permission_interface.IGuardPermissionProps.html +3 -2
- package/docs/interfaces/components_guard_permission_guard_permission_interface.IGuardPermissionState.html +2 -2
- package/docs/interfaces/components_search_input_search_input_interfaces.ISearchInputProps.html +2 -2
- package/docs/interfaces/components_text_area_text_area_interface.ITextAreaProps.html +2 -2
- package/docs/interfaces/components_text_field_text_field_interface.ITextFieldProps.html +2 -2
- package/docs/interfaces/models_chat_model.IInviteList.html +3 -2
- package/docs/interfaces/models_user_model.UserModelOld.html +4 -2
- package/docs/interfaces/repositories_chat_repository_interface.IChatRepository.html +2 -2
- package/docs/interfaces/repositories_lovefield_repository_interface.ILoveFieldRepository.html +2 -2
- package/docs/interfaces/repositories_user_metadata_repository_interface.IUserMetadataRepository.html +5 -2
- package/docs/interfaces/repositories_user_repository_interface.IUserRepository.html +2 -2
- package/docs/interfaces/services_chat_service_interface.IChatService.html +15 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatBotFields.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatBotFormattedMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatBotMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatBotTableMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatFormattedMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatListSidebar.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatMessages.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IChatPermissions.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IClearMessages.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IConversationDTO.html +3 -2
- package/docs/interfaces/services_dtos_chat_dto.IGetConversationList.html +4 -0
- package/docs/interfaces/services_dtos_chat_dto.IGetConversations.html +3 -0
- package/docs/interfaces/services_dtos_chat_dto.IGetConversationsResponse.html +3 -0
- package/docs/interfaces/services_dtos_chat_dto.IGetMessagesDTO.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IMemberSidebar.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.INewChatListWithoutRepeating.html +4 -0
- package/docs/interfaces/services_dtos_chat_dto.INewChatListWithoutRepeatingResponse.html +3 -0
- package/docs/interfaces/services_dtos_chat_dto.INewChatMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.INewMessageInterface.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IOpenConversation.html +26 -0
- package/docs/interfaces/services_dtos_chat_dto.IOpenConversationInfo.html +9 -0
- package/docs/interfaces/services_dtos_chat_dto.IProfileSidebar.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IRemoveOpenConversations.html +3 -0
- package/docs/interfaces/services_dtos_chat_dto.ISetChatMessages.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.ISetConversationGroupInformation.html +3 -0
- package/docs/interfaces/services_dtos_chat_dto.ISmallChat.html +3 -2
- package/docs/interfaces/services_dtos_chat_dto.IStateChatMessages.html +1 -0
- package/docs/interfaces/services_dtos_chat_dto.IStateMessages.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.ISubscribeMessage.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IUpdateClassificationDTO.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IUpdateGroupDTO.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IUpdateGroupInfoDTO.html +4 -0
- package/docs/interfaces/services_dtos_chat_dto.IUpdatedGroup.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.IUpdatedUsers.html +2 -2
- package/docs/interfaces/services_dtos_chat_dto.RequestPayload.html +2 -2
- package/docs/interfaces/services_dtos_user_dto.GetUserDTO.html +2 -2
- package/docs/interfaces/services_dtos_user_dto.IGetUserImage.html +2 -2
- package/docs/interfaces/services_dtos_user_dto.IGetUserListDTO.html +3 -2
- package/docs/interfaces/services_dtos_user_dto.IGetUserListResponseDTO.html +3 -0
- package/docs/interfaces/services_dtos_user_dto.IResponseUserImage.html +2 -2
- package/docs/interfaces/services_dtos_user_metadata_dto.IPostGuidanceFileDownloadDTO.html +7 -0
- package/docs/interfaces/services_dtos_user_metadata_dto.IPostGuidanceViewDTO.html +5 -0
- package/docs/interfaces/services_upload_service_interface.IUploadService.html +3 -2
- package/docs/interfaces/services_user_metadata_service_interface.IUserMetadataService.html +5 -2
- package/docs/interfaces/services_user_service_interface.IUserService.html +2 -2
- package/docs/interfaces/states_chat_container_chat_app_state_interface.IChatApp.html +7 -2
- package/docs/modules/constants.html +2 -1
- package/docs/modules/constants_chat_constants.html +1 -0
- package/docs/modules/index.html +3 -1
- package/docs/modules/models.html +2 -1
- package/docs/modules/models_user_metadata_model.html +2 -0
- package/docs/modules/services.html +2 -1
- package/docs/modules/services_dtos.html +2 -1
- package/docs/modules/services_dtos_chat_dto.html +11 -0
- package/docs/modules/services_dtos_user_dto.html +1 -0
- package/docs/modules/services_dtos_user_metadata_dto.html +3 -0
- package/docs/types/services_dtos_chat_dto.BotHandle.html +1 -1
- package/docs/types/services_dtos_chat_dto.ConversationType.html +1 -1
- package/docs/types/services_dtos_chat_dto.MessageBotType.html +1 -1
- package/docs/variables/constants_chat_constants.ChatConstants.html +1 -1
- package/docs/variables/constants_user_metadata_constants.UserMetadataConstants.html +1 -1
- package/docs/variables/utils_chat_utils.ChatUtils.html +1 -1
- package/package.json +1 -1
- package/src/components/text-field/text-field.interface.ts +1 -1
- package/src/constants/chat.constants.ts +9 -0
- package/src/models/chat.model.ts +2 -0
- package/src/models/user-session.model.ts +1 -0
- package/src/repositories/chat.repository.interface.ts +1 -1
- package/src/repositories/lovefield.repository.interface.ts +0 -1
- package/src/repositories/user.repository.interface.ts +1 -1
- package/src/services/chat.service.interface.ts +19 -7
- package/src/services/dtos/chat.dto.ts +71 -2
- package/src/services/dtos/user.dto.ts +8 -0
- package/src/services/user.service.interface.ts +1 -1
- package/src/states/chat-container/chat-app.state.interface.ts +9 -1
- package/src/utils/chat.utils.ts +2 -0
- package/src/utils/robbyson-navigate.ts +14 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CHAT_CLASSIFICATION, TYPE_CHAT } from "../../constants";
|
|
2
|
-
import { ChatModel, MessageModel, UserListModel } from "../../models";
|
|
2
|
+
import { ChatModel, ChatUser, MessageModel, UserListModel } from "../../models";
|
|
3
3
|
import { GetUserDTO } from "./user.dto";
|
|
4
4
|
|
|
5
5
|
export interface IGetConversationDTO {
|
|
@@ -24,7 +24,20 @@ export interface ICreateConversationDTO {
|
|
|
24
24
|
admin?: boolean;
|
|
25
25
|
classification?: CHAT_CLASSIFICATION;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
export interface IGetConversations {
|
|
28
|
+
data: UserListModel[] & ChatModel[];
|
|
29
|
+
totalItems?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface IGetConversationsResponse {
|
|
32
|
+
data: UserListModel[] & ChatModel[];
|
|
33
|
+
meta: {
|
|
34
|
+
type?: string,
|
|
35
|
+
total?: number,
|
|
36
|
+
page?: number,
|
|
37
|
+
per?: number,
|
|
38
|
+
totalDocs?: number
|
|
39
|
+
};
|
|
40
|
+
}
|
|
28
41
|
export interface IUpdateGroupDTO {
|
|
29
42
|
name?: string;
|
|
30
43
|
description?: string;
|
|
@@ -145,6 +158,10 @@ export interface IProfileSidebar {
|
|
|
145
158
|
isOpen: boolean;
|
|
146
159
|
userInfo?: UserListModel;
|
|
147
160
|
}
|
|
161
|
+
export interface ISetConversationGroupInformation {
|
|
162
|
+
open: boolean;
|
|
163
|
+
data?: ChatModel;
|
|
164
|
+
}
|
|
148
165
|
|
|
149
166
|
export interface IMemberSidebar {
|
|
150
167
|
isOpen?: boolean;
|
|
@@ -160,6 +177,43 @@ export interface IConversationDTO extends Partial<ChatModel> {
|
|
|
160
177
|
onClose?: () => void;
|
|
161
178
|
}
|
|
162
179
|
|
|
180
|
+
export interface IOpenConversationInfo {
|
|
181
|
+
canSendMessages: boolean;
|
|
182
|
+
canSendFiles: boolean;
|
|
183
|
+
chatImage: string;
|
|
184
|
+
name: string;
|
|
185
|
+
photo?: string;
|
|
186
|
+
isGroup: boolean;
|
|
187
|
+
quitedGroup: boolean;
|
|
188
|
+
user?: ChatUser;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface IOpenConversation extends ChatModel {
|
|
192
|
+
info: IOpenConversationInfo;
|
|
193
|
+
}
|
|
194
|
+
export interface IGetConversationList {
|
|
195
|
+
conversations: ChatModel[] | UserListModel[];
|
|
196
|
+
totalItems: number;
|
|
197
|
+
countNotRead: number;
|
|
198
|
+
|
|
199
|
+
}
|
|
200
|
+
export interface IUpdateGroupInfoDTO {
|
|
201
|
+
openConversations: { [conversationId: string]: IOpenConversation };
|
|
202
|
+
conversations: ChatModel[];
|
|
203
|
+
chatMessages?: {
|
|
204
|
+
[conversationId: string]: IChatMessages;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface IRemoveOpenConversations {
|
|
209
|
+
updatedOpenConversations: {
|
|
210
|
+
[conversationId: string]: IOpenConversation;
|
|
211
|
+
};
|
|
212
|
+
updatedChatMessages: {
|
|
213
|
+
[conversationId: string]: IChatMessages;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
163
217
|
export interface IChatMessages {
|
|
164
218
|
data: IChatFormattedMessage[];
|
|
165
219
|
hasMoreResults: boolean;
|
|
@@ -174,6 +228,10 @@ export interface IChatListSidebar {
|
|
|
174
228
|
shouldRedirect?: boolean;
|
|
175
229
|
}
|
|
176
230
|
|
|
231
|
+
export interface IStateChatMessages {
|
|
232
|
+
[conversationId: string]: IChatMessages;
|
|
233
|
+
}
|
|
234
|
+
|
|
177
235
|
export interface ISubscribeMessage {
|
|
178
236
|
_id: string;
|
|
179
237
|
conversation_id: string;
|
|
@@ -224,3 +282,14 @@ export interface IClearMessages {
|
|
|
224
282
|
conversation_id: string;
|
|
225
283
|
identification: string;
|
|
226
284
|
}
|
|
285
|
+
|
|
286
|
+
export interface INewChatListWithoutRepeating {
|
|
287
|
+
oldConversations: UserListModel[] & ChatModel[];
|
|
288
|
+
newConversations: UserListModel[] & ChatModel[];
|
|
289
|
+
append?: boolean
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface INewChatListWithoutRepeatingResponse {
|
|
293
|
+
conversations: UserListModel[] & ChatModel[],
|
|
294
|
+
countNotRead: number
|
|
295
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UserListModel } from "../../models";
|
|
2
|
+
|
|
1
3
|
export interface GetUserDTO {
|
|
2
4
|
name?: string;
|
|
3
5
|
identification?: string;
|
|
@@ -21,6 +23,12 @@ export interface IGetUserListDTO {
|
|
|
21
23
|
page?: number;
|
|
22
24
|
per?: number;
|
|
23
25
|
active?: boolean;
|
|
26
|
+
count?:boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IGetUserListResponseDTO {
|
|
30
|
+
items: UserListModel[];
|
|
31
|
+
numTotalItems: number
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
export interface IGetUserImage {
|
|
@@ -39,7 +39,7 @@ export interface IUserService {
|
|
|
39
39
|
|
|
40
40
|
getUserMirror(_id: number): Promise<UserMirrorModel>;
|
|
41
41
|
|
|
42
|
-
getUserList(params: UserDTO.IGetUserListDTO): Promise<UserListModel[]>;
|
|
42
|
+
getUserList(params: UserDTO.IGetUserListDTO): Promise<UserListModel[] | UserDTO.IGetUserListResponseDTO>;
|
|
43
43
|
|
|
44
44
|
getUserImage({
|
|
45
45
|
user_id,
|
|
@@ -6,20 +6,28 @@ export interface IChatApp {
|
|
|
6
6
|
conversation_id: string;
|
|
7
7
|
}[];
|
|
8
8
|
chatListSideBar: ChatDTO.IChatListSidebar;
|
|
9
|
+
chatListSideBarExists: boolean;
|
|
9
10
|
smallChats: ChatDTO.ISmallChat[];
|
|
10
11
|
profileSideBar: {
|
|
11
12
|
isOpen: boolean;
|
|
12
13
|
};
|
|
14
|
+
chatKeyList: string;
|
|
13
15
|
memberSideBar: {
|
|
14
16
|
isOpen: boolean;
|
|
15
17
|
};
|
|
16
18
|
chatBotMessages: any[];
|
|
17
|
-
chatMessages:
|
|
19
|
+
chatMessages: ChatDTO.IStateChatMessages;
|
|
18
20
|
conversationSideBar: ChatDTO.IConversationDTO;
|
|
19
21
|
countNotRead: number;
|
|
20
22
|
conversations: UserListModel[] | ChatModel[];
|
|
23
|
+
totalItems: number;
|
|
24
|
+
openConversations: { [conversationId: string]: ChatDTO.IOpenConversation };
|
|
21
25
|
addMemberModal: boolean;
|
|
22
26
|
editGroupModal: boolean;
|
|
23
27
|
updatedUsers: ChatDTO.IUpdatedUsers;
|
|
24
28
|
lastConversationsSearch: { search: string; type: string };
|
|
29
|
+
group: {
|
|
30
|
+
open: boolean,
|
|
31
|
+
data: any
|
|
32
|
+
}
|
|
25
33
|
}
|
package/src/utils/chat.utils.ts
CHANGED
|
@@ -112,6 +112,8 @@ export function getPlaceholderMessage(
|
|
|
112
112
|
): string {
|
|
113
113
|
if (!isActive) return "inactive_user";
|
|
114
114
|
|
|
115
|
+
if (canSendMessages === undefined) return "";
|
|
116
|
+
|
|
115
117
|
if (!canSendMessages) return "chat_type_your_message_no_permission";
|
|
116
118
|
|
|
117
119
|
return "chat_type_your_message";
|
|
@@ -14,13 +14,13 @@ export class RobbysonNavigate {
|
|
|
14
14
|
|
|
15
15
|
const { history } = RobbysonNavigate._globalState.Global.RootApp;
|
|
16
16
|
const routeState = { ...state, pathname: history.location.pathname };
|
|
17
|
-
this.setLocationHistory(
|
|
17
|
+
this.setLocationHistory(history.location.pathname);
|
|
18
18
|
// TODO: Usar a LIB PATH para concatenar a URL
|
|
19
19
|
history.push(`/operacao${url}`, routeState);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
static openInNewTab(url: string) {
|
|
23
|
-
window.open(url,
|
|
23
|
+
window.open(url, "_blank");
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
static open(url: string): void {
|
|
@@ -53,7 +53,7 @@ export class RobbysonNavigate {
|
|
|
53
53
|
|
|
54
54
|
const { history } = RobbysonNavigate._globalState.Global.RootApp;
|
|
55
55
|
const routeState = { ...state, pathname: history.location.pathname };
|
|
56
|
-
this.setLocationHistory(
|
|
56
|
+
this.setLocationHistory(history.location.pathname);
|
|
57
57
|
|
|
58
58
|
history.replace(replace, routeState);
|
|
59
59
|
}
|
|
@@ -77,10 +77,10 @@ export class RobbysonNavigate {
|
|
|
77
77
|
RobbysonNavigate._globalState =
|
|
78
78
|
RobbysonNavigate._globalStore.GetGlobalState();
|
|
79
79
|
|
|
80
|
-
const
|
|
80
|
+
const history = RobbysonNavigate._globalState.Global?.RootApp.history;
|
|
81
81
|
|
|
82
|
-
const routeParams = history
|
|
83
|
-
const id = routeParams[routeParams.length - 1];
|
|
82
|
+
const routeParams = history?.location.pathname.split("/");
|
|
83
|
+
const id = routeParams ? routeParams[routeParams.length - 1] : "";
|
|
84
84
|
|
|
85
85
|
return id;
|
|
86
86
|
}
|
|
@@ -90,9 +90,9 @@ export class RobbysonNavigate {
|
|
|
90
90
|
RobbysonNavigate._globalState =
|
|
91
91
|
RobbysonNavigate._globalStore.GetGlobalState();
|
|
92
92
|
|
|
93
|
-
const
|
|
93
|
+
const history = RobbysonNavigate._globalState.Global?.RootApp.history;
|
|
94
94
|
|
|
95
|
-
return history
|
|
95
|
+
return history?.location.pathname;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
static matchPath(path: string): boolean {
|
|
@@ -104,17 +104,17 @@ export class RobbysonNavigate {
|
|
|
104
104
|
RobbysonNavigate._globalState =
|
|
105
105
|
RobbysonNavigate._globalStore.GetGlobalState();
|
|
106
106
|
|
|
107
|
-
const
|
|
107
|
+
const history = RobbysonNavigate._globalState.Global?.RootApp.history;
|
|
108
108
|
|
|
109
|
-
return queryString.parse(history
|
|
109
|
+
return queryString.parse(history?.location.search, {
|
|
110
110
|
sort: false,
|
|
111
111
|
}) as T;
|
|
112
112
|
}
|
|
113
|
-
static setLocationHistory(location: string){
|
|
114
|
-
localStorage.setItem("location-history", location)
|
|
113
|
+
static setLocationHistory(location: string) {
|
|
114
|
+
localStorage.setItem("location-history", location);
|
|
115
115
|
}
|
|
116
116
|
static getLocationHistory(): string | null {
|
|
117
|
-
return localStorage.getItem("location-history")
|
|
117
|
+
return localStorage.getItem("location-history");
|
|
118
118
|
}
|
|
119
119
|
static setQueryParams(
|
|
120
120
|
key: string | string[],
|