@droppii-org/chat-sdk 0.0.14 → 0.0.15

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.
@@ -26,7 +26,7 @@ export const ChatProvider = ({ children, config }) => {
26
26
  setLoading(false);
27
27
  })
28
28
  .catch(({ errCode, errMsg }) => {
29
- console.log("login", errCode, errMsg);
29
+ console.log("handleLogin", errCode, errMsg);
30
30
  });
31
31
  };
32
32
  useEffect(() => {
@@ -0,0 +1,4 @@
1
+ export declare const useDChatAuth: () => {
2
+ logout: () => Promise<import("@openim/wasm-client-sdk").WsResponse<unknown>>;
3
+ };
4
+ //# sourceMappingURL=useAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useAuth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;CAOxB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { getSDK } from "@openim/wasm-client-sdk";
2
+ const DChatSDK = getSDK();
3
+ export const useDChatAuth = () => {
4
+ const logout = async () => {
5
+ const res = await DChatSDK.logout();
6
+ return res;
7
+ };
8
+ return { logout };
9
+ };
package/dist/index.d.ts CHANGED
@@ -3,9 +3,8 @@ import { Platform, LogLevel, SessionType, InitAndLoginConfig } from "@openim/was
3
3
  import { Icon } from "./components/icon";
4
4
  import ChatBubble from "./components/ChatBubble";
5
5
  export { ChatProvider, useChatContext } from "./context/ChatContext";
6
- export { DChatDeskMessage };
7
- export { Icon };
8
- export { ChatBubble };
6
+ export { DChatDeskMessage, ChatBubble, Icon };
7
+ export { useDChatAuth } from "./hooks/user/useAuth";
9
8
  export { Platform as DChatPlatform, LogLevel as DChatLogLevel, SessionType as DChatSessionType, };
10
9
  export type { InitAndLoginConfig as DChatInitAndLoginConfig };
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,UAAU,EAAE,CAAC;AAItB,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -4,9 +4,9 @@ import { Icon } from "./components/icon";
4
4
  import ChatBubble from "./components/ChatBubble";
5
5
  // Main exports for the SDK
6
6
  export { ChatProvider, useChatContext } from "./context/ChatContext";
7
- //Screens
8
- export { DChatDeskMessage };
9
- export { Icon };
10
- export { ChatBubble };
7
+ //Components
8
+ export { DChatDeskMessage, ChatBubble, Icon };
9
+ //Hooks
10
+ export { useDChatAuth } from "./hooks/user/useAuth";
11
11
  // export * from "./types/sdk";
12
12
  export { Platform as DChatPlatform, LogLevel as DChatLogLevel, SessionType as DChatSessionType, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",