@developer.notchatbot/webchat 1.6.0 → 2.0.0
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/README.md +31 -0
- package/dist/components/ChatBot.d.ts +3 -4
- package/dist/components/ContactCapture.d.ts +7 -0
- package/dist/components/MessageActions.d.ts +8 -0
- package/dist/components/MessageAlertSettings.d.ts +5 -0
- package/dist/components/MessageSelectionActions.d.ts +4 -0
- package/dist/components/ReplyQuote.d.ts +8 -0
- package/dist/components/UnreadMessagePreview.d.ts +15 -0
- package/dist/components/embedchat/EmbedChat.d.ts +6 -2
- package/dist/config/endpoints.d.ts +9 -5
- package/dist/hooks/useMessageAlerts.d.ts +11 -0
- package/dist/hooks/useMessageGesture.d.ts +14 -0
- package/dist/hooks/useTeamAvailability.d.ts +2 -0
- package/dist/hooks/useVisitorChat.d.ts +48 -0
- package/dist/types.d.ts +110 -14
- package/dist/utils/cart-model.d.ts +23 -0
- package/dist/utils/contact-link.d.ts +2 -0
- package/dist/utils/convex.d.ts +2 -3
- package/dist/utils/markdown.d.ts +2 -0
- package/dist/utils/message-alerts.d.ts +15 -0
- package/dist/utils/message-colors.d.ts +3 -0
- package/dist/utils/message-id.d.ts +2 -0
- package/dist/utils/phone.d.ts +16 -0
- package/dist/utils/storefront-cart.d.ts +6 -0
- package/dist/utils/storefront-identity.d.ts +23 -0
- package/dist/utils/transcript.d.ts +23 -0
- package/dist/utils/visitor-presence.d.ts +30 -0
- package/dist/utils/visitor-session.d.ts +31 -0
- package/dist/webchat-bundle.min.js +8435 -5050
- package/dist/webchat-bundle.min.umd.cjs +81 -55
- package/package.json +8 -4
- package/dist/components/ConversationRating.d.ts +0 -7
- package/dist/utils/notchatbot-cookie.d.ts +0 -32
- package/dist/utils/survey.d.ts +0 -30
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface VisitorSession {
|
|
2
|
+
chatbotUid: string;
|
|
3
|
+
conversationId: string;
|
|
4
|
+
visitorId: string;
|
|
5
|
+
token: string;
|
|
6
|
+
expiresAt: number;
|
|
7
|
+
presenceUrl?: string | null;
|
|
8
|
+
started?: boolean;
|
|
9
|
+
contactConversationId?: string;
|
|
10
|
+
contactSession?: {
|
|
11
|
+
token: string;
|
|
12
|
+
expiresAt: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const visitorStorageKey: (uid: string, item: string) => string;
|
|
16
|
+
/** Tenant/site-scoped storage with a stable in-memory fallback for blocked browser storage. */
|
|
17
|
+
export declare function readVisitorData(uid: string, item: string): string | null;
|
|
18
|
+
export declare function writeVisitorData(uid: string, item: string, value: string | null): void;
|
|
19
|
+
export declare function getVisitorSession(uid: string): VisitorSession | null;
|
|
20
|
+
export declare function getContactSession(uid: string): {
|
|
21
|
+
token: string;
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
} | null;
|
|
24
|
+
export declare function saveVisitorSession(session: VisitorSession): void;
|
|
25
|
+
/** Called on first send/upload, never on page load or merely opening the launcher. */
|
|
26
|
+
export declare function ensureVisitorSession(uid: string): Promise<VisitorSession>;
|
|
27
|
+
export declare function resetVisitorSession(uid: string, forgetContact?: boolean): void;
|
|
28
|
+
export declare function visitorHeaders(session: VisitorSession): {
|
|
29
|
+
'Content-Type': string;
|
|
30
|
+
Authorization: string;
|
|
31
|
+
};
|