easemob-websdk 4.23.0 → 4.24.0

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.23.0",
3
+ "version": "4.24.0",
4
4
  "description": "Easemob chat web sdk",
5
5
  "main": "Easemob-chat.js",
6
6
  "typings": "Easemob-chat.d.ts",
package/silent/silent.js CHANGED
@@ -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()}(self,(function(){return(self.webpackChunkwebsdk=self.webpackChunkwebsdk||[]).push([[624],{4958:function(e,r,t){t.d(r,{default:function(){return v}});var o={};t.r(o),t.d(o,{clearRemindTypeForConversation:function(){return p},getPushPerformLanguage:function(){return h},getSilentModeForAll:function(){return c},getSilentModeForConversation:function(){return l},getSilentModeForConversations:function(){return d},getSilentModeRemindTypeConversations:function(){return m},setPushPerformLanguage:function(){return f},setSilentModeForAll:function(){return s},setSilentModeForConversation:function(){return u}}),t(8706),t(1629),t(4346),t(8598),t(2062),t(739),t(9432),t(6099),t(3362),t(3500);var n=t(4269),a=t(1156),i=t(7968);function s(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var r=e.options.paramType;if("number"!=typeof r||r<0||r>2)throw Error('Invalid parameter: "options of paramType"');if(0===r){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===r){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===r){var t=e.options,o=t.startTime,s=t.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=a.dO.call(this).error;if(c)return Promise.reject(c);var u=this.context,p=u.accessToken,l=u.orgName,d=u.appName,f=u.userId,h=u.jid,m={};switch(r){case 0:m={type:e.options.remindType};break;case 1:m={ignoreDuration:e.options.duration};break;case 2:var v=e.options;o=v.startTime,s=v.endTime,m={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(s.hours,":").concat(s.minutes)}}var y={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(f,"/notification/user/").concat(f,"?resource=").concat(h.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setSilentModeForAll:",e),n.RD.call(this,y)}function c(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/user/").concat(u),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.vF.debug("Call getSilentModeForAll:",e),n.RD.call(this,p)}function u(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var r=e.options.paramType;if("number"!=typeof r||r<0||r>2)throw Error('Invalid parameter: "options of paramType"');if(0===r){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===r){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===r){var t=e.options,o=t.startTime,s=t.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if(!s.hours||"number"!=typeof s.hours||!s.minutes||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=a.dO.call(this).error;if(c)return Promise.reject(c);var u=this.context,p=u.accessToken,l=u.orgName,d=u.appName,f=u.userId,h=u.jid,m="chatgroup",v={};switch(r){case 0:v={type:e.options.remindType};break;case 1:v={ignoreDuration:e.options.duration};break;case 2:var y=e.options;o=y.startTime,s=y.endTime,v={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(s.hours,":").concat(s.minutes)}}"singleChat"===e.type&&(m="user");var g={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(f,"/notification/").concat(m,"/").concat(e.conversationId,"?resource=").concat(h.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(v),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setSilentModeForConversation:",e),n.RD.call(this,g)}function p(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p=t.jid,l="chatgroup";"singleChat"===e.type&&(l="user");var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(l,"/").concat(e.conversationId,"?resource=").concat(p.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call clearRemindTypeForConversation:",e),n.RD.call(this,d)}function l(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p="chatgroup";"singleChat"===e.type&&(p="user");var l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(p,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call getSilentModeForConversation:",e),n.RD.call(this,l)}function d(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p=[],l=[];e.conversationList.forEach((function(e){"singleChat"===e.type?p.push(e.id):l.push(e.id)}));var d=p.length?p.join(","):"",f=l.length?l.join(","):"",h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification?user=").concat(d,"&group=").concat(f),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call getSilentModeForConversations:",e),n.RD.call(this,h)}function f(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t={translationLanguage:e.language},o=this.context,s=o.accessToken,c=o.orgName,u=o.appName,p=o.userId,l={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(p,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(t),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setPushPerformLanguage:",e),n.RD.call(this,l)}function h(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.vF.debug("Call getPushPerformLanguage:",e),n.RD.call(this,p)}function m(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete p.cursor;var l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/mute/type"),type:"GET",dataType:"json",data:p,headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return i.vF.debug("Call getSilentModeRemindTypeConversations:",e),n.RD.call(this,l).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}var v=o}},function(e){var r=e(e.s=4958);return r.default}])}));
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()}(self,(function(){return(self.webpackChunkwebsdk=self.webpackChunkwebsdk||[]).push([[624],{4958:function(e,r,t){t.d(r,{default:function(){return v}});var o={};t.r(o),t.d(o,{clearRemindTypeForConversation:function(){return p},getPushPerformLanguage:function(){return h},getSilentModeForAll:function(){return c},getSilentModeForConversation:function(){return l},getSilentModeForConversations:function(){return d},getSilentModeRemindTypeConversations:function(){return m},setPushPerformLanguage:function(){return f},setSilentModeForAll:function(){return s},setSilentModeForConversation:function(){return u}}),t(8706),t(1629),t(4346),t(8598),t(2062),t(739),t(9432),t(6099),t(3362),t(3500);var n=t(4269),a=t(1156),i=t(7968);function s(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var r=e.options.paramType;if("number"!=typeof r||r<0||r>2)throw Error('Invalid parameter: "options of paramType"');if(0===r){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===r){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===r){var t=e.options,o=t.startTime,s=t.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof s.hours||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=a.dO.call(this).error;if(c)return Promise.reject(c);var u=this.context,p=u.accessToken,l=u.orgName,d=u.appName,f=u.userId,h=u.jid,m={};switch(r){case 0:m={type:e.options.remindType};break;case 1:m={ignoreDuration:e.options.duration};break;case 2:var v=e.options;o=v.startTime,s=v.endTime,m={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(s.hours,":").concat(s.minutes)}}var y={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(f,"/notification/user/").concat(f,"?resource=").concat(h.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setSilentModeForAll:",e),n.RD.call(this,y)}function c(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/user/").concat(u),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.vF.debug("Call getSilentModeForAll:",e),n.RD.call(this,p)}function u(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var r=e.options.paramType;if("number"!=typeof r||r<0||r>2)throw Error('Invalid parameter: "options of paramType"');if(0===r){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===r){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===r){var t=e.options,o=t.startTime,s=t.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(s instanceof Object&&Object.keys(s).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof s.hours||"number"!=typeof s.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var c=a.dO.call(this).error;if(c)return Promise.reject(c);var u=this.context,p=u.accessToken,l=u.orgName,d=u.appName,f=u.userId,h=u.jid,m="chatgroup",v={};switch(r){case 0:v={type:e.options.remindType};break;case 1:v={ignoreDuration:e.options.duration};break;case 2:var y=e.options;o=y.startTime,s=y.endTime,v={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(s.hours,":").concat(s.minutes)}}"singleChat"===e.type&&(m="user");var g={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(f,"/notification/").concat(m,"/").concat(e.conversationId,"?resource=").concat(h.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(v),headers:{Authorization:"Bearer "+p,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setSilentModeForConversation:",e),n.RD.call(this,g)}function p(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p=t.jid,l="chatgroup";"singleChat"===e.type&&(l="user");var d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(l,"/").concat(e.conversationId,"?resource=").concat(p.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call clearRemindTypeForConversation:",e),n.RD.call(this,d)}function l(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p="chatgroup";"singleChat"===e.type&&(p="user");var l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/").concat(p,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call getSilentModeForConversation:",e),n.RD.call(this,l)}function d(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p=[],l=[];e.conversationList.forEach((function(e){"singleChat"===e.type?p.push(e.id):l.push(e.id)}));var d=p.length?p.join(","):"",f=l.length?l.join(","):"",h={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification?user=").concat(d,"&group=").concat(f),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call getSilentModeForConversations:",e),n.RD.call(this,h)}function f(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t={translationLanguage:e.language},o=this.context,s=o.accessToken,c=o.orgName,u=o.appName,p=o.userId,l={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(p,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(t),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return i.vF.debug("Call setPushPerformLanguage:",e),n.RD.call(this,l)}function h(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return i.vF.debug("Call getPushPerformLanguage:",e),n.RD.call(this,p)}function m(e){var r=a.dO.call(this).error;if(r)return Promise.reject(r);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var t=this.context,o=t.accessToken,s=t.orgName,c=t.appName,u=t.userId,p={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete p.cursor;var l={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/users/").concat(u,"/notification/mute/type"),type:"GET",dataType:"json",data:p,headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return i.vF.debug("Call getSilentModeRemindTypeConversations:",e),n.RD.call(this,l).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}var v=o}},function(e){var r=e(e.s=4958);return r.default}])}));
package/types/index.d.ts CHANGED
@@ -15,6 +15,14 @@ import * as ReactionType from './reactionApi';
15
15
  import * as ThreadType from './threadApi';
16
16
  import * as TranslationType from './translation';
17
17
  import * as SilentModeType from './silentModeApi';
18
+ import type {
19
+ MessageSearchKeywordListMatchType,
20
+ MessageSearchOption,
21
+ MessageSearchScope,
22
+ SearchMeta,
23
+ ServerSearchMessage,
24
+ ServerSearchMessagesResult,
25
+ } from './indexApi';
18
26
  export type {
19
27
  ContactType,
20
28
  GroupType,
@@ -29,4 +37,10 @@ export type {
29
37
  Message,
30
38
  Error,
31
39
  Common,
40
+ MessageSearchKeywordListMatchType,
41
+ MessageSearchOption,
42
+ MessageSearchScope,
43
+ SearchMeta,
44
+ ServerSearchMessage,
45
+ ServerSearchMessagesResult,
32
46
  };
@@ -4,6 +4,8 @@ import {
4
4
  MessageBody,
5
5
  ModifiedMsgInfo,
6
6
  ExcludeAckMessageBody,
7
+ ChatType,
8
+ MessageType,
7
9
  } from './message';
8
10
  interface UpdateOwnUserInfoParams {
9
11
  /** The nickname. */
@@ -127,6 +129,99 @@ interface HistoryMessages {
127
129
  isLast: boolean;
128
130
  }
129
131
 
132
+ /**
133
+ * The multiple-keyword match type for server message search.
134
+ * `or` means any keyword can match, and `and` means all keywords must match.
135
+ * 服务端消息搜索的多关键词匹配关系。
136
+ * `or` 表示命中任意关键词即可,`and` 表示必须命中全部关键词。
137
+ */
138
+ type MessageSearchKeywordListMatchType = 'or' | 'and';
139
+
140
+ /**
141
+ * The search scope for server message search.
142
+ * `none` searches only the message body, `with` searches both body and extensions,
143
+ * and `only` searches only extension fields.
144
+ * 服务端消息搜索范围。
145
+ * `none` 仅搜索消息体,`with` 同时搜索消息体和扩展字段,
146
+ * `only` 仅搜索扩展字段。
147
+ */
148
+ type MessageSearchScope = 'none' | 'with' | 'only';
149
+
150
+ /**
151
+ * A WebSDK message object mapped from one server-side search hit.
152
+ * 由单条服务端搜索命中结果映射得到的 WebSDK 消息对象。
153
+ */
154
+ type ServerSearchMessage = ExcludeAckMessageBody & {
155
+ /** The conversation ID of the matched message. */
156
+ /** 命中消息所属的会话 ID。 */
157
+ conversationId?: string;
158
+ /** Highlight fragments returned by the server. */
159
+ /** 服务端返回的高亮片段。 */
160
+ highlight?: string[];
161
+ /** Summary text returned by the server for quick display. */
162
+ /** 服务端返回的摘要文本,用于快速展示。 */
163
+ text?: string;
164
+ };
165
+
166
+ /**
167
+ * The paged result returned by server-side message search.
168
+ * 服务端消息搜索返回的分页结果。
169
+ */
170
+ interface ServerSearchMessagesResult {
171
+ /** The server search result messages. */
172
+ /** 服务端搜索结果消息列表。 */
173
+ messages: ServerSearchMessage[];
174
+ /** The current page number. */
175
+ /** 当前页码。 */
176
+ pageNum: number;
177
+ /** The requested page size echoed by the SDK. */
178
+ /** SDK 回填的请求页大小。 */
179
+ pageSize: number;
180
+ /** The total number of pages. */
181
+ /** 总页数。 */
182
+ totalPages: number;
183
+ /** Whether the current page is the last page. */
184
+ /** 当前页是否为最后一页。 */
185
+ isLast: boolean;
186
+ /** The request trace id returned by the server. */
187
+ /** 服务端返回的请求追踪 ID。 */
188
+ requestId?: string;
189
+ /** The server response timestamp in milliseconds. */
190
+ /** 服务端响应时间戳,单位为毫秒。 */
191
+ timestamp: number;
192
+ }
193
+
194
+ /**
195
+ * The options for server-side message search.
196
+ * 用于配置服务端消息搜索请求的参数集合。
197
+ */
198
+ interface MessageSearchOption {
199
+ /** The keyword list for search. */
200
+ /** 搜索关键词列表。 */
201
+ keywordList: string[];
202
+ /** The keyword list match type. The valid values are `or` and `and`. The default value is `or`. */
203
+ /** 多关键词匹配关系,可选值为 `or` 和 `and`。默认值为 `or`。 */
204
+ keywordListMatchType?: MessageSearchKeywordListMatchType;
205
+ /** The conversation ID for in-conversation search. */
206
+ /** 会话内搜索时的会话 ID。 */
207
+ conversationId?: string;
208
+ /** The conversation type for filtering. Must be used with conversationId. */
209
+ /** 会话类型过滤。需要与 conversationId 配合使用。 */
210
+ conversationType?: ChatType;
211
+ /** Message body type filters. */
212
+ /** 消息体类型过滤。 */
213
+ msgTypes?: MessageType[];
214
+ /** The start timestamp for query. The unit is millisecond. */
215
+ /** 查询开始时间戳,单位为毫秒。 */
216
+ startTime?: number;
217
+ /** The end timestamp for query. The unit is millisecond. */
218
+ /** 查询结束时间戳,单位为毫秒。 */
219
+ endTime?: number;
220
+ /** The search scope. */
221
+ /** 搜索范围。 */
222
+ searchScope?: MessageSearchScope;
223
+ }
224
+
130
225
  interface ServerConversations {
131
226
  /** The conversation list. */
132
227
  conversations: ConversationItem[];
@@ -263,4 +358,9 @@ export type {
263
358
  ConfigurableKey,
264
359
  HistoryMessages,
265
360
  ModifyMsgResult,
361
+ MessageSearchKeywordListMatchType,
362
+ MessageSearchScope,
363
+ ServerSearchMessage,
364
+ ServerSearchMessagesResult,
365
+ MessageSearchOption,
266
366
  };