@aakash58/chatbot 1.0.98 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,57 +1,44 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, ElementRef, Renderer2, OnInit, OnDestroy, SimpleChanges, EventEmitter, AfterContentInit, QueryList } from '@angular/core';
3
3
  import { MatDialogRef, MatDialog } from '@angular/material/dialog';
4
4
  import { Observable } from 'rxjs';
5
5
 
6
+ /**
7
+ * Message role types for chat messages
8
+ */
9
+ type MessageRole = 'user' | 'assistant';
10
+
6
11
  interface Message {
7
12
  id: string;
8
- sender: 'user' | 'bot';
13
+ sender: MessageRole;
9
14
  senderName?: string;
10
15
  text: string;
16
+ chunks?: string[];
11
17
  timestamp?: Date;
12
18
  showSuggestions?: boolean;
13
19
  platformTenant?: string;
14
20
  subTenant?: string;
15
21
  agent?: string;
22
+ completed: boolean | true;
23
+ isHistory: boolean | true;
24
+ copied?: boolean;
16
25
  }
17
26
 
18
27
  declare class LoginRequest {
19
28
  username: string;
20
29
  password: string;
21
30
  rememberMe?: boolean;
22
- }
23
-
24
- interface UserContext {
25
- userId: string;
26
- userName: string;
27
- userEmail: string;
28
- metadata?: Record<string, any>;
31
+ license?: string;
29
32
  }
30
33
 
31
34
  declare class DoohbotInput {
32
35
  username: string;
33
36
  password: string;
34
37
  authToken?: string;
38
+ license?: string;
39
+ licenseCode?: string;
35
40
  licenseKey?: string;
36
- DOOHBOT_API_URL?: string;
37
- userAvatarUrl: string;
38
- readonly appTitle?: "DoohBot" | undefined;
39
- readonly appSubtitle?: "Welcome to DoohBot" | undefined;
40
- readonly welcomeDesc?: "We provide a powerful live chat platform to help businesses connect with their customers, offer support, and increase sales through real-time conversations." | undefined;
41
- readonly chatIcon?: "chat" | undefined;
42
- readonly sendIcon?: "send" | undefined;
43
- readonly closeIcon?: "close" | undefined;
44
- readonly clear?: "clear_all" | undefined;
45
- readonly minimizeIcon?: "remove" | undefined;
46
- readonly moreIcon?: "more_vert" | undefined;
47
- readonly fullscreenIcon?: "fullscreen" | undefined;
48
- readonly fullscreenExitIcon?: "fullscreen_exit" | undefined;
49
- readonly hintText?: "Please Enter Here" | undefined;
50
- readonly errorMessage?: "The message you submitted was too long." | undefined;
51
- readonly appLogoUrl?: string | undefined;
52
- readonly appTextLogoUrl?: string | undefined;
53
- readonly appHeaderLogoUrl?: string | undefined;
54
- readonly botAvatarUrl?: string | undefined;
41
+ buttonStyle?: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
55
42
  }
56
43
 
57
44
  /**
@@ -135,7 +122,10 @@ interface DoohbotThemeConfig {
135
122
  black?: string;
136
123
  grey?: string;
137
124
  red?: string;
138
- lightRed?: string;
125
+ yellow?: string;
126
+ orange?: string;
127
+ green?: string;
128
+ blue?: string;
139
129
  }
140
130
 
141
131
  declare class FullscreenDirective {
@@ -147,8 +137,8 @@ declare class FullscreenDirective {
147
137
  constructor(el: ElementRef, renderer: Renderer2);
148
138
  toggle(): void;
149
139
  getFullscreenState(): boolean;
150
- static ɵfac: i0.ɵɵFactoryDeclaration<FullscreenDirective, never>;
151
- static ɵdir: i0.ɵɵDirectiveDeclaration<FullscreenDirective, "[appFullscreen]", never, { "fullscreenTarget": { "alias": "fullscreenTarget"; "required": false; }; }, {}, never, never, true, never>;
140
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FullscreenDirective, never>;
141
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<FullscreenDirective, "[appFullscreen]", never, { "fullscreenTarget": { "alias": "fullscreenTarget"; "required": false; }; }, {}, never, never, true, never>;
152
142
  }
153
143
 
154
144
  interface ChatSession {
@@ -156,60 +146,69 @@ interface ChatSession {
156
146
  timestamp: Date;
157
147
  title: string;
158
148
  messages: Message[];
159
- contextKey: string;
160
149
  userId: string;
161
150
  }
162
151
 
163
- type AuthStatus = 'unknown' | 'authenticated' | 'unauthenticated' | 'expired';
152
+ /**
153
+ * Authentication status
154
+ */
155
+ type AuthStatus = 'authenticated' | 'unauthenticated' | 'expired';
164
156
 
