easemob-websdk 4.1.6 → 4.1.7-beta

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,6 +1,6 @@
1
1
  {
2
2
  "name": "easemob-websdk",
3
- "version": "4.1.6",
3
+ "version": "4.1.7-beta",
4
4
  "description": "Easemob chat websdk",
5
5
  "main": "Easemob-chat",
6
6
  "scripts": {
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.websdk=r():e.websdk=r()}(this,(function(){return(this.webpackChunkwebsdk=this.webpackChunkwebsdk||[]).push([[962],{6369:function(e,r,t){t.r(r),t.d(r,{getPresenceStatus:function(){return y},getSubscribedPresenceList:function(){return f},getSubscribedPresencelist:function(){return d},publishPresence:function(){return l},subscribePresence:function(){return p},unsubscribePresence:function(){return h}}),t(900),t(3814),t(514),t(4201),t(6864),t(1685),t(2486),t(4261),t(7095),t(3529);var n=t(7551),s=t(1222),a=t(7480),o=t(3365),c=t(6916),i=function(e,r,t,n){return new(t||(t=Promise))((function(s,a){function o(e){try{i(n.next(e))}catch(e){a(e)}}function c(e){try{i(n.throw(e))}catch(e){a(e)}}function i(e){var r;e.done?s(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,c)}i((n=n.apply(e,r||[])).next())}))},u=function(e,r){var t,n,s,a,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e],n=0}finally{t=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function l(e){return i(this,void 0,void 0,(function(){var r,t,i,l,p,h,f,d,y;return u(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return s.XZ.call(this)?(t=this.context,i=t.accessToken,l=t.orgName,p=t.appName,h=t.userId,f=this.context.jid.clientResource,d={ext:e.description},y={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(p,"/users/").concat(h,"/presence/").concat(f,"/1"),type:"POST",dataType:"json",data:JSON.stringify(d),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error},c.kg.debug("Call publishPresence:",e),[4,n.hj.call(this,y)]):(r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)]);case 1:return u.sent(),[2]}}))}))}function p(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t=this.context,i=t.orgName,u=t.appName,l=t.userId,p=t.accessToken,h={usernames:e.usernames},f={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(u,"/users/").concat(l,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call subscribePresence:",e),n.hj.call(this,f).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function h(e){return i(this,void 0,void 0,(function(){var r,t,i,l,p,h,f;return u(this,(function(u){switch(u.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return s.XZ.call(this)?(t=this.context,i=t.orgName,l=t.appName,p=t.userId,h=t.accessToken,f={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(l,"/users/").concat(p,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"},success:e.success,error:e.error},c.kg.debug("Call unsubscribePresence:",e),[4,n.hj.call(this,f)]):(r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)]);case 1:return u.sent(),[2]}}))}))}function f(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t=this.context,i=t.orgName,u=t.appName,l=t.userId,p=t.accessToken,h={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(u,"/users/").concat(l,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call getSubscribedPresenceList:",e),n.hj.call(this,h).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var d=f;function y(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t={usernames:e.usernames},i=this.context,u=i.orgName,l=i.appName,p=i.userId,h=i.accessToken,f={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/users/").concat(p,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(t),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call getPresenceStatus:",e),n.hj.call(this,f).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}},1222:function(e,r,t){t.d(r,{H7:function(){return u},XZ:function(){return c},_W:function(){return i}}),t(3786),t(1362),t(900),t(7988),t(9889),t(6619);var n=t(3365),s=t(7480);function a(){var e=this.context.appName,r=this.context.orgName;return!(!e||!r)||(this.onError&&this.onError({type:n.E.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function o(){var e;if(!this.context.accessToken){var r=s.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function c(){return o.call(this)&&a.call(this)}function i(e){var r=e.data,t=e.type;return{data:{status:Object.keys(r.errorKeys).length>0?"fail":"success",errorKeys:r.errorKeys,successKeys:r.successKeys},type:t}}function u(e){var r=e.data,t=void 0;return Object.keys(r.errorKeys).length>0&&Object.keys(r.errorKeys).forEach((function(e){var a=r.errorKeys[e];t=a.includes("is not part of you")?s.Z.create({type:n.E.NO_PERMISSION,message:a}):a.includes("size of metadata for this single chatroom exceeds the user defined limit")||a.includes("total size of chatroom metadata for this app exceeds the user defined limit")||a.includes("is exceeding maximum limit")?s.Z.create({type:n.E.MAX_LIMIT,message:a}):a.includes("is not Legal")?s.Z.create({type:n.E.REQUEST_PARAMETER_ERROR,message:a}):a.includes("Failed to update userMetadata. Concurrent updates not allowed")?s.Z.create({type:n.E.OPERATION_NOT_ALLOWED,message:a}):s.Z.create({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:a})})),t}}},function(e){return 6369,e(e.s=6369)}])}));
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.websdk=r():e.websdk=r()}(this,(function(){return(this.webpackChunkwebsdk=this.webpackChunkwebsdk||[]).push([[962],{3770:function(e,r,t){t.r(r),t.d(r,{getPresenceStatus:function(){return y},getSubscribedPresenceList:function(){return f},getSubscribedPresencelist:function(){return d},publishPresence:function(){return l},subscribePresence:function(){return p},unsubscribePresence:function(){return h}}),t(1539),t(8674),t(2526),t(1817),t(2165),t(6992),t(8783),t(3948),t(2222),t(9753);var n=t(4370),s=t(3246),a=t(7252),o=t(5531),c=t(7360),i=function(e,r,t,n){return new(t||(t=Promise))((function(s,a){function o(e){try{i(n.next(e))}catch(e){a(e)}}function c(e){try{i(n.throw(e))}catch(e){a(e)}}function i(e){var r;e.done?s(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(o,c)}i((n=n.apply(e,r||[])).next())}))},u=function(e,r){var t,n,s,a,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e],n=0}finally{t=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};function l(e){return i(this,void 0,void 0,(function(){var r,t,i,l,p,h,f,d,y;return u(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return s.XZ.call(this)?(t=this.context,i=t.accessToken,l=t.orgName,p=t.appName,h=t.userId,f=this.context.jid.clientResource,d={ext:e.description},y={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(p,"/users/").concat(h,"/presence/").concat(f,"/1"),type:"POST",dataType:"json",data:JSON.stringify(d),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error},c.kg.debug("Call publishPresence:",e),[4,n.hj.call(this,y)]):(r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)]);case 1:return u.sent(),[2]}}))}))}function p(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t=this.context,i=t.orgName,u=t.appName,l=t.userId,p=t.accessToken,h={usernames:e.usernames},f={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(u,"/users/").concat(l,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call subscribePresence:",e),n.hj.call(this,f).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function h(e){return i(this,void 0,void 0,(function(){var r,t,i,l,p,h,f;return u(this,(function(u){switch(u.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return s.XZ.call(this)?(t=this.context,i=t.orgName,l=t.appName,p=t.userId,h=t.accessToken,f={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(l,"/users/").concat(p,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"},success:e.success,error:e.error},c.kg.debug("Call unsubscribePresence:",e),[4,n.hj.call(this,f)]):(r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)]);case 1:return u.sent(),[2]}}))}))}function f(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t=this.context,i=t.orgName,u=t.appName,l=t.userId,p=t.accessToken,h={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(u,"/users/").concat(l,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call getSubscribedPresenceList:",e),n.hj.call(this,h).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var d=f;function y(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if(!s.XZ.call(this)){var r=a.Z.create({type:o.E.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var t={usernames:e.usernames},i=this.context,u=i.orgName,l=i.appName,p=i.userId,h=i.accessToken,f={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/users/").concat(p,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(t),headers:{Authorization:"Bearer "+h,"Content-Type":"application/json"},success:e.success,error:e.error};return c.kg.debug("Call getPresenceStatus:",e),n.hj.call(this,f).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}},3246:function(e,r,t){t.d(r,{H7:function(){return u},XZ:function(){return c},_W:function(){return i}}),t(7941),t(9554),t(1539),t(4747),t(6699),t(2023);var n=t(5531),s=t(7252);function a(){var e=this.context.appName,r=this.context.orgName;return!(!e||!r)||(this.onError&&this.onError({type:n.E.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function o(){var e;if(!this.context.accessToken){var r=s.Z.create({type:n.E.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function c(){return o.call(this)&&a.call(this)}function i(e){var r=e.data,t=e.type;return{data:{status:Object.keys(r.errorKeys).length>0?"fail":"success",errorKeys:r.errorKeys,successKeys:r.successKeys},type:t}}function u(e){var r=e.data,t=void 0;return Object.keys(r.errorKeys).length>0&&Object.keys(r.errorKeys).forEach((function(e){var a=r.errorKeys[e];t=a.includes("is not part of you")?s.Z.create({type:n.E.NO_PERMISSION,message:a}):a.includes("size of metadata for this single chatroom exceeds the user defined limit")||a.includes("total size of chatroom metadata for this app exceeds the user defined limit")||a.includes("is exceeding maximum limit")?s.Z.create({type:n.E.MAX_LIMIT,message:a}):a.includes("is not Legal")?s.Z.create({type:n.E.REQUEST_PARAMETER_ERROR,message:a}):a.includes("Failed to update userMetadata. Concurrent updates not allowed")?s.Z.create({type:n.E.OPERATION_NOT_ALLOWED,message:a}):s.Z.create({type:n.E.WEBIM_CONNCTION_AJAX_ERROR,message:a})})),t}}},function(e){return 3770,e(e.s=3770)}])}));
@@ -107,9 +107,23 @@ interface GroupMemberAttributesUpdateMultiDeviceInfo {
107
107
  /** The user ID of the group member whose custom attributes are set. */
108
108
  userId: UserId;
109
109
  }
110
+ interface ConversationChangedInfo {
111
+ /** The multi-device conversation event. */
112
+ operation:
113
+ | 'pinnedConversation'
114
+ | 'unpinnedConversation'
115
+ | 'deleteConversation';
116
+ /** The conversation ID. */
117
+ conversationId: string;
118
+ /** The conversation type. */
119
+ conversationType: 'singleChat' | 'groupChat';
120
+ /** The UNIX timestamp of the current operation. The unit is millisecond.*/
121
+ timestamp: number;
122
+ }
110
123
 
111
124
  type MultiDeviceEvent =
112
125
  | ThreadMultiDeviceInfo
126
+ | ConversationChangedInfo
113
127
  | RoamingDeleteMultiDeviceInfo
114
128
  | GroupMemberAttributesUpdateMultiDeviceInfo;
115
129
 
@@ -120,4 +134,5 @@ export type {
120
134
  ThreadMultiDeviceInfo,
121
135
  multiDeviceEventType,
122
136
  MultiDeviceEvent,
137
+ ConversationChangedInfo,
123
138
  };
@@ -3,19 +3,19 @@ import { MessagesType, MessageBody } from './message';
3
3
  interface UpdateOwnUserInfoParams {
4
4
  /** The nickname. */
5
5
  nickname?: string;
6
- /** The avatar url. */
6
+ /** The avatar URL. */
7
7
  avatarurl?: string;
8
- /** The email. */
8
+ /** The email address. */
9
9
  mail?: string;
10
10
  /** The phone number. */
11
11
  phone?: string;
12
- /** Gender. */
13
- gender?: string;
12
+ /** Gender. You can define it with the following type: string, number, boolean. */
13
+ gender?: string | number | boolean;
14
14
  /** Signature. */
15
15
  sign?: string;
16
16
  /** Birthday. */
17
17
  birth?: string;
18
- /** Extension. */
18
+ /** Extension. You can define it with the following type: string, number, boolean. */
19
19
  ext?: string;
20
20
  }
21
21
  /** Configurable fields. */
@@ -38,7 +38,7 @@ interface BaseUserInfo {
38
38
  activated: boolean;
39
39
  /** The timestamp when the current user is created. */
40
40
  created: number;
41
- /** The time when the user information is last edited. */
41
+ /** The time when the user information is last modified. */
42
42
  modified: number;
43
43
  /** The display name in the message push notification. */
44
44
  nickname: string;
@@ -46,7 +46,7 @@ interface BaseUserInfo {
46
46
  type: string;
47
47
  /** The user ID. */
48
48
  username: string;
49
- /** The user uuid on the chat server. */
49
+ /** The user uuid on the server. */
50
50
  uuid: string;
51
51
  }
52
52
  export interface PushInfo {
@@ -58,7 +58,7 @@ export interface PushInfo {
58
58
  notifier_name: string;
59
59
  }
60
60
  interface UploadTokenResult extends BaseUserInfo {
61
- /** The push info. */
61
+ /** The push information. */
62
62
  pushInfo: PushInfo[];
63
63
  }
64
64
  interface SessionInfo {
@@ -90,7 +90,6 @@ interface ConversationList {
90
90
  }
91
91
  interface ConversationInfo {
92
92
  /** The conversation list. */
93
- /** 会话列表。 */
94
93
  channel_infos: ConversationList[];
95
94
  }
96
95
  interface DeleteSessionResult {
@@ -98,27 +97,52 @@ interface DeleteSessionResult {
98
97
  result: 'ok';
99
98
  }
100
99
  interface SendMsgResult {
101
- /** The message local ID. */
100
+ /** The local ID of the message. */
102
101
  localMsgId: string;
103
- /** The ID of the message on the server. */
102
+ /** The message ID on the server. */
104
103
  serverMsgId: string;
105
104
  }
106
105
  interface HistoryMessages {
107
- /** 游标。如果数据还有下一页,该方法的返回值会包含此字段,传递此字段可获取下一页的数据,为 '' 时获取第一页数据 */
106
+ /** The position from which to start getting data for the next query. If the number of returned data entries is smaller than that specified in the request, the cursor is `'undefined'`, which indicates that the current page is the last page; otherwise, the SDK returns the specific cursor position which indicates where to start getting data for the next query. */
108
107
  cursor?: string;
109
- /** The Historical messages. */
108
+ /** The historical messages. */
110
109
  messages: MessagesType[];
110
+ /** Whether it is the last page of data.
111
+ * - `true`: Yes;
112
+ * - `false`: No.
113
+ * If the number of data entries is smaller than the message count set in the request, `false` is returned; otherwise, `true` is returned.
114
+ */
115
+ isLast: boolean;
111
116
  }
112
- interface ContactRelationshipMsg {
113
- /** The message type, subscribe: request a contact, unsubscribed: cancel or refuse to add contact, subscribed: added contact successfully. */
114
- type: 'subscribe' | 'unsubscribed' | 'subscribed';
115
- /** The message receiver. */
116
- to: string;
117
- /** The message sender. */
118
- from: string;
119
- /** Reason. */
120
- status?: string;
117
+
118
+ interface ServerConversations {
119
+ /** The conversation list. */
120
+ conversations: ConversationItem[];
121
+ /** The position from which to start getting data for the next query. If the number of returned data entries is smaller than that specified in the request, the cursor is an empty string (''), which indicates that the current page is the last page; otherwise, the SDK returns the specific cursor position which indicates where to start getting data for the next query.*/
122
+ cursor: string;
123
+ }
124
+
125
+ interface ConversationItem {
126
+ /** The conversation ID. */
127
+ conversationId: string;
128
+ /** The conversation type. */
129
+ conversationType: 'singleChat' | 'groupChat';
130
+ /** Whether the conversation is pinned. `true`: pinned; `false`: unpinned. */
131
+ isPinned: boolean;
132
+ /** The UNIX timestamp when the conversation is pinned. The unit is millisecond. This value is `0` when conversation is not pinned. */
133
+ pinnedTime: number;
134
+ /** Overview of the latest message. */
135
+ lastMessage: MessageBody | Record<string, never> | null;
136
+ /** The number of unread messages. */
137
+ unReadCount: number;
138
+ }
139
+ interface PinConversation {
140
+ /** Whether the conversation is pinned. `true`: pinned; `false`: unpinned.*/
141
+ isPinned: boolean;
142
+ /** The UNIX timestamp when the conversation is pinned. The unit is millisecond. This value is `0` when the conversation is not pinned. */
143
+ pinnedTime: number;
121
144
  }
145
+
122
146
  export type {
123
147
  UploadTokenResult,
124
148
  SessionInfo,
@@ -126,8 +150,10 @@ export type {
126
150
  BaseUserInfo,
127
151
  DeleteSessionResult,
128
152
  SendMsgResult,
129
- ContactRelationshipMsg,
130
153
  ConversationInfo,
154
+ ServerConversations,
155
+ ConversationItem,
156
+ PinConversation,
131
157
  };
132
158
  export type {
133
159
  RosterData,
package/types/status.d.ts CHANGED
@@ -257,6 +257,9 @@ declare enum Code {
257
257
  /** The network is disconnected, causing message sending failure. */
258
258
  /** 网络断开连接导致消息发送失败。 */
259
259
  MESSAGE_WEBSOCKET_DISCONNECTED = 510,
260
+ /** You have exceeded the maximum allowed size of a message body.*/
261
+ /** 消息体大小超过限制。 */
262
+ MESSAGE_SIZE_LIMIT = 511,
260
263
  /** The group is not found. */
261
264
  /** 群组不存在。 */
262
265
  GROUP_NOT_EXIST = 605,
@@ -327,5 +330,8 @@ declare enum Code {
327
330
  /** Chat thread already exists. */
328
331
  /** chatThread 已经存在。 */
329
332
  THREAD_ALREADY_EXIST = 1301,
333
+ /** The current conversation not exist . */
334
+ /** 操作的用户会话不存在。 */
335
+ CONVERSATION_NOT_EXIST = 1400, //操作的用户会话不存在
330
336
  }
331
337
  export { Code };