@aakash58/chatbot 1.0.97 → 1.0.98

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.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, ElementRef, Renderer2, OnDestroy, SimpleChanges, RendererFactory2, OnInit, OnChanges, TrackByFunction, EventEmitter, AfterViewInit, AfterContentInit, QueryList } from '@angular/core';
3
- import { OverlayContainer } from '@angular/cdk/overlay';
2
+ import { InjectionToken, ElementRef, Renderer2, OnInit, OnDestroy, SimpleChanges, EventEmitter, AfterContentInit, QueryList } from '@angular/core';
4
3
  import { MatDialogRef, MatDialog } from '@angular/material/dialog';
5
4
  import { Observable } from 'rxjs';
6
- import { HttpClient } from '@angular/common/http';
7
- import { JwtHelperService } from '@auth0/angular-jwt';
8
- import { Router } from '@angular/router';
9
5
 
10
6
  interface Message {
11
7
  id: string;
@@ -19,10 +15,24 @@ interface Message {
19
15
  agent?: string;
20
16
  }
21
17
 
18
+ declare class LoginRequest {
19
+ username: string;
20
+ password: string;
21
+ rememberMe?: boolean;
22
+ }
23
+
24
+ interface UserContext {
25
+ userId: string;
26
+ userName: string;
27
+ userEmail: string;
28
+ metadata?: Record<string, any>;
29
+ }
30
+
22
31
  declare class DoohbotInput {
23
32
  username: string;
24
33
  password: string;
25
34
  authToken?: string;
35
+ licenseKey?: string;
26
36
  DOOHBOT_API_URL?: string;
27
37
  userAvatarUrl: string;
28
38
  readonly appTitle?: "DoohBot" | undefined;
@@ -102,13 +112,6 @@ interface DoohbotApiConfig {
102
112
  */
103
113
  declare const DOOHBOT_API_CONFIG: InjectionToken<DoohbotApiConfig>;
104
114
 
105
- interface UserContext {
106
- userId: string;
107
- userName: string;
108
- userEmail: string;
109
- metadata?: Record<string, any>;
110
- }
111
-
112
115
  interface DoohbotThemeConfig {
113
116
  fontFamily?: string;
114
117
  primaryColor?: string;
@@ -156,17 +159,10 @@ interface ChatSession {
156
159
  contextKey: string;
157
160
  userId: string;
158
161
  }
159
- interface ChatSessionGroup {
160
- label: string;
161
- sessions: ChatSession[];
162
- }
163
162
 
164
- declare class LoginRequest {
165
- username: string;
166
- password: string;
167
- }
163
+ type AuthStatus = 'unknown' | 'authenticated' | 'unauthenticated' | 'expired';
168
164
 
169
- declare class Doohbot extends DoohbotInput implements OnDestroy {
165
+ declare class Doohbot extends DoohbotInput implements OnInit, OnDestroy {
170
166
  private elementRef;
171
167
  private renderer;
172
168
  config: DoohbotInput;
@@ -191,42 +187,36 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
191
187
  private chatFacade;
192
188
  private uiState;
193
189
  private themeService;
190
+ private authService;
194
191
  isChatOpen: i0.WritableSignal<boolean>;
195
192
  isHistorySidebarOpen: i0.WritableSignal<boolean>;
196
- unreadCount: i0.Signal<number>;
197
193
  isFullScreen: i0.WritableSignal<boolean>;
198
- isAuthenticated: i0.WritableSignal<boolean>;
194
+ unreadCount: i0.Signal<number>;
199
195
  messages: i0.WritableSignal<Message[]>;
200
196
  isBotTyping: i0.WritableSignal<boolean>;
201
- chatSessions: i0.WritableSignal<ChatSession[]>;
202
197
  messageError: i0.WritableSignal<string | null>;
203
198
  showSuggestionChips: i0.Signal<boolean>;
204
- isGuestMode: i0.WritableSignal<boolean>;
199
+ chatSessions: i0.WritableSignal<ChatSession[]>;
200
+ hasMoreHistory: i0.WritableSignal<boolean>;
201
+ isLoadingMore: i0.WritableSignal<boolean>;
202
+ isLoadingSessions: i0.WritableSignal<boolean>;
205
203
  isLoggingIn: i0.WritableSignal<boolean>;
206
204
  authError: i0.WritableSignal<string | null>;
207
205
  authSuccess: i0.WritableSignal<string | null>;
208
206
  userName: string;
209
207
  predefinedMessages: string[];
208
+ suggestedMessages: string[];
210
209
  maxMessageLength: number;
211
210
  private contextCleanup?;
212
- /**
213
- * Check if current user is a guest user
214
- */
215
- isGuestUser: i0.Signal<boolean>;
216
- /**
217
- * Helper method to check if a user ID belongs to a guest user
218
- */
219
- private checkIfGuestUser;
211
+ isAuthenticated: boolean;
212
+ authStatus: AuthStatus;
220
213
  chatWindowRef: ElementRef;
221
214
  fullscreenDirective: FullscreenDirective;
222
215
  constructor(elementRef: ElementRef, renderer: Renderer2);
223
- ngOnChanges(changes: SimpleChanges): void;
224
216
  ngOnInit(): void;
225
- ngOnDestroy(): void;
226
- private performLogin;
227
- performLoginWithCredentials(credentials: LoginRequest): void;
228
- continueAsGuest(): void;
229
- disableGuestMode(): void;
217
+ private initializeUI;
218
+ ngOnChanges(changes: SimpleChanges): void;
219
+ onNormalLogin(credentials: LoginRequest): void;
230
220
  performLogout(): void;
231
221
  toggleChat(): void;
232
222
  sendMessage(text: string): Promise<void>;
@@ -236,12 +226,25 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
236
226
  loadChatSession(session: ChatSession): void;
237
227
  deleteSession(sessionId: string): void;
238
228
  private loadUserSessions;
229
+ /**
230
+ * Load more sessions for infinite scroll
231
+ */
232
+ loadMoreHistory(): void;
233
+ /**
234
+ * Manually refresh history
235
+ */
236
+ refreshHistory(): void;
239
237
  toggleFullScreen(): void;
240
238
  trackByMessageId(index: number, item: any): string;
239
+ /**
240
+ * Resolve and update the username from all available sources
241
+ */
242
+ private updateUserName;
243
+ ngOnDestroy(): void;
241
244
  static ɵfac: i0.ɵɵFactoryDeclaration<Doohbot, never>;
242
245
  static ɵcmp: i0.ɵɵComponentDeclaration<Doohbot, "app-doohbot", never, { "config": { "alias": "config"; "required": false; }; "platformTenant": { "alias": "platformTenant"; "required": false; }; "subTenant": { "alias": "subTenant"; "required": false; }; "agent": { "alias": "agent"; "required": false; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; "enableResize": { "alias": "enableResize"; "required": false; }; "apiConfig": { "alias": "apiConfig"; "required": false; }; "userContext": { "alias": "userContext"; "required": false; }; "themeConfig": { "alias": "themeConfig"; "required": false; }; }, {}, never, never, true, never>;
243
246
  }
244
- declare function initializeApp(): () => Promise<any>;
247
+ declare function initializeApp(): Promise<any>;
245
248
 
246
249
  declare const appConst: {
247
250
  APP_LOGO: string;
@@ -251,8 +254,6 @@ declare const appConst: {
251
254
  BOT_AVATAR: string;
252
255
  };
253
256
 
254
- declare const DOOHBOT_API_URL: InjectionToken<string>;
255
-
256
257
  interface ChatContext {
257
258
  platformTenant: string;
258
259
  subTenant: string;
@@ -266,140 +267,6 @@ interface TenantConfig extends ChatContext {
266
267
  userContext?: UserContext;
267
268
  }
268
269
 
269
- type ThemeMode = 'light' | 'dark' | 'auto';
270
- declare class ThemeService implements OnDestroy {
271
- private overlay;
272
- private renderer;
273
- private _theme;
274
- theme: i0.Signal<ThemeMode>;
275
- private _activeTheme;
276
- activeTheme: i0.Signal<"light-theme" | "dark-theme">;
277
- private observer;
278
- constructor(rendererFactory: RendererFactory2, overlay: OverlayContainer);
279
- setTheme(mode: ThemeMode): void;
280
- private updateActiveTheme;
281
- private handleAutoTheme;
282
- private detectAndApplyParentTheme;
283
- private isParentDark;
284
- private applyThemeToGlobal;
285
- private cleanupObservers;
286
- ngOnDestroy(): void;
287
- applyCssVariables(element: HTMLElement, config: DoohbotThemeConfig | undefined): void;
288
- private parseColor;
289
- static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
290
- static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
291
- }
292
-
293
- declare class ChatWindowComponent implements OnInit, OnDestroy, OnChanges {
294
- isChatOpen: boolean;
295
- enableDrag: boolean;
296
- enableResize: boolean;
297
- isFullScreen: boolean;
298
- isAuthenticated: boolean;
299
- appTitle: string;
300
- appLogoUrl: string;
301
- appTextLogoUrl: string;
302
- appHeaderLogoUrl: string;
303
- moreIcon: string;
304
- minimizeIcon: string;
305
- messages: Message[];
306
- isBotTyping: boolean;
307
- appSubtitle: string;
308
- welcomeDesc: string;
309
- predefinedMessages: string[];
310
- botAvatarUrl: string;
311
- userAvatarUrl: string;
312
- userName: string;
313
- trackByMessageId: TrackByFunction<Message>;
314
- hintText: string;
315
- sendIcon: string;
316
- messageError: string | null;
317
- showSuggestionChips: boolean;
318
- isHistorySidebarOpen: boolean;
319
- chatSessions: ChatSession[];
320
- chatHistoryUserName: string;
321
- isGuestUser: boolean;
322
- isGuestMode: boolean;
323
- isLoggingIn: boolean;
324
- authError: string | null;
325
- authSuccess: string | null;
326
- themeConfig: DoohbotThemeConfig | undefined;
327
- toggleChat: EventEmitter<void>;
328
- toggleFullScreen: EventEmitter<void>;
329
- toggleHistorySidebar: EventEmitter<void>;
330
- openSettings: EventEmitter<void>;
331
- suggestionClick: EventEmitter<string>;
332
- send: EventEmitter<string>;
333
- clearMessageError: EventEmitter<void>;
334
- clearChat: EventEmitter<void>;
335
- sessionSelected: EventEmitter<ChatSession>;
336
- sessionDeleted: EventEmitter<string>;
337
- continueAsGuest: EventEmitter<void>;
338
- loginClick: EventEmitter<void>;
339
- loginSubmit: EventEmitter<{
340
- username: string;
341
- password: string;
342
- }>;
343
- logout: EventEmitter<void>;
344
- themeService: ThemeService;
345
- loginUsername: string;
346
- loginPassword: string;
347
- showLoginForm: boolean;
348
- showPassword: boolean;
349
- togglePasswordVisibility(): void;
350
- onToggleChat(): void;
351
- onToggleHistorySidebar(): void;
352
- onLoginClick(): void;
353
- onLoginSubmit(): void;
354
- onCancelLogin(): void;
355
- onToggleFullScreen(): void;
356
- onOpenSettings(): void;
357
- onSuggestionClick(text: string): void;
358
- onSend(text: string): void;
359
- onClearMessageError(): void;
360
- onClearAuthError(): void;
361
- onClearChat(): void;
362
- onLogout(): void;
363
- onSessionSelected(session: ChatSession): void;
364
- onSessionDeleted(sessionId: string): void;
365
- onContinueAsGuest(): void;
366
- onPopoutShown(win: Window): void;
367
- ngOnInit(): void;
368
- ngOnChanges(changes: SimpleChanges): void;
369
- ngOnDestroy(): void;
370
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatWindowComponent, never>;
371
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatWindowComponent, "app-chat-window", never, { "isChatOpen": { "alias": "isChatOpen"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; "enableResize": { "alias": "enableResize"; "required": false; }; "isFullScreen": { "alias": "isFullScreen"; "required": false; }; "isAuthenticated": { "alias": "isAuthenticated"; "required": false; }; "appTitle": { "alias": "appTitle"; "required": false; }; "appLogoUrl": { "alias": "appLogoUrl"; "required": false; }; "appTextLogoUrl": { "alias": "appTextLogoUrl"; "required": false; }; "appHeaderLogoUrl": { "alias": "appHeaderLogoUrl"; "required": false; }; "moreIcon": { "alias": "moreIcon"; "required": false; }; "minimizeIcon": { "alias": "minimizeIcon"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "isBotTyping": { "alias": "isBotTyping"; "required": false; }; "appSubtitle": { "alias": "appSubtitle"; "required": false; }; "welcomeDesc": { "alias": "welcomeDesc"; "required": false; }; "predefinedMessages": { "alias": "predefinedMessages"; "required": false; }; "botAvatarUrl": { "alias": "botAvatarUrl"; "required": false; }; "userAvatarUrl": { "alias": "userAvatarUrl"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; "trackByMessageId": { "alias": "trackByMessageId"; "required": false; }; "hintText": { "alias": "hintText"; "required": false; }; "sendIcon": { "alias": "sendIcon"; "required": false; }; "messageError": { "alias": "messageError"; "required": false; }; "showSuggestionChips": { "alias": "showSuggestionChips"; "required": false; }; "isHistorySidebarOpen": { "alias": "isHistorySidebarOpen"; "required": false; }; "chatSessions": { "alias": "chatSessions"; "required": false; }; "chatHistoryUserName": { "alias": "chatHistoryUserName"; "required": false; }; "isGuestUser": { "alias": "isGuestUser"; "required": false; }; "isGuestMode": { "alias": "isGuestMode"; "required": false; }; "isLoggingIn": { "alias": "isLoggingIn"; "required": false; }; "authError": { "alias": "authError"; "required": false; }; "authSuccess": { "alias": "authSuccess"; "required": false; }; "themeConfig": { "alias": "themeConfig"; "required": false; }; }, { "toggleChat": "toggleChat"; "toggleFullScreen": "toggleFullScreen"; "toggleHistorySidebar": "toggleHistorySidebar"; "openSettings": "openSettings"; "suggestionClick": "suggestionClick"; "send": "send"; "clearMessageError": "clearMessageError"; "clearChat": "clearChat"; "sessionSelected": "sessionSelected"; "sessionDeleted": "sessionDeleted"; "continueAsGuest": "continueAsGuest"; "loginClick": "loginClick"; "loginSubmit": "loginSubmit"; "logout": "logout"; }, never, never, true, never>;
372
- }
373
-
374
- declare class MessageListComponent implements AfterViewInit, OnDestroy {
375
- messages: Message[];
376
- isBotTyping: boolean;
377
- appLogoUrl: string;
378
- appSubtitle: string;
379
- welcomeDesc: string;
380
- predefinedMessages: string[];
381
- botAvatarUrl: string;
382
- userAvatarUrl: string;
383
- userName: string;
384
- isAuthenticated: boolean;
385
- isGuestMode: boolean;
386
- trackByMessageId: TrackByFunction<Message>;
387
- suggestionClick: EventEmitter<string>;
388
- loginClick: EventEmitter<void>;
389
- continueAsGuest: EventEmitter<void>;
390
- private chatMessagesContainer;
391
- private mutationObserver;
392
- appEmoji: {
393
- waveHand: string;
394
- };
395
- ngAfterViewInit(): void;
396
- private scrollToBottom;
397
- ngOnDestroy(): void;
398
- onPredefinedClick(text: string): void;
399
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageListComponent, never>;
400
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageListComponent, "app-message-list", never, { "messages": { "alias": "messages"; "required": false; }; "isBotTyping": { "alias": "isBotTyping"; "required": false; }; "appLogoUrl": { "alias": "appLogoUrl"; "required": false; }; "appSubtitle": { "alias": "appSubtitle"; "required": false; }; "welcomeDesc": { "alias": "welcomeDesc"; "required": false; }; "predefinedMessages": { "alias": "predefinedMessages"; "required": false; }; "botAvatarUrl": { "alias": "botAvatarUrl"; "required": false; }; "userAvatarUrl": { "alias": "userAvatarUrl"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; "isAuthenticated": { "alias": "isAuthenticated"; "required": false; }; "isGuestMode": { "alias": "isGuestMode"; "required": false; }; "trackByMessageId": { "alias": "trackByMessageId"; "required": false; }; }, { "suggestionClick": "suggestionClick"; "loginClick": "loginClick"; "continueAsGuest": "continueAsGuest"; }, never, never, true, never>;
401
- }
402
-
403
270
  interface DialogData {
404
271
  title: string;
405
272
  message: string;
@@ -478,487 +345,5 @@ declare class DropdownMenu implements AfterContentInit {
478
345
  static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenu, "app-dropdown-menu", never, {}, {}, ["menuItems"], ["[trigger]", "*"], true, never>;
479
346
  }
480
347
 
481
- /**
482
- * Response from chat API
483
- */
484
- interface ChatApiResponse {
485
- /**
486
- * Bot's reply message
487
- */
488
- reply: string;
489
- /**
490
- * Optional confidence score (0-1)
491
- */
492
- confidence?: number;
493
- /**
494
- * Whether to show suggestion chips
495
- */
496
- showSuggestions?: boolean;
497
- /**
498
- * Optional suggested responses
499
- */
500
- suggestions?: string[];
501
- /**
502
- * Optional metadata from the API
503
- */
504
- metadata?: Record<string, any>;
505
- /**
506
- * Optional message ID from the backend
507
- */
508
- messageId?: string;
509
- }
510
-
511
- declare class ChatbotApiService {
512
- private http;
513
- private tenantContext;
514
- private config;
515
- /**
516
- * Send a chat message to the API
517
- * @param message User's message text
518
- * @param history Optional message history for context
519
- * @returns Observable of the API response
520
- */
521
- sendMessage(message: string, history?: Message[]): Observable<ChatApiResponse>;
522
- /**
523
- * Build request payload with current tenant context
524
- */
525
- private buildRequest;
526
- /**
527
- * Build HTTP headers
528
- */
529
- private buildHeaders;
530
- /**
531
- * Apply retry strategy based on configuration
532
- */
533
- private applyRetryStrategy;
534
- /**
535
- * Determine if error should trigger a retry
536
- */
537
- private shouldRetry;
538
- /**
539
- * Validate API response
540
- */
541
- private validateResponse;
542
- /**
543
- * Handle API errors
544
- */
545
- private handleError;
546
- /**
547
- * Check if API is enabled
548
- */
549
- isApiEnabled(): boolean;
550
- /**
551
- * Get current API configuration
552
- */
553
- getConfig(): DoohbotApiConfig;
554
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotApiService, never>;
555
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotApiService>;
556
- }
557
-
558
- declare class AuthResult {
559
- access_token: string;
560
- refresh_token: string;
561
- }
562
-
563
- declare class CryptoHelperService {
564
- private encoder;
565
- private decoder;
566
- private secretKey;
567
- setSecretKey(key: string): void;
568
- private getKey;
569
- encrypt(value: string): Promise<string | null>;
570
- decrypt(value: string): Promise<string | null>;
571
- static ɵfac: i0.ɵɵFactoryDeclaration<CryptoHelperService, never>;
572
- static ɵprov: i0.ɵɵInjectableDeclaration<CryptoHelperService>;
573
- }
574
-
575
- declare global {
576
- interface Window {
577
- storageEventAdded?: boolean;
578
- tabCLoseEventAdded?: boolean;
579
- }
580
- }
581
- declare class AuthService {
582
- private router;
583
- private http;
584
- private cryptoHelper;
585
- apiUrl: string;
586
- storageKey: string;
587
- secretKey: string;
588
- companyCode: string;
589
- jwtHelper: JwtHelperService;
590
- constructor(router: Router, http: HttpClient, cryptoHelper: CryptoHelperService);
591
- logout(): Observable<boolean>;
592
- setSession(session: AuthResult): void;
593
- setLocalStorage(key: string, value: any): void;
594
- getLocalStorage(key: string): any;
595
- isAuthenticated(): boolean;
596
- isTokenExpired(): boolean;
597
- encrypt(value: string): any;
598
- decrypt(value: string): string | null;
599
- clearAuth(): void;
600
- clearSession(): void;
601
- clearTabInfo(): void;
602
- clearStorage(): void;
603
- clearCache(): void;
604
- getUserId(): any;
605
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
606
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
607
- }
608
-
609
- declare class HttpService {
610
- private http;
611
- apiUrl: string;
612
- constructor(http: HttpClient);
613
- get(url: string, param?: object, nestedParam?: boolean, showLoader?: boolean, refresh?: boolean): Observable<any>;
614
- private buildHttpParams;
615
- post(url: string, param?: object, showLoader?: boolean): Observable<any>;
616
- private returnResponse;
617
- static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
618
- static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
619
- }
620
-
621
- declare class ApiResponse<T> {
622
- success: boolean;
623
- message: string;
624
- data?: T;
625
- constructor(success: boolean, message: string, data?: T);
626
- }
627
-
628
- declare class AccountService {
629
- private http;
630
- constructor(http: HttpService);
631
- login(param?: LoginRequest, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
632
- logout(refreshToken: string, showLoader?: boolean): Observable<ApiResponse<any>>;
633
- startChat(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
634
- getChatHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
635
- deleteHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
636
- refreshLogin(param?: object, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
637
- static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
638
- static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
639
- }
640
-
641
- /**
642
- * ChatFacadeService - High-level orchestration service
643
- *
644
- * Coordinates operations between multiple services to provide simplified,
645
- * high-level operations for the chat component. This facade encapsulates
646
- * complex interactions and provides a clean API for common chat operations.
647
- *
648
- * Responsibilities:
649
- * - Session management (load, delete, switch sessions)
650
- * - Authentication orchestration
651
- * - Message operations coordination
652
- * - Context management
653
- */
654
- declare class ChatFacadeService {
655
- private messageService;
656
- private chatHistoryService;
657
- private accountService;
658
- private authService;
659
- private tenantContextService;
660
- messages: i0.WritableSignal<Message[]>;
661
- isBotTyping: i0.WritableSignal<boolean>;
662
- chatSessions: i0.WritableSignal<ChatSession[]>;
663
- isAuthenticated: i0.WritableSignal<boolean>;
664
- isGuestMode: i0.WritableSignal<boolean>;
665
- messageError: i0.WritableSignal<string | null>;
666
- apiError: i0.WritableSignal<string | null>;
667
- authError: i0.WritableSignal<string | null>;
668
- authSuccess: i0.WritableSignal<string | null>;
669
- isLoggingIn: i0.WritableSignal<boolean>;
670
- constructor();
671
- /**
672
- * Get logged-in user's name from auth token
673
- */
674
- getLoggedInUserName(): string;
675
- /**
676
- * Load all chat sessions for a specific user and context
677
- */
678
- loadUserSessions(contextKey: string, userId: string): void;
679
- /**
680
- * Delete a specific session
681
- */
682
- deleteSession(sessionId: string, contextKey: string, userId: string): Observable<void>;
683
- /**
684
- * Load a specific session into the message service
685
- */
686
- loadSession(session: ChatSession): void;
687
- /**
688
- * Start a new chat session
689
- */
690
- startNewSession(): void;
691
- /**
692
- * Send a message with validation
693
- */
694
- sendMessage(text: string, maxLength?: number): Promise<void>;
695
- /**
696
- * Clear the current chat and start a new session
697
- */
698
- clearCurrentChat(contextKey: string, userId: string): void;
699
- /**
700
- * Clear message error
701
- */
702
- clearMessageError(): void;
703
- /**
704
- * Enable guest mode explicitly
705
- */
706
- enableGuestMode(): void;
707
- /**
708
- * Disable guest mode explicitly
709
- */
710
- disableGuestMode(): void;
711
- /**
712
- * Authenticate user with credentials
713
- */
714
- login(credentials: LoginRequest, silent?: boolean): Promise<boolean>;
715
- /**
716
- * Check if user is authenticated
717
- */
718
- checkAuthentication(): boolean;
719
- /**
720
- * Logout the current user
721
- */
722
- logout(): Promise<void>;
723
- /**
724
- * Clear authentication state and reset UI
725
- */
726
- private clearAuthState;
727
- /**
728
- * Update tenant context (platformTenant, subTenant, agent)
729
- */
730
- updateTenantContext(platformTenant: string, subTenant: string, agent: string): void;
731
- /**
732
- * Handle user context changes (for backend proxy mode)
733
- */
734
- handleUserContextChange(userContext: UserContext): void;
735
- /**
736
- * Get current context key
737
- */
738
- getCurrentContextKey(): string;
739
- /**
740
- * Subscribe to context changes
741
- */
742
- subscribeToContextChanges(callback: (contextKey: string) => void): () => void;
743
- /**
744
- * Determine if suggestion chips should be shown
745
- */
746
- showSuggestionChips: i0.Signal<boolean>;
747
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatFacadeService, never>;
748
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatFacadeService>;
749
- }
750
-
751
- declare class ChatHistoryService {
752
- private readonly STORAGE_PREFIX;
753
- private readonly LEGACY_PREFIX;
754
- constructor();
755
- /**
756
- * Create a new chat session
757
- */
758
- createSession(contextKey: string, userId: string): ChatSession;
759
- /**
760
- * Check if user is a guest/anonymous user who shouldn't have chat history
761
- */
762
- private isGuestUser;
763
- /**
764
- * Save a message to a specific session
765
- */
766
- saveMessageToSession(session: ChatSession, message: Message): Observable<void>;
767
- /**
768
- * Save entire session
769
- */
770
- saveSession(session: ChatSession): Observable<void>;
771
- /**
772
- * Load all sessions for a context and user
773
- */
774
- loadAllSessions(contextKey: string, userId: string): Observable<ChatSession[]>;
775
- /**
776
- * Load all sessions synchronously (for internal use)
777
- */
778
- private loadAllSessionsSync;
779
- /**
780
- * Load a specific session
781
- */
782
- loadSession(sessionId: string, contextKey: string, userId: string): Observable<ChatSession | null>;
783
- /**
784
- * Delete a session
785
- */
786
- deleteSession(sessionId: string, contextKey: string, userId: string): Observable<void>;
787
- /**
788
- * Clear all sessions for a context and user
789
- */
790
- clearAllSessions(contextKey: string, userId: string): Observable<void>;
791
- /**
792
- * Generate a unique session ID for a session
793
- */
794
- private generateSessionId;
795
- private generateRandomString;
796
- /**
797
- * Generate a title from the first message
798
- */
799
- private generateTitle;
800
- /**
801
- * Get storage key for sessions
802
- */
803
- private getSessionStorageKey;
804
- /**
805
- * Migrate legacy flat message history to session format
806
- */
807
- private migrateLegacyData;
808
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatHistoryService, never>;
809
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatHistoryService>;
810
- }
811
-
812
- declare abstract class StorageService {
813
- abstract getItem(key: string): string | null;
814
- abstract setItem(key: string, value: string): void;
815
- abstract removeItem(key: string): void;
816
- abstract clear(): void;
817
- abstract get length(): number;
818
- abstract key(index: number): string | null;
819
- abstract getAllKeys(): string[];
820
- }
821
- declare class LocalStorageService extends StorageService {
822
- getItem(key: string): string | null;
823
- setItem(key: string, value: string): void;
824
- removeItem(key: string): void;
825
- clear(): void;
826
- get length(): number;
827
- key(index: number): string | null;
828
- getAllKeys(): string[];
829
- static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
830
- static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageService>;
831
- }
832
- declare function provideStorage(): {
833
- provide: typeof StorageService;
834
- useClass: typeof LocalStorageService;
835
- };
836
-
837
- declare const PredefinedMessages: string[];
838
-
839
- declare class ChatButtonComponent {
840
- buttonStyle: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
841
- isChatOpen: boolean;
842
- unreadCount: number;
843
- chatIcon: string;
844
- appTitle: string;
845
- appLogoUrl: string;
846
- appTextLogoUrl: string;
847
- toggle: EventEmitter<void>;
848
- get isSidebar(): boolean;
849
- get sidebarPosition(): 'top' | 'center' | 'bottom';
850
- onToggle(): void;
851
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatButtonComponent, never>;
852
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatButtonComponent, "app-chat-button", never, { "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "isChatOpen": { "alias": "isChatOpen"; "required": false; }; "unreadCount": { "alias": "unreadCount"; "required": false; }; "chatIcon": { "alias": "chatIcon"; "required": false; }; "appTitle": { "alias": "appTitle"; "required": false; }; "appLogoUrl": { "alias": "appLogoUrl"; "required": false; }; "appTextLogoUrl": { "alias": "appTextLogoUrl"; "required": false; }; }, { "toggle": "toggle"; }, never, never, true, never>;
853
- }
854
-
855
- declare class MessageInputComponent {
856
- isBotTyping: boolean;
857
- hintText: string;
858
- sendIcon: string;
859
- send: EventEmitter<string>;
860
- onSend(text: string): void;
861
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
862
- static ɵcmp: i0.ɵɵComponentDeclaration<MessageInputComponent, "app-message-input", never, { "isBotTyping": { "alias": "isBotTyping"; "required": false; }; "hintText": { "alias": "hintText"; "required": false; }; "sendIcon": { "alias": "sendIcon"; "required": false; }; }, { "send": "send"; }, never, never, true, never>;
863
- }
864
-
865
- declare class ChatHistorySidebarComponent implements OnInit, OnChanges {
866
- private dialogService;
867
- sessions: ChatSession[];
868
- isOpen: boolean;
869
- userName: string;
870
- sessionSelected: EventEmitter<ChatSession>;
871
- sessionDeleted: EventEmitter<string>;
872
- closed: EventEmitter<void>;
873
- chatHistory: ChatSessionGroup[];
874
- constructor(dialogService: DialogService);
875
- ngOnInit(): void;
876
- ngOnChanges(changes: SimpleChanges): void;
877
- groupedSessions(): ChatSessionGroup[];
878
- onSessionClick(session: ChatSession): void;
879
- onDeleteClick(event: Event, sessionId: string): void;
880
- onClose(): void;
881
- formatTime(date: Date): string;
882
- formatDate(date: Date): string;
883
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatHistorySidebarComponent, never>;
884
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatHistorySidebarComponent, "app-chat-history-sidebar", never, { "sessions": { "alias": "sessions"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; }, { "sessionSelected": "sessionSelected"; "sessionDeleted": "sessionDeleted"; "closed": "closed"; }, never, never, true, never>;
885
- }
886
-
887
- declare class PopoutWindowDirective implements OnDestroy {
888
- private renderer2;
889
- private elementRef;
890
- private innerWrapper;
891
- windowWidth: number;
892
- windowHeight: number;
893
- windowLeft: number;
894
- windowTop: number;
895
- windowTitle: string;
896
- windowStyle: string;
897
- windowStyleUrl: string;
898
- suppressCloneStyles: boolean;
899
- get isPoppedOut(): boolean;
900
- closed: EventEmitter<boolean>;
901
- shown: EventEmitter<Window>;
902
- private popoutWindow;
903
- private isOut;
904
- private observer;
905
- beforeunloadHandler(): void;
906
- constructor(renderer2: Renderer2, elementRef: ElementRef);
907
- ngOnDestroy(): void;
908
- private close;
909
- popIn(): void;
910
- popOut(): void;
911
- private observeStyleChanges;
912
- static ɵfac: i0.ɵɵFactoryDeclaration<PopoutWindowDirective, never>;
913
- static ɵcmp: i0.ɵɵComponentDeclaration<PopoutWindowDirective, "popout-window", never, { "windowWidth": { "alias": "windowWidth"; "required": false; }; "windowHeight": { "alias": "windowHeight"; "required": false; }; "windowLeft": { "alias": "windowLeft"; "required": false; }; "windowTop": { "alias": "windowTop"; "required": false; }; "windowTitle": { "alias": "windowTitle"; "required": false; }; "windowStyle": { "alias": "windowStyle"; "required": false; }; "windowStyleUrl": { "alias": "windowStyleUrl"; "required": false; }; "suppressCloneStyles": { "alias": "suppressCloneStyles"; "required": false; }; "isPoppedOut": { "alias": "isPoppedOut"; "required": false; }; }, { "closed": "closed"; "shown": "shown"; }, never, ["*"], true, never>;
914
- }
915
-
916
- declare class DraggableDialogDirective implements OnInit {
917
- private el;
918
- private renderer;
919
- private isDragging;
920
- private startX;
921
- private startY;
922
- private offsetX;
923
- private offsetY;
924
- dragHandleSelector: string | undefined;
925
- enableDrag: boolean;
926
- private dragHandle;
927
- constructor(el: ElementRef, renderer: Renderer2);
928
- ngOnInit(): void;
929
- onMouseDown(event: MouseEvent): void;
930
- onMouseMove(event: MouseEvent): void;
931
- onMouseUp(): void;
932
- static ɵfac: i0.ɵɵFactoryDeclaration<DraggableDialogDirective, never>;
933
- static ɵdir: i0.ɵɵDirectiveDeclaration<DraggableDialogDirective, "[draggableDialog]", never, { "dragHandleSelector": { "alias": "dragHandle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; }, {}, never, never, true, never>;
934
- }
935
-
936
- declare class ResizableDialogDirective implements OnInit, OnDestroy {
937
- private el;
938
- private renderer;
939
- private resizeHandles;
940
- private activeHandle;
941
- private startX;
942
- private startY;
943
- private startWidth;
944
- private startHeight;
945
- private startLeft;
946
- private startTop;
947
- enableResize: boolean;
948
- private directions;
949
- constructor(el: ElementRef<HTMLElement>, renderer: Renderer2);
950
- ngOnInit(): void;
951
- ngOnDestroy(): void;
952
- private setStyle;
953
- private createResizeHandles;
954
- private removeResizeHandles;
955
- onMouseDown(event: MouseEvent): void;
956
- onMouseMove(event: MouseEvent): void;
957
- onMouseUp(): void;
958
- private getComputedStyleValue;
959
- static ɵfac: i0.ɵɵFactoryDeclaration<ResizableDialogDirective, never>;
960
- static ɵdir: i0.ɵɵDirectiveDeclaration<ResizableDialogDirective, "[resizableDialog]", never, { "enableResize": { "alias": "enableResize"; "required": false; }; }, {}, never, never, true, never>;
961
- }
962
-
963
- export { AccountService, AuthService, ChatButtonComponent, ChatFacadeService, ChatHistoryService, ChatHistorySidebarComponent, ChatWindowComponent, ChatbotApiService, Chips, DOOHBOT_API_CONFIG, DOOHBOT_API_URL, DialogComponent, DialogService, Doohbot, DoohbotInput, DraggableDialogDirective, DropdownMenu, FullscreenDirective, LocalStorageService, MenuItem, MessageInputComponent, MessageListComponent, PopoutWindowDirective, PredefinedMessages, ResizableDialogDirective, SnackBar, StorageService, ThemeService, appConst, initializeApp, provideStorage };
964
- export type { ChatContext, ChatSession, ChatSessionGroup, DialogData, DoohbotApiConfig, DoohbotThemeConfig, TenantConfig, ThemeMode, UserContext };
348
+ export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotInput, DropdownMenu, MenuItem, SnackBar, appConst, initializeApp };
349
+ export type { DialogData, DoohbotApiConfig, DoohbotThemeConfig, TenantConfig, UserContext };