@zjw-jszn/shared-imsdk 1.0.10 → 1.0.13

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/README.md CHANGED
@@ -114,6 +114,7 @@ import {
114
114
  - `ws.platform` 必须小写,且需与 `ws.controller.toLowerCase()` 一致。
115
115
  - 未传 `ws.url` 时,SDK 会优先使用 `api.baseURL` 推导 WS 地址(`https -> wss`,`http -> ws`)。
116
116
  - 首次初始化且无 token 时,必须传 `phone`。
117
+ - 若鉴权响应缺少 `phone/username/avatar`,会回落到初始化输入与 `auth.authorizationPayload`(`avatar` 支持回落 `cover`)。
117
118
  - 已以某模式初始化后,不允许在同页面切换到另一模式。
118
119
  - 调用 `getChatList` 且参数为 `friend_type=4` + `customeronly=1/true` 时,如未传 `phone`,会自动回落到 `chat.platformServicePhone`。
119
120
 
@@ -31,6 +31,11 @@ export type EntityRecord = Record<string, EntityFieldValue>;
31
31
  * @param file 图片文件
32
32
  */
33
33
  export declare function uploadImage(file: File): Promise<UploadImageResponse>;
34
+ /**
35
+ * 上传文件(视频、文档等)
36
+ * @param file 文件对象
37
+ */
38
+ export declare function uploadFile(file: File): Promise<UploadImageResponse>;
34
39
  export interface Session {
35
40
  id: number;
36
41
  site_id: number;
@@ -91,12 +96,14 @@ export declare function getAuthorization(params: {
91
96
  * @param data.limit - 每页数量
92
97
  * @param data.uid - 用户ID
93
98
  * @param data.user_type - 用户类型
99
+ * @param data.username - 用户名(可选,门店场景可用于筛选)
94
100
  */
95
101
  export declare function getUserChatList(data: {
96
102
  page: number;
97
103
  limit: number;
98
104
  uid?: number;
99
105
  user_type?: number;
106
+ username?: string;
100
107
  }): Promise<PageResponse<Session>>;
101
108
  /**
102
109
  * 根据会话ID获取聊天记录
@@ -7,6 +7,7 @@ export interface SDKConfig {
7
7
  resourceBaseURL: string;
8
8
  prefix: string;
9
9
  uploadURL: string;
10
+ uploadFileURL: string;
10
11
  signKey: string;
11
12
  suffix: string;
12
13
  groupId: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getUserInfo, initIM } from './sdk/index';
2
- export { getAuthorization, getChatList, getChatListBySession, getChatRewordBySession, getUnReadCount, getUnReadList, getUserChatList, } from './api';
2
+ export { getAuthorization, getChatList, getChatListBySession, getChatRewordBySession, getUnReadCount, getUnReadList, getUserChatList, uploadFile, uploadImage, } from './api';
3
3
  export type { Message as APIMessage, PageResponse, Session } from './api';
4
4
  export { default as IMSDKApp } from './App.vue';
5
5
  export { buildApiPath, getAuthorizationExtraPayload, getConfig, getRuntimeApi, hasApiCapability, isPlatformMode, isStoreMode, resetConfig, updateConfig, } from './config';