@phonghq/go-chat 1.0.70 → 1.0.72

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.
Files changed (388) hide show
  1. package/dist/go-chat.es.js +11166 -11151
  2. package/dist/go-chat.umd.js +21 -21
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/dist/assets/icons/call/IconClock.vue.d.ts +0 -2
  6. package/dist/assets/icons/call/IconClock.vue.js +0 -22
  7. package/dist/assets/icons/call/IconClose.vue.d.ts +0 -2
  8. package/dist/assets/icons/call/IconClose.vue.js +0 -26
  9. package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
  10. package/dist/assets/icons/call/IconMic.vue.js +0 -123
  11. package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
  12. package/dist/assets/icons/call/IconPhone.vue.js +0 -22
  13. package/dist/assets/icons/call/IconPhoneBase.vue.d.ts +0 -2
  14. package/dist/assets/icons/call/IconPhoneBase.vue.js +0 -20
  15. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -14
  16. package/dist/assets/icons/call/IconPhoneCancel.vue.js +0 -46
  17. package/dist/assets/icons/call/IconSoundDownload.vue.d.ts +0 -2
  18. package/dist/assets/icons/call/IconSoundDownload.vue.js +0 -50
  19. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
  20. package/dist/assets/icons/call/IconSpeaker.vue.js +0 -62
  21. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
  22. package/dist/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
  23. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
  24. package/dist/assets/icons/customer-detail/IconArrow.vue.js +0 -22
  25. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
  26. package/dist/assets/icons/customer-detail/IconCheck.vue.js +0 -27
  27. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
  28. package/dist/assets/icons/customer-detail/IconDate.vue.js +0 -43
  29. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
  30. package/dist/assets/icons/customer-detail/IconGroup.vue.js +0 -48
  31. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
  32. package/dist/assets/icons/customer-detail/IconMessage.vue.js +0 -28
  33. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
  34. package/dist/assets/icons/customer-detail/IconNote.vue.js +0 -29
  35. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -14
  36. package/dist/assets/icons/customer-detail/IconPhone.vue.js +0 -41
  37. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
  38. package/dist/assets/icons/customer-detail/IconPin.vue.js +0 -29
  39. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
  40. package/dist/assets/icons/customer-detail/IconSearch.vue.js +0 -29
  41. package/dist/assets/icons/global/IconAiCheck.vue.d.ts +0 -2
  42. package/dist/assets/icons/global/IconAiCheck.vue.js +0 -28
  43. package/dist/assets/icons/global/IconArrowLeft.vue.d.ts +0 -2
  44. package/dist/assets/icons/global/IconArrowLeft.vue.js +0 -29
  45. package/dist/assets/icons/global/IconBackspace.vue.d.ts +0 -2
  46. package/dist/assets/icons/global/IconBackspace.vue.js +0 -28
  47. package/dist/assets/icons/global/IconCloseCircle.vue.d.ts +0 -2
  48. package/dist/assets/icons/global/IconCloseCircle.vue.js +0 -36
  49. package/dist/assets/icons/global/IconPhone.vue.d.ts +0 -2
  50. package/dist/assets/icons/global/IconPhone.vue.js +0 -19
  51. package/dist/assets/icons/global/IconPlan.vue.d.ts +0 -14
  52. package/dist/assets/icons/global/IconPlan.vue.js +0 -39
  53. package/dist/assets/icons/global/IconPlus.vue.d.ts +0 -2
  54. package/dist/assets/icons/global/IconPlus.vue.js +0 -22
  55. package/dist/assets/icons/global/IconSearch.vue.d.ts +0 -32
  56. package/dist/assets/icons/global/IconSearch.vue.js +0 -68
  57. package/dist/assets/icons/global/IconSms.vue.d.ts +0 -2
  58. package/dist/assets/icons/global/IconSms.vue.js +0 -22
  59. package/dist/assets/icons/global/IconUser.vue.d.ts +0 -2
  60. package/dist/assets/icons/global/IconUser.vue.js +0 -25
  61. package/dist/chat/App.vue.d.ts +0 -22
  62. package/dist/chat/App.vue.js +0 -1022
  63. package/dist/chat/main.d.ts +0 -7
  64. package/dist/chat/main.js +0 -7
  65. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
  66. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
  67. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
  68. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
  69. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
  70. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -138
  71. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
  72. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +0 -233
  73. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
  74. package/dist/chat/page/customer-detail/SubInformation.vue.js +0 -102
  75. package/dist/chat/page/error/Error.vue.d.ts +0 -2
  76. package/dist/chat/page/error/Error.vue.js +0 -64
  77. package/dist/chat/page/home/ChatList.vue.d.ts +0 -98
  78. package/dist/chat/page/home/ChatList.vue.js +0 -621
  79. package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -21
  80. package/dist/chat/page/home/ChatMessage.vue.js +0 -200
  81. package/dist/chat/page/home/ChatMessageItem.vue.d.ts +0 -19
  82. package/dist/chat/page/home/ChatMessageItem.vue.js +0 -358
  83. package/dist/chat/page/home/ChatMessageItem2.vue.d.ts +0 -19
  84. package/dist/chat/page/home/ChatMessageItem2.vue.js +0 -351
  85. package/dist/chat/page/home/DropZone.vue.d.ts +0 -13
  86. package/dist/chat/page/home/DropZone.vue.js +0 -130
  87. package/dist/chat/page/home/Home.vue.d.ts +0 -25
  88. package/dist/chat/page/home/Home.vue.js +0 -430
  89. package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -14
  90. package/dist/chat/page/home/HomeHeader.vue.js +0 -248
  91. package/dist/chat/page/home/InputChat.vue.d.ts +0 -27
  92. package/dist/chat/page/home/InputChat.vue.js +0 -412
  93. package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -7
  94. package/dist/chat/page/home/NewCustomer.vue.js +0 -81
  95. package/dist/chat/page/home/PhoneNumpad.vue.d.ts +0 -18
  96. package/dist/chat/page/home/PhoneNumpad.vue.js +0 -143
  97. package/dist/chat/page/setting/Setting.vue.d.ts +0 -2
  98. package/dist/chat/page/setting/Setting.vue.js +0 -277
  99. package/dist/chat/page/setting/SettingSuccess.vue.d.ts +0 -2
  100. package/dist/chat/page/setting/SettingSuccess.vue.js +0 -33
  101. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -24
  102. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -207
  103. package/dist/components/chat/call/Calling.vue.d.ts +0 -17
  104. package/dist/components/chat/call/Calling.vue.js +0 -600
  105. package/dist/components/chat/call/TimeLeft.vue.d.ts +0 -5
  106. package/dist/components/chat/call/TimeLeft.vue.js +0 -59
  107. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
  108. package/dist/components/chat/card/CardCustomerDetail.vue.js +0 -28
  109. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
  110. package/dist/components/chat/common/collapse/CollapseBase.vue.js +0 -59
  111. package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
  112. package/dist/components/chat/common/input/InputSearch.vue.js +0 -71
  113. package/dist/components/chat/common/modal/Modal.vue.d.ts +0 -94
  114. package/dist/components/chat/common/modal/Modal.vue.js +0 -260
  115. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
  116. package/dist/components/chat/common/popover/PopoverBase.vue.js +0 -148
  117. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -10
  118. package/dist/components/chat/common/spin/BaseSpin.vue.js +0 -43
  119. package/dist/components/chat/common/switch/SwitchBase.vue.d.ts +0 -17
  120. package/dist/components/chat/common/switch/SwitchBase.vue.js +0 -76
  121. package/dist/components/chat/common/tab/TabBase.vue.d.ts +0 -30
  122. package/dist/components/chat/common/tab/TabBase.vue.js +0 -86
  123. package/dist/components/chat/common/tabs/TabBase.vue.d.ts +0 -18
  124. package/dist/components/chat/common/tabs/TabBase.vue.js +0 -93
  125. package/dist/components/chat/customer/Avatar.vue.d.ts +0 -12
  126. package/dist/components/chat/customer/Avatar.vue.js +0 -127
  127. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
  128. package/dist/components/chat/layout/mobile/Footer.vue.js +0 -114
  129. package/dist/components/chat/select/SelectBase.vue.d.ts +0 -24
  130. package/dist/components/chat/select/SelectBase.vue.js +0 -105
  131. package/dist/components/common/CustomLoading.vue.d.ts +0 -2
  132. package/dist/components/common/CustomLoading.vue.js +0 -19
  133. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
  134. package/dist/components/common/Notification/NotificationDescription.vue.js +0 -38
  135. package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
  136. package/dist/components/common/button/ButtonBase.vue.js +0 -78
  137. package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
  138. package/dist/components/common/button/ButtonToggle.vue.js +0 -70
  139. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
  140. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
  141. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
  142. package/dist/components/common/collapse/BaseCollapse.vue.js +0 -36
  143. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
  144. package/dist/components/common/collapse/BaseCollapseItem.vue.js +0 -22
  145. package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
  146. package/dist/components/common/drawer/DrawerBase.vue.js +0 -126
  147. package/dist/components/common/drawer/DrawerBaseCustom.vue.d.ts +0 -33
  148. package/dist/components/common/drawer/DrawerBaseCustom.vue.js +0 -135
  149. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
  150. package/dist/components/common/dropdown/DropdownBase.vue.js +0 -91
  151. package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
  152. package/dist/components/common/input/CInputSearch.vue.js +0 -62
  153. package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
  154. package/dist/components/common/modal/ModalBase.vue.js +0 -187
  155. package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
  156. package/dist/components/common/popover/PopoverBase.vue.js +0 -36
  157. package/dist/components/common/select/SelectBase.vue.d.ts +0 -28
  158. package/dist/components/common/select/SelectBase.vue.js +0 -102
  159. package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
  160. package/dist/components/common/slider/BaseSlider.vue.js +0 -70
  161. package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
  162. package/dist/components/common/spin/CSpin.vue.js +0 -41
  163. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
  164. package/dist/components/common/tooltip/TooltipBase.vue.js +0 -8
  165. package/dist/components/layout/PageError.vue.d.ts +0 -2
  166. package/dist/components/layout/PageError.vue.js +0 -91
  167. package/dist/components/ui/button/CButton.vue.d.ts +0 -19
  168. package/dist/components/ui/button/CButton.vue.js +0 -49
  169. package/dist/components/ui/button/c-button.d.ts +0 -7
  170. package/dist/components/ui/button/c-button.js +0 -26
  171. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
  172. package/dist/components/ui/checkbox/Checkbox.vue.js +0 -79
  173. package/dist/components/ui/checkbox/index.d.ts +0 -1
  174. package/dist/components/ui/checkbox/index.js +0 -1
  175. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
  176. package/dist/components/ui/collapsible/Collapsible.vue.js +0 -47
  177. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
  178. package/dist/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
  179. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
  180. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
  181. package/dist/components/ui/collapsible/index.d.ts +0 -3
  182. package/dist/components/ui/collapsible/index.js +0 -3
  183. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
  184. package/dist/components/ui/dialog/Dialog.vue.js +0 -42
  185. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
  186. package/dist/components/ui/dialog/DialogClose.vue.js +0 -35
  187. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
  188. package/dist/components/ui/dialog/DialogContent.vue.js +0 -84
  189. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
  190. package/dist/components/ui/dialog/DialogDescription.vue.js +0 -43
  191. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
  192. package/dist/components/ui/dialog/DialogFooter.vue.js +0 -26
  193. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
  194. package/dist/components/ui/dialog/DialogHeader.vue.js +0 -26
  195. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
  196. package/dist/components/ui/dialog/DialogScrollContent.vue.js +0 -99
  197. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
  198. package/dist/components/ui/dialog/DialogTitle.vue.js +0 -43
  199. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
  200. package/dist/components/ui/dialog/DialogTrigger.vue.js +0 -35
  201. package/dist/components/ui/dialog/index.d.ts +0 -9
  202. package/dist/components/ui/dialog/index.js +0 -9
  203. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
  204. package/dist/components/ui/drawer/Drawer.vue.js +0 -48
  205. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
  206. package/dist/components/ui/drawer/DrawerContent.vue.js +0 -81
  207. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
  208. package/dist/components/ui/drawer/DrawerDescription.vue.js +0 -42
  209. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
  210. package/dist/components/ui/drawer/DrawerFooter.vue.js +0 -26
  211. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
  212. package/dist/components/ui/drawer/DrawerHeader.vue.js +0 -26
  213. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
  214. package/dist/components/ui/drawer/DrawerOverlay.vue.js +0 -37
  215. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
  216. package/dist/components/ui/drawer/DrawerTitle.vue.js +0 -42
  217. package/dist/components/ui/drawer/index.d.ts +0 -8
  218. package/dist/components/ui/drawer/index.js +0 -8
  219. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
  220. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
  221. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
  222. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
  223. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
  224. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
  225. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
  226. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
  227. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
  228. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
  229. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
  230. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
  231. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
  232. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
  233. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
  234. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
  235. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
  236. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
  237. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
  238. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
  239. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
  240. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
  241. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
  242. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
  243. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
  244. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
  245. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
  246. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
  247. package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
  248. package/dist/components/ui/dropdown-menu/index.js +0 -15
  249. package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
  250. package/dist/components/ui/popover/Popover.vue.js +0 -41
  251. package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
  252. package/dist/components/ui/popover/PopoverContent.vue.js +0 -60
  253. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
  254. package/dist/components/ui/popover/PopoverTrigger.vue.js +0 -35
  255. package/dist/components/ui/popover/index.d.ts +0 -3
  256. package/dist/components/ui/popover/index.js +0 -3
  257. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
  258. package/dist/components/ui/radio-group/RadioGroup.vue.js +0 -46
  259. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
  260. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
  261. package/dist/components/ui/radio-group/index.d.ts +0 -2
  262. package/dist/components/ui/radio-group/index.js +0 -2
  263. package/dist/components/ui/select/Select.vue.d.ts +0 -20
  264. package/dist/components/ui/select/Select.vue.js +0 -49
  265. package/dist/components/ui/select/SelectContent.vue.d.ts +0 -24
  266. package/dist/components/ui/select/SelectContent.vue.js +0 -98
  267. package/dist/components/ui/select/SelectGroup.vue.d.ts +0 -10
  268. package/dist/components/ui/select/SelectGroup.vue.js +0 -37
  269. package/dist/components/ui/select/SelectItem.vue.d.ts +0 -18
  270. package/dist/components/ui/select/SelectItem.vue.js +0 -73
  271. package/dist/components/ui/select/SelectItemText.vue.d.ts +0 -10
  272. package/dist/components/ui/select/SelectItemText.vue.js +0 -37
  273. package/dist/components/ui/select/SelectLabel.vue.d.ts +0 -14
  274. package/dist/components/ui/select/SelectLabel.vue.js +0 -40
  275. package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +0 -14
  276. package/dist/components/ui/select/SelectScrollDownButton.vue.js +0 -58
  277. package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +0 -14
  278. package/dist/components/ui/select/SelectScrollUpButton.vue.js +0 -58
  279. package/dist/components/ui/select/SelectSeparator.vue.d.ts +0 -7
  280. package/dist/components/ui/select/SelectSeparator.vue.js +0 -39
  281. package/dist/components/ui/select/SelectTrigger.vue.d.ts +0 -17
  282. package/dist/components/ui/select/SelectTrigger.vue.js +0 -49
  283. package/dist/components/ui/select/SelectValue.vue.d.ts +0 -10
  284. package/dist/components/ui/select/SelectValue.vue.js +0 -37
  285. package/dist/components/ui/select/index.d.ts +0 -11
  286. package/dist/components/ui/select/index.js +0 -11
  287. package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
  288. package/dist/components/ui/slider/Slider.vue.js +0 -155
  289. package/dist/components/ui/slider/index.d.ts +0 -1
  290. package/dist/components/ui/slider/index.js +0 -1
  291. package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
  292. package/dist/components/ui/switch/Switch.vue.js +0 -61
  293. package/dist/components/ui/switch/index.d.ts +0 -1
  294. package/dist/components/ui/switch/index.js +0 -1
  295. package/dist/components/ui/tabs/Tabs.vue.d.ts +0 -20
  296. package/dist/components/ui/tabs/Tabs.vue.js +0 -54
  297. package/dist/components/ui/tabs/TabsContent.vue.d.ts +0 -14
  298. package/dist/components/ui/tabs/TabsContent.vue.js +0 -44
  299. package/dist/components/ui/tabs/TabsList.vue.d.ts +0 -14
  300. package/dist/components/ui/tabs/TabsList.vue.js +0 -44
  301. package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +0 -14
  302. package/dist/components/ui/tabs/TabsTrigger.vue.js +0 -45
  303. package/dist/components/ui/tabs/index.d.ts +0 -4
  304. package/dist/components/ui/tabs/index.js +0 -4
  305. package/dist/composable/useDigibot.d.ts +0 -7
  306. package/dist/composable/useDigibot.js +0 -23
  307. package/dist/composable/useInitData.d.ts +0 -12
  308. package/dist/composable/useInitData.js +0 -99
  309. package/dist/composable/useListConversations.d.ts +0 -55
  310. package/dist/composable/useListConversations.js +0 -209
  311. package/dist/composable/useListentEvent.d.ts +0 -5
  312. package/dist/composable/useListentEvent.js +0 -51
  313. package/dist/composable/usePlivo.d.ts +0 -17
  314. package/dist/composable/usePlivo.js +0 -207
  315. package/dist/constant/color.d.ts +0 -22
  316. package/dist/constant/color.js +0 -47
  317. package/dist/constant/datetime.d.ts +0 -6
  318. package/dist/constant/datetime.js +0 -6
  319. package/dist/constant/general.d.ts +0 -11
  320. package/dist/constant/general.js +0 -12
  321. package/dist/constant/message.d.ts +0 -8
  322. package/dist/constant/message.js +0 -8
  323. package/dist/constant/mqtt.d.ts +0 -7
  324. package/dist/constant/mqtt.js +0 -18
  325. package/dist/constant/user.d.ts +0 -8
  326. package/dist/constant/user.js +0 -9
  327. package/dist/lib/utils.d.ts +0 -2
  328. package/dist/lib/utils.js +0 -5
  329. package/dist/plugins/axios-gci.d.ts +0 -3
  330. package/dist/plugins/axios-gci.js +0 -25
  331. package/dist/plugins/axios.d.ts +0 -3
  332. package/dist/plugins/axios.js +0 -84
  333. package/dist/plugins/mqtt.d.ts +0 -8
  334. package/dist/plugins/mqtt.js +0 -189
  335. package/dist/plugins/pocketbase.d.ts +0 -5
  336. package/dist/plugins/pocketbase.js +0 -15
  337. package/dist/plugins/sdk.d.ts +0 -18
  338. package/dist/plugins/sdk.js +0 -73
  339. package/dist/plugins/websocket.d.ts +0 -15
  340. package/dist/plugins/websocket.js +0 -151
  341. package/dist/types/chat/auth.d.ts +0 -41
  342. package/dist/types/chat/auth.js +0 -1
  343. package/dist/types/chat/call.d.ts +0 -19
  344. package/dist/types/chat/call.js +0 -23
  345. package/dist/types/chat/global.d.ts +0 -32
  346. package/dist/types/chat/global.js +0 -1
  347. package/dist/types/chat/promise.d.ts +0 -17
  348. package/dist/types/chat/promise.js +0 -1
  349. package/dist/types/chat/user.d.ts +0 -88
  350. package/dist/types/chat/user.js +0 -1
  351. package/dist/types/conversation.d.ts +0 -23
  352. package/dist/types/conversation.js +0 -1
  353. package/dist/types/global.d.ts +0 -11
  354. package/dist/types/global.js +0 -15
  355. package/dist/types/message.d.ts +0 -52
  356. package/dist/types/message.js +0 -1
  357. package/dist/utils/chat/cache.d.ts +0 -7
  358. package/dist/utils/chat/cache.js +0 -63
  359. package/dist/utils/chat/chat-router.d.ts +0 -3
  360. package/dist/utils/chat/chat-router.js +0 -8
  361. package/dist/utils/chat/page-error.d.ts +0 -4
  362. package/dist/utils/chat/page-error.js +0 -25
  363. package/dist/utils/chat/phone-string.d.ts +0 -1
  364. package/dist/utils/chat/phone-string.js +0 -4
  365. package/dist/utils/chat/store/auth.d.ts +0 -62
  366. package/dist/utils/chat/store/auth.js +0 -93
  367. package/dist/utils/chat/store/call.d.ts +0 -15
  368. package/dist/utils/chat/store/call.js +0 -160
  369. package/dist/utils/chat/store/conversation.d.ts +0 -13
  370. package/dist/utils/chat/store/conversation.js +0 -69
  371. package/dist/utils/chat/store/message.d.ts +0 -31
  372. package/dist/utils/chat/store/message.js +0 -74
  373. package/dist/utils/chat/store/user.d.ts +0 -200
  374. package/dist/utils/chat/store/user.js +0 -43
  375. package/dist/utils/debounce.d.ts +0 -1
  376. package/dist/utils/debounce.js +0 -9
  377. package/dist/utils/json.d.ts +0 -2
  378. package/dist/utils/json.js +0 -18
  379. package/dist/utils/logger.d.ts +0 -3
  380. package/dist/utils/logger.js +0 -5
  381. package/dist/utils/string-helper.d.ts +0 -2
  382. package/dist/utils/string-helper.js +0 -40
  383. package/dist/views/NotTenantPhone.vue.d.ts +0 -9
  384. package/dist/views/NotTenantPhone.vue.js +0 -99
  385. package/dist/views/home/phone-numpad/ConvercationList.vue.d.ts +0 -18
  386. package/dist/views/home/phone-numpad/ConvercationList.vue.js +0 -174
  387. package/dist/views/home/phone-numpad/PhoneNumpad.vue.d.ts +0 -28
  388. package/dist/views/home/phone-numpad/PhoneNumpad.vue.js +0 -377
