nim-web-sdk-ng 10.9.81 → 10.10.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.
Files changed (84) hide show
  1. package/dist/esm/adapters.d.ts +16 -0
  2. package/dist/esm/nim/src/CloudStorageServiceInterface.d.ts +22 -0
  3. package/dist/esm/nim/src/NIMInterface.d.ts +33 -0
  4. package/dist/esm/nim/src/QChatMsgServiceInterface.d.ts +4 -3
  5. package/dist/esm/nim/src/V2NIMLoginService.d.ts +8 -0
  6. package/dist/esm/nim/src/V2NIMMessageService.d.ts +8 -0
  7. package/dist/esm/nim/src/types.d.ts +4 -6
  8. package/dist/esm/nim.js +5 -7
  9. package/dist/v1/CHATROOM_BROWSER_SDK/types.d.ts +4 -6
  10. package/dist/v1/CHATROOM_BROWSER_SDK.js +6 -8
  11. package/dist/v1/CHATROOM_MINIAPP_SDK/types.d.ts +4 -6
  12. package/dist/v1/CHATROOM_MINIAPP_SDK.js +4 -6
  13. package/dist/v1/CHATROOM_UNIAPP_SDK/types.d.ts +4 -6
  14. package/dist/v1/CHATROOM_UNIAPP_SDK.js +4 -6
  15. package/dist/v1/NIM_BROWSER_SDK/CloudStorageServiceInterface.d.ts +22 -0
  16. package/dist/v1/NIM_BROWSER_SDK/NIMInterface.d.ts +33 -0
  17. package/dist/v1/NIM_BROWSER_SDK/QChatMsgServiceInterface.d.ts +4 -3
  18. package/dist/v1/NIM_BROWSER_SDK/V2NIMLoginService.d.ts +8 -0
  19. package/dist/v1/NIM_BROWSER_SDK/V2NIMMessageService.d.ts +8 -0
  20. package/dist/v1/NIM_BROWSER_SDK/types.d.ts +4 -6
  21. package/dist/v1/NIM_BROWSER_SDK.js +6 -8
  22. package/dist/v1/NIM_MINIAPP_SDK/CloudStorageServiceInterface.d.ts +22 -0
  23. package/dist/v1/NIM_MINIAPP_SDK/NIMInterface.d.ts +33 -0
  24. package/dist/v1/NIM_MINIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  25. package/dist/v1/NIM_MINIAPP_SDK/V2NIMLoginService.d.ts +8 -0
  26. package/dist/v1/NIM_MINIAPP_SDK/V2NIMMessageService.d.ts +8 -0
  27. package/dist/v1/NIM_MINIAPP_SDK/types.d.ts +4 -6
  28. package/dist/v1/NIM_MINIAPP_SDK.js +4 -6
  29. package/dist/v1/NIM_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +22 -0
  30. package/dist/v1/NIM_UNIAPP_SDK/NIMInterface.d.ts +33 -0
  31. package/dist/v1/NIM_UNIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  32. package/dist/v1/NIM_UNIAPP_SDK/V2NIMLoginService.d.ts +8 -0
  33. package/dist/v1/NIM_UNIAPP_SDK/V2NIMMessageService.d.ts +8 -0
  34. package/dist/v1/NIM_UNIAPP_SDK/types.d.ts +4 -6
  35. package/dist/v1/NIM_UNIAPP_SDK.js +4 -6
  36. package/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface.d.ts +6 -6
  37. package/dist/v1/QCHAT_BROWSER_SDK.js +6 -8
  38. package/dist/v1/QCHAT_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +6 -6
  39. package/dist/v1/QCHAT_UNIAPP_SDK.js +4 -6
  40. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMChatroomService.d.ts +61 -2
  41. package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMStatisticsService.d.ts +41 -0
  42. package/dist/v2/CHATROOM_BROWSER_SDK/index.d.ts +11 -1
  43. package/dist/v2/CHATROOM_BROWSER_SDK.js +6 -8
  44. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMChatroomService.d.ts +61 -2
  45. package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMStatisticsService.d.ts +41 -0
  46. package/dist/v2/CHATROOM_MINIAPP_SDK/index.d.ts +11 -1
  47. package/dist/v2/CHATROOM_MINIAPP_SDK.js +4 -6
  48. package/dist/v2/CHATROOM_RN_SDK/V2NIMChatroomService.d.ts +61 -2
  49. package/dist/v2/CHATROOM_RN_SDK/V2NIMStatisticsService.d.ts +41 -0
  50. package/dist/v2/CHATROOM_RN_SDK/index.d.ts +11 -1
  51. package/dist/v2/CHATROOM_RN_SDK.js +4 -6
  52. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMChatroomService.d.ts +61 -2
  53. package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMStatisticsService.d.ts +41 -0
  54. package/dist/v2/CHATROOM_UNIAPP_SDK/index.d.ts +11 -1
  55. package/dist/v2/CHATROOM_UNIAPP_SDK.js +4 -6
  56. package/dist/v2/NIM_BROWSER_SDK/CloudStorageServiceInterface.d.ts +22 -0
  57. package/dist/v2/NIM_BROWSER_SDK/NIMInterface.d.ts +33 -0
  58. package/dist/v2/NIM_BROWSER_SDK/QChatMsgServiceInterface.d.ts +4 -3
  59. package/dist/v2/NIM_BROWSER_SDK/V2NIMLoginService.d.ts +8 -0
  60. package/dist/v2/NIM_BROWSER_SDK/V2NIMMessageService.d.ts +8 -0
  61. package/dist/v2/NIM_BROWSER_SDK/types.d.ts +4 -6
  62. package/dist/v2/NIM_BROWSER_SDK.js +6 -8
  63. package/dist/v2/NIM_MINIAPP_SDK/CloudStorageServiceInterface.d.ts +22 -0
  64. package/dist/v2/NIM_MINIAPP_SDK/NIMInterface.d.ts +33 -0
  65. package/dist/v2/NIM_MINIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  66. package/dist/v2/NIM_MINIAPP_SDK/V2NIMLoginService.d.ts +8 -0
  67. package/dist/v2/NIM_MINIAPP_SDK/V2NIMMessageService.d.ts +8 -0
  68. package/dist/v2/NIM_MINIAPP_SDK/types.d.ts +4 -6
  69. package/dist/v2/NIM_MINIAPP_SDK.js +4 -6
  70. package/dist/v2/NIM_RN_SDK/CloudStorageServiceInterface.d.ts +22 -0
  71. package/dist/v2/NIM_RN_SDK/NIMInterface.d.ts +33 -0
  72. package/dist/v2/NIM_RN_SDK/QChatMsgServiceInterface.d.ts +4 -3
  73. package/dist/v2/NIM_RN_SDK/V2NIMLoginService.d.ts +8 -0
  74. package/dist/v2/NIM_RN_SDK/V2NIMMessageService.d.ts +8 -0
  75. package/dist/v2/NIM_RN_SDK/types.d.ts +4 -6
  76. package/dist/v2/NIM_RN_SDK.js +5 -7
  77. package/dist/v2/NIM_UNIAPP_SDK/CloudStorageServiceInterface.d.ts +22 -0
  78. package/dist/v2/NIM_UNIAPP_SDK/NIMInterface.d.ts +33 -0
  79. package/dist/v2/NIM_UNIAPP_SDK/QChatMsgServiceInterface.d.ts +4 -3
  80. package/dist/v2/NIM_UNIAPP_SDK/V2NIMLoginService.d.ts +8 -0
  81. package/dist/v2/NIM_UNIAPP_SDK/V2NIMMessageService.d.ts +8 -0
  82. package/dist/v2/NIM_UNIAPP_SDK/types.d.ts +4 -6
  83. package/dist/v2/NIM_UNIAPP_SDK.js +4 -6
  84. package/package.json +1 -1
