@aakash58/chatbot 1.0.96 → 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, EnvironmentProviders } 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,43 +187,36 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
191
187
  private chatFacade;
192
188
  private uiState;
193
189
  private themeService;
194
- private configService;
190
+ private authService;
195
191
  isChatOpen: i0.WritableSignal<boolean>;
196
192
  isHistorySidebarOpen: i0.WritableSignal<boolean>;
197
- unreadCount: i0.Signal<number>;
198
193
  isFullScreen: i0.WritableSignal<boolean>;
199
- isAuthenticated: i0.WritableSignal<boolean>;
194
+ unreadCount: i0.Signal<number>;
200
195
  messages: i0.WritableSignal<Message[]>;
201
196
  isBotTyping: i0.WritableSignal<boolean>;
202
- chatSessions: i0.WritableSignal<ChatSession[]>;
203
197
  messageError: i0.WritableSignal<string | null>;
204
198
  showSuggestionChips: i0.Signal<boolean>;
205
- isGuestMode: i0.WritableSignal<boolean>;
199
+ chatSessions: i0.WritableSignal<ChatSession[]>;
200
+ hasMoreHistory: i0.WritableSignal<boolean>;
201
+ isLoadingMore: i0.WritableSignal<boolean>;
202
+ isLoadingSessions: i0.WritableSignal<boolean>;
206
203
  isLoggingIn: i0.WritableSignal<boolean>;
207
204
  authError: i0.WritableSignal<string | null>;
208
205
  authSuccess: i0.WritableSignal<string | null>;
209
206
  userName: string;
210
207
  predefinedMessages: string[];
208
+ suggestedMessages: string[];
211
209
  maxMessageLength: number;
212
210
  private contextCleanup?;
213
- /**
214
- * Check if current user is a guest user
215
- */
216
- isGuestUser: i0.Signal<boolean>;
217
- /**
218
- * Helper method to check if a user ID belongs to a guest user
219
- */
220
- private checkIfGuestUser;
211
+ isAuthenticated: boolean;
212
+ authStatus: AuthStatus;
221
213
  chatWindowRef: ElementRef;
222
214
  fullscreenDirective: FullscreenDirective;
223
215
  constructor(elementRef: ElementRef, renderer: Renderer2);
224
- ngOnChanges(changes: SimpleChanges): void;
225
216
  ngOnInit(): void;
226
- ngOnDestroy(): void;
227
- private performLogin;
228
- performLoginWithCredentials(credentials: LoginRequest): void;
229
- continueAsGuest(): void;
230
- disableGuestMode(): void;
217
+ private initializeUI;
218
+ ngOnChanges(changes: SimpleChanges): void;
219
+ onNormalLogin(credentials: LoginRequest): void;
231
220
  performLogout(): void;
232
221
  toggleChat(): void;
233
222
  sendMessage(text: string): Promise<void>;
@@ -237,11 +226,25 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
237
226
  loadChatSession(session: ChatSession): void;
238
227
  deleteSession(sessionId: string): void;
239
228
  private loadUserSessions;
229
+ /**
230
+ * Load more sessions for infinite scroll
231
+ */
232
+ loadMoreHistory(): void;
233
+ /**
234
+ * Manually refresh history
235
+ */
236
+ refreshHistory(): void;
240
237
  toggleFullScreen(): void;
241
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;
242
244
  static ɵfac: i0.ɵɵFactoryDeclaration<Doohbot, never>;
