@@ -249,13 +249,21 @@ export declare interface ChatMessageAttachment {
249
249
type : string
250
250
/** Link to a file in Internet. */
251
251
url ?: string
252
- /** UID of file from `QB.content.createAndUpload` */
253
- uid ?: string
254
252
/** Name of attachment. */
255
253
name ?: string
256
254
/** 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
259
267
}
260
268
261
269
declare enum QBChatDialogType {
@@ -307,6 +315,7 @@ export declare interface QBChatDialog {
307
315
last_message_id : string | null
308
316
/** Number of unread messages in this dialog for a current user. */
309
317
unread_messages_count : number | null
318
+ is_join_required : number | undefined | null
310
319
/**
311
320
* - Information about class and fields in Custom Objects.
312
321
* - Any dialog can be extended using Custom Objects to store additional parameters.
@@ -580,8 +589,7 @@ interface QBChatModule {
580
589
*/
581
590
sendSystemMessage (
582
591
jidOrUserId : QBUser [ 'id' ] | string ,
583
- // TODO: change type
584
- message : { extension : QBSystemMessage [ 'extension' ] } ,
592
+ message : Partial < Omit < QBSystemMessage , 'userId' > > ,
585
593
) : string
586
594
/** Send is delivered status. */
587
595
sendDeliveredStatus ( params : QBMessageStatusParams ) : void
@@ -823,9 +831,9 @@ export declare interface QBBlobCreate extends QBBlob {
823
831
}
824
832
export declare interface QBBlobCreateUploadParams {
825
833
name : string
826
- file : File
834
+ file : File | Blob | Buffer
827
835
type : string
828
- size : number
836
+ size : number | string
829
837
public ?: boolean // optional, "false" by default
830
838
}
831
839
interface QBContentModule {
@@ -893,7 +901,11 @@ interface QBContentModule {
893
901
upload (
894
902
params : {
895
903
url : string
896
- data : Dictionary < any >
904
+ data : {
905
+ name ?: string
906
+ file : File | Blob | Buffer
907
+ key : string
908
+ }
897
909
} ,
898
910
callback : QBCallback < any > ,
899
911
) : void
@@ -955,7 +967,7 @@ interface QBDataModule {
955
967
callback : QBCallback < T > ,
956
968
) : void
957
969
/**
958
- * Delete record/records by ID, IDs or criteria (filters) of particular class
970
+ * Delete record/records by ID, IDs
959
971
* ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
960
972
*/
961
973
delete (
@@ -964,13 +976,13 @@ interface QBDataModule {
964
976
callback : QBCallback < QBDataDeletedResponse > ,
965
977
) : void
966
978
/**
967
- * Delete record/ records by ID, IDs or criteria (filters) of particular class
979
+ * Delete records by criteria (filters) of particular class
968
980
* ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
969
981
*/
970
982
delete (
971
983
className : string ,
972
984
criteria : Dictionary < any > ,
973
- callback : QBCallback < { total_deleted : number } > ,
985
+ callback : QBCallback < { deleted : null ; deletedCount : number } > ,
974
986
) : void
975
987
/**
976
988
* Delete file from file field by ID
@@ -1031,7 +1043,7 @@ interface QBDataModule {
1031
1043
*/
1032
1044
uploadFile (
1033
1045
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 } ,
1035
1047
callback : QBCallback < QBDataFile > ,
1036
1048
) : void
1037
1049
}
@@ -1044,14 +1056,9 @@ export declare type ListUserParams = {
1044
1056
}
1045
1057
1046
1058
export declare type GetUserParams =
1047
- | { login : string }
1048
1059
| { full_name : string ; page ?: number ; per_page ?: number }
1049
- | { facebook_id : string }
1050
- | { phone : string }
1051
- | { email : string }
1052
1060
| { tags : string | string [ ] ; page ?: number ; per_page ?: number }
1053
1061
| Omit < ListUserParams , 'filter' >
1054
- | { external : string }
1055
1062
1056
1063
interface QBUsersModule {
1057
1064
/**
@@ -1071,11 +1078,31 @@ interface QBUsersModule {
1071
1078
* Remove a user from the app, by user's external id that represents the user in an external user registry.
1072
1079
* ([read more](https://docs.quickblox.com/docs/js-users#delete-user)).
1073
1080
*/
1074
- delete ( params : { external : number } , callback : QBCallback < any > ) : void
1081
+ delete ( params : { external : string | number } , callback : QBCallback < any > ) : void
1075
1082
/**
1076
1083
* Retrieve the user by id.
1077
1084
*/
1078
1085
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
1079
1106
/**
1080
1107
* Retrieve a specific users.
1081
1108
*/
0 commit comments