easemob-websdk 4.0.4 → 4.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changes to easemob chat
2
2
 
3
+ ## ## 4.0.5 (May 15, 2022)
4
+
5
+ - Add reporting API for content auditing
6
+ - Add push setting API to support different push configuration
7
+ - Add the data reporting function
8
+ - The API for getting groups that you have joined supports paging
9
+ - When creating a group, the SDK supports setting the number of group members
10
+ - Add thumbnail address parameter to receive picture message
11
+ - Fixed group chat message cache issues
12
+
3
13
  ## 4.0.4 (April 19, 2022)
4
14
 
5
15
  - Add presence feature
package/Easemob-chat.d.ts CHANGED
@@ -730,6 +730,91 @@ export declare namespace EasemobChat {
730
730
  expire: number;
731
731
  }
732
732
 
733
+ interface SilentModeConversationType {
734
+ /** Silent mode type. */
735
+ type: string;
736
+ /** Silent mode duration, duration of Unix timestamp. */
737
+ ignoreDuration: number;
738
+ /** Silent mode interval. */
739
+ ignoreInterval: string;
740
+ }
741
+
742
+ interface ConversationSilentModeType {
743
+ /** User push map. */
744
+ user: {
745
+ [propname: UserId]: SilentModeConversationType;
746
+ };
747
+ /** Group push map. */
748
+ group: {
749
+ [propname: string]: SilentModeConversationType;
750
+ };
751
+ }
752
+
753
+ interface TranslationLanguageType {
754
+ /** Translation language. */
755
+ language: string;
756
+ }
757
+
758
+ enum SILENTMODETYPE {
759
+ /** All messsage. */
760
+ ALL = 'ALL',
761
+ /** @ messaage of myself. */
762
+ AT = 'AT',
763
+ /** None. */
764
+ NONE = 'NONE',
765
+ }
766
+
767
+ enum CONVERSATIONTYPE {
768
+ /** Single chat. */
769
+ SINGLECHAT = 'singleChat',
770
+ /** Group chat. */
771
+ GROUPCHAT = 'groupChat',
772
+ /** Chat room. */
773
+ CHATROOM = 'chatRoom',
774
+ }
775
+
776
+ type ConversationListType = {
777
+ /** Conversation id. */
778
+ id: string;
779
+ /** Conversation type. */
780
+ type: string;
781
+ };
782
+
783
+ interface SilentModeRemindType {
784
+ /** Silent mode type. */
785
+ paramType: 0;
786
+ /** Silent mode type. */
787
+ remindType: SILENTMODETYPE;
788
+ }
789
+
790
+ interface SilentModeDuration {
791
+ /** Silent mode type. */
792
+ paramType: 1;
793
+ /** Silent mode duration, duration of Unix timestamp. */
794
+ duration: number;
795
+ }
796
+
797
+ interface SilentModeInterval {
798
+ /** Silent mode type. */
799
+ paramType: 2;
800
+ /** Start time interval. */
801
+ startTime: Interval;
802
+ /** End time interval. */
803
+ endTime: Interval;
804
+ }
805
+
806
+ type Interval = {
807
+ /** Hours. */
808
+ hours: number;
809
+ /** Minutes. */
810
+ minutes: number;
811
+ };
812
+
813
+ type SilentModeParamType =
814
+ | SilentModeRemindType
815
+ | SilentModeDuration
816
+ | SilentModeInterval;
817
+
733
818
  enum Code {
734
819
  REQUEST_SUCCESS = 0,
735
820
  REQUEST_TIMEOUT = -1,
@@ -1684,6 +1769,7 @@ export declare namespace EasemobChat {
1684
1769
  approval: boolean;
1685
1770
  allowinvites: boolean;
1686
1771
  inviteNeedConfirm: boolean;
1772
+ maxusers: number;
1687
1773
  };
1688
1774
  success?: (res: AsyncResult<CreateGroupResult>) => void;
1689
1775
  error?: (error: ErrorEvent) => void;
@@ -1719,6 +1805,7 @@ export declare namespace EasemobChat {
1719
1805
  approval: boolean;
1720
1806
  allowinvites: boolean;
1721
1807
  inviteNeedConfirm: boolean;
1808
+ maxusers: number;
1722
1809
  };
1723
1810
  success?: (res: AsyncResult<CreateGroupResult>) => void;
1724
1811
  error?: (error: ErrorEvent) => void;
@@ -1776,6 +1863,7 @@ export declare namespace EasemobChat {
1776
1863
  * connection.getGroup()
1777
1864
  * ```
1778
1865
  * @since 1.4.11
1866
+ * @deprecated
1779
1867
  */
1780
1868
  getGroup(
1781
1869
  this: Connection,
@@ -1785,6 +1873,23 @@ export declare namespace EasemobChat {
1785
1873
  }
1786
1874
  ): Promise<AsyncResult<BaseGroupInfo[]>>;
1787
1875
 
1876
+ /**
1877
+ * Lists all the groups a user has joined.
1878
+ *
1879
+ * ```typescript
1880
+ * connection.getJoinedGroups()
1881
+ * ```
1882
+ */
1883
+ getJoinedGroups(
1884
+ this: Connection,
1885
+ params: {
1886
+ pageNum: number;
1887
+ pageSize: number;
1888
+ success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
1889
+ error?: (error: ErrorEvent) => void;
1890
+ }
1891
+ ): Promise<AsyncResult<BaseGroupInfo[]>>;
1892
+
1788
1893
  /** @deprecated */
1789
1894
  changeOwner(
1790
1895
  this: Connection,
@@ -3090,6 +3195,179 @@ export declare namespace EasemobChat {
3090
3195
  error?: (error: ErrorEvent) => void;
3091
3196
  }
3092
3197
  ): Promise<AsyncResult<SubscribePresenceResult>>;
3198
+
3199
+ /**
3200
+ * Reports a message.
3201
+ *
3202
+ * ```typescript
3203
+ * reportMessage({reportType: 'adult', reportReason: 'reason', messageId: 'id'})
3204
+ * ```
3205
+ */
3206
+ reportMessage(
3207
+ this: Connection,
3208
+ params: {
3209
+ reportType: string; // 举报类型。
3210
+ reportReason: string; // 举报原因。
3211
+ messageId: string;
3212
+ }
3213
+ ): Promise<void>;
3214
+
3215
+ /**
3216
+ * Set the DND Settings for the current login user.
3217
+ *
3218
+ * ```typescript
3219
+ * connection.setSilentModeForAll({options: {paramType: 0, remindType: 'ALL'}})
3220
+ * ```
3221
+ */
3222
+ setSilentModeForAll(
3223
+ this: Connection,
3224
+ params: {
3225
+ /** Options object include paramType,remindType,duration,startTime,endTime. */
3226
+ options: SilentModeParamType;
3227
+ success?: (
3228
+ res: AsyncResult<SilentModeConversationType>
3229
+ ) => void;
3230
+ error?: (error: ErrorEvent) => void;
3231
+ }
3232
+ ): Promise<AsyncResult<SilentModeConversationType>>;
3233
+
3234
+ /**
3235
+ * Get the DND Settings of the current user.
3236
+ *
3237
+ * ```typescript
3238
+ * connection.getSilentModeForAll()
3239
+ * ```
3240
+ */
3241
+ getSilentModeForAll(
3242
+ this: Connection,
3243
+ params?: {
3244
+ success?: (
3245
+ res: AsyncResult<SilentModeConversationType>
3246
+ ) => void;
3247
+ error?: (error: ErrorEvent) => void;
3248
+ }
3249
+ ): Promise<AsyncResult<SilentModeConversationType>>;
3250
+
3251
+ /**
3252
+ * Set the DND of the session.
3253
+ *
3254
+ * ```typescript
3255
+ * connection.setSilentModeForConversation({conversationId: '100', type: 'singleChat', params: {paramType: 0, remindType: 'ALL'}})
3256
+ * ```
3257
+ */
3258
+ setSilentModeForConversation(
3259
+ this: Connection,
3260
+ params: {
3261
+ /** The Conversation id.
3262
+ * For one-to-one chat, conversation ID is to chat user's name.
3263
+ * For group chat, conversation ID is group ID, different with group name.
3264
+ * For chat room, conversation ID is chat room ID, different with chat room name.
3265
+ * For help desk, it is same with one-to-one chat, conversation ID is also chat user's name.
3266
+ */
3267
+ conversationId: string;
3268
+ /** Conversation type. */
3269
+ type: CONVERSATIONTYPE;
3270
+ /** Options object include paramType,remindType,duration,startTime,endTime. */
3271
+ options: SilentModeParamType;
3272
+ success?: (
3273
+ res: AsyncResult<SilentModeConversationType>
3274
+ ) => void;
3275
+ error?: (error: ErrorEvent) => void;
3276
+ }
3277
+ ): Promise<AsyncResult<SilentModeConversationType>>;
3278
+
3279
+ /**
3280
+ * Clear the setting of offline push notification type for the session.
3281
+ *
3282
+ * ```typescript
3283
+ * connection.clearRemindTypeForConversation({conversationId: '123', type: 'singleChat'})
3284
+ * ```
3285
+ */
3286
+ clearRemindTypeForConversation(
3287
+ this: Connection,
3288
+ params: {
3289
+ /** Conversation id. */
3290
+ conversationId: string;
3291
+ /** Conversation type. */
3292
+ type: CONVERSATIONTYPE;
3293
+ success?: (
3294
+ res: AsyncResult<SilentModeConversationType>
3295
+ ) => void;
3296
+ error?: (error: ErrorEvent) => void;
3297
+ }
3298
+ ): Promise<AsyncResult<SilentModeConversationType>>;
3299
+
3300
+ /**
3301
+ * Gets the DND setting of the session.
3302
+ *
3303
+ * ```typescript
3304
+ * connection.getSilentModeForConversation({conversationId: '3333', type: 'singleChat'})
3305
+ * ```
3306
+ */
3307
+ getSilentModeForConversation(
3308
+ this: Connection,
3309
+ params: {
3310
+ /** Conversation id. */
3311
+ conversationId: string;
3312
+ /** Conversation type. */
3313
+ type: CONVERSATIONTYPE;
3314
+ success?: (
3315
+ res: AsyncResult<SilentModeConversationType>
3316
+ ) => void;
3317
+ error?: (error: ErrorEvent) => void;
3318
+ }
3319
+ ): Promise<AsyncResult<SilentModeConversationType>>;
3320
+
3321
+ /**
3322
+ * Obtain the DND Settings of specified sessions in batches.
3323
+ *
3324
+ * ```typescript
3325
+ * connection.getSilentModeForConversations({conversationList:[{id: 'test', type: 'singleChat'}, {id: '12345', type: 'groupChat'}]})
3326
+ * ```
3327
+ */
3328
+ getSilentModeForConversations(
3329
+ this: Connection,
3330
+ params: {
3331
+ /** Conversation list. */
3332
+ conversationList: ConversationListType[];
3333
+ success?: (
3334
+ res: AsyncResult<ConversationSilentModeType>
3335
+ ) => void;
3336
+ error?: (error: ErrorEvent) => void;
3337
+ }
3338
+ ): Promise<AsyncResult<ConversationSilentModeType>>;
3339
+
3340
+ /**
3341
+ * Set user push translation language.
3342
+ *
3343
+ * ```typescript
3344
+ * connection.setPushPerformLanguage({language: 'EU'})
3345
+ * ```
3346
+ */
3347
+ setPushPerformLanguage(
3348
+ this: Connection,
3349
+ params: {
3350
+ /** translation language */
3351
+ language: string;
3352
+ success?: (res: AsyncResult<TranslationLanguageType>) => void;
3353
+ error?: (error: ErrorEvent) => void;
3354
+ }
3355
+ ): Promise<AsyncResult<TranslationLanguageType>>;
3356
+
3357
+ /**
3358
+ * Gets the push translation language set by the user.
3359
+ *
3360
+ * ```typescript
3361
+ * connection.getPushPerformLanguage()
3362
+ * ```
3363
+ */
3364
+ getPushPerformLanguage(
3365
+ this: Connection,
3366
+ params?: {
3367
+ success?: (res: AsyncResult<TranslationLanguageType>) => void;
3368
+ error?: (error: ErrorEvent) => void;
3369
+ }
3370
+ ): Promise<AsyncResult<TranslationLanguageType>>;
3093
3371
  }
3094
3372
 
3095
3373
  /**