@phonghq/go-chat 1.0.19 → 1.0.21
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/chat/main.d.ts +1 -0
- package/dist/composable/usePlivo.d.ts +3 -3
- package/dist/go-chat.es.js +121 -113
- package/dist/go-chat.umd.js +13 -13
- package/dist/test/chat/main.js +1 -0
- package/dist/test/components/chat/call/Calling.vue.js +1 -1
- package/dist/test/composable/usePlivo.js +1 -1
- package/dist/test/types/chat/call.js +18 -0
- package/dist/types/chat/call.d.ts +14 -0
- package/dist/types/chat/global.d.ts +3 -3
- package/package.json +1 -1
- package/dist/test/types/call.js +0 -10
- package/dist/types/call.d.ts +0 -13
package/dist/test/chat/main.js
CHANGED
|
@@ -12,7 +12,7 @@ import { formatPhone10number } from '../../../utils/chat/phone-string';
|
|
|
12
12
|
import IconSoundDownload from '../../../assets/icons/call/IconSoundDownload.vue';
|
|
13
13
|
import IconClose from '../../../assets/icons/call/IconClose.vue';
|
|
14
14
|
import { usePlivo } from '../../../composable/usePlivo';
|
|
15
|
-
import { PLIVO_CALL_STATUS } from '../../../types/call';
|
|
15
|
+
import { PLIVO_CALL_STATUS } from '../../../types/chat/call';
|
|
16
16
|
import IconMic from '../../../assets/icons/call/IconMic.vue';
|
|
17
17
|
const { call, end, handleMedia, startIncomingCall, handleCallAnswer, callAnswer, uuid, startPeerConnection } = useCallHelper();
|
|
18
18
|
const handlePlivoCallBack = (status, data) => {
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type IResCall = {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
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 './call';
|
|
4
4
|
export type GoChatProps = {
|
|
5
5
|
token?: string;
|
|
6
6
|
id?: string;
|
|
@@ -11,13 +11,13 @@ export type GoChatProps = {
|
|
|
11
11
|
export interface GoChatInstance {
|
|
12
12
|
unreadCount: ComputedRef<number>;
|
|
13
13
|
getUserRemote: () => (IResUser | null);
|
|
14
|
-
callStatus: ComputedRef<
|
|
14
|
+
callStatus: ComputedRef<PlivoCallStatusType | null>;
|
|
15
15
|
startCall: (() => Promise<void>) | undefined;
|
|
16
16
|
endCall: (() => void) | undefined;
|
|
17
17
|
}
|
|
18
18
|
export interface CallInstance {
|
|
19
19
|
userRemoter: Ref<IResUser | null>;
|
|
20
|
-
callStatus: Ref<
|
|
20
|
+
callStatus: Ref<PlivoCallStatusType | null>;
|
|
21
21
|
startCall: ((data: IResUser) => Promise<void>);
|
|
22
22
|
endCall: (() => void);
|
|
23
23
|
answer: (() => Promise<void>);
|
package/package.json
CHANGED
package/dist/test/types/call.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export var PLIVO_CALL_STATUS;
|
|
2
|
-
(function (PLIVO_CALL_STATUS) {
|
|
3
|
-
PLIVO_CALL_STATUS["CONNECTING"] = "Connecting...";
|
|
4
|
-
PLIVO_CALL_STATUS["CALLING"] = "calling";
|
|
5
|
-
PLIVO_CALL_STATUS["RINGING"] = "ringing";
|
|
6
|
-
PLIVO_CALL_STATUS["CONNECT_FAILED"] = "failed";
|
|
7
|
-
PLIVO_CALL_STATUS["CALL_START"] = "in-progress";
|
|
8
|
-
PLIVO_CALL_STATUS["CALL_END"] = "completed";
|
|
9
|
-
PLIVO_CALL_STATUS["NO_ANSWER"] = "no-answer";
|
|
10
|
-
})(PLIVO_CALL_STATUS || (PLIVO_CALL_STATUS = {}));
|
package/dist/types/call.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type IResCall = {
|
|
2
|
-
from: string;
|
|
3
|
-
to: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const enum PLIVO_CALL_STATUS {
|
|
6
|
-
CONNECTING = "Connecting...",
|
|
7
|
-
CALLING = "calling",
|
|
8
|
-
RINGING = "ringing",
|
|
9
|
-
CONNECT_FAILED = "failed",
|
|
10
|
-
CALL_START = "in-progress",
|
|
11
|
-
CALL_END = "completed",
|
|
12
|
-
NO_ANSWER = "no-answer"
|
|
13
|
-
}
|