@phonghq/go-chat 1.0.1 → 1.0.3

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 (186) hide show
  1. package/dist/chat/App.vue.d.ts +2 -2
  2. package/dist/chat/main.d.ts +6 -3
  3. package/dist/chat/page/customer-detail/CustomerDetail.vue.d.ts +1 -1
  4. package/dist/chat/page/home/ChatList.vue.d.ts +1 -1
  5. package/dist/chat/page/home/ChatMessage.vue.d.ts +2 -2
  6. package/dist/chat/page/home/Home.vue.d.ts +2 -2
  7. package/dist/chat/page/home/HomeHeader.vue.d.ts +1 -1
  8. package/dist/chat/page/home/InputChat.vue.d.ts +1 -1
  9. package/dist/chat/page/home/NewCustomer.vue.d.ts +1 -1
  10. package/dist/components/chat/call/Calling.vue.d.ts +1 -1
  11. package/dist/components/chat/common/input/InputSearch.vue.d.ts +1 -1
  12. package/dist/composable/useCallHelper.d.ts +1 -1
  13. package/dist/composable/useInitData.d.ts +1 -1
  14. package/dist/composable/useModalConfirm.d.ts +1 -1
  15. package/dist/go-chat.es.js +26369 -28399
  16. package/dist/go-chat.umd.js +15 -23
  17. package/dist/plugins/mqtt.d.ts +2 -1
  18. package/dist/plugins/websocket.d.ts +4 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{chat → test/chat}/App.vue.js +60 -63
  21. package/dist/test/chat/main.js +6 -0
  22. package/dist/{chat/page/customer-appointment/CustomerApointment.vue.js → test/chat/page/customer-appointment/CustomerAppointment.vue.js} +5 -5
  23. package/dist/{chat → test/chat}/page/customer-check-in/CollapseCheckIn.vue.js +2 -2
  24. package/dist/{chat → test/chat}/page/customer-check-in/CustomerCheckIn.vue.js +4 -4
  25. package/dist/{chat → test/chat}/page/customer-detail/CustomerDetail.vue.js +16 -15
  26. package/dist/{chat → test/chat}/page/customer-detail/SubInformation.vue.js +1 -1
  27. package/dist/{chat → test/chat}/page/error/Error.vue.js +1 -1
  28. package/dist/{chat → test/chat}/page/home/ChatList.vue.js +11 -13
  29. package/dist/{chat → test/chat}/page/home/ChatMessage.vue.js +4 -4
  30. package/dist/{chat → test/chat}/page/home/Home.vue.js +10 -10
  31. package/dist/{chat → test/chat}/page/home/HomeHeader.vue.js +6 -6
  32. package/dist/{chat → test/chat}/page/home/InputChat.vue.js +13 -11
  33. package/dist/{chat → test/chat}/page/home/NewCustomer.vue.js +2 -2
  34. package/dist/test/components/ListenEvent.vue.js +45 -0
  35. package/dist/{components → test/components}/chat/ScrollEvent/ScrollEvent.vue.js +1 -1
  36. package/dist/{components → test/components}/chat/call/Calling.vue.js +68 -38
  37. package/dist/{components → test/components}/chat/common/collapse/CollapseBase.vue.js +1 -1
  38. package/dist/{components → test/components}/chat/common/input/InputSearch.vue.js +2 -2
  39. package/dist/{components → test/components}/chat/common/popover/PopoverBase.vue.js +1 -1
  40. package/dist/{components → test/components}/chat/layout/mobile/Footer.vue.js +10 -10
  41. package/dist/{components → test/components}/common/button/ButtonBase.vue.js +2 -2
  42. package/dist/{components → test/components}/common/button/ButtonToggle.vue.js +1 -1
  43. package/dist/{components → test/components}/common/checkbox/CCheckboxNumber.vue.js +1 -1
  44. package/dist/{components → test/components}/common/drawer/DrawerBase.vue.js +1 -1
  45. package/dist/{components → test/components}/common/dropdown/DropdownBase.vue.js +1 -1
  46. package/dist/{components → test/components}/common/input/CInputSearch.vue.js +1 -1
  47. package/dist/{components → test/components}/common/modal/ModalBase.vue.js +2 -2
  48. package/dist/{components → test/components}/common/slider/BaseSlider.vue.js +1 -1
  49. package/dist/{components → test/components}/modal/Confirm.vue.js +3 -3
  50. package/dist/{components → test/components}/ui/button/CButton.vue.js +1 -1
  51. package/dist/{components → test/components}/ui/checkbox/Checkbox.vue.js +1 -1
  52. package/dist/{components → test/components}/ui/dialog/DialogContent.vue.js +1 -1
  53. package/dist/{components → test/components}/ui/dialog/DialogDescription.vue.js +1 -1
  54. package/dist/{components → test/components}/ui/dialog/DialogFooter.vue.js +1 -1
  55. package/dist/{components → test/components}/ui/dialog/DialogHeader.vue.js +1 -1
  56. package/dist/{components → test/components}/ui/dialog/DialogScrollContent.vue.js +1 -1
  57. package/dist/{components → test/components}/ui/dialog/DialogTitle.vue.js +1 -1
  58. package/dist/{components → test/components}/ui/drawer/DrawerContent.vue.js +1 -1
  59. package/dist/{components → test/components}/ui/drawer/DrawerDescription.vue.js +1 -1
  60. package/dist/{components → test/components}/ui/drawer/DrawerFooter.vue.js +1 -1
  61. package/dist/{components → test/components}/ui/drawer/DrawerHeader.vue.js +1 -1
  62. package/dist/{components → test/components}/ui/drawer/DrawerOverlay.vue.js +1 -1
  63. package/dist/{components → test/components}/ui/drawer/DrawerTitle.vue.js +1 -1
  64. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.js +1 -1
  65. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuContent.vue.js +1 -1
  66. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuItem.vue.js +1 -1
  67. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuLabel.vue.js +1 -1
  68. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuRadioItem.vue.js +1 -1
  69. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuSeparator.vue.js +1 -1
  70. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuShortcut.vue.js +1 -1
  71. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuSubContent.vue.js +1 -1
  72. package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuSubTrigger.vue.js +1 -1
  73. package/dist/{components → test/components}/ui/popover/PopoverContent.vue.js +1 -1
  74. package/dist/{components → test/components}/ui/radio-group/RadioGroup.vue.js +1 -1
  75. package/dist/{components → test/components}/ui/radio-group/RadioGroupItem.vue.js +1 -1
  76. package/dist/{components → test/components}/ui/slider/Slider.vue.js +1 -1
  77. package/dist/{components → test/components}/ui/switch/Switch.vue.js +1 -1
  78. package/dist/{composable → test/composable}/useCallHelper.js +4 -16
  79. package/dist/{composable → test/composable}/useInitData.js +8 -6
  80. package/dist/{plugins → test/plugins}/mqtt.js +1 -2
  81. package/dist/{plugins → test/plugins}/sdk.js +3 -3
  82. package/dist/test/plugins/websocket.js +65 -0
  83. package/dist/test/types/chat/global.js +1 -0
  84. package/dist/test/types/chat/promise.js +1 -0
  85. package/dist/test/types/chat/user.js +1 -0
  86. package/dist/test/types/conversation.js +1 -0
  87. package/dist/test/types/global.js +15 -0
  88. package/dist/test/types/message.js +1 -0
  89. package/dist/{utils → test/utils}/chat/auth.js +2 -2
  90. package/dist/test/utils/chat/call.js +61 -0
  91. package/dist/{utils → test/utils}/chat/chat-router.js +1 -1
  92. package/dist/{utils → test/utils}/chat/conversation.js +1 -1
  93. package/dist/{utils → test/utils}/chat/message.js +1 -1
  94. package/dist/{utils → test/utils}/chat/user.js +1 -1
  95. package/dist/test/utils/json.js +18 -0
  96. package/dist/types/call.d.ts +4 -0
  97. package/dist/types/chat/auth.d.ts +37 -0
  98. package/dist/types/chat/global.d.ts +7 -0
  99. package/dist/types/chat/promise.d.ts +17 -0
  100. package/dist/types/global.d.ts +11 -0
  101. package/dist/types/message.d.ts +43 -0
  102. package/dist/utils/chat/auth.d.ts +1 -1
  103. package/dist/utils/chat/call.d.ts +4 -0
  104. package/dist/utils/chat/chat-router.d.ts +1 -1
  105. package/dist/utils/chat/conversation.d.ts +2 -2
  106. package/dist/utils/chat/message.d.ts +2 -2
  107. package/dist/utils/chat/user.d.ts +2 -2
  108. package/dist/utils/json.d.ts +2 -0
  109. package/package.json +1 -1
  110. package/dist/chat/main.js +0 -2
  111. package/dist/components/ListenEvent.vue.js +0 -47
  112. package/dist/plugins/websocket.js +0 -26
  113. package/dist/stores/general.d.ts +0 -48
  114. package/dist/stores/general.js +0 -39
  115. package/dist/utils/chat/call.js +0 -10
  116. /package/dist/chat/page/customer-appointment/{CustomerApointment.vue.d.ts → CustomerAppointment.vue.d.ts} +0 -0
  117. /package/dist/{assets → test/assets}/icons/IconArrowLeft.vue.js +0 -0
  118. /package/dist/{assets → test/assets}/icons/IconPhone.vue.js +0 -0
  119. /package/dist/{assets → test/assets}/icons/IconPlan.vue.js +0 -0
  120. /package/dist/{assets → test/assets}/icons/IconPlus.vue.js +0 -0
  121. /package/dist/{assets → test/assets}/icons/IconSearch.vue.js +0 -0
  122. /package/dist/{assets → test/assets}/icons/call/IconMic.vue.js +0 -0
  123. /package/dist/{assets → test/assets}/icons/call/IconPhone.vue.js +0 -0
  124. /package/dist/{assets → test/assets}/icons/call/IconPhoneCancel.vue.js +0 -0
  125. /package/dist/{assets → test/assets}/icons/call/IconSpeaker.vue.js +0 -0
  126. /package/dist/{assets → test/assets}/icons/customer-appointment/IconFilter.vue.js +0 -0
  127. /package/dist/{assets → test/assets}/icons/customer-detail/IconArrow.vue.js +0 -0
  128. /package/dist/{assets → test/assets}/icons/customer-detail/IconCheck.vue.js +0 -0
  129. /package/dist/{assets → test/assets}/icons/customer-detail/IconDate.vue.js +0 -0
  130. /package/dist/{assets → test/assets}/icons/customer-detail/IconGroup.vue.js +0 -0
  131. /package/dist/{assets → test/assets}/icons/customer-detail/IconMessage.vue.js +0 -0
  132. /package/dist/{assets → test/assets}/icons/customer-detail/IconNote.vue.js +0 -0
  133. /package/dist/{assets → test/assets}/icons/customer-detail/IconPhone.vue.js +0 -0
  134. /package/dist/{assets → test/assets}/icons/customer-detail/IconPin.vue.js +0 -0
  135. /package/dist/{assets → test/assets}/icons/customer-detail/IconSearch.vue.js +0 -0
  136. /package/dist/{components → test/components}/chat/card/CardCustomerDetail.vue.js +0 -0
  137. /package/dist/{components → test/components}/chat/common/spin/BaseSpin.vue.js +0 -0
  138. /package/dist/{components → test/components}/chat/customer/Avatar.vue.js +0 -0
  139. /package/dist/{components → test/components}/common/CustomLoading.vue.js +0 -0
  140. /package/dist/{components → test/components}/common/Notification/NotificationDescription.vue.js +0 -0
  141. /package/dist/{components → test/components}/common/collapse/BaseCollapse.vue.js +0 -0
  142. /package/dist/{components → test/components}/common/collapse/BaseCollapseItem.vue.js +0 -0
  143. /package/dist/{components → test/components}/common/popover/PopoverBase.vue.js +0 -0
  144. /package/dist/{components → test/components}/common/spin/CSpin.vue.js +0 -0
  145. /package/dist/{components → test/components}/common/tooltip/TooltipBase.vue.js +0 -0
  146. /package/dist/{components → test/components}/layout/Blank.vue.js +0 -0
  147. /package/dist/{components → test/components}/layout/Default.vue.js +0 -0
  148. /package/dist/{components → test/components}/ui/button/c-button.js +0 -0
  149. /package/dist/{components → test/components}/ui/checkbox/index.js +0 -0
  150. /package/dist/{components → test/components}/ui/collapsible/Collapsible.vue.js +0 -0
  151. /package/dist/{components → test/components}/ui/collapsible/CollapsibleContent.vue.js +0 -0
  152. /package/dist/{components → test/components}/ui/collapsible/CollapsibleTrigger.vue.js +0 -0
  153. /package/dist/{components → test/components}/ui/collapsible/index.js +0 -0
  154. /package/dist/{components → test/components}/ui/dialog/Dialog.vue.js +0 -0
  155. /package/dist/{components → test/components}/ui/dialog/DialogClose.vue.js +0 -0
  156. /package/dist/{components → test/components}/ui/dialog/DialogTrigger.vue.js +0 -0
  157. /package/dist/{components → test/components}/ui/dialog/index.js +0 -0
  158. /package/dist/{components → test/components}/ui/drawer/Drawer.vue.js +0 -0
  159. /package/dist/{components → test/components}/ui/drawer/index.js +0 -0
  160. /package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenu.vue.js +0 -0
  161. /package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuGroup.vue.js +0 -0
  162. /package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuRadioGroup.vue.js +0 -0
  163. /package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuSub.vue.js +0 -0
  164. /package/dist/{components → test/components}/ui/dropdown-menu/DropdownMenuTrigger.vue.js +0 -0
  165. /package/dist/{components → test/components}/ui/dropdown-menu/index.js +0 -0
  166. /package/dist/{components → test/components}/ui/popover/Popover.vue.js +0 -0
  167. /package/dist/{components → test/components}/ui/popover/PopoverTrigger.vue.js +0 -0
  168. /package/dist/{components → test/components}/ui/popover/index.js +0 -0
  169. /package/dist/{components → test/components}/ui/radio-group/index.js +0 -0
  170. /package/dist/{components → test/components}/ui/slider/index.js +0 -0
  171. /package/dist/{components → test/components}/ui/switch/index.js +0 -0
  172. /package/dist/{composable → test/composable}/useModalConfirm.js +0 -0
  173. /package/dist/{constant → test/constant}/color.js +0 -0
  174. /package/dist/{constant → test/constant}/datetime.js +0 -0
  175. /package/dist/{constant → test/constant}/general.js +0 -0
  176. /package/dist/{constant → test/constant}/message.js +0 -0
  177. /package/dist/{constant → test/constant}/mqtt.js +0 -0
  178. /package/dist/{constant → test/constant}/user.js +0 -0
  179. /package/dist/{lib → test/lib}/utils.js +0 -0
  180. /package/dist/{plugins → test/plugins}/axios-gci.js +0 -0
  181. /package/dist/{plugins → test/plugins}/axios.js +0 -0
  182. /package/dist/{types/chat/user.js → test/types/call.js} +0 -0
  183. /package/dist/{types/conversation.js → test/types/chat/auth.js} +0 -0
  184. /package/dist/{utils → test/utils}/debounce.js +0 -0
  185. /package/dist/{utils → test/utils}/logger.js +0 -0
  186. /package/dist/{utils → test/utils}/string-helper.js +0 -0
