@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.
Files changed (284) hide show
  1. package/dist/go-chat.es.js +6578 -6530
  2. package/dist/go-chat.umd.js +14 -14
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/dist/assets/icons/IconArrowLeft.vue.d.ts +0 -2
  6. package/dist/assets/icons/IconArrowLeft.vue.js +0 -29
  7. package/dist/assets/icons/IconPhone.vue.d.ts +0 -2
  8. package/dist/assets/icons/IconPhone.vue.js +0 -19
  9. package/dist/assets/icons/IconPlan.vue.d.ts +0 -2
  10. package/dist/assets/icons/IconPlan.vue.js +0 -19
  11. package/dist/assets/icons/IconPlus.vue.d.ts +0 -2
  12. package/dist/assets/icons/IconPlus.vue.js +0 -22
  13. package/dist/assets/icons/IconSearch.vue.d.ts +0 -32
  14. package/dist/assets/icons/IconSearch.vue.js +0 -68
  15. package/dist/assets/icons/call/IconMic.vue.d.ts +0 -14
  16. package/dist/assets/icons/call/IconMic.vue.js +0 -123
  17. package/dist/assets/icons/call/IconPhone.vue.d.ts +0 -2
  18. package/dist/assets/icons/call/IconPhone.vue.js +0 -35
  19. package/dist/assets/icons/call/IconPhoneCancel.vue.d.ts +0 -2
  20. package/dist/assets/icons/call/IconPhoneCancel.vue.js +0 -35
  21. package/dist/assets/icons/call/IconSpeaker.vue.d.ts +0 -14
  22. package/dist/assets/icons/call/IconSpeaker.vue.js +0 -62
  23. package/dist/assets/icons/customer-appointment/IconFilter.vue.d.ts +0 -2
  24. package/dist/assets/icons/customer-appointment/IconFilter.vue.js +0 -53
  25. package/dist/assets/icons/customer-detail/IconArrow.vue.d.ts +0 -2
  26. package/dist/assets/icons/customer-detail/IconArrow.vue.js +0 -22
  27. package/dist/assets/icons/customer-detail/IconCheck.vue.d.ts +0 -2
  28. package/dist/assets/icons/customer-detail/IconCheck.vue.js +0 -27
  29. package/dist/assets/icons/customer-detail/IconDate.vue.d.ts +0 -2
  30. package/dist/assets/icons/customer-detail/IconDate.vue.js +0 -43
  31. package/dist/assets/icons/customer-detail/IconGroup.vue.d.ts +0 -2
  32. package/dist/assets/icons/customer-detail/IconGroup.vue.js +0 -48
  33. package/dist/assets/icons/customer-detail/IconMessage.vue.d.ts +0 -2
  34. package/dist/assets/icons/customer-detail/IconMessage.vue.js +0 -28
  35. package/dist/assets/icons/customer-detail/IconNote.vue.d.ts +0 -2
  36. package/dist/assets/icons/customer-detail/IconNote.vue.js +0 -29
  37. package/dist/assets/icons/customer-detail/IconPhone.vue.d.ts +0 -2
  38. package/dist/assets/icons/customer-detail/IconPhone.vue.js +0 -21
  39. package/dist/assets/icons/customer-detail/IconPin.vue.d.ts +0 -2
  40. package/dist/assets/icons/customer-detail/IconPin.vue.js +0 -29
  41. package/dist/assets/icons/customer-detail/IconSearch.vue.d.ts +0 -2
  42. package/dist/assets/icons/customer-detail/IconSearch.vue.js +0 -29
  43. package/dist/chat/App.vue.d.ts +0 -5
  44. package/dist/chat/App.vue.js +0 -502
  45. package/dist/chat/main.d.ts +0 -3
  46. package/dist/chat/main.js +0 -2
  47. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.d.ts +0 -2
  48. package/dist/chat/page/customer-appointment/CustomerAppointment.vue.js +0 -207
  49. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.d.ts +0 -12
  50. package/dist/chat/page/customer-check-in/CollapseCheckIn.vue.js +0 -80
  51. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.d.ts +0 -2
  52. package/dist/chat/page/customer-check-in/CustomerCheckIn.vue.js +0 -136
  53. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +0 -7
  54. package/dist/chat/page/customer-detail/CustomerDetail.vue.js +0 -235
  55. package/dist/chat/page/customer-detail/SubInformation.vue.d.ts +0 -16
  56. package/dist/chat/page/customer-detail/SubInformation.vue.js +0 -102
  57. package/dist/chat/page/error/Error.vue.d.ts +0 -2
  58. package/dist/chat/page/error/Error.vue.js +0 -64
  59. package/dist/chat/page/home/ChatList.vue.d.ts +0 -20
  60. package/dist/chat/page/home/ChatList.vue.js +0 -380
  61. package/dist/chat/page/home/ChatMessage.vue.d.ts +0 -16
  62. package/dist/chat/page/home/ChatMessage.vue.js +0 -271
  63. package/dist/chat/page/home/Home.vue.d.ts +0 -14
  64. package/dist/chat/page/home/Home.vue.js +0 -327
  65. package/dist/chat/page/home/HomeHeader.vue.d.ts +0 -10
  66. package/dist/chat/page/home/HomeHeader.vue.js +0 -122
  67. package/dist/chat/page/home/InputChat.vue.d.ts +0 -19
  68. package/dist/chat/page/home/InputChat.vue.js +0 -226
  69. package/dist/chat/page/home/NewCustomer.vue.d.ts +0 -6
  70. package/dist/chat/page/home/NewCustomer.vue.js +0 -82
  71. package/dist/components/ListenEvent.vue.d.ts +0 -2
  72. package/dist/components/ListenEvent.vue.js +0 -45
  73. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +0 -22
  74. package/dist/components/chat/ScrollEvent/ScrollEvent.vue.js +0 -197
  75. package/dist/components/chat/call/Calling.vue.d.ts +0 -7
  76. package/dist/components/chat/call/Calling.vue.js +0 -291
  77. package/dist/components/chat/card/CardCustomerDetail.vue.d.ts +0 -13
  78. package/dist/components/chat/card/CardCustomerDetail.vue.js +0 -28
  79. package/dist/components/chat/common/collapse/CollapseBase.vue.d.ts +0 -20
  80. package/dist/components/chat/common/collapse/CollapseBase.vue.js +0 -59
  81. package/dist/components/chat/common/input/InputSearch.vue.d.ts +0 -16
  82. package/dist/components/chat/common/input/InputSearch.vue.js +0 -71
  83. package/dist/components/chat/common/popover/PopoverBase.vue.d.ts +0 -35
  84. package/dist/components/chat/common/popover/PopoverBase.vue.js +0 -148
  85. package/dist/components/chat/common/spin/BaseSpin.vue.d.ts +0 -2
  86. package/dist/components/chat/common/spin/BaseSpin.vue.js +0 -12
  87. package/dist/components/chat/customer/Avatar.vue.d.ts +0 -11
  88. package/dist/components/chat/customer/Avatar.vue.js +0 -79
  89. package/dist/components/chat/layout/mobile/Footer.vue.d.ts +0 -2
  90. package/dist/components/chat/layout/mobile/Footer.vue.js +0 -109
  91. package/dist/components/common/CustomLoading.vue.d.ts +0 -2
  92. package/dist/components/common/CustomLoading.vue.js +0 -19
  93. package/dist/components/common/Notification/NotificationDescription.vue.d.ts +0 -7
  94. package/dist/components/common/Notification/NotificationDescription.vue.js +0 -38
  95. package/dist/components/common/button/ButtonBase.vue.d.ts +0 -22
  96. package/dist/components/common/button/ButtonBase.vue.js +0 -78
  97. package/dist/components/common/button/ButtonToggle.vue.d.ts +0 -20
  98. package/dist/components/common/button/ButtonToggle.vue.js +0 -70
  99. package/dist/components/common/checkbox/CCheckboxNumber.vue.d.ts +0 -16
  100. package/dist/components/common/checkbox/CCheckboxNumber.vue.js +0 -48
  101. package/dist/components/common/collapse/BaseCollapse.vue.d.ts +0 -12
  102. package/dist/components/common/collapse/BaseCollapse.vue.js +0 -36
  103. package/dist/components/common/collapse/BaseCollapseItem.vue.d.ts +0 -4
  104. package/dist/components/common/collapse/BaseCollapseItem.vue.js +0 -22
  105. package/dist/components/common/drawer/DrawerBase.vue.d.ts +0 -39
  106. package/dist/components/common/drawer/DrawerBase.vue.js +0 -126
  107. package/dist/components/common/dropdown/DropdownBase.vue.d.ts +0 -21
  108. package/dist/components/common/dropdown/DropdownBase.vue.js +0 -91
  109. package/dist/components/common/input/CInputSearch.vue.d.ts +0 -14
  110. package/dist/components/common/input/CInputSearch.vue.js +0 -62
  111. package/dist/components/common/modal/ModalBase.vue.d.ts +0 -35
  112. package/dist/components/common/modal/ModalBase.vue.js +0 -164
  113. package/dist/components/common/popover/PopoverBase.vue.d.ts +0 -3
  114. package/dist/components/common/popover/PopoverBase.vue.js +0 -36
  115. package/dist/components/common/slider/BaseSlider.vue.d.ts +0 -11
  116. package/dist/components/common/slider/BaseSlider.vue.js +0 -70
  117. package/dist/components/common/spin/CSpin.vue.d.ts +0 -9
  118. package/dist/components/common/spin/CSpin.vue.js +0 -41
  119. package/dist/components/common/tooltip/TooltipBase.vue.d.ts +0 -2
  120. package/dist/components/common/tooltip/TooltipBase.vue.js +0 -8
  121. package/dist/components/layout/Blank.vue.d.ts +0 -9
  122. package/dist/components/layout/Blank.vue.js +0 -19
  123. package/dist/components/layout/Default.vue.d.ts +0 -9
  124. package/dist/components/layout/Default.vue.js +0 -21
  125. package/dist/components/modal/Confirm.vue.d.ts +0 -2
  126. package/dist/components/modal/Confirm.vue.js +0 -164
  127. package/dist/components/ui/button/CButton.vue.d.ts +0 -19
  128. package/dist/components/ui/button/CButton.vue.js +0 -49
  129. package/dist/components/ui/button/c-button.d.ts +0 -7
  130. package/dist/components/ui/button/c-button.js +0 -26
  131. package/dist/components/ui/checkbox/Checkbox.vue.d.ts +0 -18
  132. package/dist/components/ui/checkbox/Checkbox.vue.js +0 -79
  133. package/dist/components/ui/checkbox/index.d.ts +0 -1
  134. package/dist/components/ui/checkbox/index.js +0 -1
  135. package/dist/components/ui/collapsible/Collapsible.vue.d.ts +0 -16
  136. package/dist/components/ui/collapsible/Collapsible.vue.js +0 -47
  137. package/dist/components/ui/collapsible/CollapsibleContent.vue.d.ts +0 -10
  138. package/dist/components/ui/collapsible/CollapsibleContent.vue.js +0 -41
  139. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.d.ts +0 -10
  140. package/dist/components/ui/collapsible/CollapsibleTrigger.vue.js +0 -35
  141. package/dist/components/ui/collapsible/index.d.ts +0 -3
  142. package/dist/components/ui/collapsible/index.js +0 -3
  143. package/dist/components/ui/dialog/Dialog.vue.d.ts +0 -14
  144. package/dist/components/ui/dialog/Dialog.vue.js +0 -42
  145. package/dist/components/ui/dialog/DialogClose.vue.d.ts +0 -10
  146. package/dist/components/ui/dialog/DialogClose.vue.js +0 -35
  147. package/dist/components/ui/dialog/DialogContent.vue.d.ts +0 -29
  148. package/dist/components/ui/dialog/DialogContent.vue.js +0 -84
  149. package/dist/components/ui/dialog/DialogDescription.vue.d.ts +0 -14
  150. package/dist/components/ui/dialog/DialogDescription.vue.js +0 -43
  151. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +0 -13
  152. package/dist/components/ui/dialog/DialogFooter.vue.js +0 -26
  153. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +0 -13
  154. package/dist/components/ui/dialog/DialogHeader.vue.js +0 -26
  155. package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +0 -30
  156. package/dist/components/ui/dialog/DialogScrollContent.vue.js +0 -99
  157. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +0 -14
  158. package/dist/components/ui/dialog/DialogTitle.vue.js +0 -43
  159. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +0 -10
  160. package/dist/components/ui/dialog/DialogTrigger.vue.js +0 -35
  161. package/dist/components/ui/dialog/index.d.ts +0 -9
  162. package/dist/components/ui/dialog/index.js +0 -9
  163. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -26
  164. package/dist/components/ui/drawer/Drawer.vue.js +0 -48
  165. package/dist/components/ui/drawer/DrawerContent.vue.d.ts +0 -33
  166. package/dist/components/ui/drawer/DrawerContent.vue.js +0 -81
  167. package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +0 -14
  168. package/dist/components/ui/drawer/DrawerDescription.vue.js +0 -42
  169. package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +0 -13
  170. package/dist/components/ui/drawer/DrawerFooter.vue.js +0 -26
  171. package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +0 -13
  172. package/dist/components/ui/drawer/DrawerHeader.vue.js +0 -26
  173. package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +0 -7
  174. package/dist/components/ui/drawer/DrawerOverlay.vue.js +0 -37
  175. package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +0 -14
  176. package/dist/components/ui/drawer/DrawerTitle.vue.js +0 -42
  177. package/dist/components/ui/drawer/index.d.ts +0 -8
  178. package/dist/components/ui/drawer/index.js +0 -8
  179. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +0 -14
  180. package/dist/components/ui/dropdown-menu/DropdownMenu.vue.js +0 -41
  181. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +0 -20
  182. package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +0 -79
  183. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -28
  184. package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.js +0 -61
  185. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -10
  186. package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -35
  187. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -15
  188. package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.js +0 -43
  189. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -15
  190. package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.js +0 -43
  191. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +0 -14
  192. package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -41
  193. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +0 -18
  194. package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +0 -80
  195. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -7
  196. package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.js +0 -37
  197. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
  198. package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.js +0 -26
  199. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -14
  200. package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -41
  201. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -30
  202. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.js +0 -46
  203. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -14
  204. package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +0 -58
  205. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -10
  206. package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -41
  207. package/dist/components/ui/dropdown-menu/index.d.ts +0 -15
  208. package/dist/components/ui/dropdown-menu/index.js +0 -15
  209. package/dist/components/ui/popover/Popover.vue.d.ts +0 -14
  210. package/dist/components/ui/popover/Popover.vue.js +0 -41
  211. package/dist/components/ui/popover/PopoverContent.vue.d.ts +0 -28
  212. package/dist/components/ui/popover/PopoverContent.vue.js +0 -60
  213. package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +0 -10
  214. package/dist/components/ui/popover/PopoverTrigger.vue.js +0 -35
  215. package/dist/components/ui/popover/index.d.ts +0 -3
  216. package/dist/components/ui/popover/index.js +0 -3
  217. package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +0 -18
  218. package/dist/components/ui/radio-group/RadioGroup.vue.js +0 -46
  219. package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +0 -7
  220. package/dist/components/ui/radio-group/RadioGroupItem.vue.js +0 -71
  221. package/dist/components/ui/radio-group/index.d.ts +0 -2
  222. package/dist/components/ui/radio-group/index.js +0 -2
  223. package/dist/components/ui/slider/Slider.vue.d.ts +0 -13
  224. package/dist/components/ui/slider/Slider.vue.js +0 -155
  225. package/dist/components/ui/slider/index.d.ts +0 -1
  226. package/dist/components/ui/slider/index.js +0 -1
  227. package/dist/components/ui/switch/Switch.vue.d.ts +0 -18
  228. package/dist/components/ui/switch/Switch.vue.js +0 -61
  229. package/dist/components/ui/switch/index.d.ts +0 -1
  230. package/dist/components/ui/switch/index.js +0 -1
  231. package/dist/composable/useCallHelper.d.ts +0 -23
  232. package/dist/composable/useCallHelper.js +0 -170
  233. package/dist/composable/useInitData.d.ts +0 -11
  234. package/dist/composable/useInitData.js +0 -84
  235. package/dist/composable/useModalConfirm.d.ts +0 -5
  236. package/dist/composable/useModalConfirm.js +0 -39
  237. package/dist/constant/color.d.ts +0 -22
  238. package/dist/constant/color.js +0 -43
  239. package/dist/constant/datetime.d.ts +0 -5
  240. package/dist/constant/datetime.js +0 -5
  241. package/dist/constant/general.d.ts +0 -8
  242. package/dist/constant/general.js +0 -9
  243. package/dist/constant/message.d.ts +0 -8
  244. package/dist/constant/message.js +0 -8
  245. package/dist/constant/mqtt.d.ts +0 -4
  246. package/dist/constant/mqtt.js +0 -11
  247. package/dist/constant/user.d.ts +0 -8
  248. package/dist/constant/user.js +0 -9
  249. package/dist/lib/utils.d.ts +0 -2
  250. package/dist/lib/utils.js +0 -5
  251. package/dist/plugins/axios-gci.d.ts +0 -3
  252. package/dist/plugins/axios-gci.js +0 -25
  253. package/dist/plugins/axios.d.ts +0 -3
  254. package/dist/plugins/axios.js +0 -85
  255. package/dist/plugins/mqtt.d.ts +0 -10
  256. package/dist/plugins/mqtt.js +0 -128
  257. package/dist/plugins/sdk.d.ts +0 -19
  258. package/dist/plugins/sdk.js +0 -83
  259. package/dist/plugins/websocket.d.ts +0 -4
  260. package/dist/plugins/websocket.js +0 -65
  261. package/dist/types/chat/user.d.ts +0 -88
  262. package/dist/types/chat/user.js +0 -1
  263. package/dist/types/conversation.d.ts +0 -18
  264. package/dist/types/conversation.js +0 -1
  265. package/dist/utils/chat/auth.d.ts +0 -45
  266. package/dist/utils/chat/auth.js +0 -51
  267. package/dist/utils/chat/call.d.ts +0 -5
  268. package/dist/utils/chat/call.js +0 -61
  269. package/dist/utils/chat/chat-router.d.ts +0 -3
  270. package/dist/utils/chat/chat-router.js +0 -9
  271. package/dist/utils/chat/conversation.d.ts +0 -3
  272. package/dist/utils/chat/conversation.js +0 -7
  273. package/dist/utils/chat/message.d.ts +0 -17
  274. package/dist/utils/chat/message.js +0 -42
  275. package/dist/utils/chat/user.d.ts +0 -193
  276. package/dist/utils/chat/user.js +0 -33
  277. package/dist/utils/debounce.d.ts +0 -1
  278. package/dist/utils/debounce.js +0 -9
  279. package/dist/utils/json.d.ts +0 -2
  280. package/dist/utils/json.js +0 -18
  281. package/dist/utils/logger.d.ts +0 -3
  282. package/dist/utils/logger.js +0 -5
  283. package/dist/utils/string-helper.d.ts +0 -1
  284. package/dist/utils/string-helper.js +0 -27
