@zjw-jszn/platform-imsdk 1.0.0 → 1.0.2

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.
@@ -40,7 +40,7 @@ var p = {
40
40
  function m(e) {
41
41
  a("platform-imsdk", e, p);
42
42
  let t = e.runtimeApi;
43
- (t?.getChatConfig || t?.closeSession || t?.getCustomerChatList) && console.warn("[platform-imsdk] 已忽略 runtimeApi 的平台扩展覆盖配置,平台扩展接口由内置实现提供");
43
+ (t != null && t.getChatConfig || t != null && t.closeSession || t != null && t.getCustomerChatList) && console.warn("[platform-imsdk] 已忽略 runtimeApi 的平台扩展覆盖配置,平台扩展接口由内置实现提供");
44
44
  }
45
45
  function h(e = {}) {
46
46
  m(e);
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@zjw-jszn/shared-imsdk`)):typeof define==`function`&&define.amd?define([`exports`,`@zjw-jszn/shared-imsdk`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PlatformIMSDK={},e.SharedIMSDK))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=`/site/IM`;function r(e){return`${n}${e.startsWith(`/`)?e:`/${e}`}`}function i(e){if(!t.http.getAuth())throw Error(`未登录,禁止请求 ${e},请先完成鉴权`)}function a(e,t){if(e.result===void 0||e.result===null)throw Error(`${t} 接口返回 result 为空`);return e.result}async function o(){return i(`getChatConfig`),a(await t.http.post(r(`/chatConfig/getConfig`)),`getChatConfig`)}async function s(e){i(`closeSession`);let n=e.uid!==void 0&&e.uid!==null,a=e.session_id!==void 0&&e.session_id!==null;if(!n&&!a)throw Error(`结束会话失败:uid 和 session_id 不能同时为空`);let o=n?{uid:e.uid}:{session_id:e.session_id};return await t.http.post(r(`/chat/closeSession`),o),!0}async function c(e){return i(`getCustomerChatList`),a(await t.http.post(r(`/customer/getChatList`),e),`getCustomerChatList`)}var l={api:{prefix:`/site/IM`,userType:4},ws:{controller:`Site`,platform:`site`}};function u(e){(0,t.warnModeOverrides)(`platform-imsdk`,e,l);let n=e.runtimeApi;(n?.getChatConfig||n?.closeSession||n?.getCustomerChatList)&&console.warn(`[platform-imsdk] 已忽略 runtimeApi 的平台扩展覆盖配置,平台扩展接口由内置实现提供`)}function d(e={}){u(e);let n=e;return{...(0,t.applyModeDefaults)(e,l),runtimeApi:{...n.runtimeApi||{},getChatConfig:o,closeSession:s,getCustomerChatList:c}}}async function f(e={}){return(0,t.initIM)(d(e))}var p={...t.IMSDK,init:f,getUserInfo:t.getUserInfo};e.IMSDK=p,e.default=p,e.closeSession=s,e.getChatConfig=o,e.getCustomerChatList=c,e.initIM=f,Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@zjw-jszn/shared-imsdk`)):typeof define==`function`&&define.amd?define([`exports`,`@zjw-jszn/shared-imsdk`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PlatformIMSDK={},e.SharedIMSDK))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=`/site/IM`;function r(e){return`${n}${e.startsWith(`/`)?e:`/${e}`}`}function i(e){if(!t.http.getAuth())throw Error(`未登录,禁止请求 ${e},请先完成鉴权`)}function a(e,t){if(e.result===void 0||e.result===null)throw Error(`${t} 接口返回 result 为空`);return e.result}async function o(){return i(`getChatConfig`),a(await t.http.post(r(`/chatConfig/getConfig`)),`getChatConfig`)}async function s(e){i(`closeSession`);let n=e.uid!==void 0&&e.uid!==null,a=e.session_id!==void 0&&e.session_id!==null;if(!n&&!a)throw Error(`结束会话失败:uid 和 session_id 不能同时为空`);let o=n?{uid:e.uid}:{session_id:e.session_id};return await t.http.post(r(`/chat/closeSession`),o),!0}async function c(e){return i(`getCustomerChatList`),a(await t.http.post(r(`/customer/getChatList`),e),`getCustomerChatList`)}var l={api:{prefix:`/site/IM`,userType:4},ws:{controller:`Site`,platform:`site`}};function u(e){(0,t.warnModeOverrides)(`platform-imsdk`,e,l);let n=e.runtimeApi;(n!=null&&n.getChatConfig||n!=null&&n.closeSession||n!=null&&n.getCustomerChatList)&&console.warn(`[platform-imsdk] 已忽略 runtimeApi 的平台扩展覆盖配置,平台扩展接口由内置实现提供`)}function d(e={}){u(e);let n=e;return{...(0,t.applyModeDefaults)(e,l),runtimeApi:{...n.runtimeApi||{},getChatConfig:o,closeSession:s,getCustomerChatList:c}}}async function f(e={}){return(0,t.initIM)(d(e))}var p={...t.IMSDK,init:f,getUserInfo:t.getUserInfo};e.IMSDK=p,e.default=p,e.closeSession=s,e.getChatConfig=o,e.getCustomerChatList=c,e.initIM=f,Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})});
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@zjw-jszn/platform-imsdk",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
+ "main": "./dist/platform-imsdk.umd.js",
6
+ "module": "./dist/platform-imsdk.es.js",
5
7
  "exports": {
6
8
  ".": {
7
9
  "types": {
@@ -25,7 +27,7 @@
25
27
  "registry": "https://registry.npmjs.org/"
26
28
  },
27
29
  "dependencies": {
28
- "@zjw-jszn/shared-imsdk": "1.0.0"
30
+ "@zjw-jszn/shared-imsdk": "1.0.2"
29
31
  },
30
32
  "devDependencies": {
31
33
  "typescript": "~5.9.3",