gotrip-fx-transaction-form 1.0.293-dev → 1.0.295-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/index.js +27333 -26084
- package/package.json +1 -1
- package/types/components/Apps/EmbededIndividualApp.d.ts +2 -1
- package/types/components/Chat/ChatAvatar.d.ts +2 -2
- package/types/components/Chat/ChatMessage.d.ts +2 -1
- package/types/components/Chat/ChatNameForm.d.ts +5 -0
- package/types/embeded-main.d.ts +1 -0
- package/types/hooks/useChat.d.ts +1 -1
- package/types/store/useChatStore.d.ts +5 -1
- package/types/types/chat.d.ts +2 -0
- package/types/types/sdk.d.ts +2 -1
- package/types/util/chat.d.ts +1 -0
- package/types/util/chatBrowserKey.d.ts +12 -0
- package/types/util/socket.d.ts +1 -1
package/package.json
CHANGED
|
@@ -8,5 +8,6 @@ export type EmbededIndividualAppProps = {
|
|
|
8
8
|
type?: ESdkFormType;
|
|
9
9
|
scrollable?: boolean;
|
|
10
10
|
recommendBoxHeight?: string;
|
|
11
|
+
chatTopics?: string[];
|
|
11
12
|
};
|
|
12
|
-
export declare const EmbededIndividualApp: ({ apiKey, externalCssUrl, hide, defaultBank, displayDefaultBankLogo, type, scrollable, recommendBoxHeight, }: EmbededIndividualAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const EmbededIndividualApp: ({ apiKey, externalCssUrl, hide, defaultBank, displayDefaultBankLogo, type, scrollable, recommendBoxHeight, chatTopics, }: EmbededIndividualAppProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
interface Props {
|
|
2
|
+
name?: string;
|
|
2
3
|
firstName?: string;
|
|
3
4
|
lastName?: string;
|
|
4
5
|
userId?: number;
|
|
5
6
|
size?: number;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
export declare const ChatAvatar: ({ firstName, lastName, userId, size }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const ChatAvatar: ({ name, firstName, lastName, userId, size }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -4,6 +4,7 @@ interface Props {
|
|
|
4
4
|
currentUserId: number;
|
|
5
5
|
showAvatar?: boolean;
|
|
6
6
|
showName?: boolean;
|
|
7
|
+
nameOverride?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const ChatMessage: ({ message, currentUserId, showAvatar, showName, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ChatMessage: ({ message, currentUserId, showAvatar, showName, nameOverride, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
package/types/embeded-main.d.ts
CHANGED
package/types/hooks/useChat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EChatTopic, IChatMessage, IChatSession } from '../types/chat';
|
|
2
2
|
export declare const useChat: () => {
|
|
3
|
-
startSession: (topic: EChatTopic) => Promise<IChatSession>;
|
|
3
|
+
startSession: (topic: EChatTopic, guestName?: string | null) => Promise<IChatSession>;
|
|
4
4
|
getMyActiveSession: () => Promise<IChatSession | null>;
|
|
5
5
|
getMessages: (sessionId: number, before?: number, limit?: number) => Promise<{
|
|
6
6
|
data: IChatMessage[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IChatMessage, IChatSession } from '../types/chat';
|
|
1
|
+
import { EChatTopic, IChatMessage, IChatSession } from '../types/chat';
|
|
2
2
|
interface ChatStore {
|
|
3
3
|
session: IChatSession | null;
|
|
4
4
|
messages: IChatMessage[];
|
|
@@ -8,6 +8,8 @@ interface ChatStore {
|
|
|
8
8
|
sessionUnreadCounts: Record<number, number>;
|
|
9
9
|
adminIsOnline: boolean | null;
|
|
10
10
|
agencyIsOnline: boolean | null;
|
|
11
|
+
allowedTopics: EChatTopic[] | null;
|
|
12
|
+
guestName: string | null;
|
|
11
13
|
setSession: (session: IChatSession | null) => void;
|
|
12
14
|
setMessages: (messages: IChatMessage[]) => void;
|
|
13
15
|
addMessage: (message: IChatMessage) => void;
|
|
@@ -26,6 +28,8 @@ interface ChatStore {
|
|
|
26
28
|
getSessionUnread: (sessionId: number) => number;
|
|
27
29
|
setAdminIsOnline: (isOnline: boolean | null) => void;
|
|
28
30
|
setAgencyIsOnline: (isOnline: boolean | null) => void;
|
|
31
|
+
setAllowedTopics: (topics: EChatTopic[] | null) => void;
|
|
32
|
+
setGuestName: (name: string | null) => void;
|
|
29
33
|
}
|
|
30
34
|
export declare const useChatStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ChatStore>>;
|
|
31
35
|
export {};
|
package/types/types/chat.d.ts
CHANGED
package/types/types/sdk.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export declare enum ESdkFormType {
|
|
|
7
7
|
EXCHANGE_RATE_TABLE = "exchange_rate_table",
|
|
8
8
|
INSURANCE_APPROVAL = "insurance_approval",
|
|
9
9
|
MOTOR_INSURANCE_CAR_APPROVAL = "motor_insurance_car_approval",
|
|
10
|
-
MOTOR_INSURANCE_BIKE_APPROVAL = "motor_insurance_bike_approval"
|
|
10
|
+
MOTOR_INSURANCE_BIKE_APPROVAL = "motor_insurance_bike_approval",
|
|
11
|
+
CHAT_SUPPORT = "chat_support"
|
|
11
12
|
}
|
package/types/util/chat.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ETenantType } from '../types/enum';
|
|
|
2
2
|
import { IChatMessage } from '../types/chat';
|
|
3
3
|
export declare const getAvatarColor: (userId: number) => string;
|
|
4
4
|
export declare const getAvatarInitials: (firstName?: string, lastName?: string) => string;
|
|
5
|
+
export declare const getNameInitials: (fullName?: string) => string;
|
|
5
6
|
/** Join first + last name, falling back to `fallback` when both are empty. */
|
|
6
7
|
export declare const getFullName: (info?: {
|
|
7
8
|
firstName?: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable per-browser chat identity. Read-or-create a UUID in localStorage.
|
|
3
|
+
*
|
|
4
|
+
* The same agency identity (e.g. all visitors of a tenant behind one api-key)
|
|
5
|
+
* is split into one chat session per browser using this key. It is sent to the
|
|
6
|
+
* backend on every chat request (REST header `x-chat-browser-key`) and on the
|
|
7
|
+
* socket handshake (`auth.browserKey`).
|
|
8
|
+
*
|
|
9
|
+
* Idempotent: the first call on a browser writes the key; later calls reuse it.
|
|
10
|
+
* Call it once at app bootstrap so the key exists before any chat call fires.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getChatBrowserKey: () => string;
|
package/types/util/socket.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const requestNotificationPermission: () => void;
|
|
|
7
7
|
/**
|
|
8
8
|
* Initialize Socket.IO connection with authentication token
|
|
9
9
|
*/
|
|
10
|
-
export declare const initializeSocket: (token
|
|
10
|
+
export declare const initializeSocket: (token?: string) => Socket;
|
|
11
11
|
/**
|
|
12
12
|
* Get the current socket instance
|
|
13
13
|
*/
|