quickblox-react-ui-kit 0.5.0-beta.13 → 0.5.0-beta.15
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/CommonTypes/CommonTypes.d.ts +2 -0
- package/dist/CommonTypes/CommonTypes.d.ts.map +1 -1
- package/dist/Data/DefaultConfigurations.d.ts.map +1 -1
- package/dist/Data/source/remote/RemoteDataSource.d.ts +3 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts.map +1 -1
- package/dist/Domain/use_cases/CreateDialogUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ForwardMessagesUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetAllDialogsUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetAllDialogsUseCaseWithMock.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetAllUsersUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetDialogByIdUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/GetUsersByIdsUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/LeaveDialogUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/RemoveUsersFromTheDialogUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ReplyMessagesUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/SendTextMessageUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/SubscribeToDialogEventsUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/SyncDialogsUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/UpdateDialogUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/UploadFileUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/UserTypingMessageUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AIAnswerAssistUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AIRephraseUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AIRephraseWithProxyUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AITranslateUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AITranslateWithProxyUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/ai/AITranslateWithSDKUseCase.d.ts.map +1 -1
- package/dist/Domain/use_cases/base/Subscribable/SubscriptionPerformer.d.ts.map +1 -1
- package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts +3 -2
- package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts.map +1 -1
- package/dist/Presentation/Views/Dialog/useDialogViewModel.d.ts.map +1 -1
- package/dist/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.d.ts.map +1 -1
- package/dist/Presentation/Views/DialogList/useDialogListViewModel.d.ts.map +1 -1
- package/dist/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.d.ts.map +1 -1
- package/dist/QBconfig.d.ts.map +1 -1
- package/dist/index-ui.js +65 -202
- package/package.json +1 -1
- package/src/CommonTypes/CommonTypes.ts +2 -0
- package/src/Data/DefaultConfigurations.ts +2 -0
- package/src/Data/source/remote/RemoteDataSource.ts +72 -166
- package/src/Domain/use_cases/CreateDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/ForwardMessagesUseCase.ts +0 -1
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +0 -1
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +0 -2
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +0 -1
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +0 -1
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +0 -2
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +0 -3
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +0 -1
- package/src/Domain/use_cases/ReplyMessagesUseCase.ts +0 -2
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +0 -3
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +0 -1
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +0 -1
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +0 -1
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +0 -2
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +0 -2
- package/src/Domain/use_cases/UploadFileUseCase.ts +0 -2
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AITranslateUseCase.ts +0 -2
- package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +0 -3
- package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +0 -3
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +0 -1
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +4 -1
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +0 -5
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +0 -3
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +0 -1
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +6 -1
- package/src/QBconfig.ts +2 -0
- package/src/hooks/useQuickBloxUIKit.ts +1 -1
- package/storybook-static/161.53da4e03.iframe.bundle.js +2 -0
- package/storybook-static/{756.92971caf.iframe.bundle.js.LICENSE.txt → 161.53da4e03.iframe.bundle.js.LICENSE.txt} +0 -10
- package/storybook-static/217.3c66ff1e.iframe.bundle.js +405 -0
- package/storybook-static/217.3c66ff1e.iframe.bundle.js.LICENSE.txt +9 -0
- package/storybook-static/{756.92971caf.iframe.bundle.js.map → 217.3c66ff1e.iframe.bundle.js.map} +1 -1
- package/storybook-static/844.6041e1a5.iframe.bundle.js +95 -0
- package/storybook-static/844.6041e1a5.iframe.bundle.js.map +1 -0
- package/storybook-static/iframe.html +3 -3
- package/storybook-static/{main.c2fb2ab0.iframe.bundle.js → main.59f682e8.iframe.bundle.js} +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.5a7ba727.iframe.bundle.js +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +24 -24
- package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +5 -5
- package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-11/manager-bundle.js +20 -20
- package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +1 -1
- package/storybook-static/sb-manager/globals-module-info.js +5 -0
- package/storybook-static/sb-manager/globals-runtime.js +11936 -11584
- package/storybook-static/sb-manager/runtime.js +144 -144
- package/storybook-static/sb-preview/runtime.js +3 -5
- package/storybook-static/756.92971caf.iframe.bundle.js +0 -405
- package/storybook-static/844.642791cb.iframe.bundle.js +0 -95
- package/storybook-static/844.642791cb.iframe.bundle.js.map +0 -1
- package/storybook-static/runtime~main.df48e830.iframe.bundle.js +0 -1
- /package/storybook-static/{844.642791cb.iframe.bundle.js.LICENSE.txt → 844.6041e1a5.iframe.bundle.js.LICENSE.txt} +0 -0
package/dist/index-ui.js
CHANGED
|
@@ -60682,7 +60682,6 @@ class SubscriptionPerformer {
|
|
|
60682
60682
|
// });
|
|
60683
60683
|
}
|
|
60684
60684
|
constructor() {
|
|
60685
|
-
console.log('CONSTRUCTOR SubscriptionPerformer');
|
|
60686
60685
|
// this.onEventByTypeSubscribers[EventMessageType.LocalMessage] = [];
|
|
60687
60686
|
this.onEventByTypeSubscribers[EventMessageType.LocalMessage] =
|
|
60688
60687
|
this.subscribers;
|
|
@@ -65311,6 +65310,8 @@ const QBConfig = {
|
|
|
65311
65310
|
chatProtocol: {
|
|
65312
65311
|
active: 2,
|
|
65313
65312
|
},
|
|
65313
|
+
pingLocalhostTimeInterval: 0,
|
|
65314
|
+
chatReconnectionTimeInterval: 3,
|
|
65314
65315
|
debug: true,
|
|
65315
65316
|
enableForwarding: true,
|
|
65316
65317
|
enableReplying: true,
|
|
@@ -65438,7 +65439,6 @@ class RemoteDataSource {
|
|
|
65438
65439
|
}
|
|
65439
65440
|
//
|
|
65440
65441
|
constructor() {
|
|
65441
|
-
console.log('CONSTRUCTOR RemoteDataSourceMock');
|
|
65442
65442
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
65443
65443
|
// @ts-ignore
|
|
65444
65444
|
console.log('QB inside RemoteDataSource:', window.QB);
|
|
@@ -65463,7 +65463,7 @@ class RemoteDataSource {
|
|
|
65463
65463
|
new SubscriptionPerformer();
|
|
65464
65464
|
this.subscriptionOnSystemMessages[NotificationTypes.NEW_DIALOG] =
|
|
65465
65465
|
new SubscriptionPerformer();
|
|
65466
|
-
this.startUserCachePreload();
|
|
65466
|
+
// this.startUserCachePreload(); //TODO: uncomment this line after test [CSAMPLES-4065] is done
|
|
65467
65467
|
}
|
|
65468
65468
|
// eslint-disable-next-line class-methods-use-this
|
|
65469
65469
|
createAnswer(text, messages, smartChatAssistantId) {
|
|
@@ -65840,7 +65840,6 @@ class RemoteDataSource {
|
|
|
65840
65840
|
};
|
|
65841
65841
|
QB.chat.onMessageErrorListener = (messageId, error) => {
|
|
65842
65842
|
console.log(`EVENT: receive error message id: ${messageId}, error: ${parse_stringifyError(error)}, current auth status is: ${this.authProcessed ? 'true' : 'false'}`);
|
|
65843
|
-
this.subscriptionOnSessionExpiredListener.informSubscribers(true, EventMessageType.LocalMessage);
|
|
65844
65843
|
};
|
|
65845
65844
|
QB.chat.onReadStatusListener = (messageId, dialogId, userId) => {
|
|
65846
65845
|
console.log(`EVENT: receive read message id: ${messageId}, dialogid: ${dialogId} userid: ${userId}`);
|
|
@@ -65939,6 +65938,7 @@ class RemoteDataSource {
|
|
|
65939
65938
|
async joinGroupDialog(dialogId) {
|
|
65940
65939
|
try {
|
|
65941
65940
|
await QBJoinGroupDialog(dialogId).catch(() => {
|
|
65941
|
+
this.joinStatusMap.set(dialogId, false);
|
|
65942
65942
|
throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
|
|
65943
65943
|
});
|
|
65944
65944
|
this.joinStatusMap.set(dialogId, true);
|
|
@@ -65948,171 +65948,81 @@ class RemoteDataSource {
|
|
|
65948
65948
|
this.joinStatusMap.set(dialogId, false);
|
|
65949
65949
|
}
|
|
65950
65950
|
}
|
|
65951
|
+
//version 0.5.0-beta.11,12,14
|
|
65952
|
+
startJoinRetryProcess() {
|
|
65953
|
+
if (this.joinCheckInterval)
|
|
65954
|
+
return;
|
|
65955
|
+
this.joinCheckInterval = setInterval(async () => {
|
|
65956
|
+
const dialogsToRetry = Array.from(this.joinStatusMap.entries())
|
|
65957
|
+
.filter(([_, isJoined]) => !isJoined)
|
|
65958
|
+
.map(([id]) => id);
|
|
65959
|
+
if (dialogsToRetry.length === 0) {
|
|
65960
|
+
clearInterval(this.joinCheckInterval);
|
|
65961
|
+
this.joinCheckInterval = null;
|
|
65962
|
+
console.log('All dialogs successfully joined. Stopping retry process.');
|
|
65963
|
+
return;
|
|
65964
|
+
}
|
|
65965
|
+
console.log(`Retrying join for ${dialogsToRetry.length} dialogs...`);
|
|
65966
|
+
await this.processDialogs(dialogsToRetry);
|
|
65967
|
+
}, 7000);
|
|
65968
|
+
}
|
|
65969
|
+
async processDialogsInBackground(dialogIds) {
|
|
65970
|
+
const BATCH_SIZE = 12;
|
|
65971
|
+
console.log(`Starting background processing for ${dialogIds.length} dialogs`);
|
|
65972
|
+
for (let i = 0; i < dialogIds.length; i += BATCH_SIZE) {
|
|
65973
|
+
const batch = dialogIds.slice(i, i + BATCH_SIZE);
|
|
65974
|
+
console.log(`Processing batch ${i / BATCH_SIZE + 1}:`, batch);
|
|
65975
|
+
await Promise.all(batch.map((id) => this.joinGroupDialog(id)));
|
|
65976
|
+
console.log(`Batch ${i / BATCH_SIZE + 1} completed.`);
|
|
65977
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
65978
|
+
}
|
|
65979
|
+
console.log('Background processing complete.');
|
|
65980
|
+
}
|
|
65981
|
+
async processDialogs(dialogIds) {
|
|
65982
|
+
await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
|
|
65983
|
+
}
|
|
65951
65984
|
async getDialogs(pagination) {
|
|
65952
65985
|
let currentPagination = pagination || new Pagination();
|
|
65953
|
-
console.log('call getDialogs in RemoteDataSourceMock param pagination: ', JSON.stringify(pagination));
|
|
65954
|
-
console.log('call getDialogs in RemoteDataSourceMock with result pagination: ', JSON.stringify(currentPagination));
|
|
65955
65986
|
const pageNumber = currentPagination.getCurrentPage() || 1;
|
|
65956
|
-
console.log('pageNumber: ', pageNumber);
|
|
65957
65987
|
const perPage = currentPagination.perPage || 100;
|
|
65958
|
-
console.log('perPage: ', perPage);
|
|
65959
65988
|
const params = {
|
|
65960
|
-
created_at: {
|
|
65961
|
-
lt: Date.now() / 1000,
|
|
65962
|
-
},
|
|
65963
|
-
// sort_desc: 'created_at',// artan 19.0.2024
|
|
65989
|
+
created_at: { lt: Date.now() / 1000 },
|
|
65964
65990
|
sort_desc: 'updated_at',
|
|
65965
65991
|
page: pageNumber,
|
|
65966
|
-
// per_page: perPage,
|
|
65967
65992
|
limit: perPage,
|
|
65968
|
-
type: {
|
|
65969
|
-
in: [2, 3],
|
|
65970
|
-
},
|
|
65993
|
+
type: { in: [2, 3] },
|
|
65971
65994
|
};
|
|
65972
|
-
// filter['type[in]'] = [3, 2].join(',');
|
|
65973
|
-
console.log('call getDialogs in RemoteDataSourceMock with params: ', JSON.stringify(params));
|
|
65974
65995
|
const dialogsDTO = [];
|
|
65996
|
+
const joinDialogIds = [];
|
|
65975
65997
|
const qbDialogs = await QBGetDialogs(params);
|
|
65976
65998
|
if (qbDialogs) {
|
|
65977
|
-
console.log(`request completed. have: total_entries ${qbDialogs.total_entries}, limit: ${qbDialogs.limit}, skip: ${qbDialogs.skip} items: ${JSON.stringify(qbDialogs.items)}`);
|
|
65978
65999
|
currentPagination = new Pagination(0, perPage);
|
|
65979
66000
|
currentPagination.totalPages = qbDialogs.total_entries / perPage;
|
|
65980
66001
|
currentPagination.setCurrentPage(pageNumber);
|
|
65981
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
65982
66002
|
for (const item of qbDialogs.items) {
|
|
65983
66003
|
const qbEntity = item;
|
|
65984
|
-
if (!qbEntity)
|
|
66004
|
+
if (!qbEntity)
|
|
65985
66005
|
continue;
|
|
65986
|
-
|
|
65987
|
-
|
|
65988
|
-
|
|
65989
|
-
await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
|
|
65990
|
-
if (newDTO.type === DialogType.group) {
|
|
65991
|
-
// eslint-disable-next-line no-await-in-loop
|
|
66006
|
+
const newDTO = await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
|
|
66007
|
+
if (newDTO.type === DialogType.group && !this.processedDialogs.has(newDTO.id)) {
|
|
66008
|
+
this.processedDialogs.add(newDTO.id);
|
|
65992
66009
|
if (!this.joinStatusMap.has(newDTO.id)) {
|
|
65993
|
-
|
|
66010
|
+
this.joinStatusMap.set(newDTO.id, false);
|
|
66011
|
+
joinDialogIds.push(newDTO.id);
|
|
65994
66012
|
}
|
|
65995
|
-
// await QBJoinGroupDialog(newDTO.id).catch((reason) => {
|
|
65996
|
-
// console.log('getDialogs. QBJoinGroupDialog error', reason);
|
|
65997
|
-
// throw new RemoteDataSourceException(
|
|
65998
|
-
// INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
|
|
65999
|
-
// INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
|
|
66000
|
-
// );
|
|
66001
|
-
// });
|
|
66002
66013
|
}
|
|
66003
|
-
//
|
|
66004
|
-
// const currentUserId = this._authInformation?.userId || 0;
|
|
66005
|
-
// const statusMessageParams: QBMessageStatusParams = {
|
|
66006
|
-
// userId: newDTO.lastMessageUserId || currentUserId,
|
|
66007
|
-
// dialogId: newDTO.id,
|
|
66008
|
-
// messageId: newDTO.lastMessageId,
|
|
66009
|
-
// };
|
|
66010
|
-
//
|
|
66011
|
-
// // eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
66012
|
-
// QBChatMarkMessageDelivered(statusMessageParams);
|
|
66013
66014
|
dialogsDTO.push(newDTO);
|
|
66014
66015
|
}
|
|
66016
|
+
const firstBatch = joinDialogIds.slice(0, 24);
|
|
66017
|
+
await this.processDialogs(firstBatch);
|
|
66018
|
+
const remainingDialogs = joinDialogIds.slice(24);
|
|
66019
|
+
if (remainingDialogs.length) {
|
|
66020
|
+
await this.processDialogsInBackground(remainingDialogs);
|
|
66021
|
+
this.startJoinRetryProcess();
|
|
66022
|
+
}
|
|
66015
66023
|
}
|
|
66016
66024
|
return Promise.resolve(new RemoteDialogsDTO(dialogsDTO, currentPagination));
|
|
66017
66025
|
}
|
|
66018
|
-
//version 0.5.0-beta.11 - 12
|
|
66019
|
-
// private startJoinRetryProcess(): void {
|
|
66020
|
-
// if (this.joinCheckInterval) return; // Избегаем дублирования таймера
|
|
66021
|
-
//
|
|
66022
|
-
// this.joinCheckInterval = setInterval(async () => {
|
|
66023
|
-
// const dialogsToRetry = Array.from(this.joinStatusMap.entries())
|
|
66024
|
-
// .filter(([_, isJoined]) => !isJoined) // Только неприсоединённые
|
|
66025
|
-
// .map(([id]) => id);
|
|
66026
|
-
//
|
|
66027
|
-
// if (dialogsToRetry.length === 0) {
|
|
66028
|
-
// clearInterval(this.joinCheckInterval!);
|
|
66029
|
-
// this.joinCheckInterval = null;
|
|
66030
|
-
// console.log('All dialogs successfully joined. Stopping retry process.');
|
|
66031
|
-
// return;
|
|
66032
|
-
// }
|
|
66033
|
-
//
|
|
66034
|
-
// console.log(`Retrying join for ${dialogsToRetry.length} dialogs...`);
|
|
66035
|
-
// await this.processDialogs(dialogsToRetry);
|
|
66036
|
-
// }, 7000);
|
|
66037
|
-
// }
|
|
66038
|
-
//
|
|
66039
|
-
// private async processDialogsInBackground(dialogIds: string[]): Promise<void> {
|
|
66040
|
-
// const BATCH_SIZE = 12;
|
|
66041
|
-
//
|
|
66042
|
-
// console.log(`Starting background processing for ${dialogIds.length} dialogs`);
|
|
66043
|
-
//
|
|
66044
|
-
// for (let i = 0; i < dialogIds.length; i += BATCH_SIZE) {
|
|
66045
|
-
// const batch = dialogIds.slice(i, i + BATCH_SIZE);
|
|
66046
|
-
//
|
|
66047
|
-
// console.log(`Processing batch ${i / BATCH_SIZE + 1}:`, batch);
|
|
66048
|
-
//
|
|
66049
|
-
// await Promise.all(batch.map((id) => this.joinGroupDialog(id)));
|
|
66050
|
-
// console.log(`Batch ${i / BATCH_SIZE + 1} completed.`);
|
|
66051
|
-
//
|
|
66052
|
-
// await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
66053
|
-
// }
|
|
66054
|
-
//
|
|
66055
|
-
// console.log('Background processing complete.');
|
|
66056
|
-
// }
|
|
66057
|
-
//
|
|
66058
|
-
// private async processDialogs(dialogIds: string[]): Promise<void> {
|
|
66059
|
-
// await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
|
|
66060
|
-
// }
|
|
66061
|
-
//
|
|
66062
|
-
// async getDialogs(pagination?: Pagination): Promise<RemoteDialogsDTO> {
|
|
66063
|
-
// let currentPagination: Pagination = pagination || new Pagination();
|
|
66064
|
-
//
|
|
66065
|
-
// const pageNumber = currentPagination.getCurrentPage() || 1;
|
|
66066
|
-
// const perPage = currentPagination.perPage || 100;
|
|
66067
|
-
//
|
|
66068
|
-
// const params = {
|
|
66069
|
-
// created_at: { lt: Date.now() / 1000 },
|
|
66070
|
-
// sort_desc: 'updated_at',
|
|
66071
|
-
// page: pageNumber,
|
|
66072
|
-
// limit: perPage,
|
|
66073
|
-
// type: { in: [2, 3] },
|
|
66074
|
-
// };
|
|
66075
|
-
//
|
|
66076
|
-
// const dialogsDTO: Array<RemoteDialogDTO> = [];
|
|
66077
|
-
// const joinDialogIds: string[] = [];
|
|
66078
|
-
// const qbDialogs: QBGetDialogResult | undefined = await QBGetDialogs(params);
|
|
66079
|
-
//
|
|
66080
|
-
// if (qbDialogs) {
|
|
66081
|
-
// currentPagination = new Pagination(0, perPage);
|
|
66082
|
-
// currentPagination.totalPages = qbDialogs.total_entries / perPage;
|
|
66083
|
-
// currentPagination.setCurrentPage(pageNumber);
|
|
66084
|
-
//
|
|
66085
|
-
// for (const item of qbDialogs.items) {
|
|
66086
|
-
// const qbEntity: QBChatDialog = item;
|
|
66087
|
-
// if (!qbEntity) continue;
|
|
66088
|
-
//
|
|
66089
|
-
// const newDTO: RemoteDialogDTO = await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
|
|
66090
|
-
//
|
|
66091
|
-
// if (newDTO.type === DialogType.group && !this.processedDialogs.has(newDTO.id)) {
|
|
66092
|
-
// this.processedDialogs.add(newDTO.id);
|
|
66093
|
-
//
|
|
66094
|
-
// // Если уже есть в Map — пропускаем, иначе добавляем в joinDialogIds
|
|
66095
|
-
// if (!this.joinStatusMap.has(newDTO.id)) {
|
|
66096
|
-
// this.joinStatusMap.set(newDTO.id, false);
|
|
66097
|
-
// joinDialogIds.push(newDTO.id);
|
|
66098
|
-
// }
|
|
66099
|
-
// }
|
|
66100
|
-
//
|
|
66101
|
-
// dialogsDTO.push(newDTO);
|
|
66102
|
-
// }
|
|
66103
|
-
//
|
|
66104
|
-
// const firstBatch = joinDialogIds.slice(0, 12);
|
|
66105
|
-
// await this.processDialogs(firstBatch);
|
|
66106
|
-
//
|
|
66107
|
-
// const remainingDialogs = joinDialogIds.slice(12);
|
|
66108
|
-
// if (remainingDialogs.length) {
|
|
66109
|
-
// await this.processDialogsInBackground(remainingDialogs);
|
|
66110
|
-
// this.startJoinRetryProcess();
|
|
66111
|
-
// }
|
|
66112
|
-
// }
|
|
66113
|
-
//
|
|
66114
|
-
// return Promise.resolve(new RemoteDialogsDTO(dialogsDTO, currentPagination));
|
|
66115
|
-
// }
|
|
66116
66026
|
//tested in 0.5.0-beta.10
|
|
66117
66027
|
// private async processDialogs(dialogIds: string[]): Promise<void> {
|
|
66118
66028
|
// await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
|
|
@@ -66642,13 +66552,16 @@ class RemoteDataSource {
|
|
|
66642
66552
|
}
|
|
66643
66553
|
catch (e) {
|
|
66644
66554
|
qbMessageId = undefined;
|
|
66645
|
-
|
|
66555
|
+
const errorMessage = `Error in DataSource: send message throw: ${parse_stringifyError(e)}`;
|
|
66556
|
+
console.log('Error in DataSource: send message throw: ', errorMessage);
|
|
66557
|
+
console.warn('Error in DataSource: send message throw: ', errorMessage);
|
|
66558
|
+
console.error('Error in DataSource: send message throw: ', errorMessage);
|
|
66646
66559
|
}
|
|
66647
66560
|
}
|
|
66648
66561
|
if (qbMessageId === null || qbMessageId === undefined) {
|
|
66649
66562
|
return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
|
|
66650
66563
|
}
|
|
66651
|
-
console.log(
|
|
66564
|
+
console.log(`DataSource: regular message was sent, id: ${qbMessageId}`);
|
|
66652
66565
|
// eslint-disable-next-line no-param-reassign
|
|
66653
66566
|
dto.id = qbMessageId;
|
|
66654
66567
|
return Promise.resolve(dto);
|
|
@@ -66993,7 +66906,6 @@ class SyncDialogsUseCase extends BaseUseCase {
|
|
|
66993
66906
|
timerId = null;
|
|
66994
66907
|
constructor(dialogRepository, connectionRepository, eventMessagesRepository) {
|
|
66995
66908
|
super();
|
|
66996
|
-
console.log('CONSTRUCTOR SyncDialogsUseCaseWithMock');
|
|
66997
66909
|
this.callBackExecute = undefined;
|
|
66998
66910
|
this.dialogRepository = dialogRepository;
|
|
66999
66911
|
this.connectionRepository = connectionRepository;
|
|
@@ -67899,6 +67811,8 @@ class DefaultConfigurations {
|
|
|
67899
67811
|
chatProtocol: {
|
|
67900
67812
|
active: 2,
|
|
67901
67813
|
},
|
|
67814
|
+
pingLocalhostTimeInterval: 0,
|
|
67815
|
+
chatReconnectionTimeInterval: 3,
|
|
67902
67816
|
debug: true,
|
|
67903
67817
|
enableForwarding: true,
|
|
67904
67818
|
enableReplying: true,
|
|
@@ -68333,12 +68247,10 @@ class GetAllDialogsUseCaseWithMock {
|
|
|
68333
68247
|
dialogRepository;
|
|
68334
68248
|
pagination;
|
|
68335
68249
|
constructor(dialogRepository, pagination) {
|
|
68336
|
-
console.log('CONSTRUCTOR GetAllDialogsUseCaseWithMock');
|
|
68337
68250
|
this.dialogRepository = dialogRepository;
|
|
68338
68251
|
this.pagination = pagination || new Pagination();
|
|
68339
68252
|
}
|
|
68340
68253
|
async execute() {
|
|
68341
|
-
console.log('execute GetAllDialogsUseCaseWithMock');
|
|
68342
68254
|
const fromRemote = await this.dialogRepository.getDialogsFromRemote(this.pagination);
|
|
68343
68255
|
this.dialogRepository.release();
|
|
68344
68256
|
await Promise.all(fromRemote.ResultData.map(async (entity) => {
|
|
@@ -68364,7 +68276,6 @@ class CreateDialogUseCase {
|
|
|
68364
68276
|
newDialog;
|
|
68365
68277
|
textInformationMessage;
|
|
68366
68278
|
constructor(eventMessagesRepository, dialogRepository, newDialog, textInformationMessage) {
|
|
68367
|
-
console.log('CONSTRUCTOR CreateDialogUseCase');
|
|
68368
68279
|
this.dialogRepository = dialogRepository;
|
|
68369
68280
|
this.newDialog = newDialog;
|
|
68370
68281
|
this.eventMessagesRepository = eventMessagesRepository;
|
|
@@ -68409,14 +68320,12 @@ class UpdateDialogUseCase {
|
|
|
68409
68320
|
updateDialog;
|
|
68410
68321
|
textInformationMessage;
|
|
68411
68322
|
constructor(eventMessagesRepository, dialogRepository, updateDialog, textInformationMessage) {
|
|
68412
|
-
console.log('CONSTRUCTOR UpdateDialogUseCase');
|
|
68413
68323
|
this.dialogRepository = dialogRepository;
|
|
68414
68324
|
this.updateDialog = updateDialog;
|
|
68415
68325
|
this.eventMessagesRepository = eventMessagesRepository;
|
|
68416
68326
|
this.textInformationMessage = textInformationMessage;
|
|
68417
68327
|
}
|
|
68418
68328
|
async execute() {
|
|
68419
|
-
console.log('execute UpdateDialogUseCase');
|
|
68420
68329
|
const result = await this.dialogRepository.updateDialogInRemote(this.updateDialog);
|
|
68421
68330
|
await this.dialogRepository.updateDialogInLocal(result);
|
|
68422
68331
|
const remoteMessageDTO = new RemoteMessageDTO();
|
|
@@ -68458,7 +68367,6 @@ class LeaveDialogUseCase {
|
|
|
68458
68367
|
leaveType;
|
|
68459
68368
|
textInformationMessage;
|
|
68460
68369
|
constructor(eventMessagesRepository, dialogRepository, dialog, leaveType, textInformationMessage) {
|
|
68461
|
-
console.log('CONSTRUCTOR LeaveDialogUseCase');
|
|
68462
68370
|
this.eventMessagesRepository = eventMessagesRepository;
|
|
68463
68371
|
this.dialogRepository = dialogRepository;
|
|
68464
68372
|
this.dialogToLeave = dialog;
|
|
@@ -68515,12 +68423,10 @@ class UploadFileUseCase {
|
|
|
68515
68423
|
fileRepository;
|
|
68516
68424
|
fileEntity;
|
|
68517
68425
|
constructor(fileRepository, fileEntity) {
|
|
68518
|
-
console.log('CONSTRUCTOR UploadFileUseCase');
|
|
68519
68426
|
this.fileRepository = fileRepository;
|
|
68520
68427
|
this.fileEntity = fileEntity;
|
|
68521
68428
|
}
|
|
68522
68429
|
async execute() {
|
|
68523
|
-
console.log('execute UploadFileUseCase');
|
|
68524
68430
|
const result = await this.fileRepository.saveFileInRemote(this.fileEntity);
|
|
68525
68431
|
return Promise.resolve(result);
|
|
68526
68432
|
}
|
|
@@ -68882,7 +68788,6 @@ class SubscribeToDialogEventsUseCase extends BaseUseCase {
|
|
|
68882
68788
|
eventMessagesRepository;
|
|
68883
68789
|
callBackExecute;
|
|
68884
68790
|
constructor(eventMessagesRepository, nameSubscription = SubscriptionPerformer.DEFAULT_SUBSCRIPTION_NAME) {
|
|
68885
|
-
console.log('CONSTRUCTOR SubscribeToDialogsUpdatesUseCaseWithMock');
|
|
68886
68791
|
super();
|
|
68887
68792
|
this.callBackExecute = undefined;
|
|
68888
68793
|
this.EVENT_NAME = nameSubscription;
|
|
@@ -68964,12 +68869,10 @@ class GetDialogByIdUseCase {
|
|
|
68964
68869
|
dialogRepository;
|
|
68965
68870
|
dialogId;
|
|
68966
68871
|
constructor(dialogRepository, dialogId) {
|
|
68967
|
-
console.log('CONSTRUCTOR GetDialogByIdUseCase');
|
|
68968
68872
|
this.dialogRepository = dialogRepository;
|
|
68969
68873
|
this.dialogId = dialogId;
|
|
68970
68874
|
}
|
|
68971
68875
|
async execute() {
|
|
68972
|
-
console.log('execute GetAllDialogsUseCaseWithMock');
|
|
68973
68876
|
const fromRemote = await this.dialogRepository.getDialogFromRemote(this.dialogId);
|
|
68974
68877
|
try {
|
|
68975
68878
|
await this.dialogRepository.updateDialogInLocal(fromRemote);
|
|
@@ -68995,7 +68898,6 @@ class RemoveUsersFromTheDialogUseCase {
|
|
|
68995
68898
|
usersIds;
|
|
68996
68899
|
textInformationMessage;
|
|
68997
68900
|
constructor(eventMessagesRepository, dialogRepository, dialog, usersIds, textInformationMessage) {
|
|
68998
|
-
console.log('CONSTRUCTOR LeaveDialogUseCase');
|
|
68999
68901
|
this.eventMessagesRepository = eventMessagesRepository;
|
|
69000
68902
|
this.dialogRepository = dialogRepository;
|
|
69001
68903
|
this.dialogToLeave = dialog;
|
|
@@ -69061,12 +68963,10 @@ class GetUsersByIdsUseCase {
|
|
|
69061
68963
|
usersRepository;
|
|
69062
68964
|
userIds;
|
|
69063
68965
|
constructor(usersRepository, userIds) {
|
|
69064
|
-
console.log('CONSTRUCTOR GetUsersByIdsUseCase');
|
|
69065
68966
|
this.usersRepository = usersRepository;
|
|
69066
68967
|
this.userIds = userIds;
|
|
69067
68968
|
}
|
|
69068
68969
|
execute() {
|
|
69069
|
-
console.log('execute GetUsersByIdsUseCase');
|
|
69070
68970
|
// return this.usersRepository.getUsersFromLocal(this.userIds);
|
|
69071
68971
|
return this.usersRepository.getUsersFromRemote(this.userIds);
|
|
69072
68972
|
}
|
|
@@ -69506,13 +69406,11 @@ class UpdateCurrentDialogInDataSourceUseCase {
|
|
|
69506
69406
|
updateDialog;
|
|
69507
69407
|
qbConfig;
|
|
69508
69408
|
constructor(dialogRepository, updateDialog, qbConfig) {
|
|
69509
|
-
console.log('CONSTRUCTOR UpdateCurrentDialogInDataSourceUseCase');
|
|
69510
69409
|
this.dialogRepository = dialogRepository;
|
|
69511
69410
|
this.updateDialog = updateDialog;
|
|
69512
69411
|
this.qbConfig = qbConfig;
|
|
69513
69412
|
}
|
|
69514
69413
|
async execute() {
|
|
69515
|
-
console.log('execute UpdateCurrentDialogInDataSourceUseCase');
|
|
69516
69414
|
const result = await this.dialogRepository.updateCurrentDialogInLocalDataSource(this.updateDialog, this.qbConfig);
|
|
69517
69415
|
return Promise.resolve(result);
|
|
69518
69416
|
}
|
|
@@ -69542,7 +69440,6 @@ class UpdateCurrentDialogInDataSourceUseCase {
|
|
|
69542
69440
|
|
|
69543
69441
|
|
|
69544
69442
|
function useDialogListViewModel(currentContext, initPagination) {
|
|
69545
|
-
console.log('3.1. useDialogListViewModel');
|
|
69546
69443
|
const startPagination = initPagination || new Pagination();
|
|
69547
69444
|
const [loading, setLoading] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
|
|
69548
69445
|
const [error, setError] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)('');
|
|
@@ -73309,7 +73206,6 @@ const EditDialog_EditDialog_EditDialog = ({ nameDialog = '', typeDialog, ulrIcon
|
|
|
73309
73206
|
|
|
73310
73207
|
|
|
73311
73208
|
function useUsersListViewModel(dialogEntity) {
|
|
73312
|
-
console.log('create useUsersListViewModel');
|
|
73313
73209
|
const [loading, setLoading] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
|
|
73314
73210
|
const [error, setError] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)('error with getting user list');
|
|
73315
73211
|
const [users, setUsers] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)([]);
|
|
@@ -73365,7 +73261,6 @@ function useUsersListViewModel(dialogEntity) {
|
|
|
73365
73261
|
}
|
|
73366
73262
|
}
|
|
73367
73263
|
async function getUsers() {
|
|
73368
|
-
console.log('call getUsers in useUsersListViewModel');
|
|
73369
73264
|
const participants =
|
|
73370
73265
|
// eslint-disable-next-line no-nested-ternary
|
|
73371
73266
|
dialog?.type === DialogType.group
|
|
@@ -73374,7 +73269,6 @@ function useUsersListViewModel(dialogEntity) {
|
|
|
73374
73269
|
? [dialog.participantId]
|
|
73375
73270
|
: [];
|
|
73376
73271
|
await fetchUsersData(participants);
|
|
73377
|
-
console.log('EXECUTE USE CASES getUsers');
|
|
73378
73272
|
}
|
|
73379
73273
|
async function getUserById(id) {
|
|
73380
73274
|
const response = await getUsersData([id]);
|
|
@@ -73506,7 +73400,6 @@ class GetAllUsersUseCase {
|
|
|
73506
73400
|
currentPagination;
|
|
73507
73401
|
filter;
|
|
73508
73402
|
constructor(usersRepository, currentPagination, filter) {
|
|
73509
|
-
console.log('CONSTRUCTOR GetUsersByIdsUseCase');
|
|
73510
73403
|
this.usersRepository = usersRepository;
|
|
73511
73404
|
this.currentPagination = currentPagination;
|
|
73512
73405
|
this.filter = filter;
|
|
@@ -76254,7 +76147,7 @@ function reducer(state, action) {
|
|
|
76254
76147
|
return state;
|
|
76255
76148
|
}
|
|
76256
76149
|
}
|
|
76257
|
-
function MessageItem_MessageItem_MessageItem({ message, currentUserId, enableForwarding, enableReplying, onReply, onForward,
|
|
76150
|
+
function MessageItem_MessageItem_MessageItem({ message, avatar, currentUserId, enableForwarding, enableReplying, onReply, onForward,
|
|
76258
76151
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
76259
76152
|
listRef, messagesToView, AITranslateWidget, AIAssistWidget, maxTokens, defaultTranslationLanguage, languagesForAITranslate, onError, disableAction = false, }) {
|
|
76260
76153
|
const messageStates = {};
|
|
@@ -76335,7 +76228,8 @@ listRef, messagesToView, AITranslateWidget, AIAssistWidget, maxTokens, defaultTr
|
|
|
76335
76228
|
}
|
|
76336
76229
|
if (messageTypes === TypeIncomingMessage ||
|
|
76337
76230
|
messageTypes === TypeOutgoingMessage) {
|
|
76338
|
-
return ((0,jsx_runtime_.jsxs)("div", { children: [renderForwardedReplyMessageSegment(messageTypes), !message.message.includes(MessageDTOMapper.FORWARD_MESSAGE_PREFIX) && ((0,jsx_runtime_.jsx)(Message_Message_Message, { avatar:
|
|
76231
|
+
return ((0,jsx_runtime_.jsxs)("div", { children: [renderForwardedReplyMessageSegment(messageTypes), !message.message.includes(MessageDTOMapper.FORWARD_MESSAGE_PREFIX) && ((0,jsx_runtime_.jsx)(Message_Message_Message, { avatar: avatar ||
|
|
76232
|
+
(0,jsx_runtime_.jsx)(Avatar_Avatar_Avatar, { src: message?.sender?.photo || '', icon: (0,jsx_runtime_.jsx)(userreact, {}), size: "md" }), userName: senderName, status: getStatusMessage(message), time: getTimeShort24hFormat(message.date_sent), type: messageTypes, bottomPart: !(message.attachments && message.attachments.length > 0) &&
|
|
76339
76233
|
AITranslateWidget ? ((0,jsx_runtime_.jsx)(AITranslate_AITranslate_AITranslate, { disableAction: disableAction, AITranslateWidget: AITranslateWidget, defaultLanguage: defaultTranslationLanguage, languages: languagesForAITranslate, originalTextMessage: state[message.id] && state[message.id].translatedText
|
|
76340
76234
|
? state[message.id].translatedText.length === 0
|
|
76341
76235
|
: true, loading: state[message.id] && state[message.id].loading
|
|
@@ -76634,7 +76528,6 @@ class AIAnswerAssistUseCase {
|
|
|
76634
76528
|
sessionToken;
|
|
76635
76529
|
openAIModel;
|
|
76636
76530
|
constructor(textToSend, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
76637
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
76638
76531
|
this.api = api;
|
|
76639
76532
|
this.openAIModel = openAIModel;
|
|
76640
76533
|
this.port = port;
|
|
@@ -76644,7 +76537,6 @@ class AIAnswerAssistUseCase {
|
|
|
76644
76537
|
this.dialogMessages = dialogMessages;
|
|
76645
76538
|
}
|
|
76646
76539
|
async execute() {
|
|
76647
|
-
console.log('execute AIRephraseUseCase');
|
|
76648
76540
|
const settings = dist_browser.QBAIAnswerAssistant.createDefaultAIAnswerAssistantSettings();
|
|
76649
76541
|
settings.apiKey = this.sessionToken;
|
|
76650
76542
|
// settings.organization = 'Quickblox';
|
|
@@ -76720,7 +76612,6 @@ class AITranslateUseCase {
|
|
|
76720
76612
|
sessionToken;
|
|
76721
76613
|
openAIModel;
|
|
76722
76614
|
constructor(textToSend, language, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
76723
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
76724
76615
|
this.api = api;
|
|
76725
76616
|
this.openAIModel = openAIModel;
|
|
76726
76617
|
this.port = port;
|
|
@@ -76731,7 +76622,6 @@ class AITranslateUseCase {
|
|
|
76731
76622
|
this.dialogMessages = dialogMessages;
|
|
76732
76623
|
}
|
|
76733
76624
|
async execute() {
|
|
76734
|
-
console.log('execute AIRephraseUseCase');
|
|
76735
76625
|
const settings =
|
|
76736
76626
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
76737
76627
|
qb_ai_translate_dist_browser.QBAITranslate.createDefaultAITranslateSettings();
|
|
@@ -76815,7 +76705,6 @@ class AIRephraseUseCase {
|
|
|
76815
76705
|
sessionToken;
|
|
76816
76706
|
openAIModel;
|
|
76817
76707
|
constructor(textToSend, tone, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
76818
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
76819
76708
|
this.api = api;
|
|
76820
76709
|
this.openAIModel = openAIModel;
|
|
76821
76710
|
this.port = port;
|
|
@@ -76826,7 +76715,6 @@ class AIRephraseUseCase {
|
|
|
76826
76715
|
this.dialogMessages = dialogMessages;
|
|
76827
76716
|
}
|
|
76828
76717
|
async execute() {
|
|
76829
|
-
console.log('execute AIRephraseUseCase');
|
|
76830
76718
|
const settings = browser.QBAIRephrase.createDefaultAIRephraseSettings();
|
|
76831
76719
|
settings.apiKey = this.sessionToken;
|
|
76832
76720
|
// settings.organization = 'Quickblox';
|
|
@@ -76931,7 +76819,6 @@ class AIAnswerAssistWithProxyUseCase {
|
|
|
76931
76819
|
sessionToken;
|
|
76932
76820
|
openAIModel;
|
|
76933
76821
|
constructor(textToSend, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
76934
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
76935
76822
|
this.api = api;
|
|
76936
76823
|
this.openAIModel = openAIModel;
|
|
76937
76824
|
this.port = port;
|
|
@@ -76941,7 +76828,6 @@ class AIAnswerAssistWithProxyUseCase {
|
|
|
76941
76828
|
this.dialogMessages = dialogMessages;
|
|
76942
76829
|
}
|
|
76943
76830
|
async execute() {
|
|
76944
|
-
console.log('execute AIRephraseUseCase');
|
|
76945
76831
|
const settings = dist_browser.QBAIAnswerAssistant.createDefaultAIAnswerAssistantSettings();
|
|
76946
76832
|
settings.token = this.sessionToken;
|
|
76947
76833
|
// settings.organization = 'Quickblox';
|
|
@@ -77004,7 +76890,6 @@ class AITranslateWithProxyUseCase {
|
|
|
77004
76890
|
sessionToken;
|
|
77005
76891
|
openAIModel;
|
|
77006
76892
|
constructor(textToSend, language, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
77007
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
77008
76893
|
this.api = api;
|
|
77009
76894
|
this.openAIModel = openAIModel;
|
|
77010
76895
|
this.port = port;
|
|
@@ -77015,7 +76900,6 @@ class AITranslateWithProxyUseCase {
|
|
|
77015
76900
|
this.dialogMessages = dialogMessages;
|
|
77016
76901
|
}
|
|
77017
76902
|
async execute() {
|
|
77018
|
-
console.log('execute AIRephraseUseCase');
|
|
77019
76903
|
const settings =
|
|
77020
76904
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
77021
76905
|
qb_ai_translate_dist_browser.QBAITranslate.createDefaultAITranslateSettings();
|
|
@@ -77085,7 +76969,6 @@ class AIRephraseWithProxyUseCase {
|
|
|
77085
76969
|
sessionToken;
|
|
77086
76970
|
openAIModel;
|
|
77087
76971
|
constructor(textToSend, tone, dialogMessages, servername, api, port, sessionToken, openAIModel = 'gpt-3.5-turbo') {
|
|
77088
|
-
console.log('CONSTRUCTOR AIRephraseUseCase');
|
|
77089
76972
|
this.api = api;
|
|
77090
76973
|
this.openAIModel = openAIModel;
|
|
77091
76974
|
this.port = port;
|
|
@@ -77096,7 +76979,6 @@ class AIRephraseWithProxyUseCase {
|
|
|
77096
76979
|
this.dialogMessages = dialogMessages;
|
|
77097
76980
|
}
|
|
77098
76981
|
async execute() {
|
|
77099
|
-
console.log('execute AIRephraseUseCase');
|
|
77100
76982
|
const settings = browser.QBAIRephrase.createDefaultAIRephraseSettings();
|
|
77101
76983
|
settings.token = this.sessionToken;
|
|
77102
76984
|
// settings.organization = 'Quickblox';
|
|
@@ -77169,7 +77051,6 @@ class GetAllMessagesForDialogMock {
|
|
|
77169
77051
|
dialogId;
|
|
77170
77052
|
currentPagination;
|
|
77171
77053
|
constructor(messagesRepository, dialogId, currentPagination) {
|
|
77172
|
-
console.log('CONSTRUCTOR GetAllMessagesForDialog');
|
|
77173
77054
|
this.messagesRepository = messagesRepository;
|
|
77174
77055
|
this.dialogId = dialogId;
|
|
77175
77056
|
this.currentPagination = currentPagination;
|
|
@@ -77371,12 +77252,10 @@ class SendTextMessageUseCase {
|
|
|
77371
77252
|
messagesRepository;
|
|
77372
77253
|
messageToSend;
|
|
77373
77254
|
constructor(messagesRepository, messageToSend) {
|
|
77374
|
-
console.log('CONSTRUCTOR SendTextMessageUseCase');
|
|
77375
77255
|
this.messagesRepository = messagesRepository;
|
|
77376
77256
|
this.messageToSend = messageToSend;
|
|
77377
77257
|
}
|
|
77378
77258
|
async execute() {
|
|
77379
|
-
console.log('execute SendTextMessageUseCase');
|
|
77380
77259
|
const sentMessage = await this.messagesRepository.sendMessageToRemote(this.messageToSend);
|
|
77381
77260
|
return Promise.resolve(sentMessage);
|
|
77382
77261
|
}
|
|
@@ -77391,13 +77270,11 @@ class UserTypingMessageUseCase {
|
|
|
77391
77270
|
_typingTimer = null;
|
|
77392
77271
|
_typingTime = 0;
|
|
77393
77272
|
constructor(messagesRepository, dialog, senderId) {
|
|
77394
|
-
console.log('CONSTRUCTOR SendUserIsTypingMessageUseCase');
|
|
77395
77273
|
this.messagesRepository = messagesRepository;
|
|
77396
77274
|
this.dialog = dialog;
|
|
77397
77275
|
this.senderId = senderId;
|
|
77398
77276
|
}
|
|
77399
77277
|
async execute() {
|
|
77400
|
-
console.log('execute SendUserIsTypingMessageUseCase');
|
|
77401
77278
|
this._typingTime = Date.now();
|
|
77402
77279
|
if (!this._typingTimer) {
|
|
77403
77280
|
await this.messagesRepository.typingMessageStart(this.dialog, this.senderId);
|
|
@@ -77424,7 +77301,6 @@ class ForwardMessagesUseCase {
|
|
|
77424
77301
|
relatedMessage;
|
|
77425
77302
|
userName;
|
|
77426
77303
|
constructor(messagesRepository, targetDialogs, messagesToForward, relatedMessage, userName) {
|
|
77427
|
-
console.log('CONSTRUCTOR ForwardMessagesUseCase');
|
|
77428
77304
|
this.messagesRepository = messagesRepository;
|
|
77429
77305
|
this.relatedMessage = relatedMessage;
|
|
77430
77306
|
this.targetDialogs = targetDialogs;
|
|
@@ -77463,13 +77339,11 @@ class ReplyMessagesUseCase {
|
|
|
77463
77339
|
messagesToReply;
|
|
77464
77340
|
relatedMessage;
|
|
77465
77341
|
constructor(messagesRepository, messagesToReply, relatedMessage) {
|
|
77466
|
-
console.log('CONSTRUCTOR ReplyMessagesUseCase');
|
|
77467
77342
|
this.messagesRepository = messagesRepository;
|
|
77468
77343
|
this.relatedMessage = relatedMessage;
|
|
77469
77344
|
this.messagesToReply = messagesToReply;
|
|
77470
77345
|
}
|
|
77471
77346
|
async execute() {
|
|
77472
|
-
console.log('execute ReplyMessagesUseCase');
|
|
77473
77347
|
this.relatedMessage.qb_original_messages = this.messagesToReply;
|
|
77474
77348
|
this.relatedMessage.qb_message_action = 'reply';
|
|
77475
77349
|
this.relatedMessage.origin_sender_name =
|
|
@@ -77506,7 +77380,6 @@ class ReplyMessagesUseCase {
|
|
|
77506
77380
|
|
|
77507
77381
|
|
|
77508
77382
|
function useDialogViewModel(dialogType, dialogEntity) {
|
|
77509
|
-
console.log('useDialogViewModel');
|
|
77510
77383
|
const [loading, setLoading] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
|
|
77511
77384
|
const [error, setError] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)('');
|
|
77512
77385
|
const startPagination = new Pagination(0, 0);
|
|
@@ -77642,10 +77515,8 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
77642
77515
|
return newItems;
|
|
77643
77516
|
});
|
|
77644
77517
|
setLoading(false);
|
|
77645
|
-
console.log('EXECUTE USE CASE MessagesViewModelWithMockUseCase EXECUTED');
|
|
77646
77518
|
}
|
|
77647
77519
|
const dialogUpdateHandler = (dialogInfo) => {
|
|
77648
|
-
console.log('call dialogUpdateHandler in useDialogViewModel');
|
|
77649
77520
|
if (dialogInfo.eventMessageType === EventMessageType.LocalMessage) {
|
|
77650
77521
|
if (dialogInfo.messageStatus) {
|
|
77651
77522
|
if (dialogInfo.messageStatus.isTyping &&
|
|
@@ -77756,7 +77627,6 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
77756
77627
|
};
|
|
77757
77628
|
const userTypingMessageUseCase = new UserTypingMessageUseCase(new MessagesRepository(LOCAL_DATA_SOURCE, REMOTE_DATA_SOURCE), dialog || dialogEntity, REMOTE_DATA_SOURCE.authInformation?.userId || 0);
|
|
77758
77629
|
const sendTypingTextMessage = () => {
|
|
77759
|
-
console.log('call release in MessagesViewModelWithMockUseCase');
|
|
77760
77630
|
userTypingMessageUseCase.execute().catch((reason) => {
|
|
77761
77631
|
const errorMessage = parse_stringifyError(reason);
|
|
77762
77632
|
console.log('Error: have exception in sendTypingTextMessage: ', errorMessage);
|
|
@@ -77870,7 +77740,6 @@ function useDialogViewModel(dialogType, dialogEntity) {
|
|
|
77870
77740
|
return messageToReturn;
|
|
77871
77741
|
};
|
|
77872
77742
|
const sendAttachmentMessage = async (newMessage) => {
|
|
77873
|
-
console.log('call sendAttachmentMessage');
|
|
77874
77743
|
setLoading(true);
|
|
77875
77744
|
const currentUserId = REMOTE_DATA_SOURCE.authInformation?.userId || 0;
|
|
77876
77745
|
try {
|
|
@@ -78045,14 +77914,12 @@ class AIAnswerAssistWithSDKUseCase {
|
|
|
78045
77914
|
dataSource;
|
|
78046
77915
|
smartChatAssistantId;
|
|
78047
77916
|
constructor(textToSend, dialogMessages, dataSource, smartChatAssistantId) {
|
|
78048
|
-
console.log('CONSTRUCTOR AIAnswerAssistWithSDKUseCase');
|
|
78049
77917
|
this.textToSend = textToSend;
|
|
78050
77918
|
this.dialogMessages = dialogMessages;
|
|
78051
77919
|
this.dataSource = dataSource;
|
|
78052
77920
|
this.smartChatAssistantId = smartChatAssistantId;
|
|
78053
77921
|
}
|
|
78054
77922
|
async execute() {
|
|
78055
|
-
console.log('execute AIAnswerAssistWithSDKUseCase');
|
|
78056
77923
|
const history = this.dialogMessages.map((msg) => {
|
|
78057
77924
|
return {
|
|
78058
77925
|
role: msg.role,
|
|
@@ -78180,7 +78047,6 @@ class AITranslateWithSDKUseCase {
|
|
|
78180
78047
|
dataSource;
|
|
78181
78048
|
smartChatAssistantId;
|
|
78182
78049
|
constructor(textToSend, language, dataSource, smartChatAssistantId) {
|
|
78183
|
-
console.log('CONSTRUCTOR AITranslateWithSDKUseCase');
|
|
78184
78050
|
this.dataSource = dataSource;
|
|
78185
78051
|
this.textToSend = textToSend;
|
|
78186
78052
|
this.language = language;
|
|
@@ -78190,7 +78056,6 @@ class AITranslateWithSDKUseCase {
|
|
|
78190
78056
|
return this.languageCodes[language] || 'en';
|
|
78191
78057
|
}
|
|
78192
78058
|
async execute() {
|
|
78193
|
-
console.log('execute AITranslateWithSDKUseCase');
|
|
78194
78059
|
const response = await this.dataSource.translate(this.textToSend, this.getLanguageCode(this.language), this.smartChatAssistantId);
|
|
78195
78060
|
return response.answer;
|
|
78196
78061
|
}
|
|
@@ -78856,7 +78721,7 @@ function useQuickBloxUIKit({ AIRephrase = undefined, AITranslate = undefined, AI
|
|
|
78856
78721
|
}
|
|
78857
78722
|
};
|
|
78858
78723
|
(0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(() => {
|
|
78859
|
-
const codeVersion = '0.
|
|
78724
|
+
const codeVersion = '0.5.0';
|
|
78860
78725
|
console.log(`React UIKit CODE VERSION IS ${codeVersion}`);
|
|
78861
78726
|
if (isAuthProcessed()) {
|
|
78862
78727
|
const pagination = new Pagination();
|
|
@@ -79481,9 +79346,7 @@ const QuickBloxUIKitDesktopLayout = ({ theme, AITranslate, AIRephrase, AIAssist,
|
|
|
79481
79346
|
messagesViewModel.messages &&
|
|
79482
79347
|
messagesViewModel.messages.length > 0 && ((0,jsx_runtime_.jsx)(SectionList, { resetScroll: scrollUpToDown, className: "messages-container", onEndReached: fetchMoreData, onEndReachedThreshold: 0.95, refreshing: needRefresh || messagesViewModel?.loading, renderSectionHeader: (section) => ((0,jsx_runtime_.jsx)("div", { className: "message-view-container--system-message-wrapper", children: (0,jsx_runtime_.jsx)("div", { style: theme
|
|
79483
79348
|
? { backgroundColor: theme.disabledElements() }
|
|
79484
|
-
: {}, className: "message-view-container--system-message-wrapper__date_container", children: (0,jsx_runtime_.jsx)(MessageSeparator_MessageSeparator_MessageSeparator, { text: section.title, type: "date" }) }) })), renderItem: ([, groupMessages], listRef) => groupMessages.map((message) => ((0,jsx_runtime_.jsx)(MessageItem_MessageItem_MessageItem, { disableAction: !isOnline,
|
|
79485
|
-
// defaultGetSenderName={defaultGetSenderName}
|
|
79486
|
-
message: message, currentUserId: currentUserId || -1, enableForwarding: enableForwarding, enableReplying: enableReplying, onReply: (m) => {
|
|
79349
|
+
: {}, className: "message-view-container--system-message-wrapper__date_container", children: (0,jsx_runtime_.jsx)(MessageSeparator_MessageSeparator_MessageSeparator, { text: section.title, type: "date" }) }) })), renderItem: ([, groupMessages], listRef) => groupMessages.map((message) => ((0,jsx_runtime_.jsx)(MessageItem_MessageItem_MessageItem, { disableAction: !isOnline, avatar: (0,jsx_runtime_.jsx)(Avatar_Avatar_Avatar, { src: message?.sender?.photo || '', icon: (0,jsx_runtime_.jsx)(userreact, {}), size: "md" }), message: message, currentUserId: currentUserId || -1, enableForwarding: enableForwarding, enableReplying: enableReplying, onReply: (m) => {
|
|
79487
79350
|
handleOnReply(m);
|
|
79488
79351
|
}, onForward: (m) => {
|
|
79489
79352
|
if (isOnline) {
|