gotrip-fx-transaction-form 1.0.291-dev → 1.0.293-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/index.css +1 -1
- package/index.js +18862 -18655
- package/package.json +1 -1
- package/types/components/Chat/AdminChatPanel.d.ts +5 -0
- package/types/components/Chat/AdminOnlineToggle.d.ts +1 -0
- package/types/components/Chat/AdminSessionItem.d.ts +6 -0
- package/types/components/Chat/AdminSessionList.d.ts +1 -0
- package/types/components/Chat/ChatAvatar.d.ts +9 -0
- package/types/components/Chat/ChatButton.d.ts +1 -0
- package/types/components/Chat/ChatComposer.d.ts +9 -0
- package/types/components/Chat/ChatImageGallery.d.ts +9 -0
- package/types/components/Chat/ChatMessage.d.ts +9 -0
- package/types/components/Chat/ChatWidget.d.ts +1 -0
- package/types/components/Chat/ChatWindow.d.ts +1 -0
- package/types/components/Chat/ImageLightbox.d.ts +11 -0
- package/types/components/Chat/OfflineMessageMode.d.ts +1 -0
- package/types/components/Chat/QueueStatus.d.ts +1 -0
- package/types/components/Chat/SessionInfoHeader.d.ts +10 -0
- package/types/components/Chat/TopicSelector.d.ts +6 -0
- package/types/components/Chat/TransferSessionModal.d.ts +9 -0
- package/types/components/Chat/TypingIndicator.d.ts +7 -0
- package/types/constants/chat-constants.d.ts +3 -0
- package/types/hooks/transactions/useEducation.hook.d.ts +8 -8
- package/types/hooks/transactions/useImmigration.hook.d.ts +8 -8
- package/types/hooks/useChat.d.ts +25 -0
- package/types/hooks/useImportBookers.d.ts +18 -18
- package/types/hooks/useImportMembers.d.ts +18 -18
- package/types/pages/admin/chat/AdminChatPage.d.ts +1 -0
- package/types/store/useChatStore.d.ts +31 -0
- package/types/types/chat.d.ts +86 -0
- package/types/util/chat.d.ts +30 -0
- package/types/util/formatMessageTime.d.ts +1 -0
- package/types/util/formatWaitTime.d.ts +1 -0
- package/types/util/socket.d.ts +5 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare enum EChatTopic {
|
|
2
|
+
FX = "FX",
|
|
3
|
+
INSURANCE = "INSURANCE",
|
|
4
|
+
MOTOR_INSURANCE = "MOTOR_INSURANCE",
|
|
5
|
+
ESIM = "ESIM",
|
|
6
|
+
SIM = "SIM",
|
|
7
|
+
GENERAL = "GENERAL"
|
|
8
|
+
}
|
|
9
|
+
export declare enum EChatSessionStatus {
|
|
10
|
+
QUEUED = "queued",
|
|
11
|
+
ACTIVE = "active",
|
|
12
|
+
RESOLVED = "resolved",
|
|
13
|
+
OFFLINE_MESSAGE = "offline_message"
|
|
14
|
+
}
|
|
15
|
+
export declare enum EChatSenderType {
|
|
16
|
+
AGENCY = "agency",
|
|
17
|
+
ADMIN = "admin",
|
|
18
|
+
SYSTEM = "system"
|
|
19
|
+
}
|
|
20
|
+
export interface UserInfo {
|
|
21
|
+
id: number;
|
|
22
|
+
firstName?: string;
|
|
23
|
+
lastName?: string;
|
|
24
|
+
email?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface TenantInfo {
|
|
27
|
+
id: number;
|
|
28
|
+
tenantName: string;
|
|
29
|
+
}
|
|
30
|
+
export interface AdminInfo extends UserInfo {
|
|
31
|
+
isOnline?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface AgencyInfo extends UserInfo {
|
|
34
|
+
tenant?: TenantInfo;
|
|
35
|
+
isOnline?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface IChatSession {
|
|
38
|
+
id: number;
|
|
39
|
+
publicId: string;
|
|
40
|
+
agencyUserId: number;
|
|
41
|
+
agencyInfo?: AgencyInfo;
|
|
42
|
+
assignedAdminId: number | null;
|
|
43
|
+
adminInfo?: AdminInfo;
|
|
44
|
+
topic: EChatTopic;
|
|
45
|
+
status: EChatSessionStatus;
|
|
46
|
+
queuePosition: number | null;
|
|
47
|
+
resolvedAt: string | null;
|
|
48
|
+
lastActivityAt: string;
|
|
49
|
+
lastAgencyMessageAt: string | null | undefined;
|
|
50
|
+
agencyLastReadAt?: string | null;
|
|
51
|
+
adminLastReadAt?: string | null;
|
|
52
|
+
unreadCount?: number;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
waitTimeSeconds?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface SenderInfo {
|
|
57
|
+
id: number;
|
|
58
|
+
firstName?: string;
|
|
59
|
+
lastName?: string;
|
|
60
|
+
email?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface IChatMedia {
|
|
63
|
+
type: 'image' | 'file';
|
|
64
|
+
url: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
size?: number;
|
|
67
|
+
mime?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface IChatMessage {
|
|
70
|
+
id: number;
|
|
71
|
+
sessionId: number;
|
|
72
|
+
senderId: number;
|
|
73
|
+
senderType: EChatSenderType;
|
|
74
|
+
senderInfo?: SenderInfo;
|
|
75
|
+
content: string;
|
|
76
|
+
media?: IChatMedia[] | null;
|
|
77
|
+
messageType: 'text' | 'image' | 'system_event';
|
|
78
|
+
createdAt: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IAdminSupportProfile {
|
|
81
|
+
id: number;
|
|
82
|
+
adminUserId: number;
|
|
83
|
+
specialties: EChatTopic[];
|
|
84
|
+
maxConcurrent: number;
|
|
85
|
+
isOnline: boolean;
|
|
86
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ETenantType } from '../types/enum';
|
|
2
|
+
import { IChatMessage } from '../types/chat';
|
|
3
|
+
export declare const getAvatarColor: (userId: number) => string;
|
|
4
|
+
export declare const getAvatarInitials: (firstName?: string, lastName?: string) => string;
|
|
5
|
+
/** Join first + last name, falling back to `fallback` when both are empty. */
|
|
6
|
+
export declare const getFullName: (info?: {
|
|
7
|
+
firstName?: string;
|
|
8
|
+
lastName?: string;
|
|
9
|
+
} | null, fallback?: string) => string;
|
|
10
|
+
/** Whether the given user belongs to the internal (SYSTEM) tenant, i.e. an admin. */
|
|
11
|
+
export declare const isAdminUser: (user?: {
|
|
12
|
+
tenant?: {
|
|
13
|
+
type?: ETenantType;
|
|
14
|
+
} | null;
|
|
15
|
+
} | null) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Legacy image messages stored their URLs as a JSON array string in `content`.
|
|
18
|
+
* Parse defensively, falling back to treating the raw content as a single URL.
|
|
19
|
+
*/
|
|
20
|
+
export declare const parseImageUrls: (content: string) => string[];
|
|
21
|
+
/**
|
|
22
|
+
* Image URLs for a message. Prefers the structured `media` column; falls back
|
|
23
|
+
* to the legacy `messageType === 'image'` content-as-JSON encoding.
|
|
24
|
+
*/
|
|
25
|
+
export declare const getMessageImages: (message: IChatMessage) => string[];
|
|
26
|
+
/**
|
|
27
|
+
* Text of a message to display as a bubble/caption. The legacy image encoding
|
|
28
|
+
* stored a JSON URL array in `content`, which must not be shown as text.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getMessageText: (message: IChatMessage) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatMessageTime: (dateString: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatWaitTime: (waitTimeSeconds?: number) => string;
|
package/types/util/socket.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Socket } from 'socket.io-client';
|
|
2
|
+
/**
|
|
3
|
+
* Request browser notification permission. Call from a user gesture
|
|
4
|
+
* (e.g. opening the chat widget or an admin going online).
|
|
5
|
+
*/
|
|
6
|
+
export declare const requestNotificationPermission: () => void;
|
|
2
7
|
/**
|
|
3
8
|
* Initialize Socket.IO connection with authentication token
|
|
4
9
|
*/
|