@@ -307,6 +307,10 @@ export interface AdapterSystemInfo {
307
307
  * - 小程序:等于 hostEnv
308
308
  */
309
309
  manufactor: string;
310
+ /**
311
+ * 端设备时区。仅在 adapter 能稳定获取端设备时区时填写,不支持时返回空字符串。
312
+ */
313
+ timeZone?: string;
310
314
  pushDeviceInfo?: {
311
315
  PRODUCT: string;
312
316
  DEVICE: string;
@@ -360,6 +364,18 @@ export interface AdapterUploadFileOptions {
360
364
  headers?: {
361
365
  [key: string]: string;
362
366
  };
367
+ timeout?: number;
368
+ uploadHostCandidates?: Array<{
369
+ url: string;
370
+ source?: 'lbs' | 'default';
371
+ }>;
372
+ maxRetry?: number;
373
+ onUploadAttemptFail?: (info: {
374
+ url: string;
375
+ source: 'lbs' | 'default';
376
+ error: any;
377
+ kind: 'network' | 'business' | 'communication' | 'server';
378
+ }) => void;
363
379
  onUploadStart?: (task: {
364
380
  abort: () => void;
365
381
  [key: string]: any;
@@ -317,6 +317,28 @@ export interface GetFileTokenResult {
317
317
  ttl: number;
318
318
  }
319
319
  export interface NIMEModuleParamCloudStorageConfig {
320
+ /**
321
+ * @Multi_Lang_Tag
322
+ * @locale cn
323
+ * IM NOS LBS 地址,必须是包含 scheme 和 host 的完整 URL。SDK 默认 'https://lbs.netease.im/lbs/nosconf'
324
+ * @locale
325
+ *
326
+ * @locale en
327
+ * IM NOS LBS URL. It must be an absolute URL with scheme and host. SDK default: 'https://lbs.netease.im/lbs/nosconf'
328
+ * @locale
329
+ */
330
+ imNOSUploadLBS?: string;
331
+ /**
332
+ * @Multi_Lang_Tag
333
+ * @locale cn
334
+ * 是否启用 IM NOS LBS。显式设置时使用该值;未设置时由 IM 登录 LBS 地址是否为默认值决定。
335
+ * @locale
336
+ *
337
+ * @locale en
338
+ * Whether IM NOS LBS is enabled. Explicit values take effect directly. If unset, the default is derived from whether IM login LBS URLs are default.
339
+ * @locale
340
+ */
341
+ enableIMNOSLBS?: boolean;
320
342
  /**
321
343
  * @Multi_Lang_Tag
322
344
  * @locale cn
@@ -9,6 +9,7 @@ import { SyncOptions } from './SyncServiceInterface';
9
9
  import { SystemMessage, TSystemMessageStatus, TSystemMessageType } from './SystemMessageServiceInterface';
10
10
  import { Team, TeamMember, TeamMemberType } from './TeamServiceInterface';
11
11
  import { NIMServiceName, StrAnyObj } from './types';
12
+ import { NIMEStrAnyObj } from '../../types';
12
13
  import { Relations, UserNameCard } from './UserServiceInterface';
13
14
  import { NIMEInstanceStatus, V1NIMLoginKickOptions, V1NIMLoginKickResult, V1NIMLoginListener, NIMEModuleParamV1Login } from './V1NIMLoginService';
14
15
  import { V2NIMFriendServiceConfig } from './V2NIMFriendService';
@@ -548,6 +549,12 @@ export declare type NIMOtherOptionsAbtestConfig = {
548
549
  * abTest 服务器下发地址
549
550
  */
550
551
  abtestUrl?: string;
552
+ /**
553
+ * 对线上拉取到的 abtInfo 做预处理,返回值会作为实例最终生效的 abtInfo。
554
+ *
555
+ * 可用于 ABTest 测试阶段覆盖或调整线上返回配置。
556
+ */
557
+ abtestInfoPreprocessor?: (abtInfo: NIMEStrAnyObj) => NIMEStrAnyObj;
551
558
  };
552
559
  export declare type NIMOtherOptionsPrivateConfig = {
553
560
  /**
@@ -568,6 +575,10 @@ export declare type NIMOtherOptionsPrivateConfig = {
568
575
  * 上传地址
569
576
  */
570
577
  nos_uploader?: string;
578
+ /**
579
+ * IM NOS LBS 地址
580
+ */
581
+ im_nos_lbs?: string;
571
582
  /**
572
583
  * 下载地址的格式
573
584
  */
@@ -638,6 +649,28 @@ export declare type NIMOtherOptionsReporterConfig = {
638
649
  isDataReportEnable?: boolean;
639
650
  };
640
651
  export interface ServerConfig {
652
+ /**
653
+ * @Multi_Lang_Tag
654
+ * @locale cn
655
+ * IM NOS LBS 地址,必须是包含 scheme 和 host 的完整 URL。SDK 默认 'https://lbs.netease.im/lbs/nosconf'
656
+ * @locale
657
+ *
658
+ * @locale en
659
+ * IM NOS LBS URL. It must be an absolute URL with scheme and host. SDK default: 'https://lbs.netease.im/lbs/nosconf'
660
+ * @locale
661
+ */
662
+ imNOSUploadLBS?: string;
663
+ /**
664
+ * @Multi_Lang_Tag
665
+ * @locale cn
666
+ * 是否启用 IM NOS LBS。显式设置时使用该值;未设置时由 IM 登录 LBS 地址是否为默认值决定。
667
+ * @locale
668
+ *
669
+ * @locale en
670
+ * Whether IM NOS LBS is enabled. Explicit values take effect directly. If unset, the default is derived from whether IM login LBS URLs are default.
671
+ * @locale
672
+ */
673
+ enableIMNOSLBS?: boolean;
641
674
  /**
642
675
  * @Multi_Lang_Tag
643
676
  * @locale cn
@@ -275,10 +275,11 @@ export interface IUploadFileOptions {
275
275
  /**
276
276
  * maxSize 限制文件大小。
277
277
  *
278
- * 只对浏览器生效。
278
+ * 对浏览器生效(v10.0.0+)
279
279
  *
280
- * uni-app,小程序等,由于sdk只能得到一个 filePath 临时路径,不能得到整个文件的信息。
281
- * 所以请开发者自行在选择文件后进行判断,参考那些端的API如 wx.chooseImage,uni.chooseImage
280
+ * 而在 uni-app、小程序等 filePath 上传场景中,调用 stat 方法检测生效 (v10.9.90+)。
281
+ *
282
+ * 若宿主环境不支持文件大小探查,则仍建议开发者在选择文件后自行判断,参考 wx.chooseImage、uni.chooseImage 等端能力。
282
283
  */
283
284
  maxSize?: number;
284
285
  /**
@@ -667,4 +667,12 @@ export declare type NIMEModuleParamV2Login = {
667
667
  * 注: 传 false 将允许 LBS 和 Websocket 连接使用 http 和 ws 协议. 不推荐使用.
668
668
  */
669
669
  linkSSL?: boolean;
670
+ /**
671
+ * 是否启用网络可达性探测上报。默认 true。
672
+ *
673
+ * 注: 该能力仅用于在 login、chatroomLogin、LinkKeep 等 SDK 数据上报中追加 net_probe 字段,
674
+ * 不会改变连接、心跳、断线或重连行为。设置为 false 时,SDK 不读取网络探测 ABTest 配置、
675
+ * 不发起探测请求,也不追加 net_probe。
676
+ */
677
+ networkProbeEnable?: boolean;
670
678
  };
@@ -442,13 +442,21 @@ export declare class V2NIMMessageLogUtil {
442
442
  /**
443
443
  * 仅清空会话漫游消息
444
444
  *
445
+ * 注: 如果需要删除会话, 并且刷新页面重新初始化登录后不再看到该会话, 但后续新消息进入重新产生会话时仍能拉取历史消息,
446
+ * 可以先调用本接口清空漫游消息, 再调用会话删除接口并将 clearMessage 设置为 false.
447
+ * 这样只会删除会话和漫游消息, 不会删除云端历史消息.
448
+ *
445
449
  * 注: 使用 dist/esm 产物时,需要动态引入 {@link V2NIMMessageLogUtil | V2NIMMessageLogUtil} 后使用
446
450
  *
447
451
  * @param conversationIds 会话 id 列表
448
452
  *
449
453
  * @example
450
454
  * ```ts
455
+ * // 组合调用场景: 删除本地会话并清空漫游消息, 但保留云端历史消息.
456
+ * // 刷新页面重新初始化登录后, 该会话不会因漫游消息重新出现.
457
+ * // 接着因新消息弹出这个会话, 点击进入会话后, 能够拉得到历史消息记录.
451
458
  * await nim.V2NIMMessageService.clearRoamingMessage([conversationId])
459
+ * await nim.V2NIMLocalConversationService.deleteConversation(conversationId, false)
452
460
  * ```
453
461
  */
454
462
  clearRoamingMessage(conversationIds: string[]): Promise<void>;
@@ -431,19 +431,17 @@ export interface IBaseUploadFileOptions {
431
431
  * @locale cn
432
432
  * maxSize 限制文件大小。
433
433
  *
434
- * 只对浏览器生效。
434
+ * 对浏览器生效;在 uni-app、小程序等 filePath 上传场景中,若 adapter 能探查到本地文件大小,也会生效。
435
435
  *
436
- * uni-app,小程序等,由于sdk只能得到一个 filePath 临时路径,不能得到整个文件的信息。
437
- * 所以请开发者自行在选择文件后进行判断,参考那些端的API如 wx.chooseImage,uni.chooseImage
436
+ * 若宿主环境不支持文件大小探查,则仍建议开发者在选择文件后自行判断,参考 wx.chooseImage、uni.chooseImage 等端能力。
438
437
  * @locale
439
438
  *
440
439
  * @locale en
441
440
  * maxSize : maximum file size.
442
441
  *
443
- * Only valid for browsers.
442
+ * Valid for browsers. For filePath uploads in uni-app and mini-program runtimes, it is also valid when the adapter can inspect local file size.
444
443
  *
445
- * For uni-app, applet, etc., because the SDK can only get a temporary filePath path, the information of the entire file cannot be obtained.
446
- * So please make your determination after selecting the file. Refer to those frame/platform’s APIs such as wx.chooseImage, uni.chooseImage.
444
+ * If the host runtime does not support file size inspection, make your determination after selecting the file. Refer to those frame/platform’s APIs such as wx.chooseImage, uni.chooseImage.
447
445
  * @locale
448
446
  */
449
447
  maxSize?: number;