Skip to content

Commit 54a2999

Browse files
v2.20.0
1 parent 022ec25 commit 54a2999

File tree

9 files changed

+7799
-8129
lines changed

9 files changed

+7799
-8129
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quickblox",
33
"description": "QuickBlox JavaScript SDK",
4-
"version": "2.19.2",
4+
"version": "2.20.0",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "src/qbMain.js",
77
"types": "quickblox.d.ts",

quickblox.d.ts

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,21 @@ export declare interface ChatMessageAttachment {
249249
type: string
250250
/** Link to a file in Internet. */
251251
url?: string
252-
/** UID of file from `QB.content.createAndUpload` */
253-
uid?: string
254252
/** Name of attachment. */
255253
name?: string
256254
/** Size of attachment. */
257-
size?: number
258-
[key: string]: QBCustomField
255+
size?: string | number
256+
/** Content-Type of attachment. */
257+
'content-type'?: string
258+
/* Width of Image/Video. Useful for Image/Video type attachments */
259+
width?: string | number
260+
/* Height of Image/Video. Useful for Image/Video type attachments */
261+
height?: string | number
262+
/* Duration of Video. Useful for Video type attachments */
263+
duration?: string | number
264+
/* Custom parameters. Useful for storing metadata of attachment */
265+
data?: string
266+
[key: string]: string | undefined
259267
}
260268

261269
declare enum QBChatDialogType {
@@ -307,6 +315,7 @@ export declare interface QBChatDialog {
307315
last_message_id: string | null
308316
/** Number of unread messages in this dialog for a current user. */
309317
unread_messages_count: number | null
318+
is_join_required: number | undefined |null
310319
/**
311320
* - Information about class and fields in Custom Objects.
312321
* - Any dialog can be extended using Custom Objects to store additional parameters.
@@ -580,8 +589,7 @@ interface QBChatModule {
580589
*/
581590
sendSystemMessage(
582591
jidOrUserId: QBUser['id'] | string,
583-
// TODO: change type
584-
message: { extension: QBSystemMessage['extension'] },
592+
message: Partial<Omit<QBSystemMessage, 'userId'>>,
585593
): string
586594
/** Send is delivered status. */
587595
sendDeliveredStatus(params: QBMessageStatusParams): void
@@ -823,9 +831,9 @@ export declare interface QBBlobCreate extends QBBlob {
823831
}
824832
export declare interface QBBlobCreateUploadParams {
825833
name: string
826-
file: File
834+
file: File | Blob | Buffer
827835
type: string
828-
size: number
836+
size: number | string
829837
public?: boolean // optional, "false" by default
830838
}
831839
interface QBContentModule {
@@ -893,7 +901,11 @@ interface QBContentModule {
893901
upload(
894902
params: {
895903
url: string
896-
data: Dictionary<any>
904+
data: {
905+
name?: string
906+
file: File | Blob | Buffer
907+
key: string
908+
}
897909
},
898910
callback: QBCallback<any>,
899911
): void
@@ -955,7 +967,7 @@ interface QBDataModule {
955967
callback: QBCallback<T>,
956968
): void
957969
/**
958-
* Delete record/records by ID, IDs or criteria (filters) of particular class
970+
* Delete record/records by ID, IDs
959971
* ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
960972
*/
961973
delete(
@@ -964,13 +976,13 @@ interface QBDataModule {
964976
callback: QBCallback<QBDataDeletedResponse>,
965977
): void
966978
/**
967-
* Delete record/records by ID, IDs or criteria (filters) of particular class
979+
* Delete records by criteria (filters) of particular class
968980
* ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
969981
*/
970982
delete(
971983
className: string,
972984
criteria: Dictionary<any>,
973-
callback: QBCallback<{ total_deleted: number }>,
985+
callback: QBCallback<{ deleted: null; deletedCount: number }>,
974986
): void
975987
/**
976988
* Delete file from file field by ID
@@ -1031,7 +1043,7 @@ interface QBDataModule {
10311043
*/
10321044
uploadFile(
10331045
className: string,
1034-
params: { id: string; field_name: string; file: File; name: string },
1046+
params: { id: string; field_name: string; file: File | Blob | Buffer; name: string },
10351047
callback: QBCallback<QBDataFile>,
10361048
): void
10371049
}
@@ -1044,14 +1056,9 @@ export declare type ListUserParams = {
10441056
}
10451057

10461058
export declare type GetUserParams =
1047-
| { login: string }
10481059
| { full_name: string; page?: number; per_page?: number }
1049-
| { facebook_id: string }
1050-
| { phone: string }
1051-
| { email: string }
10521060
| { tags: string | string[]; page?: number; per_page?: number }
10531061
| Omit<ListUserParams, 'filter'>
1054-
| { external: string }
10551062

10561063
interface QBUsersModule {
10571064
/**
@@ -1071,11 +1078,31 @@ interface QBUsersModule {
10711078
* Remove a user from the app, by user's external id that represents the user in an external user registry.
10721079
* ([read more](https://docs.quickblox.com/docs/js-users#delete-user)).
10731080
*/
1074-
delete(params: { external: number }, callback: QBCallback<any>): void
1081+
delete(params: { external: string | number }, callback: QBCallback<any>): void
10751082
/**
10761083
* Retrieve the user by id.
10771084
*/
10781085
get(userId: QBUser['id'], callback: QBCallback<QBUser>): void
1086+
/**
1087+
* Retrieve the user by login.
1088+
*/
1089+
get(params: { login: string }, callback: QBCallback<QBUser>): void
1090+
/**
1091+
* Retrieve the user by phone.
1092+
*/
1093+
get(params: { phone: string }, callback: QBCallback<QBUser>): void
1094+
/**
1095+
* Retrieve the user by email.
1096+
*/
1097+
get(params: { email: string }, callback: QBCallback<QBUser>): void
1098+
/**
1099+
* Retrieve the user by facebook_id.
1100+
*/
1101+
get(params: { facebook_id: string }, callback: QBCallback<QBUser>): void
1102+
/**
1103+
* Retrieve the user by external user id.
1104+
*/
1105+
get(params: { external: string | number }, callback: QBCallback<QBUser>): void
10791106
/**
10801107
* Retrieve a specific users.
10811108
*/

0 commit comments

Comments
 (0)