243
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>;
244
246
  }
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,490 +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
- declare function initializeDoohbotApp(): () => Promise<any>;
482
- declare function provideDoohbot(): EnvironmentProviders;
483
-
484
- /**
485
- * Response from chat API
486
- */
487
- interface ChatApiResponse {
488
- /**
489
- * Bot's reply message
490
- */
491
- reply: string;
492
- /**
493
- * Optional confidence score (0-1)
494
- */
495
- confidence?: number;
496
- /**
497
- * Whether to show suggestion chips
498
- */
499
- showSuggestions?: boolean;
500
- /**
501
- * Optional suggested responses
502
- */
503
- suggestions?: string[];
504
- /**
505
- * Optional metadata from the API
506
- */
507
- metadata?: Record<string, any>;
508
- /**
509
- * Optional message ID from the backend
510
- */
511
- messageId?: string;
512
- }
513
-
514
- declare class ChatbotApiService {
515
- private http;
516
- private tenantContext;
517
- private config;
518
- /**
519
- * Send a chat message to the API
520
- * @param message User's message text
521
- * @param history Optional message history for context
522
- * @returns Observable of the API response
523
- */
524
- sendMessage(message: string, history?: Message[]): Observable<ChatApiResponse>;
525
- /**
526
- * Build request payload with current tenant context
527
- */
528
- private buildRequest;
529
- /**
530
- * Build HTTP headers
531
- */
532
- private buildHeaders;
533
- /**
534
- * Apply retry strategy based on configuration
535
- */
536
- private applyRetryStrategy;
537
- /**
538
- * Determine if error should trigger a retry
539
- */
540
- private shouldRetry;
541
- /**
542
- * Validate API response
543
- */
544
- private validateResponse;
545
- /**
546
- * Handle API errors
547
- */
548
- private handleError;
549
- /**
550
- * Check if API is enabled
551
- */
552
- isApiEnabled(): boolean;
553
- /**
554
- * Get current API configuration
555
- */
556
- getConfig(): DoohbotApiConfig;
557
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotApiService, never>;
558
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotApiService>;
559
- }
560
-
561
- declare class AuthResult {
562
- access_token: string;
563
- refresh_token: string;
564
- }
565
-
566
- declare class CryptoHelperService {
567
- private encoder;
568
- private decoder;
569
- private secretKey;
570
- setSecretKey(key: string): void;
571
- private getKey;
572
- encrypt(value: string): Promise<string | null>;
573
- decrypt(value: string): Promise<string | null>;
574
- static ɵfac: i0.ɵɵFactoryDeclaration<CryptoHelperService, never>;
575
- static ɵprov: i0.ɵɵInjectableDeclaration<CryptoHelperService>;
576
- }
577
-
578
- declare global {
579
- interface Window {
580
- storageEventAdded?: boolean;
581
- tabCLoseEventAdded?: boolean;
582
- }
583
- }
584
- declare class AuthService {
585
- private router;
586
- private http;
587
- private cryptoHelper;
588
- apiUrl: string;
589
- storageKey: string;
590
- secretKey: string;
591
- companyCode: string;
592
- jwtHelper: JwtHelperService;
593
- constructor(router: Router, http: HttpClient, cryptoHelper: CryptoHelperService);
594
- logout(): Observable<boolean>;
595
- setSession(session: AuthResult): void;
596
- setLocalStorage(key: string, value: any): void;
597
- getLocalStorage(key: string): any;
598
- isAuthenticated(): boolean;
599
- isTokenExpired(): boolean;
600
- encrypt(value: string): any;
601
- decrypt(value: string): string | null;
602
- clearAuth(): void;
603
- clearSession(): void;
604
- clearTabInfo(): void;
605
- clearStorage(): void;
606
- clearCache(): void;
607
- getUserId(): any;
608
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
609
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
610
- }
611
-
612
- declare class HttpService {
613
- private http;
614
- apiUrl: string;
615
- constructor(http: HttpClient);
616
- get(url: string, param?: object, nestedParam?: boolean, showLoader?: boolean, refresh?: boolean): Observable<any>;
617
- private buildHttpParams;
618
- post(url: string, param?: object, showLoader?: boolean): Observable<any>;
619
- private returnResponse;
620
- static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
621
- static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
622
- }
623
-
624
- declare class ApiResponse<T> {
625
- success: boolean;
626
- message: string;
627
- data?: T;
628
- constructor(success: boolean, message: string, data?: T);
629
- }
630
-
631
- declare class AccountService {
632
- private http;
633
- constructor(http: HttpService);
634
- login(param?: LoginRequest, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
635
- logout(refreshToken: string, showLoader?: boolean): Observable<ApiResponse<any>>;
636
- startChat(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
637
- getChatHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
638
- deleteHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
639
- refreshLogin(param?: object, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
640
- static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
641
- static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
642
- }
643
-
644
- /**
645
- * ChatFacadeService - High-level orchestration service
646
- *
647
- * Coordinates operations between multiple services to provide simplified,
648
- * high-level operations for the chat component. This facade encapsulates
649
- * complex interactions and provides a clean API for common chat operations.
650
- *
651
- * Responsibilities:
652
- * - Session management (load, delete, switch sessions)
653
- * - Authentication orchestration
654
- * - Message operations coordination
655
- * - Context management
656
- */
657
- declare class ChatFacadeService {
658
- private messageService;
659
- private chatHistoryService;
660
- private accountService;
661
- private authService;
662
- private tenantContextService;
663
- messages: i0.WritableSignal<Message[]>;
664
- isBotTyping: i0.WritableSignal<boolean>;
665
- chatSessions: i0.WritableSignal<ChatSession[]>;
666
- isAuthenticated: i0.WritableSignal<boolean>;
667
- isGuestMode: i0.WritableSignal<boolean>;
668
- messageError: i0.WritableSignal<string | null>;
669
- apiError: i0.WritableSignal<string | null>;
670
- authError: i0.WritableSignal<string | null>;
671
- authSuccess: i0.WritableSignal<string | null>;
672
- isLoggingIn: i0.WritableSignal<boolean>;
673
- constructor();
674
- /**
675
- * Get logged-in user's name from auth token
676
- */
677
- getLoggedInUserName(): string;
678
- /**
679
- * Load all chat sessions for a specific user and context
680
- */
681
- loadUserSessions(contextKey: string, userId: string): void;
682
- /**
683
- * Delete a specific session
684
- */
685
- deleteSession(sessionId: string, contextKey: string, userId: string): Observable<void>;
686
- /**
687
- * Load a specific session into the message service
688
- */
689
- loadSession(session: ChatSession): void;
690
- /**
691
- * Start a new chat session
692
- */
693
- startNewSession(): void;
694
- /**
695
- * Send a message with validation
696
- */
697
- sendMessage(text: string, maxLength?: number): Promise<void>;
698
- /**
699
- * Clear the current chat and start a new session
700
- */
701
- clearCurrentChat(contextKey: string, userId: string): void;
702
- /**
703
- * Clear message error
704
- */
705
- clearMessageError(): void;
706
- /**
707
- * Enable guest mode explicitly
708
- */
709
- enableGuestMode(): void;
710
- /**
711
- * Disable guest mode explicitly
712
- */
713
- disableGuestMode(): void;
714
- /**
715
- * Authenticate user with credentials
716
- */
717
- login(credentials: LoginRequest, silent?: boolean): Promise<boolean>;
718
- /**
719
- * Check if user is authenticated
720
- */
721
- checkAuthentication(): boolean;
722
- /**
723
- * Logout the current user
724
- */
725
- logout(): Promise<void>;
726
- /**
727
- * Clear authentication state and reset UI
728
- */
729
- private clearAuthState;
730
- /**
731
- * Update tenant context (platformTenant, subTenant, agent)
732
- */
733
- updateTenantContext(platformTenant: string, subTenant: string, agent: string): void;
734
- /**
735
- * Handle user context changes (for backend proxy mode)
736
- */
737
- handleUserContextChange(userContext: UserContext): void;
738
- /**
739
- * Get current context key
740
- */
741
- getCurrentContextKey(): string;
742
- /**
743
- * Subscribe to context changes
744
- */
745
- subscribeToContextChanges(callback: (contextKey: string) => void): () => void;
746
- /**
747
- * Determine if suggestion chips should be shown
748
- */
749
- showSuggestionChips: i0.Signal<boolean>;
750
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatFacadeService, never>;
751
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatFacadeService>;
752
- }
753
-
754
- declare class ChatHistoryService {
755
- private readonly STORAGE_PREFIX;
756
- private readonly LEGACY_PREFIX;
757
- constructor();
758
- /**
759
- * Create a new chat session
760
- */
761
- createSession(contextKey: string, userId: string): ChatSession;
762
- /**
763
- * Check if user is a guest/anonymous user who shouldn't have chat history
764
- */
765
- private isGuestUser;
766
- /**
767
- * Save a message to a specific session
768
- */
769
- saveMessageToSession(session: ChatSession, message: Message): Observable<void>;
770
- /**
771
- * Save entire session
772
- */
773
- saveSession(session: ChatSession): Observable<void>;
774
- /**
775
- * Load all sessions for a context and user
776
- */
777
- loadAllSessions(contextKey: string, userId: string): Observable<ChatSession[]>;
778
- /**
779
- * Load all sessions synchronously (for internal use)
780
- */
781
- private loadAllSessionsSync;
782
- /**
783
- * Load a specific session
784
- */
785
- loadSession(sessionId: string, contextKey: string, userId: string): Observable<ChatSession | null>;
786
- /**
787
- * Delete a session
788
- */
789
- deleteSession(sessionId: string, contextKey: string, userId: string): Observable<void>;
790
- /**
791
- * Clear all sessions for a context and user
792
- */
793
- clearAllSessions(contextKey: string, userId: string): Observable<void>;
794
- /**
795
- * Generate a unique session ID for a session
796
- */
797
- private generateSessionId;
798
- private generateRandomString;
799
- /**
800
- * Generate a title from the first message
801
- */
802
- private generateTitle;
803
- /**
804
- * Get storage key for sessions
805
- */
806
- private getSessionStorageKey;
807
- /**
808
- * Migrate legacy flat message history to session format
809
- */
810
- private migrateLegacyData;
811
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatHistoryService, never>;
812
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatHistoryService>;
813
- }
814
-
815
- declare abstract class StorageService {
816
- abstract getItem(key: string): string | null;
817
- abstract setItem(key: string, value: string): void;
818
- abstract removeItem(key: string): void;
819
- abstract clear(): void;
820
- abstract get length(): number;
821
- abstract key(index: number): string | null;
822
- abstract getAllKeys(): string[];
823
- }
824
- declare class LocalStorageService extends StorageService {
825
- getItem(key: string): string | null;
826
- setItem(key: string, value: string): void;
827
- removeItem(key: string): void;
828
- clear(): void;
829
- get length(): number;
830
- key(index: number): string | null;
831
- getAllKeys(): string[];
832
- static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
833
- static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageService>;
834
- }
835
- declare function provideStorage(): {
836
- provide: typeof StorageService;
837
- useClass: typeof LocalStorageService;
838
- };
839
-
840
- declare const PredefinedMessages: string[];
841
-
842
- declare class ChatButtonComponent {
843
- buttonStyle: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
844
- isChatOpen: boolean;
845
- unreadCount: number;
846
- chatIcon: string;
847
- appTitle: string;
848
- appLogoUrl: string;
849
- appTextLogoUrl: string;
850
- toggle: EventEmitter<void>;
851
- get isSidebar(): boolean;
852
- get sidebarPosition(): 'top' | 'center' | 'bottom';
853
- onToggle(): void;
854
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatButtonComponent, never>;
855
- 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>;
856
- }
857
-
858
- declare class MessageInputComponent {
859
- isBotTyping: boolean;
860
- hintText: string;
861
- sendIcon: string;
862
- send: EventEmitter<string>;
863
- onSend(text: string): void;
864
- static ɵfac: i0.ɵɵFactoryDeclaration<MessageInputComponent, never>;
865
- 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>;
866
- }
867
-
868
- declare class ChatHistorySidebarComponent implements OnInit, OnChanges {
869
- private dialogService;
870
- sessions: ChatSession[];
871
- isOpen: boolean;
872
- userName: string;
873
- sessionSelected: EventEmitter<ChatSession>;
874
- sessionDeleted: EventEmitter<string>;
875
- closed: EventEmitter<void>;
876
- chatHistory: ChatSessionGroup[];
877
- constructor(dialogService: DialogService);
878
- ngOnInit(): void;
879
- ngOnChanges(changes: SimpleChanges): void;
880
- groupedSessions(): ChatSessionGroup[];
881
- onSessionClick(session: ChatSession): void;
882
- onDeleteClick(event: Event, sessionId: string): void;
883
- onClose(): void;
884
- formatTime(date: Date): string;
885
- formatDate(date: Date): string;
886
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatHistorySidebarComponent, never>;
887
- 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>;
888
- }
889
-
890
- declare class PopoutWindowDirective implements OnDestroy {
891
- private renderer2;
892
- private elementRef;
893
- private innerWrapper;
894
- windowWidth: number;
895
- windowHeight: number;
896
- windowLeft: number;
897
- windowTop: number;
898
- windowTitle: string;
899
- windowStyle: string;
900
- windowStyleUrl: string;
901
- suppressCloneStyles: boolean;
902
- get isPoppedOut(): boolean;
903
- closed: EventEmitter<boolean>;
904
- shown: EventEmitter<Window>;
905
- private popoutWindow;
906
- private isOut;
907
- private observer;
908
- beforeunloadHandler(): void;
909
- constructor(renderer2: Renderer2, elementRef: ElementRef);
910
- ngOnDestroy(): void;
911
- private close;
912
- popIn(): void;
913
- popOut(): void;
914
- private observeStyleChanges;
915
- static ɵfac: i0.ɵɵFactoryDeclaration<PopoutWindowDirective, never>;
916
- 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>;
917
- }
918
-
919
- declare class DraggableDialogDirective implements OnInit {
920
- private el;
921
- private renderer;
922
- private isDragging;
923
- private startX;
924
- private startY;
925
- private offsetX;
926
- private offsetY;
927
- dragHandleSelector: string | undefined;
928
- enableDrag: boolean;
929
- private dragHandle;
930
- constructor(el: ElementRef, renderer: Renderer2);
931
- ngOnInit(): void;
932
- onMouseDown(event: MouseEvent): void;
933
- onMouseMove(event: MouseEvent): void;
934
- onMouseUp(): void;
935
- static ɵfac: i0.ɵɵFactoryDeclaration<DraggableDialogDirective, never>;
936
- static ɵdir: i0.ɵɵDirectiveDeclaration<DraggableDialogDirective, "[draggableDialog]", never, { "dragHandleSelector": { "alias": "dragHandle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; }, {}, never, never, true, never>;
937
- }
938
-
939
- declare class ResizableDialogDirective implements OnInit, OnDestroy {
940
- private el;
941
- private renderer;
942
- private resizeHandles;
943
- private activeHandle;
944
- private startX;
945
- private startY;
946
- private startWidth;
947
- private startHeight;
948
- private startLeft;
949
- private startTop;
950
- enableResize: boolean;
951
- private directions;
952
- constructor(el: ElementRef<HTMLElement>, renderer: Renderer2);
953
- ngOnInit(): void;
954
- ngOnDestroy(): void;
955
- private setStyle;
956
- private createResizeHandles;
957
- private removeResizeHandles;
958
- onMouseDown(event: MouseEvent): void;
959
- onMouseMove(event: MouseEvent): void;
960
- onMouseUp(): void;
961
- private getComputedStyleValue;
962
- static ɵfac: i0.ɵɵFactoryDeclaration<ResizableDialogDirective, never>;
963
- static ɵdir: i0.ɵɵDirectiveDeclaration<ResizableDialogDirective, "[resizableDialog]", never, { "enableResize": { "alias": "enableResize"; "required": false; }; }, {}, never, never, true, never>;
964
- }
965
-
966
- 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, initializeDoohbotApp, provideDoohbot, provideStorage };
967
- 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 };