165
157
  declare class Doohbot extends DoohbotInput implements OnInit, OnDestroy {
166
158
  private elementRef;
167
159
  private renderer;
168
160
  config: DoohbotInput;
169
- platformTenant: string;
170
- subTenant: string;
171
- agent: string;
172
- buttonStyle: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
161
+ buttonStyle?: 'fab' | 'sidebar' | 'sidebar-top' | 'sidebar-bottom';
173
162
  enableDrag: boolean;
174
163
  enableResize: boolean;
175
164
  apiConfig?: DoohbotApiConfig;
176
- userContext?: UserContext;
177
165
  themeConfig: DoohbotThemeConfig | undefined;
178
- appEmoji: {
179
- waveHand: string;
180
- robotFace: string;
181
- partyPopper: string;
182
- thinkingFace: string;
183
- thumbsUp: string;
184
- thumbsDown: string;
185
- redHeart: string;
186
- };
187
- private chatFacade;
166
+ private chatHistory;
188
167
  private uiState;
189
168
  private themeService;
190
169
  private authService;
191
- isChatOpen: i0.WritableSignal<boolean>;
192
- isHistorySidebarOpen: i0.WritableSignal<boolean>;
193
- isFullScreen: i0.WritableSignal<boolean>;
194
- unreadCount: i0.Signal<number>;
195
- messages: i0.WritableSignal<Message[]>;
196
- isBotTyping: i0.WritableSignal<boolean>;
197
- messageError: i0.WritableSignal<string | null>;
198
- showSuggestionChips: i0.Signal<boolean>;
199
- chatSessions: i0.WritableSignal<ChatSession[]>;
200
- hasMoreHistory: i0.WritableSignal<boolean>;
201
- isLoadingMore: i0.WritableSignal<boolean>;
202
- isLoadingSessions: i0.WritableSignal<boolean>;
203
- isLoggingIn: i0.WritableSignal<boolean>;
204
- authError: i0.WritableSignal<string | null>;
205
- authSuccess: i0.WritableSignal<string | null>;
170
+ private chatService;
171
+ private dialogService;
172
+ private snackbarService;
173
+ private personalization;
174
+ private licenseService;
175
+ isChatOpen: _angular_core.WritableSignal<boolean>;
176
+ isHistorySidebarOpen: _angular_core.WritableSignal<boolean>;
177
+ isFullScreen: _angular_core.WritableSignal<boolean>;
178
+ unreadCount: _angular_core.Signal<number>;
179
+ messages: _angular_core.WritableSignal<Message[]>;
180
+ isBotTyping: _angular_core.WritableSignal<boolean>;
181
+ isStreaming: _angular_core.WritableSignal<boolean>;
182
+ messageError: _angular_core.Signal<string | null>;
183
+ showSuggestionChips: _angular_core.Signal<boolean>;
184
+ chatSessions: _angular_core.WritableSignal<ChatSession[]>;
185
+ hasMoreHistory: _angular_core.WritableSignal<boolean>;
186
+ isLoadingMore: _angular_core.WritableSignal<boolean>;
187
+ isLoadingSessions: _angular_core.WritableSignal<boolean>;
188
+ processingSessionId: _angular_core.WritableSignal<string | null>;
189
+ isLoggingIn: _angular_core.WritableSignal<boolean>;
190
+ authError: _angular_core.WritableSignal<string | null>;
191
+ authSuccess: _angular_core.WritableSignal<string | null>;
192
+ activeButtonStyle: _angular_core.Signal<"fab" | "sidebar" | "sidebar-top" | "sidebar-bottom">;
206
193
  userName: string;
207
194
  predefinedMessages: string[];
208
195
  suggestedMessages: string[];
209
196
  maxMessageLength: number;
197
+ readonly DoohbotConst: {
198
+ appTitle: string;
199
+ appSubtitle: string;
200
+ welcomeDescription: string;
201
+ hintText: string;
202
+ errorMessage: string;
203
+ appLogo: string;
204
+ appTextLogo: string;
205
+ appHeaderLogo: string;
206
+ userAvatar: string;
207
+ botAvatar: string;
208
+ };
210
209
  private contextCleanup?;
211
- isAuthenticated: boolean;
212
- authStatus: AuthStatus;
210
+ authStatus: _angular_core.WritableSignal<AuthStatus>;
211
+ isAuthenticated: _angular_core.WritableSignal<boolean>;
213
212
  chatWindowRef: ElementRef;
214
213
  fullscreenDirective: FullscreenDirective;
215
214
  constructor(elementRef: ElementRef, renderer: Renderer2);
@@ -220,11 +219,17 @@ declare class Doohbot extends DoohbotInput implements OnInit, OnDestroy {
220
219
  performLogout(): void;
221
220
  toggleChat(): void;
222
221
  sendMessage(text: string): Promise<void>;
222
+ onStopRequest(): void;
223
223
  clearChat(): void;
224
224
  clearMessageError(): void;
225
225
  toggleHistorySidebar(): void;
226
226
  loadChatSession(session: ChatSession): void;
227
227
  deleteSession(sessionId: string): void;
228
+ deleteAllSessions(): void;
229
+ renameSession(event: {
230
+ sessionId: string;
231
+ newTitle: string;
232
+ }): void;
228
233
  private loadUserSessions;
229
234
  /**
230
235
  * Load more sessions for infinite scroll
@@ -240,31 +245,30 @@ declare class Doohbot extends DoohbotInput implements OnInit, OnDestroy {
240
245
  * Resolve and update the username from all available sources
241
246
  */
242
247
  private updateUserName;
248
+ userAvatarUrl(): string;
243
249
  ngOnDestroy(): void;
244
- static ɵfac: i0.ɵɵFactoryDeclaration<Doohbot, never>;
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>;
250
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Doohbot, never>;
251
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Doohbot, "app-doohbot", never, { "config": { "alias": "config"; "required": false; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; "enableResize": { "alias": "enableResize"; "required": false; }; "apiConfig": { "alias": "apiConfig"; "required": false; }; "themeConfig": { "alias": "themeConfig"; "required": false; }; }, {}, never, never, true, never>;
246
252
  }
247
253
  declare function initializeApp(): Promise<any>;
248
254
 
249
- declare const appConst: {
250
- APP_LOGO: string;
251
- APP_TEXT_LOGO: string;
252
- APP_HEADER_LOGO: string;
253
- USER_AVATAR: string;
254
- BOT_AVATAR: string;
255
+ declare const DoohbotConst: {
256
+ appTitle: string;
257
+ appSubtitle: string;
258
+ welcomeDescription: string;
259
+ hintText: string;
260
+ errorMessage: string;
261
+ appLogo: string;
262
+ appTextLogo: string;
263
+ appHeaderLogo: string;
264
+ userAvatar: string;
265
+ botAvatar: string;
255
266
  };
256
267
 
257
- interface ChatContext {
258
- platformTenant: string;
259
- subTenant: string;
260
- agent: string;
261
- }
262
-
263
- interface TenantConfig extends ChatContext {
268
+ interface TenantConfig {
264
269
  id: string;
265
270
  displayName: string;
266
271
  config?: Partial<DoohbotInput>;
267
- userContext?: UserContext;
268
272
  }
269
273
 
270
274
  interface DialogData {
@@ -281,8 +285,17 @@ declare class DialogComponent {
281
285
  constructor(dialogRef: MatDialogRef<DialogComponent>, data: DialogData);
282
286
  onCancel(): void;
283
287
  onConfirm(): void;
284
- static ɵfac: i0.ɵɵFactoryDeclaration<DialogComponent, never>;
285
- static ɵcmp: i0.ɵɵComponentDeclaration<DialogComponent, "app-dialog", never, {}, {}, never, never, true, never>;
288
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogComponent, never>;
289
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DialogComponent, "app-dialog", never, {}, {}, never, never, true, never>;
290
+ }
291
+
292
+ interface InputDialogData {
293
+ title: string;
294
+ message: string;
295
+ initialValue: string;
296
+ placeholder?: string;
297
+ confirmText?: string;
298
+ cancelText?: string;
286
299
  }
287
300
 
288
301
  declare class DialogService {
@@ -300,8 +313,14 @@ declare class DialogService {
300
313
  * @returns Observable that emits true if confirmed, false if cancelled
301
314
  */
302
315
  confirmDelete(itemName?: string): Observable<boolean>;
303
- static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
304
- static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
316
+ /**
317
+ * Opens a dialog with an input field
318
+ * @param data Configuration for the input dialog
319
+ * @returns Observable that emits the input value if confirmed, null if cancelled
320
+ */
321
+ openInput(data: InputDialogData): Observable<string | null>;
322
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogService, never>;
323
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogService>;
305
324
  }
306
325
 
307
326
  declare class Chips {
@@ -309,31 +328,33 @@ declare class Chips {
309
328
  disabled: boolean;
310
329
  chipClick: EventEmitter<string>;
311
330
  onChipClick(msg: string): void;
312
- static ɵfac: i0.ɵɵFactoryDeclaration<Chips, never>;
313
- static ɵcmp: i0.ɵɵComponentDeclaration<Chips, "app-chips", never, { "messages": { "alias": "messages"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "chipClick": "chipClick"; }, never, never, true, never>;
331
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Chips, never>;
332
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Chips, "app-chips", never, { "messages": { "alias": "messages"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "chipClick": "chipClick"; }, never, never, true, never>;
314
333
  }
315
334
 
316
- declare class SnackBar implements OnInit, OnDestroy {
335
+ /**
336
+ * Error types for snackbar
337
+ */
338
+ type SnackBarError = 'warn' | 'error' | 'success' | 'info';
339
+
340
+ declare class SnackBar implements OnInit {
341
+ private snackBarRef;
342
+ private data;
317
343
  message: string | null;
318
- autoDismiss: boolean;
319
- dismissDelay: number;
320
- show: boolean;
321
- closed: EventEmitter<void>;
322
- timeoutId: number | null;
344
+ type: SnackBarError;
323
345
  ngOnInit(): void;
324
- ngOnDestroy(): void;
325
346
  close(): void;
326
- clearTimeout(): void;
327
- static ɵfac: i0.ɵɵFactoryDeclaration<SnackBar, never>;
328
- static ɵcmp: i0.ɵɵComponentDeclaration<SnackBar, "app-snackbar", never, { "message": { "alias": "message"; "required": false; }; "autoDismiss": { "alias": "autoDismiss"; "required": false; }; "dismissDelay": { "alias": "dismissDelay"; "required": false; }; "show": { "alias": "show"; "required": false; }; }, { "closed": "closed"; }, never, never, true, never>;
347
+ get icon(): string;
348
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SnackBar, never>;
349
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SnackBar, "app-snackbar", never, {}, {}, never, never, true, never>;
329
350
  }
330
351
 
331
352
  declare class MenuItem {
332
353
  href: string;
333
354
  selected: EventEmitter<void>;
334
355
  onClick(event: Event): void;
335
- static ɵfac: i0.ɵɵFactoryDeclaration<MenuItem, never>;
336
- static ɵcmp: i0.ɵɵComponentDeclaration<MenuItem, "app-menu-item", never, { "href": { "alias": "href"; "required": false; }; }, { "selected": "selected"; }, never, ["*"], true, never>;
356
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItem, never>;
357
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MenuItem, "app-menu-item", never, { "href": { "alias": "href"; "required": false; }; }, { "selected": "selected"; }, never, ["*"], true, never>;
337
358
  }
338
359
 
339
360
  declare class DropdownMenu implements AfterContentInit {
@@ -341,9 +362,9 @@ declare class DropdownMenu implements AfterContentInit {
341
362
  menuItems: QueryList<MenuItem>;
342
363
  ngAfterContentInit(): void;
343
364
  close(): void;
344
- static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenu, never>;
345
- static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenu, "app-dropdown-menu", never, {}, {}, ["menuItems"], ["[trigger]", "*"], true, never>;
365
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropdownMenu, never>;
366
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropdownMenu, "app-dropdown-menu", never, {}, {}, ["menuItems"], ["[trigger]", "*"], true, never>;
346
367
  }
347
368
 
348
- export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotInput, DropdownMenu, MenuItem, SnackBar, appConst, initializeApp };
349
- export type { DialogData, DoohbotApiConfig, DoohbotThemeConfig, TenantConfig, UserContext };
369
+ export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotConst, DoohbotInput, DropdownMenu, MenuItem, SnackBar, initializeApp };
370
+ export type { DialogData, DoohbotApiConfig, DoohbotThemeConfig, TenantConfig };
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@aakash58/chatbot",
3
- "version": "1.0.98",
4
- "description": "",
3
+ "version": "1.1.0",
4
+ "description": "multi tenancy chatbot",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.3.0",
7
- "@angular/core": "^20.3.0"
7
+ "@angular/core": "^20.3.0",
8
+ "@angular/material": "^20.2.10",
9
+ "@angular/cdk": "^20.2.10"
8
10
  },
9
11
  "dependencies": {
10
12
  "crypto-js": "^4.2.0",