@@ -1,5 +0,0 @@
1
- export declare const DATE_FORMATS: {
2
- readonly DATE_FORMAT: "YYYY-MM-DD";
3
- readonly DATE_FORMAT_FULL: "YYYY-MM-DD HH:mm:ss";
4
- readonly TIME_12_FORMAT: "hh:mm A";
5
- };
@@ -1,5 +0,0 @@
1
- export const DATE_FORMATS = {
2
- DATE_FORMAT: 'YYYY-MM-DD',
3
- DATE_FORMAT_FULL: 'YYYY-MM-DD HH:mm:ss',
4
- TIME_12_FORMAT: 'hh:mm A'
5
- };
@@ -1,8 +0,0 @@
1
- export declare enum PAGE {
2
- HOME = "home",
3
- CUSTOMER_DETAIL = "customer_detail",
4
- CUSTOMER_CHECK_IN = "customer_check_in",
5
- CUSTOMER_APPOINTMENT = "customer_appointment",
6
- TENANT_ERROR = "tenant_error",
7
- CHAT_LIST = "chat_list"
8
- }
@@ -1,9 +0,0 @@
1
- export var PAGE;
2
- (function (PAGE) {
3
- PAGE["HOME"] = "home";
4
- PAGE["CUSTOMER_DETAIL"] = "customer_detail";
5
- PAGE["CUSTOMER_CHECK_IN"] = "customer_check_in";
6
- PAGE["CUSTOMER_APPOINTMENT"] = "customer_appointment";
7
- PAGE["TENANT_ERROR"] = "tenant_error";
8
- PAGE["CHAT_LIST"] = "chat_list";
9
- })(PAGE || (PAGE = {}));
@@ -1,8 +0,0 @@
1
- export declare const MessageState: {
2
- readonly Sending: "sending";
3
- readonly Sent: "sent";
4
- readonly Read: "read";
5
- readonly Failed: "failed";
6
- readonly Uploading: "uploading";
7
- readonly Uploaded: "uploaded";
8
- };
@@ -1,8 +0,0 @@
1
- export const MessageState = {
2
- Sending: "sending",
3
- Sent: "sent",
4
- Read: "read",
5
- Failed: "failed",
6
- Uploading: "uploading",
7
- Uploaded: "uploaded"
8
- };
@@ -1,4 +0,0 @@
1
- export declare const TOPIC_DETAIL_CHAT = "chat/message/";
2
- export declare const TOPIC_DETAIL_CALL = "call/message/";
3
- export declare const TOPIC_HOME: string[];
4
- export declare const TOPIC_STATUS_USER: string;
@@ -1,11 +0,0 @@
1
- export const TOPIC_DETAIL_CHAT = 'chat/message/';
2
- export const TOPIC_DETAIL_CALL = 'call/message/';
3
- export const TOPIC_HOME = [
4
- 'chat/conversation/update/',
5
- 'chat/conversation/read_message/',
6
- 'chat/conversation/update_list/'
7
- ];
8
- export const TOPIC_STATUS_USER = 'user/status/';
9
- // export CALL_STATE = {
10
- // Offer: 'offer',
11
- // }
@@ -1,8 +0,0 @@
1
- export declare const enum CalendarStatus {
2
- Confirmed = "confirmed",
3
- Scheduled = "scheduled",
4
- Canceled = "canceled",
5
- Done = "done",
6
- Reminder = "reminder",
7
- Waiting = "wait_list"
8
- }
@@ -1,9 +0,0 @@
1
- export var CalendarStatus;
2
- (function (CalendarStatus) {
3
- CalendarStatus["Confirmed"] = "confirmed";
4
- CalendarStatus["Scheduled"] = "scheduled";
5
- CalendarStatus["Canceled"] = "canceled";
6
- CalendarStatus["Done"] = "done";
7
- CalendarStatus["Reminder"] = "reminder";
8
- CalendarStatus["Waiting"] = "wait_list";
9
- })(CalendarStatus || (CalendarStatus = {}));
@@ -1,2 +0,0 @@
1
- import { type ClassValue } from "clsx";
2
- export declare function cn(...inputs: ClassValue[]): string;
package/dist/lib/utils.js DELETED
@@ -1,5 +0,0 @@
1
- import { clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
- export function cn(...inputs) {
4
- return twMerge(clsx(inputs));
5
- }
@@ -1,3 +0,0 @@
1
- declare const instance: import("axios").AxiosInstance;
2
- export declare const setAxiosGciInstance: (token: string, domain: string, id: string) => void;
3
- export default instance;
@@ -1,25 +0,0 @@
1
- import axios from 'axios';
2
- const instance = axios.create({
3
- timeout: 20000,
4
- headers: {
5
- 'Content-Type': 'application/json'
6
- }
7
- });
8
- export const setAxiosGciInstance = (token, domain, id) => {
9
- instance.defaults.headers.common['Authorization'] = `Bearer ${token}`;
10
- instance.defaults.baseURL = domain;
11
- instance.defaults.headers.common['G-ClientID'] = id || '';
12
- };
13
- instance.interceptors.response.use((response) => {
14
- console.log(response);
15
- const data = response?.data;
16
- if (data?.status == 'OK' && data?.result?.status == 'OK' && data?.result?.data) {
17
- return Promise.resolve(data?.result?.data);
18
- }
19
- else {
20
- return Promise.reject(data?.message ?? 'Error');
21
- }
22
- }, async (error) => {
23
- return Promise.reject(error.response?.data || error);
24
- });
25
- export default instance;
@@ -1,3 +0,0 @@
1
- declare const instance: import("axios").AxiosInstance;
2
- export declare const setAxiosInstance: (token: string, domain?: string) => void;
3
- export default instance;
@@ -1,85 +0,0 @@
1
- import axios from 'axios';
2
- const baseURL = 'https://go-chat.dev01.dtsmart.dev/';
3
- // const baseURL = 'http://192.168.1.152:8085/'
4
- const instance = axios.create({
5
- baseURL,
6
- timeout: 20000,
7
- headers: {
8
- 'Content-Type': 'application/json'
9
- }
10
- });
11
- export const setAxiosInstance = (token, domain) => {
12
- instance.defaults.headers.common['Authorization'] = `Bearer ${token}`;
13
- instance.defaults.baseURL = domain || baseURL;
14
- };
15
- instance.interceptors.request.use((config) => {
16
- const token = config?.token || localStorage.getItem('chat_token');
17
- if (token) {
18
- config.headers.Authorization = `Bearer ${token}`;
19
- }
20
- return config;
21
- }, (error) => Promise.reject(error));
22
- let isRefreshing = false;
23
- let failedQueue = [];
24
- const processQueue = (error, token = null) => {
25
- failedQueue.forEach((prom) => {
26
- if (token) {
27
- prom.resolve(token);
28
- }
29
- else {
30
- prom.reject(error);
31
- }
32
- });
33
- failedQueue = [];
34
- };
35
- instance.interceptors.response.use((response) => {
36
- const data = response?.data;
37
- if (data.files) {
38
- return Promise.resolve(data.files);
39
- }
40
- if (data?.status && data?.data) {
41
- return Promise.resolve(data.data);
42
- }
43
- else {
44
- return Promise.reject(data?.messages ?? 'Error');
45
- }
46
- }, async (error) => {
47
- const originalRequest = error.config;
48
- if (error.response?.status === 403 && !originalRequest._retry) {
49
- originalRequest._retry = true;
50
- if (isRefreshing) {
51
- return new Promise((resolve, reject) => {
52
- failedQueue.push({
53
- resolve: (token) => {
54
- originalRequest.headers['Authorization'] = 'Bearer ' + token;
55
- resolve(instance(originalRequest));
56
- },
57
- reject: (err) => reject(err)
58
- });
59
- });
60
- }
61
- isRefreshing = true;
62
- const authStore = null;
63
- try {
64
- const body = {
65
- refresh_token: localStorage.getItem('refresh_token') || ''
66
- };
67
- const res = await authStore.refreshToken(body);
68
- const newToken = res.data.token;
69
- localStorage.setItem('chat_token', newToken);
70
- instance.defaults.headers.common['Authorization'] = 'Bearer ' + newToken;
71
- console.log(newToken, 'asgfasf');
72
- processQueue(null, newToken);
73
- return instance(originalRequest);
74
- }
75
- catch (err) {
76
- processQueue(err, null);
77
- return Promise.reject(err);
78
- }
79
- finally {
80
- isRefreshing = false;
81
- }
82
- }
83
- return Promise.reject(error.response?.data || error);
84
- });
85
- export default instance;
@@ -1,10 +0,0 @@
1
- /// <reference path="../../env.d.ts" />
2
- import mqtt from 'mqtt/dist/mqtt.min';
3
- export declare const connectMqtt: () => Promise<void>;
4
- export declare const disconnectMqtt: () => void;
5
- export declare const subscribeToTopic: (topic: string) => void;
6
- export declare const unsubscribeFromTopic: (topic: string) => void;
7
- export declare const publishMessage: (topic: string, payload: any) => void;
8
- export declare const addHandleMqttMessage: (key: string, topic: string, callBack: any) => void;
9
- export declare const removeHandleMqttMessage: (key: string) => void;
10
- export declare const getMqttInstance: () => mqtt.MqttClient | null;
@@ -1,128 +0,0 @@
1
- import mqtt from 'mqtt/dist/mqtt.min';
2
- const mqttOptions = { qos: 1, retain: false };
3
- // const mqttClient = ref<MqttClient | null>(null)
4
- let mqttClient = null;
5
- const subscribedTopics = new Set();
6
- let dataCallBack = [];
7
- export const connectMqtt = () => {
8
- return new Promise((resolve, reject) => {
9
- console.log(mqttClient);
10
- if (mqttClient && mqttClient?.connected) {
11
- console.log('MQTT already connected');
12
- return resolve();
13
- }
14
- const userInfo = JSON.parse(localStorage.getItem('user') || '{}');
15
- const clientId = userInfo?.id;
16
- const MQTT_OPTIONS = {
17
- clientId: `${clientId}_${Date.now()}_${Math.floor(Math.random() * 1000)}`,
18
- host: 'mqtt-digital-signage.dev01.dtsmart.dev',
19
- port: 443,
20
- protocol: 'wss',
21
- username: 'admin123',
22
- password: 'admin123',
23
- clean: true,
24
- reconnectPeriod: 1000,
25
- path: '/mqtt'
26
- };
27
- const { host, port, path, ...options } = MQTT_OPTIONS;
28
- const connectUrl = `wss://${host}:${port}${path}`;
29
- mqttClient = mqtt.connect(connectUrl, options);
30
- mqttClient?.on('connect', () => {
31
- console.log('MQTT Connected Successfully');
32
- subscribedTopics.forEach((topic) => mqttClient?.subscribe(topic));
33
- mqttClient?.on('message', (topic, message) => {
34
- try {
35
- let data = message;
36
- if (message instanceof Uint8Array) {
37
- const decoder = new TextDecoder('utf-8');
38
- data = JSON.parse(decoder.decode(message));
39
- }
40
- dataCallBack
41
- .filter((e) => e.topic === topic)
42
- .forEach((e) => {
43
- e.callBack(topic, data);
44
- });
45
- }
46
- catch (e) {
47
- console.error('Error parsing message:', e);
48
- }
49
- });
50
- resolve();
51
- });
52
- mqttClient?.on('close', () => {
53
- console.log('MQTT Disconnected');
54
- });
55
- mqttClient?.on('error', (err) => {
56
- console.error('MQTT Error:', err);
57
- reject(err);
58
- });
59
- });
60
- };
61
- export const disconnectMqtt = () => {
62
- if (mqttClient) {
63
- mqttClient?.end(false, {}, () => {
64
- console.log('MQTT Disconnected');
65
- mqttClient = null;
66
- });
67
- }
68
- };
69
- export const subscribeToTopic = (topic) => {
70
- if (subscribedTopics.has(topic)) {
71
- console.log(`Already subscribed to ${topic}`);
72
- return;
73
- }
74
- if (mqttClient?.connected || true) {
75
- mqttClient?.subscribe(topic, mqttOptions, (err) => {
76
- if (!err) {
77
- subscribedTopics.add(topic);
78
- console.log(`Subscribed to ${topic}`);
79
- }
80
- else {
81
- console.error(`Failed to subscribe ${topic}`, err);
82
- }
83
- });
84
- }
85
- };
86
- export const unsubscribeFromTopic = (topic) => {
87
- if (mqttClient?.connected || true) {
88
- mqttClient?.unsubscribe(topic, (err) => {
89
- if (!err) {
90
- subscribedTopics.delete(topic);
91
- console.log(`Unsubscribed from ${topic}`);
92
- }
93
- else {
94
- console.error(`Failed to unsubscribe ${topic}`, err);
95
- }
96
- });
97
- }
98
- else {
99
- subscribedTopics.delete(topic);
100
- }
101
- };
102
- export const publishMessage = (topic, payload) => {
103
- if (mqttClient?.connected && payload) {
104
- const message = typeof payload !== 'string' ? JSON.stringify(payload) : payload;
105
- mqttClient?.publish(topic, message, { qos: 1, retain: false }, (err) => {
106
- if (!err) {
107
- // console.log(`Published message to ${topic}`)
108
- }
109
- else {
110
- console.error(`Failed to publish message to ${topic}`, err);
111
- }
112
- });
113
- }
114
- else {
115
- console.warn('MQTT not connected, cannot publish');
116
- }
117
- };
118
- export const addHandleMqttMessage = (key, topic, callBack) => {
119
- removeHandleMqttMessage(key);
120
- dataCallBack.push({ key, callBack, topic });
121
- };
122
- export const removeHandleMqttMessage = (key) => {
123
- const index = dataCallBack.findIndex((e) => e.key === key);
124
- if (index > -1) {
125
- dataCallBack.splice(index, 1);
126
- }
127
- };
128
- export const getMqttInstance = () => mqttClient;
@@ -1,19 +0,0 @@
1
- import { GapMiniAppSdk } from 'gap-miniapp-sdk';
2
- declare const baseSdk: import("gap-nodejs-sdk/dist/api/base_api").default;
3
- declare const gapMiniAppSdk: {
4
- getInstance: () => GapMiniAppSdk;
5
- getAccessToken: () => Promise<{
6
- domain: string;
7
- gClient: string;
8
- token: string;
9
- }>;
10
- };
11
- declare const sdkInit: (data: {
12
- id?: string;
13
- token?: string;
14
- domain?: string;
15
- }) => Promise<{
16
- status: boolean;
17
- tenant_error?: boolean;
18
- }>;
19
- export { sdkInit, gapMiniAppSdk, baseSdk };
@@ -1,83 +0,0 @@
1
- import Gap, { GapApiVersion } from 'gap-nodejs-sdk';
2
- import { GapMiniAppSdk } from 'gap-miniapp-sdk';
3
- import logger from '../utils/logger';
4
- import { loginTenant, setDataLogin } from '../utils/chat/auth';
5
- import { setAxiosGciInstance } from '../plugins/axios-gci';
6
- const baseSdk = new Gap.BaseApi(GapApiVersion.V1);
7
- const gapMiniAppSdk = (function () {
8
- let instance;
9
- // let domain = '';
10
- // let gClient = '';
11
- // let token = '';
12
- // if (process.env.NODE_ENV === "development") {
13
- // domain = import.meta.env.VITE_DOMAIN;
14
- // gClient = import.meta.env.VITE_GCLIENT_ID;
15
- // token = import.meta.env.VITE_TOKEN;
16
- // }
17
- function createInstance() {
18
- return new GapMiniAppSdk(logger);
19
- }
20
- return {
21
- getInstance: function () {
22
- if (!instance) {
23
- instance = createInstance();
24
- }
25
- return instance;
26
- },
27
- getAccessToken: async function () {
28
- let domain = '';
29
- let gClient = '';
30
- let token = '';
31
- try {
32
- let userAgent;
33
- if (gapMiniAppSdk.getInstance().detectPlatform()) {
34
- userAgent = gapMiniAppSdk.getInstance().detectPlatform();
35
- }
36
- if (userAgent) {
37
- gapMiniAppSdk.getInstance().setPlatformExecutor(userAgent);
38
- const response = await gapMiniAppSdk.getInstance().getAccessToken();
39
- if (response &&
40
- typeof response.token !== 'undefined' &&
41
- response.token != '') {
42
- domain = response.domain;
43
- gClient = response.gClientId;
44
- token = response.token;
45
- }
46
- }
47
- }
48
- catch (error) {
49
- console.error(error);
50
- }
51
- return { domain, gClient, token };
52
- }
53
- };
54
- })();
55
- const sdkInit = (data) => {
56
- return new Promise(async (resolve, reject) => {
57
- let status = false;
58
- try {
59
- let { domain, gClient, token } = await gapMiniAppSdk.getAccessToken();
60
- domain = data.domain || domain || '';
61
- gClient = data.id || gClient || '';
62
- token = data.token || token || '';
63
- if (!domain || !gClient || !token) {
64
- resolve({ status, tenant_error: true });
65
- return;
66
- }
67
- setAxiosGciInstance(token, domain, gClient);
68
- await loginTenant({ tenant_id: gClient });
69
- status = true;
70
- setDataLogin(gClient, token, domain);
71
- localStorage.setItem('chat_id', gClient);
72
- localStorage.setItem('chat_accessToken', token);
73
- localStorage.setItem('chat_domain', domain);
74
- resolve({ status });
75
- }
76
- catch (error) {
77
- resolve({ status, tenant_error: true });
78
- console.error(error);
79
- // reject(error)
80
- }
81
- });
82
- };
83
- export { sdkInit, gapMiniAppSdk, baseSdk };
@@ -1,4 +0,0 @@
1
- export declare function initWebSocket(server: string): void;
2
- export declare const getWebSocket: () => Promise<void>;
3
- export declare const addHandleWebSK: (key: string, callBack: any) => void;
4
- export declare const removeHandleWebSK: (key: string) => void;
@@ -1,65 +0,0 @@
1
- import { tryParseJson } from '../utils/json';
2
- let socket = null;
3
- let dataCallBack = [];
4
- export function initWebSocket(server) {
5
- // Create WebSocket connection.
6
- socket = new WebSocket('wss://web-socket.dev01.dtsmart.dev');
7
- // socket.addEventListener('open', (event: any) => {
8
- // console.log('fffffff')
9
- // socket.send('Hello Server!')
10
- // })
11
- //
12
- // socket.addEventListener('message', (event: any) => {
13
- // console.log('Message from server ', event.data)
14
- // })
15
- socket.onopen = (event) => {
16
- console.log('Connected!');
17
- };
18
- socket.onmessage = (event) => {
19
- const data = tryParseJson(event.data);
20
- dataCallBack.forEach((e) => {
21
- e.callBack(data);
22
- });
23
- };
24
- socket.onclose = (event) => {
25
- console.log('Disconnected:', event.reason);
26
- };
27
- socket.onerror = (event) => {
28
- console.error('Socket error:', event);
29
- };
30
- }
31
- const socketSend = (data) => {
32
- let request = typeof data == 'string' ? data : JSON.stringify(data);
33
- socket.send(request);
34
- };
35
- export const getWebSocket = async () => {
36
- const url = 'https://web-socket.dev01.dtsmart.dev/ws/connect';
37
- try {
38
- const response = await fetch(url, {
39
- method: 'POST',
40
- body: JSON.stringify({
41
- clientId: 'test1'
42
- }),
43
- headers: {
44
- Authorization: 'Bearer -Qixt-ZztiBA5Dxl-EIWG7f2TDhK-ZCj'
45
- }
46
- });
47
- if (!response.ok) {
48
- throw new Error(`Response status: ${response.status}`);
49
- }
50
- const result = await response.json();
51
- }
52
- catch (error) {
53
- console.error(error.message);
54
- }
55
- };
56
- export const addHandleWebSK = (key, callBack) => {
57
- removeHandleWebSK(key);
58
- dataCallBack.push({ key, callBack });
59
- };
60
- export const removeHandleWebSK = (key) => {
61
- const index = dataCallBack.findIndex((e) => e.key === key);
62
- if (index > -1) {
63
- dataCallBack.splice(index, 1);
64
- }
65
- };
@@ -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,18 +0,0 @@
1
- export type IConversation = {
2
- id: number;
3
- receiver_id: number;
4
- username: string | null;
5
- customer_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
- };
15
- export type IParamGetConversation = {
16
- page?: number;
17
- search?: string;
18
- };
@@ -1 +0,0 @@
1
- export {};