@phonghq/go-chat 1.0.18 → 1.0.20
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/dist/composable/usePlivo.d.ts +3 -3
- package/dist/go-chat.es.js +2638 -2632
- package/dist/go-chat.umd.js +6 -6
- package/dist/test/chat/App.vue.js +9 -13
- package/dist/test/types/call.js +19 -10
- package/dist/types/call.d.ts +10 -9
- package/dist/types/chat/global.d.ts +4 -3
- package/package.json +1 -1
|
@@ -102,7 +102,7 @@ const responsiveRender = computed(() => {
|
|
|
102
102
|
});
|
|
103
103
|
const list = computed(() => chatListRef.value?.listConversations ?? []);
|
|
104
104
|
const unreadCount = computed(() => list.value?.reduce((total, cur) => total + (cur?.unread_count ?? 0), 0) ?? 0);
|
|
105
|
-
const
|
|
105
|
+
const callStatus = computed(() => callingRef.value?.callStatus ?? null);
|
|
106
106
|
const responsiveObserver = ref('tablet');
|
|
107
107
|
const appChatRef = ref();
|
|
108
108
|
const callingRef = ref(null);
|
|
@@ -144,22 +144,18 @@ const getResponsiveObserver = useDebounce(() => {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}, 50);
|
|
147
|
-
const getUserRemote = () => {
|
|
148
|
-
return callingRef.value?.userRemoter ?? null;
|
|
149
|
-
};
|
|
150
|
-
const startCall = () => {
|
|
151
|
-
return callingRef.value?.answer ?? undefined;
|
|
152
|
-
};
|
|
153
|
-
const endCall = () => {
|
|
154
|
-
return callingRef.value?.endCall;
|
|
155
|
-
};
|
|
156
147
|
initPage({ props: props, response: props.response });
|
|
157
148
|
let __VLS_exposed;
|
|
158
149
|
defineExpose({
|
|
159
150
|
unreadCount,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
callStatus,
|
|
152
|
+
getUserRemote: () => {
|
|
153
|
+
return callingRef.value?.userRemoter ?? null;
|
|
154
|
+
},
|
|
155
|
+
startCall: async () => {
|
|
156
|
+
await callingRef.value?.answer();
|
|
157
|
+
},
|
|
158
|
+
endCall: () => callingRef.value?.endCall()
|
|
163
159
|
});
|
|
164
160
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
165
161
|
const __VLS_defaults = {
|
package/dist/test/types/call.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
// export const enum PLIVO_CALL_STATUS {
|
|
2
|
+
// CONNECTING = 'Connecting...',
|
|
3
|
+
// CALLING = 'calling',
|
|
4
|
+
// RINGING = 'ringing',
|
|
5
|
+
// CONNECT_FAILED = 'failed',
|
|
6
|
+
// CALL_START = 'in-progress',
|
|
7
|
+
// CALL_END = 'completed',
|
|
8
|
+
// NO_ANSWER = 'no-answer'
|
|
9
|
+
// }
|
|
10
|
+
export const PLIVO_CALL_STATUS = {
|
|
11
|
+
CONNECTING: 'Connecting...',
|
|
12
|
+
CALLING: 'calling',
|
|
13
|
+
RINGING: 'ringing',
|
|
14
|
+
CONNECT_FAILED: 'failed',
|
|
15
|
+
CALL_START: 'in-progress',
|
|
16
|
+
CALL_END: 'completed',
|
|
17
|
+
NO_ANSWER: 'no-answer'
|
|
18
|
+
};
|
|
19
|
+
// export type PlivoCallStatusType = typeof PLIVO_CALL_STATUS_LIST;
|
package/dist/types/call.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ export type IResCall = {
|
|
|
2
2
|
from: string;
|
|
3
3
|
to: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const
|
|
6
|
-
CONNECTING
|
|
7
|
-
CALLING
|
|
8
|
-
RINGING
|
|
9
|
-
CONNECT_FAILED
|
|
10
|
-
CALL_START
|
|
11
|
-
CALL_END
|
|
12
|
-
NO_ANSWER
|
|
13
|
-
}
|
|
5
|
+
export declare const PLIVO_CALL_STATUS: {
|
|
6
|
+
readonly CONNECTING: "Connecting...";
|
|
7
|
+
readonly CALLING: "calling";
|
|
8
|
+
readonly RINGING: "ringing";
|
|
9
|
+
readonly CONNECT_FAILED: "failed";
|
|
10
|
+
readonly CALL_START: "in-progress";
|
|
11
|
+
readonly CALL_END: "completed";
|
|
12
|
+
readonly NO_ANSWER: "no-answer";
|
|
13
|
+
};
|
|
14
|
+
export type PlivoCallStatusType = (typeof PLIVO_CALL_STATUS)[keyof typeof PLIVO_CALL_STATUS];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComputedRef, Ref } from 'vue';
|
|
2
2
|
import type { IResUser } from '../../types/message';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PlivoCallStatusType } from '../../types/call';
|
|
4
4
|
export type GoChatProps = {
|
|
5
5
|
token?: string;
|
|
6
6
|
id?: string;
|
|
@@ -11,12 +11,13 @@ export type GoChatProps = {
|
|
|
11
11
|
export interface GoChatInstance {
|
|
12
12
|
unreadCount: ComputedRef<number>;
|
|
13
13
|
getUserRemote: () => (IResUser | null);
|
|
14
|
-
|
|
14
|
+
callStatus: ComputedRef<PlivoCallStatusType | null>;
|
|
15
|
+
startCall: (() => Promise<void>) | undefined;
|
|
15
16
|
endCall: (() => void) | undefined;
|
|
16
17
|
}
|
|
17
18
|
export interface CallInstance {
|
|
18
19
|
userRemoter: Ref<IResUser | null>;
|
|
19
|
-
callStatus: Ref<
|
|
20
|
+
callStatus: Ref<PlivoCallStatusType | null>;
|
|
20
21
|
startCall: ((data: IResUser) => Promise<void>);
|
|
21
22
|
endCall: (() => void);
|
|
22
23
|
answer: (() => Promise<void>);
|