@@ -1,47 +0,0 @@
1
- /// <reference types="C:/phonghq/go-chat/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
- import { onMounted, onBeforeUnmount, computed } from 'vue';
3
- import { useDebounce } from '@/utils/debounce';
4
- import { useGeneralStore } from '@/stores/general';
5
- const deviceType = computed({
6
- set(value) {
7
- return useGeneralStore().deviceResponsive = value;
8
- },
9
- get() {
10
- return useGeneralStore().deviceResponsive;
11
- }
12
- });
13
- const getDeviceType = () => {
14
- const width = window.innerWidth;
15
- if (width < 767) {
16
- return 'mobile';
17
- }
18
- else if (width < 1023) {
19
- return 'tablet';
20
- }
21
- else {
22
- return 'window';
23
- }
24
- };
25
- const updateDeviceType = useDebounce(() => {
26
- const newType = getDeviceType();
27
- if (deviceType.value !== newType) {
28
- deviceType.value = newType;
29
- }
30
- }, 500);
31
- onMounted(() => {
32
- updateDeviceType();
33
- window.addEventListener('resize', updateDeviceType);
34
- });
35
- onBeforeUnmount(() => {
36
- window.removeEventListener('resize', updateDeviceType);
37
- });
38
- debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
39
- const __VLS_ctx = {
40
- ...{},
41
- ...{},
42
- };
43
- let __VLS_elements;
44
- let __VLS_components;
45
- let __VLS_directives;
46
- const __VLS_export = (await import('vue')).defineComponent({});
47
- export default {};
@@ -1,26 +0,0 @@
1
- export function initWebSocket(server) {
2
- let io;
3
- // Create WebSocket connection.
4
- const socket = new WebSocket("wss://web-socket.dev01.dtsmart.dev");
5
- socket.addEventListener("open", (event) => {
6
- console.log('fffffff');
7
- socket.send("Hello Server!");
8
- });
9
- socket.addEventListener("message", (event) => {
10
- console.log('fffffff');
11
- console.log("Message from server ", event.data);
12
- });
13
- // ws.onopen = () => {
14
- // console.log("✅ Connected to WebSocket server");
15
- // ws.send(JSON.stringify({ event: "join", userId: 1 }));
16
- // };
17
- //
18
- // ws.onmessage = (event) => {
19
- // const msg = JSON.parse(event.data);
20
- // console.log("📩 Message:", msg);
21
- // };
22
- //
23
- // ws.onclose = () => console.log("❌ Disconnected");
24
- // ws.onerror = (err) => console.error("Error:", err);
25
- return io;
26
- }
@@ -1,48 +0,0 @@
1
- import { Platform } from 'gap-miniapp-sdk';
2
- type RESPONSIVE = 'mobile' | 'tablet' | 'window';
3
- export declare const useGeneralStore: import("pinia").StoreDefinition<"general", {
4
- devicePlatform: Platform | undefined;
5
- deviceResponsive: RESPONSIVE;
6
- sdkErrors: any;
7
- isOnline: boolean;
8
- }, {
9
- isWindow(state: {
10
- devicePlatform: Platform | undefined;
11
- deviceResponsive: RESPONSIVE;
12
- sdkErrors: any;
13
- isOnline: boolean;
14
- } & import("pinia").PiniaCustomStateProperties<{
15
- devicePlatform: Platform | undefined;
16
- deviceResponsive: RESPONSIVE;
17
- sdkErrors: any;
18
- isOnline: boolean;
19
- }>): boolean;
20
- isAndroidOrIos(state: {
21
- devicePlatform: Platform | undefined;
22
- deviceResponsive: RESPONSIVE;
23
- sdkErrors: any;
24
- isOnline: boolean;
25
- } & import("pinia").PiniaCustomStateProperties<{
26
- devicePlatform: Platform | undefined;
27
- deviceResponsive: RESPONSIVE;
28
- sdkErrors: any;
29
- isOnline: boolean;
30
- }>): boolean;
31
- isWeb(state: {
32
- devicePlatform: Platform | undefined;
33
- deviceResponsive: RESPONSIVE;
34
- sdkErrors: any;
35
- isOnline: boolean;
36
- } & import("pinia").PiniaCustomStateProperties<{
37
- devicePlatform: Platform | undefined;
38
- deviceResponsive: RESPONSIVE;
39
- sdkErrors: any;
40
- isOnline: boolean;
41
- }>): boolean;
42
- }, {
43
- setDevicePlatform(value?: Platform): void;
44
- setSdkError(error: any): void;
45
- resetSdkError(): void;
46
- setIsOnline(value: boolean): void;
47
- }>;
48
- export {};
@@ -1,39 +0,0 @@
1
- import { defineStore } from 'pinia';
2
- import { Platform } from 'gap-miniapp-sdk';
3
- import { HttpMaxRetriesError, HttpUnauthorizedError } from 'gap-nodejs-sdk/dist/error';
4
- export const useGeneralStore = defineStore('general', {
5
- state: () => ({
6
- devicePlatform: undefined,
7
- deviceResponsive: 'window',
8
- sdkErrors: [],
9
- isOnline: true,
10
- }),
11
- getters: {
12
- //PLATFORM
13
- isWindow(state) {
14
- return state.devicePlatform == Platform.WINDOW;
15
- },
16
- isAndroidOrIos(state) {
17
- return state.devicePlatform == Platform.IOS || state.devicePlatform == Platform.ANDROID;
18
- },
19
- isWeb(state) {
20
- return state.devicePlatform == Platform.WEB;
21
- }
22
- },
23
- actions: {
24
- setDevicePlatform(value) {
25
- this.devicePlatform = value;
26
- },
27
- setSdkError(error) {
28
- if (error instanceof HttpMaxRetriesError || error instanceof HttpUnauthorizedError) {
29
- this.sdkErrors.push(error);
30
- }
31
- },
32
- resetSdkError() {
33
- this.sdkErrors = [];
34
- },
35
- setIsOnline(value) {
36
- this.isOnline = value;
37
- }
38
- }
39
- });
@@ -1,10 +0,0 @@
1
- import axios from '@/plugins/axios';
2
- export const getIceService = async () => {
3
- const res = await axios.post('/api/v1/message/call/ice-servers', {
4
- key_id: '3dc07e93f89e44ef5d5ff98c91edb520',
5
- api_token: 'c0a60a3d2b0f490b2c99fd7ff095ed1218fd7eda55c80c8b70efc9e0b8dfcd85'
6
- }, {
7
- token: '3VbvrMLtH6b0b9vBe0mhJz9G9NKyATiL'
8
- });
9
- return res;
10
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes