@cagent/chat-embedding-core 0.0.21 → 0.0.22
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/dist/components/Bot.d.ts +2 -0
- package/dist/features/sso/ssoSession.d.ts +12 -0
- package/dist/web.d.ts +2 -0
- package/dist/web.js +1 -1
- package/dist/window.d.ts +1 -0
- package/package.json +1 -1
- package/public/popup.html +6 -111
package/dist/components/Bot.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export type BotProps = {
|
|
|
76
76
|
apiHost?: string;
|
|
77
77
|
onRequest?: (request: RequestInit) => Promise<void>;
|
|
78
78
|
chatflowConfig?: Record<string, unknown>;
|
|
79
|
+
/** Path fragment of the host site's logout URL (e.g. '/dang-xuat'); navigating there ends the C-Agent SSO session. */
|
|
80
|
+
ssoLogoutUrlPattern?: string;
|
|
79
81
|
welcomeMessage?: string;
|
|
80
82
|
secondMessage?: string;
|
|
81
83
|
errorMessage?: string;
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
export type SsoStatus = 'not_required' | 'checking' | 'needs_login' | 'signing_in' | 'failed' | 'ready';
|
|
6
6
|
export declare const clearSsoSession: () => void;
|
|
7
7
|
export declare const getSsoToken: () => string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Ends the C-Agent session only (never the SSO session of the host site). The local copy goes first and synchronously,
|
|
10
|
+
* because the page may be unloading; the server call is best effort and `keepalive` lets it outlive the page.
|
|
11
|
+
*/
|
|
12
|
+
export declare const signOutSso: (apiHost: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* The host site (e.g. IOC) signs the user out with a full-page navigation, which destroys the widget before it can react,
|
|
15
|
+
* and the session in sessionStorage would be inherited by the next user of this tab. The Navigation API reports the
|
|
16
|
+
* navigation while the page is still alive, so the C-Agent session is ended first. Returns a function that stops watching.
|
|
17
|
+
* Browsers without the Navigation API are not covered; there the server-side back-channel logout is the only signal.
|
|
18
|
+
*/
|
|
19
|
+
export declare const watchHostLogout: (apiHost: string, logoutUrlPattern: string) => (() => void);
|
|
8
20
|
/**
|
|
9
21
|
* Login without any user action: a hidden frame asks the SSO server with prompt=none. It only succeeds when the browser
|
|
10
22
|
* sends the SSO cookie inside the frame; otherwise the caller falls back to the popup.
|
package/dist/web.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare const chatbot: {
|
|
|
4
4
|
apiHost?: string | undefined;
|
|
5
5
|
onRequest?: ((request: RequestInit) => Promise<void>) | undefined;
|
|
6
6
|
chatflowConfig?: Record<string, unknown> | undefined;
|
|
7
|
+
ssoLogoutUrlPattern?: string | undefined;
|
|
7
8
|
observersConfig?: import("./components/Bot").observersConfigType | undefined;
|
|
8
9
|
theme?: import("./features/bubble/types").BubbleTheme | undefined;
|
|
9
10
|
chatwootUrl?: string | undefined;
|
|
@@ -20,6 +21,7 @@ declare const chatbot: {
|
|
|
20
21
|
apiHost?: string | undefined;
|
|
21
22
|
onRequest?: ((request: RequestInit) => Promise<void>) | undefined;
|
|
22
23
|
chatflowConfig?: Record<string, unknown> | undefined;
|
|
24
|
+
ssoLogoutUrlPattern?: string | undefined;
|
|
23
25
|
observersConfig?: import("./components/Bot").observersConfigType | undefined;
|
|
24
26
|
theme?: import("./features/bubble/types").BubbleTheme | undefined;
|
|
25
27
|
chatwootUrl?: string | undefined;
|