@phonghq/go-chat 1.0.2 → 1.0.4
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/go-chat.es.js +6578 -6530
- package/dist/go-chat.umd.js +14 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/assets/icons/IconArrowLeft.vue.d.ts +0 -2
- package/dist/assets/icons/IconArrowLeft.vue.js +0 -29
- package/dist/assets/icons/IconPhone.vue.d.ts +0 -2
- package/dist/assets/icons/IconPhone.vue.js +0 -19
- package/dist/assets/icons/IconPlan.vue.d.ts +0 -2
- package/dist/assets/icons/IconPlan.vue.js +0 -19
- package/dist/assets/icons/IconPlus.vue.d.ts +0 -2
- package/dist/assets/icons/IconPlus.vue.js +0 -22
- package/dist/assets/icons/IconSearch.vue.d.ts +0 -32
- package/dist/assets/icons/IconSearch.vue.js +0 -68
- package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
- package/dist/assets/icons/call/IconMic.vue.js +0 -123
- package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
- package/dist/assets/icons/call/IconPhone.vue.js +0 -35
- package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -2
- package/dist/assets/icons/call/IconPhoneCancel.vue.js +0 -35
- package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
- package/dist/assets/icons/call/IconSpeaker.vue.js +0 -62
- package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
- package/dist/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
- package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconArrow.vue.js +0 -22
- package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconCheck.vue.js +0 -27
- package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconDate.vue.js +0 -43
- package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconGroup.vue.js +0 -48
- package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconMessage.vue.js +0 -28
- package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconNote.vue.js +0 -29
- package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconPhone.vue.js +0 -21
- package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconPin.vue.js +0 -29
- package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
- package/dist/assets/icons/customer-detail/IconSearch.vue.js +0 -29
- package/dist/chat/App.vue.d.ts +0 -5
- package/dist/chat/App.vue.js +0 -502
- package/dist/chat/main.d.ts +0 -3
- package/dist/chat/main.js +0 -2
- package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
- package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
- package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
- package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
- package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
- package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -136
- package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
- package/dist/chat/page/customer-detail/CustomerDetail.vue.js +0 -235
- package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
- package/dist/chat/page/customer-detail/SubInformation.vue.js +0 -102
- package/dist/chat/page/error/Error.vue.d.ts +0 -2
- package/dist/chat/page/error/Error.vue.js +0 -64
- package/dist/chat/page/home/ChatList.vue.d.ts +0 -20
- package/dist/chat/page/home/ChatList.vue.js +0 -380
- package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -16
- package/dist/chat/page/home/ChatMessage.vue.js +0 -271
- package/dist/chat/page/home/Home.vue.d.ts +0 -14
- package/dist/chat/page/home/Home.vue.js +0 -327
- package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -10
- package/dist/chat/page/home/HomeHeader.vue.js +0 -122
- package/dist/chat/page/home/InputChat.vue.d.ts +0 -19
- package/dist/chat/page/home/InputChat.vue.js +0 -226
- package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -6
- package/dist/chat/page/home/NewCustomer.vue.js +0 -82
- package/dist/components/ListenEvent.vue.d.ts +0 -2
- package/dist/components/ListenEvent.vue.js +0 -45
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -22
- package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -197
- package/dist/components/chat/call/Calling.vue.d.ts +0 -7
- package/dist/components/chat/call/Calling.vue.js +0 -291
- package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
- package/dist/components/chat/card/CardCustomerDetail.vue.js +0 -28
- package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
- package/dist/components/chat/common/collapse/CollapseBase.vue.js +0 -59
- package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
- package/dist/components/chat/common/input/InputSearch.vue.js +0 -71
- package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
- package/dist/components/chat/common/popover/PopoverBase.vue.js +0 -148
- package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -2
- package/dist/components/chat/common/spin/BaseSpin.vue.js +0 -12
- package/dist/components/chat/customer/Avatar.vue.d.ts +0 -11
- package/dist/components/chat/customer/Avatar.vue.js +0 -79
- package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
- package/dist/components/chat/layout/mobile/Footer.vue.js +0 -109
- package/dist/components/common/CustomLoading.vue.d.ts +0 -2
- package/dist/components/common/CustomLoading.vue.js +0 -19
- package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
- package/dist/components/common/Notification/NotificationDescription.vue.js +0 -38
- package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
- package/dist/components/common/button/ButtonBase.vue.js +0 -78
- package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
- package/dist/components/common/button/ButtonToggle.vue.js +0 -70
- package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
- package/dist/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
- package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
- package/dist/components/common/collapse/BaseCollapse.vue.js +0 -36
- package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
- package/dist/components/common/collapse/BaseCollapseItem.vue.js +0 -22
- package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
- package/dist/components/common/drawer/DrawerBase.vue.js +0 -126
- package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
- package/dist/components/common/dropdown/DropdownBase.vue.js +0 -91
- package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
- package/dist/components/common/input/CInputSearch.vue.js +0 -62
- package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
- package/dist/components/common/modal/ModalBase.vue.js +0 -164
- package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
- package/dist/components/common/popover/PopoverBase.vue.js +0 -36
- package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
- package/dist/components/common/slider/BaseSlider.vue.js +0 -70
- package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
- package/dist/components/common/spin/CSpin.vue.js +0 -41
- package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
- package/dist/components/common/tooltip/TooltipBase.vue.js +0 -8
- package/dist/components/layout/Blank.vue.d.ts +0 -9
- package/dist/components/layout/Blank.vue.js +0 -19
- package/dist/components/layout/Default.vue.d.ts +0 -9
- package/dist/components/layout/Default.vue.js +0 -21
- package/dist/components/modal/Confirm.vue.d.ts +0 -2
- package/dist/components/modal/Confirm.vue.js +0 -164
- package/dist/components/ui/button/CButton.vue.d.ts +0 -19
- package/dist/components/ui/button/CButton.vue.js +0 -49
- package/dist/components/ui/button/c-button.d.ts +0 -7
- package/dist/components/ui/button/c-button.js +0 -26
- package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
- package/dist/components/ui/checkbox/Checkbox.vue.js +0 -79
- package/dist/components/ui/checkbox/index.d.ts +0 -1
- package/dist/components/ui/checkbox/index.js +0 -1
- package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
- package/dist/components/ui/collapsible/Collapsible.vue.js +0 -47
- package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
- package/dist/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
- package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
- package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
- package/dist/components/ui/collapsible/index.d.ts +0 -3
- package/dist/components/ui/collapsible/index.js +0 -3
- package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
- package/dist/components/ui/dialog/Dialog.vue.js +0 -42
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
- package/dist/components/ui/dialog/DialogClose.vue.js +0 -35
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
- package/dist/components/ui/dialog/DialogContent.vue.js +0 -84
- package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
- package/dist/components/ui/dialog/DialogDescription.vue.js +0 -43
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
- package/dist/components/ui/dialog/DialogFooter.vue.js +0 -26
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
- package/dist/components/ui/dialog/DialogHeader.vue.js +0 -26
- package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
- package/dist/components/ui/dialog/DialogScrollContent.vue.js +0 -99
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
- package/dist/components/ui/dialog/DialogTitle.vue.js +0 -43
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
- package/dist/components/ui/dialog/DialogTrigger.vue.js +0 -35
- package/dist/components/ui/dialog/index.d.ts +0 -9
- package/dist/components/ui/dialog/index.js +0 -9
- package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
- package/dist/components/ui/drawer/Drawer.vue.js +0 -48
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
- package/dist/components/ui/drawer/DrawerContent.vue.js +0 -81
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
- package/dist/components/ui/drawer/DrawerDescription.vue.js +0 -42
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
- package/dist/components/ui/drawer/DrawerFooter.vue.js +0 -26
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
- package/dist/components/ui/drawer/DrawerHeader.vue.js +0 -26
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
- package/dist/components/ui/drawer/DrawerOverlay.vue.js +0 -37
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
- package/dist/components/ui/drawer/DrawerTitle.vue.js +0 -42
- package/dist/components/ui/drawer/index.d.ts +0 -8
- package/dist/components/ui/drawer/index.js +0 -8
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
- package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
- package/dist/components/ui/dropdown-menu/index.js +0 -15
- package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
- package/dist/components/ui/popover/Popover.vue.js +0 -41
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
- package/dist/components/ui/popover/PopoverContent.vue.js +0 -60
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
- package/dist/components/ui/popover/PopoverTrigger.vue.js +0 -35
- package/dist/components/ui/popover/index.d.ts +0 -3
- package/dist/components/ui/popover/index.js +0 -3
- package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
- package/dist/components/ui/radio-group/RadioGroup.vue.js +0 -46
- package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
- package/dist/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
- package/dist/components/ui/radio-group/index.d.ts +0 -2
- package/dist/components/ui/radio-group/index.js +0 -2
- package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
- package/dist/components/ui/slider/Slider.vue.js +0 -155
- package/dist/components/ui/slider/index.d.ts +0 -1
- package/dist/components/ui/slider/index.js +0 -1
- package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
- package/dist/components/ui/switch/Switch.vue.js +0 -61
- package/dist/components/ui/switch/index.d.ts +0 -1
- package/dist/components/ui/switch/index.js +0 -1
- package/dist/composable/useCallHelper.d.ts +0 -23
- package/dist/composable/useCallHelper.js +0 -170
- package/dist/composable/useInitData.d.ts +0 -11
- package/dist/composable/useInitData.js +0 -84
- package/dist/composable/useModalConfirm.d.ts +0 -5
- package/dist/composable/useModalConfirm.js +0 -39
- package/dist/constant/color.d.ts +0 -22
- package/dist/constant/color.js +0 -43
- package/dist/constant/datetime.d.ts +0 -5
- package/dist/constant/datetime.js +0 -5
- package/dist/constant/general.d.ts +0 -8
- package/dist/constant/general.js +0 -9
- package/dist/constant/message.d.ts +0 -8
- package/dist/constant/message.js +0 -8
- package/dist/constant/mqtt.d.ts +0 -4
- package/dist/constant/mqtt.js +0 -11
- package/dist/constant/user.d.ts +0 -8
- package/dist/constant/user.js +0 -9
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js +0 -5
- package/dist/plugins/axios-gci.d.ts +0 -3
- package/dist/plugins/axios-gci.js +0 -25
- package/dist/plugins/axios.d.ts +0 -3
- package/dist/plugins/axios.js +0 -85
- package/dist/plugins/mqtt.d.ts +0 -10
- package/dist/plugins/mqtt.js +0 -128
- package/dist/plugins/sdk.d.ts +0 -19
- package/dist/plugins/sdk.js +0 -83
- package/dist/plugins/websocket.d.ts +0 -4
- package/dist/plugins/websocket.js +0 -65
- package/dist/types/chat/user.d.ts +0 -88
- package/dist/types/chat/user.js +0 -1
- package/dist/types/conversation.d.ts +0 -18
- package/dist/types/conversation.js +0 -1
- package/dist/utils/chat/auth.d.ts +0 -45
- package/dist/utils/chat/auth.js +0 -51
- package/dist/utils/chat/call.d.ts +0 -5
- package/dist/utils/chat/call.js +0 -61
- package/dist/utils/chat/chat-router.d.ts +0 -3
- package/dist/utils/chat/chat-router.js +0 -9
- package/dist/utils/chat/conversation.d.ts +0 -3
- package/dist/utils/chat/conversation.js +0 -7
- package/dist/utils/chat/message.d.ts +0 -17
- package/dist/utils/chat/message.js +0 -42
- package/dist/utils/chat/user.d.ts +0 -193
- package/dist/utils/chat/user.js +0 -33
- package/dist/utils/debounce.d.ts +0 -1
- package/dist/utils/debounce.js +0 -9
- package/dist/utils/json.d.ts +0 -2
- package/dist/utils/json.js +0 -18
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/logger.js +0 -5
- package/dist/utils/string-helper.d.ts +0 -1
- package/dist/utils/string-helper.js +0 -27
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { IResLoginLink, IResProfile } from '../../types/chat/auth';
|
|
2
|
-
interface IBodyLoginTenant {
|
|
3
|
-
tenant_id: string;
|
|
4
|
-
}
|
|
5
|
-
interface IPramsLoginLink {
|
|
6
|
-
tenant_id: string;
|
|
7
|
-
phone: string;
|
|
8
|
-
message: string;
|
|
9
|
-
customer_name: string;
|
|
10
|
-
business_name: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const dataProfile: import("vue").Ref<{
|
|
13
|
-
id: number;
|
|
14
|
-
username: string;
|
|
15
|
-
tenant_id: string | null;
|
|
16
|
-
phone: string;
|
|
17
|
-
avatar: string | null;
|
|
18
|
-
user_type: "customer" | "tenant";
|
|
19
|
-
color: string;
|
|
20
|
-
} | null, IResProfile | {
|
|
21
|
-
id: number;
|
|
22
|
-
username: string;
|
|
23
|
-
tenant_id: string | null;
|
|
24
|
-
phone: string;
|
|
25
|
-
avatar: string | null;
|
|
26
|
-
user_type: "customer" | "tenant";
|
|
27
|
-
color: string;
|
|
28
|
-
} | null>;
|
|
29
|
-
export declare const dataLoginLink: import("vue").Ref<{
|
|
30
|
-
token: string;
|
|
31
|
-
refresh_token: string;
|
|
32
|
-
conversation_id: number;
|
|
33
|
-
receiver_id: number;
|
|
34
|
-
} | null, IResLoginLink | {
|
|
35
|
-
token: string;
|
|
36
|
-
refresh_token: string;
|
|
37
|
-
conversation_id: number;
|
|
38
|
-
receiver_id: number;
|
|
39
|
-
} | null>;
|
|
40
|
-
export declare const setDataLogin: (id: string, token: string, domain: string) => void;
|
|
41
|
-
export declare const loginTenant: (body: IBodyLoginTenant) => Promise<any>;
|
|
42
|
-
export declare const loginLink: (params: IPramsLoginLink) => Promise<any>;
|
|
43
|
-
export declare const getProfile: () => Promise<any>;
|
|
44
|
-
export declare const logout: () => Promise<void>;
|
|
45
|
-
export {};
|
package/dist/utils/chat/auth.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import axios from '../../plugins/axios';
|
|
2
|
-
import { gapMiniAppSdk } from '../../plugins/sdk';
|
|
3
|
-
import { ref } from 'vue';
|
|
4
|
-
export const dataProfile = ref(null);
|
|
5
|
-
export const dataLoginLink = ref(null);
|
|
6
|
-
let dataLogin = {
|
|
7
|
-
id: '',
|
|
8
|
-
token: '',
|
|
9
|
-
domain: ''
|
|
10
|
-
};
|
|
11
|
-
export const setDataLogin = (id, token, domain) => {
|
|
12
|
-
dataLogin = { id, token, domain };
|
|
13
|
-
};
|
|
14
|
-
export const loginTenant = async (body) => {
|
|
15
|
-
const res = await axios.post('/api/v1/message/tenant/login', body);
|
|
16
|
-
localStorage.setItem('chat_token', res?.token);
|
|
17
|
-
localStorage.setItem('refresh_token', res?.refresh_token);
|
|
18
|
-
dataLogin.id = body.tenant_id;
|
|
19
|
-
dataLogin.token = res?.token;
|
|
20
|
-
dataProfile.value = res;
|
|
21
|
-
return res;
|
|
22
|
-
};
|
|
23
|
-
export const loginLink = async (params) => {
|
|
24
|
-
const res = await axios.get('/api/v1/message/tenant/gci-link', { params: params });
|
|
25
|
-
localStorage.setItem('chat_token', res?.token);
|
|
26
|
-
localStorage.setItem('refresh_token', res?.refresh_token);
|
|
27
|
-
dataLogin.id = params.tenant_id;
|
|
28
|
-
dataLogin.token = res?.token;
|
|
29
|
-
dataLoginLink.value = res;
|
|
30
|
-
return res;
|
|
31
|
-
};
|
|
32
|
-
export const getProfile = async () => {
|
|
33
|
-
const res = await axios.get('/api/v1/message/user/me');
|
|
34
|
-
localStorage.setItem('chat_user', JSON.stringify(res?.data));
|
|
35
|
-
dataProfile.value = res;
|
|
36
|
-
return res;
|
|
37
|
-
};
|
|
38
|
-
export const logout = async () => {
|
|
39
|
-
dataLogin = { id: '', token: '', domain: '' };
|
|
40
|
-
dataProfile.value = null;
|
|
41
|
-
localStorage.removeItem('chat_accessToken');
|
|
42
|
-
localStorage.removeItem('chat_domain');
|
|
43
|
-
localStorage.removeItem('chat_id');
|
|
44
|
-
window.location.href = '/login';
|
|
45
|
-
try {
|
|
46
|
-
if (gapMiniAppSdk?.getInstance()?.getBridge()) {
|
|
47
|
-
gapMiniAppSdk?.getInstance()?.closeApp();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (error) { }
|
|
51
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { IResUser } from '../../types/message';
|
|
2
|
-
import type { IResCall } from '../../types/call';
|
|
3
|
-
export declare const getIceService: () => Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
-
export declare const callClient: (body: IResCall) => Promise<void>;
|
|
5
|
-
export declare const callOutBound: (user: IResUser) => Promise<void>;
|
package/dist/utils/chat/call.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import axios from '../../plugins/axios';
|
|
2
|
-
import { dataProfile } from '../../utils/chat/auth';
|
|
3
|
-
const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
|
|
4
|
-
// const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
|
|
5
|
-
export const getIceService = async () => {
|
|
6
|
-
const res = await axios.post('/api/v1/message/call/ice-servers', {
|
|
7
|
-
key_id: '3dc07e93f89e44ef5d5ff98c91edb520',
|
|
8
|
-
api_token: 'c0a60a3d2b0f490b2c99fd7ff095ed1218fd7eda55c80c8b70efc9e0b8dfcd85'
|
|
9
|
-
}, {
|
|
10
|
-
token: '3VbvrMLtH6b0b9vBe0mhJz9G9NKyATiL'
|
|
11
|
-
});
|
|
12
|
-
return res;
|
|
13
|
-
};
|
|
14
|
-
// export const callClient = async (body: IResCall): Promise<any> => {
|
|
15
|
-
// const res = await axios.post('/call/answer', body, {
|
|
16
|
-
// })
|
|
17
|
-
// return res
|
|
18
|
-
// }
|
|
19
|
-
export const callClient = async (body) => {
|
|
20
|
-
const url = BARE_WEBSOCKET_URL + '/call/answer';
|
|
21
|
-
try {
|
|
22
|
-
const response = await fetch(url, {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
body: JSON.stringify(body),
|
|
25
|
-
headers: {
|
|
26
|
-
['Content-Type']: 'application/json'
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
if (!response.ok) {
|
|
30
|
-
throw new Error(`Response status: ${response.status}`);
|
|
31
|
-
}
|
|
32
|
-
const result = await response.json();
|
|
33
|
-
console.log(result);
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
console.error(error.message);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export const callOutBound = async (user) => {
|
|
40
|
-
const url = BARE_WEBSOCKET_URL + '/call/outbound';
|
|
41
|
-
try {
|
|
42
|
-
const response = await fetch(url, {
|
|
43
|
-
method: 'POST',
|
|
44
|
-
body: JSON.stringify({
|
|
45
|
-
from: dataProfile.value?.phone,
|
|
46
|
-
to: user?.phone ?? ''
|
|
47
|
-
}),
|
|
48
|
-
headers: {
|
|
49
|
-
['Content-Type']: 'application/json'
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
if (!response.ok) {
|
|
53
|
-
throw new Error(`Response status: ${response.status}`);
|
|
54
|
-
}
|
|
55
|
-
const result = await response.json();
|
|
56
|
-
console.log(result);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
console.error(error.message);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
2
|
-
import { PAGE } from '../../constant/general';
|
|
3
|
-
export const currentPage = ref(PAGE.HOME);
|
|
4
|
-
let beforeEach = null;
|
|
5
|
-
export const routerPush = (page) => {
|
|
6
|
-
console.log('routerPush', page);
|
|
7
|
-
const to_page = beforeEach?.(page) ?? null;
|
|
8
|
-
currentPage.value = to_page ?? page;
|
|
9
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { DataWithMetaResponse } from '../../types/global';
|
|
2
|
-
import type { IResMessage, IResUser, IUploadFile } from '../../types/message';
|
|
3
|
-
interface IParamsMessage {
|
|
4
|
-
page: number;
|
|
5
|
-
receiver_id: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const getMessage: (params: IParamsMessage) => Promise<DataWithMetaResponse<IResMessage[]>>;
|
|
8
|
-
export declare const getDetailReceiver: (receiverId: string) => Promise<IResUser>;
|
|
9
|
-
export declare const getDetailUser: (id: any) => Promise<IResUser | null>;
|
|
10
|
-
export declare const readMessages: (conversationId: any) => Promise<import("axios").AxiosResponse<any, any> | undefined>;
|
|
11
|
-
export declare const sendMessage: (body: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
-
export declare const getCountUnread: (params: {
|
|
13
|
-
conversation_id: number;
|
|
14
|
-
receiver_id: number;
|
|
15
|
-
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
|
-
export declare const upLoadImage: (body: FormData) => Promise<IUploadFile[]>;
|
|
17
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import axios from '../../plugins/axios';
|
|
2
|
-
export const getMessage = async (params) => {
|
|
3
|
-
const res = await axios.get('/api/v1/message/message/get-message', {
|
|
4
|
-
params
|
|
5
|
-
});
|
|
6
|
-
return res;
|
|
7
|
-
};
|
|
8
|
-
export const getDetailReceiver = async (receiverId) => {
|
|
9
|
-
const res = await axios.get(`/api/v1/message/message/get-user?receiver_id=${receiverId}`);
|
|
10
|
-
return res;
|
|
11
|
-
};
|
|
12
|
-
export const getDetailUser = async (id) => {
|
|
13
|
-
if (!id)
|
|
14
|
-
return null;
|
|
15
|
-
const res = await axios.get(`/api/v1/message/message/user-detail?id=${id}`);
|
|
16
|
-
return res;
|
|
17
|
-
};
|
|
18
|
-
export const readMessages = async (conversationId) => {
|
|
19
|
-
if (!conversationId)
|
|
20
|
-
return;
|
|
21
|
-
return axios.post(`/api/v1/message/message/mark-as-read?conversation_id=${conversationId}`);
|
|
22
|
-
};
|
|
23
|
-
export const sendMessage = async (body) => {
|
|
24
|
-
const res = await axios.post('/api/v1/message/message/send-message', body, {
|
|
25
|
-
headers: {
|
|
26
|
-
'Content-Type': 'multipart/form-data'
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return res;
|
|
30
|
-
};
|
|
31
|
-
export const getCountUnread = async (params) => {
|
|
32
|
-
const res = await axios.get('/api/v1/message/message/unread-count', { params });
|
|
33
|
-
return res;
|
|
34
|
-
};
|
|
35
|
-
export const upLoadImage = async (body) => {
|
|
36
|
-
const res = await axios.post('/api/v1/general/storage/upload', body, {
|
|
37
|
-
headers: {
|
|
38
|
-
'Content-Type': 'multipart/form-data'
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return res;
|
|
42
|
-
};
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import type { IResUser } from '../../types/message';
|
|
2
|
-
import type { GetCustomerHistoryResponse } from '../../types/chat/user';
|
|
3
|
-
export declare const user: import("vue").Ref<{
|
|
4
|
-
id: string;
|
|
5
|
-
username: string;
|
|
6
|
-
phone: string;
|
|
7
|
-
avatar: string | null;
|
|
8
|
-
tenant_id: string | null;
|
|
9
|
-
conversation_id: number;
|
|
10
|
-
color: string;
|
|
11
|
-
status: number;
|
|
12
|
-
last_offline_at: string;
|
|
13
|
-
} | null, IResUser | {
|
|
14
|
-
id: string;
|
|
15
|
-
username: string;
|
|
16
|
-
phone: string;
|
|
17
|
-
avatar: string | null;
|
|
18
|
-
tenant_id: string | null;
|
|
19
|
-
conversation_id: number;
|
|
20
|
-
color: string;
|
|
21
|
-
status: number;
|
|
22
|
-
last_offline_at: string;
|
|
23
|
-
} | null>;
|
|
24
|
-
export declare const userHistory: import("vue").Ref<{
|
|
25
|
-
checkin: {
|
|
26
|
-
id: number;
|
|
27
|
-
created_at: string;
|
|
28
|
-
status: string;
|
|
29
|
-
point_bonus: number;
|
|
30
|
-
}[];
|
|
31
|
-
order: {
|
|
32
|
-
id: number;
|
|
33
|
-
created_at: string;
|
|
34
|
-
tip: any;
|
|
35
|
-
customer_id: number;
|
|
36
|
-
customer_name: string;
|
|
37
|
-
customer_phone: string;
|
|
38
|
-
customer_email: any;
|
|
39
|
-
customer_address: any;
|
|
40
|
-
payment_method: any;
|
|
41
|
-
currency: any;
|
|
42
|
-
start_time: any;
|
|
43
|
-
expected_end_time: any;
|
|
44
|
-
end_time: any;
|
|
45
|
-
picked_up_time: any;
|
|
46
|
-
promotion_code: any;
|
|
47
|
-
total_before_discount: number;
|
|
48
|
-
total_after_discount: number;
|
|
49
|
-
employee_id: any;
|
|
50
|
-
employee_name: any;
|
|
51
|
-
type: string;
|
|
52
|
-
note: any;
|
|
53
|
-
owner_note: any;
|
|
54
|
-
order_status: number;
|
|
55
|
-
status: number;
|
|
56
|
-
updated_at: string;
|
|
57
|
-
cancel_reason: any;
|
|
58
|
-
delivered_time: any;
|
|
59
|
-
completed_time: any;
|
|
60
|
-
order_code: string;
|
|
61
|
-
checkin_id: any;
|
|
62
|
-
total_change: number;
|
|
63
|
-
tax: number;
|
|
64
|
-
is_waiting: number;
|
|
65
|
-
is_recheck: number;
|
|
66
|
-
gift_card_price: number;
|
|
67
|
-
pax_standalone_active: any;
|
|
68
|
-
ach_payment_active: any;
|
|
69
|
-
ach_payment_data: any;
|
|
70
|
-
total_cash_discount: number;
|
|
71
|
-
is_tip_on_device: number;
|
|
72
|
-
tip_by_credit_card: number;
|
|
73
|
-
service_fee: number;
|
|
74
|
-
external_credit_card: number;
|
|
75
|
-
qr_code: string;
|
|
76
|
-
in_service: number;
|
|
77
|
-
attachment: any;
|
|
78
|
-
}[];
|
|
79
|
-
appointment: {
|
|
80
|
-
id: number;
|
|
81
|
-
created_at: string;
|
|
82
|
-
services: any;
|
|
83
|
-
status: string;
|
|
84
|
-
start_time: string;
|
|
85
|
-
end_time_expected: string;
|
|
86
|
-
note: string;
|
|
87
|
-
extra_data: string;
|
|
88
|
-
}[];
|
|
89
|
-
cashback: {
|
|
90
|
-
id: number;
|
|
91
|
-
customer_id: number;
|
|
92
|
-
type: string;
|
|
93
|
-
old_cashback: number;
|
|
94
|
-
change: number;
|
|
95
|
-
new_cashback: number;
|
|
96
|
-
description: string;
|
|
97
|
-
data: any;
|
|
98
|
-
created_at: string;
|
|
99
|
-
updated_at: string;
|
|
100
|
-
}[];
|
|
101
|
-
full_name: string;
|
|
102
|
-
lifetime_point: number;
|
|
103
|
-
total_appointment: number;
|
|
104
|
-
total_money: number;
|
|
105
|
-
visit_count: number;
|
|
106
|
-
} | null, GetCustomerHistoryResponse | {
|
|
107
|
-
checkin: {
|
|
108
|
-
id: number;
|
|
109
|
-
created_at: string;
|
|
110
|
-
status: string;
|
|
111
|
-
point_bonus: number;
|
|
112
|
-
}[];
|
|
113
|
-
order: {
|
|
114
|
-
id: number;
|
|
115
|
-
created_at: string;
|
|
116
|
-
tip: any;
|
|
117
|
-
customer_id: number;
|
|
118
|
-
customer_name: string;
|
|
119
|
-
customer_phone: string;
|
|
120
|
-
customer_email: any;
|
|
121
|
-
customer_address: any;
|
|
122
|
-
payment_method: any;
|
|
123
|
-
currency: any;
|
|
124
|
-
start_time: any;
|
|
125
|
-
expected_end_time: any;
|
|
126
|
-
end_time: any;
|
|
127
|
-
picked_up_time: any;
|
|
128
|
-
promotion_code: any;
|
|
129
|
-
total_before_discount: number;
|
|
130
|
-
total_after_discount: number;
|
|
131
|
-
employee_id: any;
|
|
132
|
-
employee_name: any;
|
|
133
|
-
type: string;
|
|
134
|
-
note: any;
|
|
135
|
-
owner_note: any;
|
|
136
|
-
order_status: number;
|
|
137
|
-
status: number;
|
|
138
|
-
updated_at: string;
|
|
139
|
-
cancel_reason: any;
|
|
140
|
-
delivered_time: any;
|
|
141
|
-
completed_time: any;
|
|
142
|
-
order_code: string;
|
|
143
|
-
checkin_id: any;
|
|
144
|
-
total_change: number;
|
|
145
|
-
tax: number;
|
|
146
|
-
is_waiting: number;
|
|
147
|
-
is_recheck: number;
|
|
148
|
-
gift_card_price: number;
|
|
149
|
-
pax_standalone_active: any;
|
|
150
|
-
ach_payment_active: any;
|
|
151
|
-
ach_payment_data: any;
|
|
152
|
-
total_cash_discount: number;
|
|
153
|
-
is_tip_on_device: number;
|
|
154
|
-
tip_by_credit_card: number;
|
|
155
|
-
service_fee: number;
|
|
156
|
-
external_credit_card: number;
|
|
157
|
-
qr_code: string;
|
|
158
|
-
in_service: number;
|
|
159
|
-
attachment: any;
|
|
160
|
-
}[];
|
|
161
|
-
appointment: {
|
|
162
|
-
id: number;
|
|
163
|
-
created_at: string;
|
|
164
|
-
services: any;
|
|
165
|
-
status: string;
|
|
166
|
-
start_time: string;
|
|
167
|
-
end_time_expected: string;
|
|
168
|
-
note: string;
|
|
169
|
-
extra_data: string;
|
|
170
|
-
}[];
|
|
171
|
-
cashback: {
|
|
172
|
-
id: number;
|
|
173
|
-
customer_id: number;
|
|
174
|
-
type: string;
|
|
175
|
-
old_cashback: number;
|
|
176
|
-
change: number;
|
|
177
|
-
new_cashback: number;
|
|
178
|
-
description: string;
|
|
179
|
-
data: any;
|
|
180
|
-
created_at: string;
|
|
181
|
-
updated_at: string;
|
|
182
|
-
}[];
|
|
183
|
-
full_name: string;
|
|
184
|
-
lifetime_point: number;
|
|
185
|
-
total_appointment: number;
|
|
186
|
-
total_money: number;
|
|
187
|
-
visit_count: number;
|
|
188
|
-
} | null>;
|
|
189
|
-
export declare const getUserHistory: (phone: string) => Promise<GetCustomerHistoryResponse>;
|
|
190
|
-
export declare function getItemsByYear<T = any>(data: any, key?: string): {
|
|
191
|
-
year: string;
|
|
192
|
-
items: T[];
|
|
193
|
-
}[];
|
package/dist/utils/chat/user.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue';
|
|
2
|
-
import axios from '../../plugins/axios-gci';
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
export const user = ref(null);
|
|
5
|
-
export const userHistory = ref(null);
|
|
6
|
-
export const getUserHistory = async (phone) => {
|
|
7
|
-
const res = await axios.get(`/v1/pos/customer/site/history?phone=${phone}`);
|
|
8
|
-
return res;
|
|
9
|
-
};
|
|
10
|
-
export function getItemsByYear(data, key = 'created_at') {
|
|
11
|
-
let result = [];
|
|
12
|
-
if (data?.length) {
|
|
13
|
-
let curYear = dayjs(data[0][key]).format("YYYY");
|
|
14
|
-
let items = [];
|
|
15
|
-
for (let i = 0; i < data.length; i++) {
|
|
16
|
-
items.push(data[i]);
|
|
17
|
-
let nextItemYear = data[i + 1] ? dayjs(data[i + 1][key]).format("YYYY") : curYear;
|
|
18
|
-
if (nextItemYear != curYear) {
|
|
19
|
-
result.push({
|
|
20
|
-
year: curYear,
|
|
21
|
-
items: [...items]
|
|
22
|
-
});
|
|
23
|
-
curYear = nextItemYear;
|
|
24
|
-
items = [];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
result.push({
|
|
28
|
-
year: curYear,
|
|
29
|
-
items: [...items]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}
|
package/dist/utils/debounce.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDebounce: <T extends (...args: any[]) => void>(func: T, wait?: number) => ((...args: Parameters<T>) => void);
|
package/dist/utils/debounce.js
DELETED
package/dist/utils/json.d.ts
DELETED
package/dist/utils/json.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const isJsonString = (str) => {
|
|
2
|
-
try {
|
|
3
|
-
JSON.parse(str);
|
|
4
|
-
}
|
|
5
|
-
catch (e) {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
return true;
|
|
9
|
-
};
|
|
10
|
-
export const tryParseJson = (data) => {
|
|
11
|
-
try {
|
|
12
|
-
const result = JSON.parse(data);
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
return data;
|
|
17
|
-
}
|
|
18
|
-
};
|
package/dist/utils/logger.d.ts
DELETED
package/dist/utils/logger.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const phoneNumberFormat: (phone: string, halfShowType?: number) => string;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const phoneNumberFormat = (phone, halfShowType = 1) => {
|
|
2
|
-
let number = (("" + phone) || '').replace(/[^\d*]/g, "");
|
|
3
|
-
if (number.length > 10) {
|
|
4
|
-
number = number.substring(number.length - 10);
|
|
5
|
-
}
|
|
6
|
-
if (number.length == 10) {
|
|
7
|
-
if (true) {
|
|
8
|
-
if (halfShowType == 4) {
|
|
9
|
-
number = (number || '').replace(/(\d{3})(\d{3})(\d{4})/, "*** $3");
|
|
10
|
-
}
|
|
11
|
-
if (halfShowType == 3) {
|
|
12
|
-
number = (number || '').replace(/(\d{3})(\d{3})(\d{4})/, "($3)");
|
|
13
|
-
}
|
|
14
|
-
if (halfShowType == 2) {
|
|
15
|
-
number = (number || '').replace(/(\d{3})(\d{3})(\d{4})/, "***-***-$3");
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
number = (number || '').replace(/(\d{3})(\d{3})(\d{4})/, "(***) ***-$3");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
number = (number || '').replace(/(\d{3})(\d{3})(\d{4})/, "($1) $2-$3");
|
|
23
|
-
}
|
|
24
|
-
return number;
|
|
25
|
-
}
|
|
26
|
-
return "";
|
|
27
|
-
};
|