quickblox-react-ui-kit 0.3.0-beta.2 → 0.3.0-beta.4
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/Data/Stubs.d.ts +1 -1
- package/dist/Data/dto/file/RemoteFileDTO.d.ts +1 -1
- package/dist/Data/dto/message/RemoteMessageDTO.d.ts +1 -1
- package/dist/Data/dto/user/LocalUserDTO.d.ts +1 -1
- package/dist/Data/dto/user/RemoteUserDTO.d.ts +2 -2
- package/dist/Data/repository/DialogsRepository.d.ts +1 -0
- package/dist/Data/source/remote/IRemoteDataSource.d.ts +1 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts +2 -0
- package/dist/Domain/entity/DialogEventInfo.d.ts +4 -0
- package/dist/Domain/entity/FileEntity.d.ts +1 -1
- package/dist/Domain/entity/UserEntity.d.ts +1 -1
- package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts +3 -3
- package/dist/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.d.ts +10 -0
- package/dist/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.d.ts +1 -0
- package/dist/Presentation/Views/Dialog/DialogViewModel.d.ts +2 -0
- package/dist/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.d.ts +1 -0
- package/dist/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.d.ts +2 -2
- package/dist/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.d.ts +2 -1
- package/dist/Presentation/Views/Dialog/MessageItem/MessageItem.d.ts +3 -2
- package/dist/Presentation/Views/DialogInfo/DialogInfo.d.ts +1 -0
- package/dist/Presentation/Views/DialogList/DialogList.d.ts +1 -0
- package/dist/Presentation/Views/EditDialog/EditDialog.d.ts +2 -1
- package/dist/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.d.ts +1 -0
- package/dist/Presentation/Views/PreviewDialog/PreviewDialog.d.ts +1 -0
- package/dist/Presentation/providers/QuickBloxUIKitProvider/useQBConnection.d.ts +1 -0
- package/dist/Presentation/ui-components/DialogWindow/DialogWindow.d.ts +3 -2
- package/dist/Presentation/ui-components/Dropdown/DropdownOption.d.ts +2 -1
- package/dist/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.d.ts +1 -0
- package/dist/Presentation/ui-components/MessageInput/MessageInput.d.ts +1 -0
- package/dist/Presentation/ui-components/MessageInput/MessageInput.stories.d.ts +4 -4
- package/dist/index-ui.js +1054 -771
- package/dist/index-ui.js.map +1 -1
- package/dist/qb-api-calls/index.d.ts +9 -7
- package/global.d.ts +2513 -546
- package/package.json +1 -1
- package/src/App.scss +3 -0
- package/src/App.tsx +1 -1
- package/src/Data/Creator.ts +1 -2
- package/src/Data/DefaultConfigurations.ts +4 -4
- package/src/Data/Stubs.ts +4 -5
- package/src/Data/dto/file/RemoteFileDTO.ts +2 -2
- package/src/Data/dto/message/RemoteMessageDTO.ts +1 -1
- package/src/Data/dto/user/LocalUserDTO.ts +2 -2
- package/src/Data/dto/user/RemoteUserDTO.ts +4 -4
- package/src/Data/mapper/FileRemoteDTOMapper.ts +8 -6
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +1 -1
- package/src/Data/mapper/UserLocalDTOMapper.ts +2 -2
- package/src/Data/mapper/UserRemoteDTOMapper.ts +2 -2
- package/src/Data/repository/DialogsRepository.ts +16 -0
- package/src/Data/repository/MessagesRepository.ts +2 -2
- package/src/Data/repository/UsersRepository.ts +1 -1
- package/src/Data/source/remote/IRemoteDataSource.ts +2 -0
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +23 -23
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +2 -2
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +0 -2
- package/src/Data/source/remote/RemoteDataSource.ts +136 -15
- package/src/Domain/entity/DialogEventInfo.ts +4 -0
- package/src/Domain/entity/FileEntity.ts +1 -1
- package/src/Domain/entity/UserEntity.ts +1 -11
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +3 -3
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +5 -1
- package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +31 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +6 -1
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +1 -1
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.scss +5 -0
- package/src/Presentation/Views/Dialog/AIComponents/AIAssist/AIAssist.tsx +9 -2
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.scss +10 -0
- package/src/Presentation/Views/Dialog/AIComponents/AITranslate/AITranslate.tsx +16 -7
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.scss +7 -2
- package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +12 -3
- package/src/Presentation/Views/Dialog/DialogViewModel.ts +2 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +1 -1
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.scss +10 -0
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogsWithSearch.tsx +12 -13
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.tsx +9 -5
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +31 -1
- package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.tsx +7 -7
- package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +17 -6
- package/src/Presentation/Views/Dialog/MessageItem/MessageItem.tsx +23 -9
- package/src/Presentation/Views/Dialog/useDialogViewModel.ts +65 -32
- package/src/Presentation/Views/DialogInfo/DialogInfo.scss +14 -12
- package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +36 -18
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +8 -99
- package/src/Presentation/Views/DialogInfo/MembersList/MembersList.tsx +9 -29
- package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +1 -0
- package/src/Presentation/Views/DialogList/DialogList.scss +5 -0
- package/src/Presentation/Views/DialogList/DialogList.tsx +12 -2
- package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +108 -11
- package/src/Presentation/Views/EditDialog/EditDialog.scss +12 -40
- package/src/Presentation/Views/EditDialog/EditDialog.tsx +18 -15
- package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +14 -0
- package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +14 -15
- package/src/Presentation/Views/InviteMembers/useInviteMembersViewModel.ts +1 -11
- package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +4 -0
- package/src/Presentation/layouts/Desktop/DesktopLayout.scss +8 -8
- package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +218 -141
- package/src/Presentation/providers/QuickBloxUIKitProvider/useQBConnection.ts +16 -0
- package/src/Presentation/ui-components/Avatar/avatar.stories.tsx +1 -1
- package/src/Presentation/ui-components/Badge/Badge.stories.ts +1 -1
- package/src/Presentation/ui-components/Button/Button.stories.ts +1 -1
- package/src/Presentation/ui-components/DialogBanner/DialogBanner.stories.ts +2 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.stories.tsx +29 -1
- package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +4 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +11 -0
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.stories.tsx +2 -1
- package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +4 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.scss +4 -0
- package/src/Presentation/ui-components/Dropdown/Dropdown.stories.tsx +2 -1
- package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +5 -2
- package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +9 -1
- package/src/Presentation/ui-components/Header/Header.stories.tsx +2 -1
- package/src/Presentation/ui-components/Loader/Loader.stories.ts +1 -1
- package/src/Presentation/ui-components/Message/Bubble/AttachmentBubble/AttachmentBubble.tsx +6 -1
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +13 -0
- package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.tsx +16 -2
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.scss +9 -0
- package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +15 -17
- package/src/Presentation/ui-components/Message/Message.stories.tsx +80 -1
- package/src/Presentation/ui-components/MessageInput/AttachmentUploader/AttachmentUploader.tsx +3 -0
- package/src/Presentation/ui-components/MessageInput/MessageInput.scss +18 -4
- package/src/Presentation/ui-components/MessageInput/MessageInput.stories.tsx +16 -8
- package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +8 -2
- package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.stories.ts +3 -1
- package/src/Presentation/ui-components/Placeholder/Placeholder.stories.tsx +2 -6
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.stories.ts +12 -1
- package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +2 -2
- package/src/Presentation/ui-components/SettingsItem/SettingsItem.stories.tsx +7 -1
- package/src/Presentation/ui-components/TextField/TextField.stories.ts +7 -2
- package/src/Presentation/ui-components/Toast/Toast.stories.tsx +1 -1
- package/src/Presentation/ui-components/UserListItem/UserListItem.stories.tsx +3 -1
- package/src/QBconfig.ts +4 -4
- package/src/index.scss +3 -2
- package/src/qb-api-calls/index.ts +59 -49
- package/storybook-static/433.dffc897e.iframe.bundle.js +1 -0
- package/storybook-static/603.4cf0423b.iframe.bundle.js +1 -0
- package/storybook-static/{758.d99b0166.iframe.bundle.js → 758.53b4954a.iframe.bundle.js} +3 -3
- package/storybook-static/{758.d99b0166.iframe.bundle.js.map → 758.53b4954a.iframe.bundle.js.map} +1 -1
- package/storybook-static/{472.3c9e81e6.iframe.bundle.js → 768.e44c05aa.iframe.bundle.js} +3 -3
- package/storybook-static/{472.3c9e81e6.iframe.bundle.js.map → 768.e44c05aa.iframe.bundle.js.map} +1 -1
- package/storybook-static/{926.f14bb932.iframe.bundle.js → 926.f5308089.iframe.bundle.js} +2 -2
- package/storybook-static/{926.f14bb932.iframe.bundle.js.map → 926.f5308089.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.cf806856.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js +14 -0
- package/storybook-static/{Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js.map → Presentation-ui-components-Badge-Badge-stories.9449e470.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Button-Button-stories.4fac7996.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js +10 -0
- package/storybook-static/{Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js.map → Presentation-ui-components-DialogBanner-DialogBanner-stories.fa91d2c7.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.6665bbfb.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.cf340397.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.b32a1e17.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Header-Header-stories.073c4507.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.9bf3fb63.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-Message-Message-stories.63bec01b.iframe.bundle.js → Presentation-ui-components-Message-Message-stories.343dfae0.iframe.bundle.js} +1 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.c2ead6a5.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js} +3 -3
- package/storybook-static/{Presentation-ui-components-MessageSeparator-MessageSeparator-stories.82483823.iframe.bundle.js.map → Presentation-ui-components-MessageSeparator-MessageSeparator-stories.a7d43c0b.iframe.bundle.js.map} +1 -1
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.871f508c.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.527e000e.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.2ff75703.iframe.bundle.js +1 -0
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.4a2eef3e.iframe.bundle.js +1 -0
- package/storybook-static/{Presentation-ui-components-Toast-Toast-stories.e26b2e07.iframe.bundle.js → Presentation-ui-components-Toast-Toast-stories.55e63162.iframe.bundle.js} +1 -1
- package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.e88f4206.iframe.bundle.js → Presentation-ui-components-UserListItem-UserListItem-stories.04d3eefe.iframe.bundle.js} +1 -1
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js +10 -0
- package/storybook-static/docs-Introduction-mdx.ac401482.iframe.bundle.js.map +1 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +10 -0
- package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js.map +1 -0
- package/storybook-static/iframe.html +4 -4
- package/storybook-static/index.json +1 -1
- package/storybook-static/main.597d432b.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/runtime~main.12da9712.iframe.bundle.js +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bee082ca.chunk.css} +2 -2
- package/storybook-static/static/css/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.e720ff21.chunk.css.map → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.bee082ca.chunk.css.map} +1 -1
- package/storybook-static/static/css/{Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css → Presentation-ui-components-DialogWindow-DialogWindow-stories.4f813450.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.4f813450.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css → Presentation-ui-components-Dropdown-Dropdown-stories.e37f549d.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.e37f549d.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css} +3 -3
- package/storybook-static/static/css/{Presentation-ui-components-Message-Message-stories.a518b61a.chunk.css.map → Presentation-ui-components-Message-Message-stories.0e129b10.chunk.css.map} +1 -1
- package/storybook-static/static/css/{Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css → Presentation-ui-components-MessageInput-MessageInput-stories.7eb916fc.chunk.css} +2 -2
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.7eb916fc.chunk.css.map +1 -0
- package/storybook-static/static/css/{Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css → Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css} +1 -2
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.cb7fb80a.chunk.css.map +1 -0
- package/storybook-static/static/css/{main.4e852eef.css → main.a921485c.css} +2 -2
- package/storybook-static/static/css/{main.4e852eef.css.map → main.a921485c.css.map} +1 -1
- package/storybook-static/stories.json +1 -1
- package/storybook-static/312.0aa0e670.iframe.bundle.js +0 -1
- package/storybook-static/341.bea6d0bd.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.2fb23ae6.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Badge-Badge-stories.fea53429.iframe.bundle.js +0 -14
- package/storybook-static/Presentation-ui-components-Button-Button-stories.f6c6437b.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogBanner-DialogBanner-stories.6b2a3f72.iframe.bundle.js +0 -10
- package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.f1cb9d40.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.0ad17c54.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.3b620239.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Header-Header-stories.45503161.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Loader-Loader-stories.8b53bb33.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.728a66ad.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-Placeholder-Placeholder-stories.0898ead6.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-PreviewFileMessage-PreviewFileMessage-stories.973cdb64.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.0af0b8a8.iframe.bundle.js +0 -1
- package/storybook-static/Presentation-ui-components-TextField-TextField-stories.5987d2bb.iframe.bundle.js +0 -1
- package/storybook-static/main.0332574c.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.16726a14.iframe.bundle.js +0 -1
- package/storybook-static/static/css/Presentation-ui-components-DialogWindow-DialogWindow-stories.6fb3af8d.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-Dropdown-Dropdown-stories.66965d64.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-MessageInput-MessageInput-stories.0e99d80b.chunk.css.map +0 -1
- package/storybook-static/static/css/Presentation-ui-components-Placeholder-Placeholder-stories.1ebf88ab.chunk.css.map +0 -1
package/package.json
CHANGED
package/src/App.scss
CHANGED
package/src/App.tsx
CHANGED
package/src/Data/Creator.ts
CHANGED
|
@@ -66,7 +66,7 @@ export class Creator {
|
|
|
66
66
|
if (error) {
|
|
67
67
|
reject(error);
|
|
68
68
|
} else {
|
|
69
|
-
resolve(result
|
|
69
|
+
resolve(result!.blob.uid);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
});
|
|
@@ -99,7 +99,6 @@ export class Creator {
|
|
|
99
99
|
name: '',
|
|
100
100
|
size: 0,
|
|
101
101
|
type: FileType.image,
|
|
102
|
-
data: '',
|
|
103
102
|
};
|
|
104
103
|
}
|
|
105
104
|
}
|
|
@@ -133,10 +133,10 @@ export class DefaultConfigurations {
|
|
|
133
133
|
static getDefaultQBConfig(): QBConfig {
|
|
134
134
|
return {
|
|
135
135
|
credentials: {
|
|
136
|
-
appId:
|
|
137
|
-
accountKey: '',
|
|
138
|
-
authKey: '',
|
|
139
|
-
authSecret: '',
|
|
136
|
+
appId: 75949,
|
|
137
|
+
accountKey: 'uK_8uinNyz8-npTNB6tx',
|
|
138
|
+
authKey: 'DdS7zxMEm5Q7DaS',
|
|
139
|
+
authSecret: 'g88RhdOjnDOqFkv',
|
|
140
140
|
sessionToken: '',
|
|
141
141
|
},
|
|
142
142
|
configAIApi: {
|
package/src/Data/Stubs.ts
CHANGED
|
@@ -64,7 +64,6 @@ export class Stubs {
|
|
|
64
64
|
name: '',
|
|
65
65
|
size: 0,
|
|
66
66
|
type: FileType.image,
|
|
67
|
-
data: '',
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -867,7 +866,7 @@ export class Stubs {
|
|
|
867
866
|
login: string,
|
|
868
867
|
created_at: string,
|
|
869
868
|
updated_at: string,
|
|
870
|
-
last_request_at:
|
|
869
|
+
last_request_at: number,
|
|
871
870
|
custom_data: string | null = null,
|
|
872
871
|
user_tags: string | null = null,
|
|
873
872
|
blob_id = '',
|
|
@@ -965,7 +964,7 @@ export class Stubs {
|
|
|
965
964
|
'login_user11',
|
|
966
965
|
'31.03.2023',
|
|
967
966
|
'31.03.2023',
|
|
968
|
-
|
|
967
|
+
0,
|
|
969
968
|
);
|
|
970
969
|
|
|
971
970
|
const user12: UserEntity = Stubs.createUserEntityWithParams(
|
|
@@ -975,7 +974,7 @@ export class Stubs {
|
|
|
975
974
|
'login_user12',
|
|
976
975
|
'31.03.2023',
|
|
977
976
|
'31.03.2023',
|
|
978
|
-
|
|
977
|
+
0,
|
|
979
978
|
);
|
|
980
979
|
|
|
981
980
|
const user13: UserEntity = Stubs.createUserEntityWithParams(
|
|
@@ -985,7 +984,7 @@ export class Stubs {
|
|
|
985
984
|
'login_user13',
|
|
986
985
|
'31.03.2023',
|
|
987
986
|
'31.03.2023',
|
|
988
|
-
|
|
987
|
+
0,
|
|
989
988
|
);
|
|
990
989
|
|
|
991
990
|
users.push(user11);
|
|
@@ -11,12 +11,12 @@ export class RemoteFileDTO {
|
|
|
11
11
|
|
|
12
12
|
public type: string;
|
|
13
13
|
|
|
14
|
-
public data:
|
|
14
|
+
public data: File | undefined;
|
|
15
15
|
|
|
16
16
|
constructor() {
|
|
17
17
|
this.id = '';
|
|
18
18
|
this.type = '';
|
|
19
|
-
this.data =
|
|
19
|
+
this.data = undefined;
|
|
20
20
|
|
|
21
21
|
this.uid = '';
|
|
22
22
|
this.url = '';
|
|
@@ -13,7 +13,7 @@ export class LocalUserDTO {
|
|
|
13
13
|
|
|
14
14
|
public updated_at: string;
|
|
15
15
|
|
|
16
|
-
public last_request_at:
|
|
16
|
+
public last_request_at: number;
|
|
17
17
|
|
|
18
18
|
public custom_data: string | null;
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ export class LocalUserDTO {
|
|
|
29
29
|
this.login = '';
|
|
30
30
|
this.created_at = '';
|
|
31
31
|
this.updated_at = '';
|
|
32
|
-
this.last_request_at =
|
|
32
|
+
this.last_request_at = 0;
|
|
33
33
|
this.custom_data = '';
|
|
34
34
|
this.user_tags = '';
|
|
35
35
|
this.blob_id = '';
|
|
@@ -13,13 +13,13 @@ export class RemoteUserDTO {
|
|
|
13
13
|
|
|
14
14
|
public updated_at: string;
|
|
15
15
|
|
|
16
|
-
public last_request_at:
|
|
16
|
+
public last_request_at: number;
|
|
17
17
|
|
|
18
18
|
public custom_data: string | null;
|
|
19
19
|
|
|
20
20
|
public user_tags: string | null;
|
|
21
21
|
|
|
22
|
-
public blob_id: number |
|
|
22
|
+
public blob_id: number | null;
|
|
23
23
|
|
|
24
24
|
constructor() {
|
|
25
25
|
this.id = '';
|
|
@@ -29,9 +29,9 @@ export class RemoteUserDTO {
|
|
|
29
29
|
this.login = '';
|
|
30
30
|
this.created_at = '';
|
|
31
31
|
this.updated_at = '';
|
|
32
|
-
this.last_request_at =
|
|
32
|
+
this.last_request_at = 0;
|
|
33
33
|
this.custom_data = '';
|
|
34
34
|
this.user_tags = '';
|
|
35
|
-
this.blob_id =
|
|
35
|
+
this.blob_id = 0;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -43,7 +43,7 @@ export class FileRemoteDTOMapper implements IMapper {
|
|
|
43
43
|
|
|
44
44
|
fileDTO.size = fileEntity.size || 0;
|
|
45
45
|
|
|
46
|
-
fileDTO.data = fileEntity.data
|
|
46
|
+
fileDTO.data = fileEntity.data;
|
|
47
47
|
|
|
48
48
|
return Promise.resolve(fileDTO as TResult);
|
|
49
49
|
}
|
|
@@ -143,11 +143,6 @@ export class FileRemoteDTOMapper implements IMapper {
|
|
|
143
143
|
|
|
144
144
|
private static validateDTO(fileDTO: RemoteFileDTO) {
|
|
145
145
|
const dtoValidator: DtoValidator<LocalFileDTO> = {
|
|
146
|
-
data(v: unknown): v is LocalFileDTO['data'] {
|
|
147
|
-
const { data } = v as LocalFileDTO;
|
|
148
|
-
|
|
149
|
-
return data !== undefined && data !== null;
|
|
150
|
-
},
|
|
151
146
|
id(v: unknown): v is LocalFileDTO['id'] {
|
|
152
147
|
const { id } = v as LocalFileDTO;
|
|
153
148
|
|
|
@@ -168,6 +163,13 @@ export class FileRemoteDTOMapper implements IMapper {
|
|
|
168
163
|
|
|
169
164
|
return uid !== undefined && uid !== null;
|
|
170
165
|
},
|
|
166
|
+
data(v: unknown): v is LocalFileDTO['data'] {
|
|
167
|
+
const { data, uid } = v as LocalFileDTO;
|
|
168
|
+
|
|
169
|
+
return <boolean>(
|
|
170
|
+
((data !== undefined && data !== null) || (uid && uid.length > 0))
|
|
171
|
+
);
|
|
172
|
+
},
|
|
171
173
|
url(v: unknown): v is LocalFileDTO['url'] {
|
|
172
174
|
const { url } = v as LocalFileDTO;
|
|
173
175
|
|
|
@@ -112,7 +112,7 @@ export class MessageRemoteDTOMapper implements IMapper {
|
|
|
112
112
|
messageEntity.created_at = messageDTO.created_at;
|
|
113
113
|
messageEntity.date_sent = messageDTO.date_sent;
|
|
114
114
|
messageEntity.delivered_ids = messageDTO.delivered_ids;
|
|
115
|
-
messageEntity.message = messageDTO.message;
|
|
115
|
+
messageEntity.message = messageDTO.message || '';
|
|
116
116
|
messageEntity.read_ids = messageDTO.read_ids;
|
|
117
117
|
messageEntity.read = messageDTO.read;
|
|
118
118
|
messageEntity.recipient_id = messageDTO.recipient_id;
|
|
@@ -134,7 +134,7 @@ export class UserLocalDTOMapper implements IMapper {
|
|
|
134
134
|
return (
|
|
135
135
|
last_request_at !== undefined &&
|
|
136
136
|
last_request_at !== null &&
|
|
137
|
-
last_request_at
|
|
137
|
+
last_request_at > 0
|
|
138
138
|
);
|
|
139
139
|
},
|
|
140
140
|
login(v: unknown): v is UserEntity['login'] {
|
|
@@ -376,7 +376,7 @@ export class UserLocalDTOMapper implements IMapper {
|
|
|
376
376
|
email: '',
|
|
377
377
|
full_name: '',
|
|
378
378
|
id: 0,
|
|
379
|
-
last_request_at:
|
|
379
|
+
last_request_at: 0,
|
|
380
380
|
login: '',
|
|
381
381
|
updated_at: '',
|
|
382
382
|
user_tags: '',
|
|
@@ -146,7 +146,7 @@ export class UserRemoteDTOMapper implements IMapper {
|
|
|
146
146
|
return (
|
|
147
147
|
last_request_at !== undefined &&
|
|
148
148
|
last_request_at !== null &&
|
|
149
|
-
last_request_at
|
|
149
|
+
last_request_at > 0
|
|
150
150
|
);
|
|
151
151
|
},
|
|
152
152
|
login(v: unknown): v is UserEntity['login'] {
|
|
@@ -387,7 +387,7 @@ export class UserRemoteDTOMapper implements IMapper {
|
|
|
387
387
|
email: '',
|
|
388
388
|
full_name: '',
|
|
389
389
|
id: 0,
|
|
390
|
-
last_request_at:
|
|
390
|
+
last_request_at: 0,
|
|
391
391
|
login: '',
|
|
392
392
|
updated_at: '',
|
|
393
393
|
user_tags: '',
|
|
@@ -147,6 +147,22 @@ export default class DialogsRepository implements IDialogsRepository {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
async updateCurrentDialogInLocalDataSource(
|
|
151
|
+
entity: DialogEntity,
|
|
152
|
+
): Promise<DialogEntity> {
|
|
153
|
+
try {
|
|
154
|
+
const dto: RemoteDialogDTO = await this.dialogRemoteDTOMapper.fromEntity(
|
|
155
|
+
entity,
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
this.remoteDataSource.updateCurrentDialog(dto);
|
|
159
|
+
|
|
160
|
+
return Promise.resolve(entity);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
return Promise.reject(e);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
150
166
|
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/no-unused-vars
|
|
151
167
|
async updateDialogInRemote(entity: DialogEntity): Promise<DialogEntity> {
|
|
152
168
|
const remoteDialogDTO: RemoteDialogDTO =
|
|
@@ -224,7 +224,7 @@ export default class MessagesRepository implements IMessagesRepository {
|
|
|
224
224
|
|
|
225
225
|
async saveMessageToLocal(entity: MessageEntity): Promise<MessageEntity> {
|
|
226
226
|
try {
|
|
227
|
-
const dto:
|
|
227
|
+
const dto: LocalMessageDTO = await this.messageLocalDTOMapper.fromEntity(
|
|
228
228
|
entity,
|
|
229
229
|
);
|
|
230
230
|
|
|
@@ -260,7 +260,7 @@ export default class MessagesRepository implements IMessagesRepository {
|
|
|
260
260
|
|
|
261
261
|
async updateMessageInLocal(entity: MessageEntity): Promise<boolean> {
|
|
262
262
|
try {
|
|
263
|
-
const dto:
|
|
263
|
+
const dto: LocalMessageDTO = await this.messageLocalDTOMapper.fromEntity(
|
|
264
264
|
entity,
|
|
265
265
|
);
|
|
266
266
|
|
|
@@ -123,7 +123,7 @@ export default class UsersRepository {
|
|
|
123
123
|
|
|
124
124
|
dto.id = userId.toString();
|
|
125
125
|
|
|
126
|
-
const userDTO:
|
|
126
|
+
const userDTO: RemoteUserDTO = await this.remoteDataSource.getUser(dto);
|
|
127
127
|
|
|
128
128
|
userEntity = await this.userRemoteDTOMapper.toEntity(userDTO);
|
|
129
129
|
} catch (e) {
|
|
@@ -109,4 +109,6 @@ export interface IRemoteDataSource extends IRemoteMessaging<RemoteMessageDTO> {
|
|
|
109
109
|
deleteFile(dto: RemoteFileDTO): Promise<void>;
|
|
110
110
|
|
|
111
111
|
subscribeToChatConnectionEvents(fileId: string): Promise<void>;
|
|
112
|
+
|
|
113
|
+
updateCurrentDialog(dto: RemoteDialogDTO): void;
|
|
112
114
|
}
|
|
@@ -18,9 +18,9 @@ export class FileDTOMapper implements IDTOMapper {
|
|
|
18
18
|
FileDTOMapper.validateDTO(fileDTO);
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
21
|
-
const fileContentParam:
|
|
21
|
+
const fileContentParam: QBBlobCreateUploadParams = {
|
|
22
22
|
name: fileDTO.name || '',
|
|
23
|
-
file: fileDTO.data
|
|
23
|
+
file: fileDTO.data!,
|
|
24
24
|
type: fileDTO.type || '',
|
|
25
25
|
size: fileDTO.size || 0,
|
|
26
26
|
public: false, // optional, "false" by default
|
|
@@ -31,7 +31,7 @@ export class FileDTOMapper implements IDTOMapper {
|
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line class-methods-use-this
|
|
33
33
|
toTDO<TArg, TResult>(qbEntity: TArg): Promise<TResult> {
|
|
34
|
-
const qbFile:
|
|
34
|
+
const qbFile: QBBlobCreate = qbEntity as unknown as QBBlobCreate;
|
|
35
35
|
|
|
36
36
|
FileDTOMapper.validateQBFileDialog(qbFile);
|
|
37
37
|
|
|
@@ -145,27 +145,27 @@ export class FileDTOMapper implements IDTOMapper {
|
|
|
145
145
|
return Promise.resolve();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
private static validateQBFileDialog(qbFile:
|
|
148
|
+
private static validateQBFileDialog(qbFile: QBBlobCreate) {
|
|
149
149
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
150
150
|
// @ts-ignore
|
|
151
|
-
const qbFileValidator: DtoValidator<
|
|
152
|
-
account_id(v: unknown): v is
|
|
153
|
-
const { account_id } = v as
|
|
151
|
+
const qbFileValidator: DtoValidator<QBBlobCreate> = {
|
|
152
|
+
account_id(v: unknown): v is QBBlobCreate['account_id'] {
|
|
153
|
+
const { account_id } = v as QBBlobCreate;
|
|
154
154
|
|
|
155
155
|
return account_id !== undefined && account_id !== null;
|
|
156
156
|
},
|
|
157
|
-
app_id(v: unknown): v is
|
|
158
|
-
const { app_id } = v as
|
|
157
|
+
app_id(v: unknown): v is QBBlobCreate['app_id'] {
|
|
158
|
+
const { app_id } = v as QBBlobCreate;
|
|
159
159
|
|
|
160
160
|
return app_id !== undefined && app_id !== null;
|
|
161
161
|
},
|
|
162
|
-
content_type(v: unknown): v is
|
|
163
|
-
const { content_type } = v as
|
|
162
|
+
content_type(v: unknown): v is QBBlobCreate['content_type'] {
|
|
163
|
+
const { content_type } = v as QBBlobCreate;
|
|
164
164
|
|
|
165
165
|
return content_type !== undefined && content_type !== null;
|
|
166
166
|
},
|
|
167
|
-
created_at(v: unknown): v is
|
|
168
|
-
const { created_at } = v as
|
|
167
|
+
created_at(v: unknown): v is QBBlobCreate['created_at'] {
|
|
168
|
+
const { created_at } = v as QBBlobCreate;
|
|
169
169
|
|
|
170
170
|
return (
|
|
171
171
|
created_at !== undefined &&
|
|
@@ -173,28 +173,28 @@ export class FileDTOMapper implements IDTOMapper {
|
|
|
173
173
|
created_at.length > 0
|
|
174
174
|
);
|
|
175
175
|
},
|
|
176
|
-
id(v: unknown): v is
|
|
177
|
-
const { id } = v as
|
|
176
|
+
id(v: unknown): v is QBBlobCreate['id'] {
|
|
177
|
+
const { id } = v as QBBlobCreate;
|
|
178
178
|
|
|
179
179
|
return id !== undefined && id !== null;
|
|
180
180
|
},
|
|
181
|
-
name(v: unknown): v is
|
|
182
|
-
const { name } = v as
|
|
181
|
+
name(v: unknown): v is QBBlobCreate['name'] {
|
|
182
|
+
const { name } = v as QBBlobCreate;
|
|
183
183
|
|
|
184
184
|
return name !== undefined && name !== null && name.length > 0;
|
|
185
185
|
},
|
|
186
|
-
size(v: unknown): v is
|
|
187
|
-
const { size } = v as
|
|
186
|
+
size(v: unknown): v is QBBlobCreate['size'] {
|
|
187
|
+
const { size } = v as QBBlobCreate;
|
|
188
188
|
|
|
189
189
|
return size !== undefined && size !== null;
|
|
190
190
|
},
|
|
191
|
-
uid(v: unknown): v is
|
|
192
|
-
const { uid } = v as
|
|
191
|
+
uid(v: unknown): v is QBBlobCreate['uid'] {
|
|
192
|
+
const { uid } = v as QBBlobCreate;
|
|
193
193
|
|
|
194
194
|
return uid !== undefined && uid !== null && uid.length > 0;
|
|
195
195
|
},
|
|
196
|
-
updated_at(v: unknown): v is
|
|
197
|
-
const { updated_at } = v as
|
|
196
|
+
updated_at(v: unknown): v is QBBlobCreate['updated_at'] {
|
|
197
|
+
const { updated_at } = v as QBBlobCreate;
|
|
198
198
|
|
|
199
199
|
return (
|
|
200
200
|
updated_at !== undefined &&
|
|
@@ -143,7 +143,7 @@ export class MessageDTOMapper implements IDTOMapper {
|
|
|
143
143
|
|
|
144
144
|
dto.recipient_id = qbMessage.recipient_id || 0;
|
|
145
145
|
dto.attachments = MessageDTOMapper.transformAttachment(
|
|
146
|
-
qbMessage.message,
|
|
146
|
+
qbMessage.message || '',
|
|
147
147
|
qbMessage.attachments || [],
|
|
148
148
|
);
|
|
149
149
|
dto.read = qbMessage.read;
|
|
@@ -163,7 +163,7 @@ export class MessageDTOMapper implements IDTOMapper {
|
|
|
163
163
|
|
|
164
164
|
dto.recipient_id = qbMessage.recipient_id || 0;
|
|
165
165
|
dto.attachments = MessageDTOMapper.transformAttachment(
|
|
166
|
-
qbMessage.message,
|
|
166
|
+
qbMessage.message || '',
|
|
167
167
|
qbMessage.attachments || [],
|
|
168
168
|
);
|
|
169
169
|
dto.read = qbMessage.read || 1;
|
|
@@ -32,9 +32,7 @@ export class UserDTOMapper implements IDTOMapper {
|
|
|
32
32
|
id: parseInt(userDTO.id, 10),
|
|
33
33
|
last_request_at: userDTO.last_request_at,
|
|
34
34
|
login: userDTO.login,
|
|
35
|
-
old_password: '',
|
|
36
35
|
parents_contacts: '',
|
|
37
|
-
password: '',
|
|
38
36
|
phone: '',
|
|
39
37
|
updated_at: userDTO.updated_at,
|
|
40
38
|
user_tags: userDTO.user_tags,
|