@@ -1,88 +0,0 @@
1
- export type GetCustomerHistoryResponse = {
2
- checkin: Checkin[];
3
- order: Order[];
4
- appointment: Appointment[];
5
- cashback: Cashback[];
6
- full_name: string;
7
- lifetime_point: number;
8
- total_appointment: number;
9
- total_money: number;
10
- visit_count: number;
11
- };
12
- export type Checkin = {
13
- id: number;
14
- created_at: string;
15
- status: string;
16
- point_bonus: number;
17
- };
18
- type Order = {
19
- id: number;
20
- created_at: string;
21
- tip: any;
22
- customer_id: number;
23
- customer_name: string;
24
- customer_phone: string;
25
- customer_email: any;
26
- customer_address: any;
27
- payment_method: any;
28
- currency: any;
29
- start_time: any;
30
- expected_end_time: any;
31
- end_time: any;
32
- picked_up_time: any;
33
- promotion_code: any;
34
- total_before_discount: number;
35
- total_after_discount: number;
36
- employee_id: any;
37
- employee_name: any;
38
- type: string;
39
- note: any;
40
- owner_note: any;
41
- order_status: number;
42
- status: number;
43
- updated_at: string;
44
- cancel_reason: any;
45
- delivered_time: any;
46
- completed_time: any;
47
- order_code: string;
48
- checkin_id: any;
49
- total_change: number;
50
- tax: number;
51
- is_waiting: number;
52
- is_recheck: number;
53
- gift_card_price: number;
54
- pax_standalone_active: any;
55
- ach_payment_active: any;
56
- ach_payment_data: any;
57
- total_cash_discount: number;
58
- is_tip_on_device: number;
59
- tip_by_credit_card: number;
60
- service_fee: number;
61
- external_credit_card: number;
62
- qr_code: string;
63
- in_service: number;
64
- attachment: any;
65
- };
66
- export type Appointment = {
67
- id: number;
68
- created_at: string;
69
- services: any;
70
- status: string;
71
- start_time: string;
72
- end_time_expected: string;
73
- note: string;
74
- extra_data: string;
75
- };
76
- type Cashback = {
77
- id: number;
78
- customer_id: number;
79
- type: string;
80
- old_cashback: number;
81
- change: number;
82
- new_cashback: number;
83
- description: string;
84
- data: any;
85
- created_at: string;
86
- updated_at: string;
87
- };
88
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- export type IConversation = {
2
- id: number;
3
- receiver_id: number;
4
- username: string | null;
5
- phone: string;
6
- avatar: string | null;
7
- last_message: string;
8
- last_message_time: string;
9
- created_at: string;
10
- updated_at: string;
11
- unread_count: number;
12
- status: number;
13
- color: string;
14
- is_known: number;
15
- customer_id?: number;
16
- tenant_id?: number;
17
- };
18
- export type IParamGetConversation = {
19
- page?: number;
20
- search?: string;
21
- is_known?: number;
22
- phone?: string;
23
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- export {};
2
- export type DataWithMetaResponse<T> = {
3
- items: T;
4
- _meta: MetaResponse;
5
- };
6
- export type MetaResponse = {
7
- totalCount: number;
8
- pageCount: number;
9
- currentPage: number;
10
- perPage: number;
11
- };
@@ -1,15 +0,0 @@
1
- export {};
2
- // declare global {
3
- // /**
4
- // * Now declare things that go in the global namespace,
5
- // * or augment existing declarations in the global namespace.
6
- // */
7
- // type AddPromise<T = unknown> = T & {
8
- // resolve: Resolve
9
- // reject?: Reject
10
- // }
11
- //
12
- // // PROMISE
13
- // declare type Resolve = typeof ReturnType<Promise.resolve>
14
- // declare type Reject = typeof ReturnType<Promise.reject>
15
- // }
@@ -1,52 +0,0 @@
1
- import { MessageState } from '../constant/message';
2
- export type IResUser = {
3
- id: number;
4
- username: string;
5
- phone: string;
6
- avatar: string | null;
7
- tenant_id: string | null;
8
- color: string;
9
- status: number;
10
- last_offline_at: string;
11
- is_known: number;
12
- };
13
- export type IResMessage = {
14
- id: number | string;
15
- local_id: number | string;
16
- conversation_id: number;
17
- sender_id: number;
18
- receiver_id: number;
19
- message: string | null;
20
- message_uuid?: string | null;
21
- is_call?: number | null;
22
- duration?: number | null;
23
- is_sms: number;
24
- record_url?: string | null;
25
- call_status?: string | null;
26
- created_at: string;
27
- attachments: IAttachment[];
28
- state?: MessageStateType;
29
- error?: string;
30
- };
31
- export interface IAttachment {
32
- file_name: string;
33
- file_path: string;
34
- file_local?: Blob;
35
- mime?: string;
36
- size?: number;
37
- }
38
- export type IResUploadImage = {
39
- files: IUploadFile[];
40
- };
41
- export type IUploadFile = {
42
- name: string;
43
- type: string;
44
- size: number;
45
- base_url: string;
46
- path: string;
47
- url: string;
48
- delete_url: string;
49
- error: boolean;
50
- errors: string;
51
- };
52
- export type MessageStateType = typeof MessageState[keyof typeof MessageState];
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export declare function setCache(key: string, data: any, ttlMs?: number): void;
2
- export declare function getCache<T = any>(key: string): {
3
- data: T | null;
4
- needReload?: boolean;
5
- };
6
- export declare function clearCache(key: string): void;
7
- export declare function removeOldestCache(limit: number, prefix: string): void;
@@ -1,63 +0,0 @@
1
- import { dataProfile } from './store/auth';
2
- export function setCache(key, data, ttlMs = 1000) {
3
- if (!dataProfile.value?.id)
4
- return;
5
- const now = Date.now();
6
- const id = dataProfile.value?.id;
7
- const payload = {
8
- timestamp: now,
9
- ttl: ttlMs,
10
- id: id,
11
- data
12
- };
13
- localStorage.setItem(key, JSON.stringify(payload));
14
- }
15
- export function getCache(key) {
16
- if (!dataProfile.value?.id)
17
- return { data: null };
18
- const raw = localStorage.getItem(key);
19
- const id = dataProfile.value?.id;
20
- if (!raw)
21
- return { data: null };
22
- try {
23
- const payload = JSON.parse(raw);
24
- if (!payload.timestamp || !payload.ttl)
25
- return { data: null };
26
- if (!payload?.id || payload?.id != id)
27
- return { data: null };
28
- const isExpired = Date.now() - payload.timestamp > payload.ttl;
29
- return {
30
- data: payload.data,
31
- needReload: isExpired
32
- };
33
- }
34
- catch (e) {
35
- console.warn("Cache parse error:", e);
36
- return { data: null };
37
- }
38
- }
39
- export function clearCache(key) {
40
- localStorage.removeItem(key);
41
- }
42
- export function removeOldestCache(limit, prefix) {
43
- const allKeys = Object.keys(localStorage).filter(k => k.startsWith(prefix));
44
- if (allKeys.length > limit) {
45
- const entries = allKeys.map(k => {
46
- const raw = localStorage.getItem(k);
47
- try {
48
- const parsed = JSON.parse(raw || "{}");
49
- return { key: k, expire: parsed.timestamp || 0 };
50
- }
51
- catch {
52
- return { key: k, expire: 0 };
53
- }
54
- });
55
- entries.sort((a, b) => a.expire - b.expire);
56
- while (entries.length > limit) {
57
- const oldest = entries.shift();
58
- if (oldest) {
59
- localStorage.removeItem(oldest.key);
60
- }
61
- }
62
- }
63
- }
@@ -1,3 +0,0 @@
1
- import { PAGE } from '../../constant/general';
2
- export declare const currentPage: import("vue").Ref<PAGE, PAGE>;
3
- export declare const routerPush: (page: PAGE) => void;
@@ -1,8 +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
- const to_page = beforeEach?.(page) ?? null;
7
- currentPage.value = to_page ?? page;
8
- };
@@ -1,4 +0,0 @@
1
- export declare const goChatError: import("vue").Ref<string, string>;
2
- export declare const mediaPermissionState: import("vue").Ref<"granted" | "denied" | "prompt", "granted" | "denied" | "prompt">;
3
- export declare const handleMedialPermissionError: () => Promise<void>;
4
- export declare const showPageError: (error: string) => void;
@@ -1,25 +0,0 @@
1
- import { ref } from 'vue';
2
- export const goChatError = ref('');
3
- export const mediaPermissionState = ref('granted');
4
- export const handleMedialPermissionError = async () => {
5
- if (navigator.permissions && navigator.permissions.query) {
6
- try {
7
- const result = await navigator.permissions.query({ name: 'microphone' });
8
- if (result.state == 'prompt') {
9
- goChatError.value =
10
- 'Microphone access is needed. Please allow microphone permission to continue.';
11
- }
12
- else if (result.state == 'denied') {
13
- goChatError.value =
14
- 'You have denied microphone access. Please enable microphone permission in your browser to continue the call.';
15
- }
16
- mediaPermissionState.value = result.state;
17
- }
18
- catch (err) {
19
- console.log(err);
20
- }
21
- }
22
- };
23
- export const showPageError = (error) => {
24
- goChatError.value = error;
25
- };
@@ -1 +0,0 @@
1
- export declare const formatPhone10number: (phone: string, dial?: string) => string;
@@ -1,4 +0,0 @@
1
- export const formatPhone10number = (phone, dial = '1') => {
2
- let result = phone.replace(/\D/g, '');
3
- return result?.startsWith(dial) ? result.slice(dial.length) : result;
4
- };
@@ -1,62 +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
- tenant_phone_limit: number;
18
- tenant_phone_forwarding: string;
19
- avatar: string | null;
20
- user_type: "customer" | "tenant";
21
- has_business_tenant_phone?: boolean | undefined;
22
- color: string;
23
- is_sms_active: number;
24
- } | null, IResProfile | {
25
- id: number;
26
- username: string;
27
- tenant_id: string | null;
28
- phone: string;
29
- tenant_phone_limit: number;
30
- tenant_phone_forwarding: string;
31
- avatar: string | null;
32
- user_type: "customer" | "tenant";
33
- has_business_tenant_phone?: boolean | undefined;
34
- color: string;
35
- is_sms_active: number;
36
- } | null>;
37
- export declare const dataLoginLink: import("vue").Ref<{
38
- token: string;
39
- refresh_token: string;
40
- conversation_id: number;
41
- receiver_id: number;
42
- } | null, IResLoginLink | {
43
- token: string;
44
- refresh_token: string;
45
- conversation_id: number;
46
- receiver_id: number;
47
- } | null>;
48
- export declare const setDataLogin: (id: string, token: string, domain: string) => void;
49
- export declare const loginTenant: (body: IBodyLoginTenant) => Promise<any>;
50
- export declare const loginLink: (params: IPramsLoginLink) => Promise<any>;
51
- export declare const getProfile: () => Promise<IResProfile>;
52
- export declare const checkTenantPhoneOnGapInsight: () => Promise<any>;
53
- export declare const submitTenantPhone: (body: {
54
- phone: string;
55
- tenant_id: string;
56
- }) => Promise<any>;
57
- export declare const updateProfile: (body: {
58
- phone: string;
59
- }) => Promise<any>;
60
- export declare const getBusinessInfo: () => Promise<any>;
61
- export declare const logout: () => Promise<void>;
62
- export {};
@@ -1,93 +0,0 @@
1
- import axios from '../../../plugins/axios';
2
- import { gapMiniAppSdk } from '../../../plugins/sdk';
3
- import { ref } from 'vue';
4
- import axios_gci from '../../../plugins/axios-gci';
5
- export const dataProfile = ref(null);
6
- export const dataLoginLink = ref(null);
7
- let dataLogin = {
8
- id: '',
9
- token: '',
10
- domain: ''
11
- };
12
- export const setDataLogin = (id, token, domain) => {
13
- dataLogin = { id, token, domain };
14
- };
15
- export const loginTenant = async (body) => {
16
- const res = await axios.post('/api/v1/message/tenant/login', body);
17
- localStorage.setItem('chat_token', res?.token);
18
- localStorage.setItem('refresh_token', res?.refresh_token);
19
- dataLogin.id = body.tenant_id;
20
- dataLogin.token = res?.token;
21
- dataProfile.value = res;
22
- return res;
23
- };
24
- export const loginLink = async (params) => {
25
- const res = await axios.get('/api/v1/message/tenant/gci-link', { params: params });
26
- localStorage.setItem('chat_token', res?.token);
27
- localStorage.setItem('refresh_token', res?.refresh_token);
28
- dataLogin.id = params.tenant_id;
29
- dataLogin.token = res?.token;
30
- dataLoginLink.value = res;
31
- return res;
32
- };
33
- export const getProfile = async () => {
34
- const res = await axios.get('/api/v1/message/user/me');
35
- localStorage.setItem('chat_user', JSON.stringify(res));
36
- dataProfile.value = res;
37
- // dataProfile.value = Object.fromEntries(
38
- // Object.entries(res).filter(([key]) => !['tenant_phone'].includes(key))
39
- // ) as IResProfile
40
- return res;
41
- };
42
- export const checkTenantPhoneOnGapInsight = async () => {
43
- const id = localStorage.getItem('chat_id');
44
- const res = await axios.get(`/api/v1/message/tenant/get-info?tenant_name=${id}`);
45
- if (res?.error || !res?.data)
46
- throw new Error(res.error);
47
- // if (dataProfile.value) dataProfile.value.tenant_phone = res?.data?.go_chat_phone ?? ''
48
- if (dataProfile.value)
49
- dataProfile.value.tenant_phone_limit = Number(res?.data?.go_chat_phone_limit ?? 0);
50
- if (dataProfile.value)
51
- dataProfile.value.tenant_phone_forwarding = res?.data?.go_chat_phone_forwarding ?? '';
52
- // if (
53
- // dataProfile.value?.phone != dataProfile.value?.tenant_phone &&
54
- // dataProfile.value?.tenant_phone
55
- // ) {
56
- // updateProfile({ phone: dataProfile.value?.tenant_phone })
57
- // }
58
- return res;
59
- };
60
- export const submitTenantPhone = async (body) => {
61
- const res = await axios.post('/api/v1/message/tenant/update-phone', body);
62
- dataLoginLink.value = res;
63
- return res;
64
- };
65
- export const updateProfile = async (body) => {
66
- const res = await axios.post('/api/v1/message/tenant/update', {
67
- ...body,
68
- id: dataProfile.value?.id
69
- });
70
- dataProfile.value = res;
71
- return res;
72
- };
73
- export const getBusinessInfo = async () => {
74
- const res = await axios_gci.get('/v1/pos/business/site/get-info');
75
- return res;
76
- };
77
- export const logout = async () => {
78
- dataLogin = { id: '', token: '', domain: '' };
79
- dataProfile.value = null;
80
- localStorage.removeItem('chat_accessToken');
81
- localStorage.removeItem('chat_domain');
82
- localStorage.removeItem('chat_id');
83
- try {
84
- gapMiniAppSdk?.getInstance()?.closeApp?.();
85
- if (gapMiniAppSdk?.getInstance()?.getBridge()) {
86
- gapMiniAppSdk?.getInstance()?.closeApp();
87
- }
88
- else {
89
- window.location.href = '/login';
90
- }
91
- }
92
- catch (error) { }
93
- };
@@ -1,15 +0,0 @@
1
- import type { IResUser } from '../../../types/message';
2
- export declare const getIceService: () => Promise<import("axios").AxiosResponse<any, any>>;
3
- export declare const callClient: (data: {
4
- call_uuid: string;
5
- clientId: string;
6
- }) => Promise<void>;
7
- export declare const callOutBound: (user: IResUser) => Promise<void>;
8
- export declare const plivoCall: (user: IResUser) => Promise<any>;
9
- export declare const plivoEndCall: (uuid: string) => Promise<void>;
10
- export declare const downloadRecord: (url_pub: string) => Promise<void>;
11
- export declare const getPlivoAccessToken: () => Promise<any>;
12
- export declare const createSipAccount: (data: {
13
- did_number: string;
14
- sip_username: string;
15
- }) => Promise<any>;
@@ -1,160 +0,0 @@
1
- import axios from '../../../plugins/axios';
2
- import { dataProfile } from './auth';
3
- import { showPageError } from '../page-error';
4
- const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
5
- // const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
6
- // const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
7
- export const getIceService = async () => {
8
- const res = await axios.post('/api/v1/message/call/ice-servers', {
9
- key_id: '3dc07e93f89e44ef5d5ff98c91edb520',
10
- api_token: 'c0a60a3d2b0f490b2c99fd7ff095ed1218fd7eda55c80c8b70efc9e0b8dfcd85'
11
- }, {
12
- token: '3VbvrMLtH6b0b9vBe0mhJz9G9NKyATiL'
13
- });
14
- return res;
15
- };
16
- // export const callClient = async (body: IResCall): Promise<any> => {
17
- // const res = await axios.post('/call/answer', body, {
18
- // })
19
- // return res
20
- // }
21
- export const callClient = async (data) => {
22
- const url = BARE_WEBSOCKET_URL + '/ws/answer';
23
- try {
24
- const response = await fetch(url, {
25
- method: 'POST',
26
- body: JSON.stringify(data),
27
- headers: {
28
- ['Content-Type']: 'application/json'
29
- }
30
- });
31
- if (!response.ok) {
32
- throw new Error(`Response status: ${response.status}`);
33
- }
34
- const result = await response.json();
35
- console.log(result);
36
- }
37
- catch (error) {
38
- console.error(error.message);
39
- }
40
- };
41
- export const callOutBound = async (user) => {
42
- const url = BARE_WEBSOCKET_URL + '/call/outbound';
43
- try {
44
- const response = await fetch(url, {
45
- method: 'POST',
46
- body: JSON.stringify({
47
- from: dataProfile.value?.phone,
48
- to: user?.phone ?? ''
49
- }),
50
- headers: {
51
- ['Content-Type']: 'application/json'
52
- }
53
- });
54
- if (!response.ok) {
55
- throw new Error(`Response status: ${response.status}`);
56
- }
57
- const result = await response.json();
58
- console.log(result);
59
- }
60
- catch (error) {
61
- console.error(error.message);
62
- }
63
- };
64
- export const plivoCall = async (user) => {
65
- const url = BARE_WEBSOCKET_URL + '/ws/call';
66
- const response = await fetch(url, {
67
- method: 'POST',
68
- body: JSON.stringify({
69
- // from: '18668259612' || dataProfile.value?.phone,
70
- from: '18668259612' || dataProfile.value?.phone,
71
- to: user?.phone || '',
72
- // clientId: dataProfile.value?.tenant_id
73
- }),
74
- headers: {
75
- ['Content-Type']: 'application/json'
76
- }
77
- });
78
- if (!response.ok) {
79
- throw new Error(`Response status: ${response.status}`);
80
- }
81
- const result = await response.json();
82
- return result;
83
- };
84
- export const plivoEndCall = async (uuid) => {
85
- const url = BARE_WEBSOCKET_URL + '/ws/end-call';
86
- const response = await fetch(url, {
87
- method: 'POST',
88
- body: JSON.stringify({
89
- call_uuid: uuid
90
- }),
91
- headers: {
92
- ['Content-Type']: 'application/json'
93
- }
94
- });
95
- if (!response.ok) {
96
- throw new Error(`Response status: ${response.status}`);
97
- }
98
- const result = await response.json();
99
- console.log(result);
100
- };
101
- export const downloadRecord = async (url_pub) => {
102
- const url = BARE_WEBSOCKET_URL + '/ws/download-record';
103
- const response = await fetch(url, {
104
- method: 'POST',
105
- body: JSON.stringify({
106
- url: url_pub
107
- }),
108
- headers: {
109
- ['Content-Type']: 'application/json'
110
- }
111
- });
112
- if (!response.ok) {
113
- throw new Error(`Response status: ${response.status}`);
114
- }
115
- const blob = await response.blob();
116
- const url_blob = window.URL.createObjectURL(blob);
117
- const a = document.createElement("a");
118
- a.href = url_blob;
119
- a.download = "recording.mp3";
120
- a.click();
121
- a.remove();
122
- };
123
- export const getPlivoAccessToken = async () => {
124
- const url = BARE_WEBSOCKET_URL + '/ws/generate-token';
125
- const response = await fetch(url, {
126
- method: 'POST',
127
- body: JSON.stringify({
128
- // clientId: dataProfile.value?.tenant_id,
129
- username: dataProfile.value?.id?.toString()
130
- }),
131
- headers: {
132
- ['Content-Type']: 'application/json'
133
- }
134
- });
135
- if (!response.ok) {
136
- throw new Error(`Response status: ${response.status}`);
137
- }
138
- const result = await response.json();
139
- return result?.accessToken;
140
- };
141
- export const createSipAccount = async (data) => {
142
- try {
143
- const url = BARE_WEBSOCKET_URL + '/ws/create-sip-account';
144
- const response = await fetch(url, {
145
- method: 'POST',
146
- body: JSON.stringify(data),
147
- headers: {
148
- ['Content-Type']: 'application/json'
149
- }
150
- });
151
- if (!response.ok) {
152
- throw new Error(`Response status: ${response.status}`);
153
- }
154
- const result = await response.json();
155
- return result;
156
- }
157
- catch (e) {
158
- showPageError('We’re having trouble connecting the call. Please try again in a moment');
159
- }
160
- };
@@ -1,13 +0,0 @@
1
- import type { IConversation, IParamGetConversation } from '../../../types/conversation';
2
- import type { DataWithMetaResponse } from '../../../types/global';
3
- import type { IResUser } from '../../../types/message';
4
- export declare const getConversation: (param: IParamGetConversation) => Promise<DataWithMetaResponse<IConversation[]>>;
5
- export declare const getConversationView: (id: any) => Promise<IConversation>;
6
- export declare const publicTopicConversationUpdate: (data: {
7
- infoUser: IResUser | null;
8
- isSendImg?: boolean;
9
- message?: string;
10
- isCall?: string;
11
- is_known: number;
12
- conversation_id: number;
13
- }) => Promise<void>;