@aakash58/chatbot 1.0.90 → 1.0.92

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,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, ElementRef, Renderer2, OnDestroy, SimpleChanges, RendererFactory2, OnInit, OnChanges, TrackByFunction, EventEmitter, AfterViewInit, AfterContentInit, QueryList, Provider } from '@angular/core';
3
+ export { provideAppInitializer } from '@angular/core';
4
+ import { OverlayContainer } from '@angular/cdk/overlay';
5
+ import { MatDialogRef, MatDialog } from '@angular/material/dialog';
3
6
  import { Observable } from 'rxjs';
4
7
  import { HttpClient } from '@angular/common/http';
5
8
  import { JwtHelperService } from '@auth0/angular-jwt';
6
9
  import { Router } from '@angular/router';
7
- import { OverlayContainer } from '@angular/cdk/overlay';
8
- import { MatDialogRef, MatDialog } from '@angular/material/dialog';
9
10
 
10
11
  interface Message {
11
12
  id: string;
@@ -241,166 +242,7 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
241
242
  static ɵfac: i0.ɵɵFactoryDeclaration<Doohbot, never>;
242
243
  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
244
  }
244
-
245
- /**
246
- * Response from chat API
247
- */
248
- interface ChatApiResponse {
249
- /**
250
- * Bot's reply message
251
- */
252
- reply: string;
253
- /**
254
- * Optional confidence score (0-1)
255
- */
256
- confidence?: number;
257
- /**
258
- * Whether to show suggestion chips
259
- */
260
- showSuggestions?: boolean;
261
- /**
262
- * Optional suggested responses
263
- */
264
- suggestions?: string[];
265
- /**
266
- * Optional metadata from the API
267
- */
268
- metadata?: Record<string, any>;
269
- /**
270
- * Optional message ID from the backend
271
- */
272
- messageId?: string;
273
- }
274
-
275
- declare class ChatbotApiService {
276
- private http;
277
- private tenantContext;
278
- private config;
279
- /**
280
- * Send a chat message to the API
281
- * @param message User's message text
282
- * @param history Optional message history for context
283
- * @returns Observable of the API response
284
- */
285
- sendMessage(message: string, history?: Message[]): Observable<ChatApiResponse>;
286
- /**
287
- * Build request payload with current tenant context
288
- */
289
- private buildRequest;
290
- /**
291
- * Build HTTP headers
292
- */
293
- private buildHeaders;
294
- /**
295
- * Apply retry strategy based on configuration
296
- */
297
- private applyRetryStrategy;
298
- /**
299
- * Determine if error should trigger a retry
300
- */
301
- private shouldRetry;
302
- /**
303
- * Validate API response
304
- */
305
- private validateResponse;
306
- /**
307
- * Handle API errors
308
- */
309
- private handleError;
310
- /**
311
- * Check if API is enabled
312
- */
313
- isApiEnabled(): boolean;
314
- /**
315
- * Get current API configuration
316
- */
317
- getConfig(): DoohbotApiConfig;
318
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotApiService, never>;
319
- static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotApiService>;
320
- }
321
-
322
- declare class AuthResult {
323
- access_token: string;
324
- refresh_token: string;
325
- }
326
-
327
- declare class CryptoHelperService {
328
- private encoder;
329
- private decoder;
330
- private secretKey;
331
- setSecretKey(key: string): void;
332
- private getKey;
333
- encrypt(value: string): Promise<string | null>;
334
- decrypt(value: string): Promise<string | null>;
335
- static ɵfac: i0.ɵɵFactoryDeclaration<CryptoHelperService, never>;
336
- static ɵprov: i0.ɵɵInjectableDeclaration<CryptoHelperService>;
337
- }
338
-
339
- declare global {
340
- interface Window {
341
- storageEventAdded?: boolean;
342
- tabCLoseEventAdded?: boolean;
343
- }
344
- }
345
- declare class AuthService {
346
- private router;
347
- private http;
348
- private cryptoHelper;
349
- apiUrl: string;
350
- storageKey: string;
351
- secretKey: string;
352
- companyCode: string;
353
- jwtHelper: JwtHelperService;
354
- constructor(router: Router, http: HttpClient, cryptoHelper: CryptoHelperService);
355
- logout(): Observable<boolean>;
356
- setSession(session: AuthResult): void;
357
- setLocalStorage(key: string, value: any): void;
358
- getLocalStorage(key: string): any;
359
- isAuthenticated(): boolean;
360
- isTokenExpired(): boolean;
361
- encrypt(value: string): any;
362
- decrypt(value: string): string | null;
363
- clearAuth(): void;
364
- clearSession(): void;
365
- clearTabInfo(): void;
366
- clearStorage(): void;
367
- clearCache(): void;
368
- getUserId(): any;
369
- static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
370
- static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
371
- }
372
-
373
- declare class HttpService {
374
- private http;
375
- apiUrl: string;
376
- constructor(http: HttpClient);
377
- get(url: string, param?: object, nestedParam?: boolean, showLoader?: boolean, refresh?: boolean): Observable<any>;
378
- private buildHttpParams;
379
- post(url: string, param?: object, showLoader?: boolean): Observable<any>;
380
- private returnResponse;
381
- static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
382
- static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
383
- }
384
-
385
- declare class ApiResponse<T> {
386
- success: boolean;
387
- message: string;
388
- data?: T;
389
- constructor(success: boolean, message: string, data?: T);
390
- }
391
-
392
- declare class AccountService {
393
- private http;
394
- constructor(http: HttpService);
395
- login(param?: LoginRequest, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
396
- logout(refreshToken: string, showLoader?: boolean): Observable<ApiResponse<any>>;
397
- startChat(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
398
- getChatHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
399
- deleteHistory(param?: object, showLoader?: boolean): Observable<ApiResponse<any>>;
400
- refreshLogin(param?: object, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
401
- static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
402
- static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
403
- }
245
+ declare function initializeApp(): Promise<any>;
404
246
 
405
247
  declare const appConst: {
406
248
  APP_LOGO: string;
@@ -637,6 +479,168 @@ declare class DropdownMenu implements AfterContentInit {
637
479
  static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenu, "app-dropdown-menu", never, {}, {}, ["menuItems"], ["[trigger]", "*"], true, never>;
638
480
  }
639
481
 
482
+ declare const DOOHBOT_INITIALIZER: Provider;
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
+
640
644
  /**
641
645
  * ChatFacadeService - High-level orchestration service
642
646
  *
@@ -833,7 +837,131 @@ declare function provideStorage(): {
833
837
  useClass: typeof LocalStorageService;
834
838
  };
835
839
 
836
- declare const DOOHBOT_INITIALIZER: Provider;
840
+ declare const PredefinedMessages: string[];
837
841
 
838
- export { AccountService, AuthService, ChatFacadeService, ChatHistoryService, ChatWindowComponent, ChatbotApiService, Chips, DOOHBOT_API_CONFIG, DOOHBOT_API_URL, DOOHBOT_INITIALIZER, DialogComponent, DialogService, Doohbot, DoohbotInput, DropdownMenu, LocalStorageService, MenuItem, MessageListComponent, SnackBar, StorageService, ThemeService, appConst, provideStorage };
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, DOOHBOT_INITIALIZER, DialogComponent, DialogService, Doohbot, DoohbotInput, DraggableDialogDirective, DropdownMenu, FullscreenDirective, LocalStorageService, MenuItem, MessageInputComponent, MessageListComponent, PopoutWindowDirective, PredefinedMessages, ResizableDialogDirective, SnackBar, StorageService, ThemeService, appConst, initializeApp, provideStorage };
839
967
  export type { ChatContext, ChatSession, ChatSessionGroup, DialogData, DoohbotApiConfig, DoohbotThemeConfig, TenantConfig, ThemeMode, UserContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aakash58/chatbot",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "description": "",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.3.0",