quickblox 2.19.2 → 2.19.3-beta.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quickblox",
3
3
  "description": "QuickBlox JavaScript SDK",
4
- "version": "2.19.2",
4
+ "version": "2.19.3-beta.1",
5
5
  "homepage": "https://quickblox.com/developers/Javascript",
6
6
  "main": "src/qbMain.js",
7
7
  "types": "quickblox.d.ts",
package/quickblox.d.ts CHANGED
@@ -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 | number | undefined
259
267
  }
260
268
 
261
269
  declare enum QBChatDialogType {
@@ -580,8 +588,7 @@ interface QBChatModule {
580
588
  */
581
589
  sendSystemMessage(
582
590
  jidOrUserId: QBUser['id'] | string,
583
- // TODO: change type
584
- message: { extension: QBSystemMessage['extension'] },
591
+ message: Partial<Omit<QBSystemMessage, 'userId'>>,
585
592
  ): string
586
593
  /** Send is delivered status. */
587
594
  sendDeliveredStatus(params: QBMessageStatusParams): void
@@ -823,7 +830,7 @@ export declare interface QBBlobCreate extends QBBlob {
823
830
  }
824
831
  export declare interface QBBlobCreateUploadParams {
825
832
  name: string
826
- file: File
833
+ file: File | Blob | Buffer
827
834
  type: string
828
835
  size: number
829
836
  public?: boolean // optional, "false" by default
@@ -893,7 +900,11 @@ interface QBContentModule {
893
900
  upload(
894
901
  params: {
895
902
  url: string
896
- data: Dictionary<any>
903
+ data: {
904
+ name?: string
905
+ file: File | Blob | Buffer
906
+ key: string
907
+ }
897
908
  },
898
909
  callback: QBCallback<any>,
899
910
  ): void
@@ -955,7 +966,7 @@ interface QBDataModule {
955
966
  callback: QBCallback<T>,
956
967
  ): void
957
968
  /**
958
- * Delete record/records by ID, IDs or criteria (filters) of particular class
969
+ * Delete record/records by ID, IDs
959
970
  * ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
960
971
  */
961
972
  delete(
@@ -964,13 +975,13 @@ interface QBDataModule {
964
975
  callback: QBCallback<QBDataDeletedResponse>,
965
976
  ): void
966
977
  /**
967
- * Delete record/records by ID, IDs or criteria (filters) of particular class
978
+ * Delete records by criteria (filters) of particular class
968
979
  * ([read more](https://docs.quickblox.com/docs/js-custom-objects#delete-records)).
969
980
  */
970
981
  delete(
971
982
  className: string,
972
983
  criteria: Dictionary<any>,
973
- callback: QBCallback<{ total_deleted: number }>,
984
+ callback: QBCallback<{ deleted: null; deletedCount: number }>,
974
985
  ): void
975
986
  /**
976
987
  * Delete file from file field by ID
@@ -1031,7 +1042,7 @@ interface QBDataModule {
1031
1042
  */
1032
1043
  uploadFile(
1033
1044
  className: string,
1034
- params: { id: string; field_name: string; file: File; name: string },
1045
+ params: { id: string; field_name: string; file: File | Blob | Buffer; name: string },
1035
1046
  callback: QBCallback<QBDataFile>,
1036
1047
  ): void
1037
1048
  }
@@ -1044,14 +1055,9 @@ export declare type ListUserParams = {
1044
1055
  }
1045
1056
 
1046
1057
  export declare type GetUserParams =
1047
- | { login: string }
1048
1058
  | { full_name: string; page?: number; per_page?: number }
1049
- | { facebook_id: string }
1050
- | { phone: string }
1051
- | { email: string }
1052
1059
  | { tags: string | string[]; page?: number; per_page?: number }
1053
1060
  | Omit<ListUserParams, 'filter'>
1054
- | { external: string }
1055
1061
 
1056
1062
  interface QBUsersModule {
1057
1063
  /**
@@ -1071,11 +1077,31 @@ interface QBUsersModule {
1071
1077
  * Remove a user from the app, by user's external id that represents the user in an external user registry.
1072
1078
  * ([read more](https://docs.quickblox.com/docs/js-users#delete-user)).
1073
1079
  */
1074
- delete(params: { external: number }, callback: QBCallback<any>): void
1080
+ delete(params: { external: string | number }, callback: QBCallback<any>): void
1075
1081
  /**
1076
1082
  * Retrieve the user by id.
1077
1083
  */
1078
1084
  get(userId: QBUser['id'], callback: QBCallback<QBUser>): void
1085
+ /**
1086
+ * Retrieve the user by login.
1087
+ */
1088
+ get(params: { login: string }, callback: QBCallback<QBUser>): void
1089
+ /**
1090
+ * Retrieve the user by phone.
1091
+ */
1092
+ get(params: { phone: string }, callback: QBCallback<QBUser>): void
1093
+ /**
1094
+ * Retrieve the user by email.
1095
+ */
1096
+ get(params: { email: string }, callback: QBCallback<QBUser>): void
1097
+ /**
1098
+ * Retrieve the user by facebook_id.
1099
+ */
1100
+ get(params: { facebook_id: string }, callback: QBCallback<QBUser>): void
1101
+ /**
1102
+ * Retrieve the user by external user id.
1103
+ */
1104
+ get(params: { external: string | number }, callback: QBCallback<QBUser>): void
1079
1105
  /**
1080
1106
  * Retrieve a specific users.
1081
1107
  */