@medipha/chat 1.0.42 → 1.0.43
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 +4 -0
- package/dist/index.cjs +43 -43
- package/dist/index.js +8011 -7976
- package/dist/module/chat-module.types.d.ts +2 -1
- package/dist/module/session/chat-session.d.ts +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,12 +26,14 @@ import '@medipha/chat/styles.css';
|
|
|
26
26
|
<ChatModule
|
|
27
27
|
userId={currentUserId}
|
|
28
28
|
accessToken={accessToken}
|
|
29
|
+
expireTime={expireTime}
|
|
29
30
|
apiUrl={CHAT_API_URL}
|
|
30
31
|
socketUrl={CHAT_SOCKET_URL}
|
|
31
32
|
hasAddGroupVerified={permissions.addGroupVerified}
|
|
32
33
|
hasUpdateGroupVerified={permissions.updateGroupVerified}
|
|
33
34
|
hasDeleteGroupVerified={permissions.deleteGroupVerified}
|
|
34
35
|
onUnauthorized={handleUnauthorized}
|
|
36
|
+
onRefreshToken={handleRefreshToken}
|
|
35
37
|
onNavigateOutsideChat={handleNavigateOutsideChat}
|
|
36
38
|
/>
|
|
37
39
|
}
|
|
@@ -48,12 +50,14 @@ relative routes: `/chat-erp` for the conversation list and
|
|
|
48
50
|
| ------------------------ | -------- | ------------------------------------------------------------- |
|
|
49
51
|
| `userId` | Yes | ERP id of the signed-in user, as the chat backend knows them. |
|
|
50
52
|
| `accessToken` | Yes | Current ERP access token used by chat API/socket clients. |
|
|
53
|
+
| `expireTime` | Yes | Token expiry as epoch seconds for media upload checks. |
|
|
51
54
|
| `apiUrl` | Yes | Base URL for the Chat HTTP API. |
|
|
52
55
|
| `socketUrl` | Yes | Socket server URL. |
|
|
53
56
|
| `hasAddGroupVerified` | Yes | May the user create a verified ("tích xanh") group. |
|
|
54
57
|
| `hasUpdateGroupVerified` | Yes | May the user rename/re-avatar a verified group. |
|
|
55
58
|
| `hasDeleteGroupVerified` | Yes | May the user disband a verified group. |
|
|
56
59
|
| `onUnauthorized` | No | ERP callback for an unauthorized chat response. |
|
|
60
|
+
| `onRefreshToken` | No | Returns a fresh token before media upload when expiry is near. |
|
|
57
61
|
| `onNavigateOutsideChat` | No | ERP callback for navigation that leaves chat. |
|
|
58
62
|
|
|
59
63
|
`accessToken`, `apiUrl` and `socketUrl` are asserted non-empty at mount and
|