@aakash58/chatbot 1.0.70 → 1.0.72

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { RendererFactory2, OnDestroy, ElementRef, Renderer2, SimpleChanges } from '@angular/core';
2
+ import { RendererFactory2, InjectionToken, OnDestroy, ElementRef, Renderer2, SimpleChanges } from '@angular/core';
3
3
  import { OverlayContainer } from '@angular/cdk/overlay';
4
4
  import { Observable } from 'rxjs';
5
5
  import { HttpClient } from '@angular/common/http';
@@ -41,21 +41,21 @@ declare class DoohbotInput {
41
41
  DOOHBOT_API_URL?: string;
42
42
  skipAuthentication?: boolean;
43
43
  userAvatarUrl: string;
44
- readonly appTitle = "DoohBot";
45
- readonly appSubtitle = "Welcome to DoohBot";
46
- 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.";
47
- readonly chatIcon = "chat";
48
- readonly sendIcon = "send";
49
- readonly closeIcon = "close";
50
- readonly clear = "clear_all";
51
- readonly minimizeIcon = "remove";
52
- readonly moreIcon = "more_vert";
53
- readonly fullscreenIcon = "fullscreen";
54
- readonly fullscreenExitIcon = "fullscreen_exit";
55
- readonly hintText = "Please Enter Here";
56
- readonly errorMessage = "The message you submitted was too long.";
57
- readonly appLogoUrl: string;
58
- readonly botAvatarUrl: string;
44
+ readonly appTitle?: "DoohBot" | undefined;
45
+ readonly appSubtitle?: "Welcome to DoohBot" | undefined;
46
+ 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;
47
+ readonly chatIcon?: "chat" | undefined;
48
+ readonly sendIcon?: "send" | undefined;
49
+ readonly closeIcon?: "close" | undefined;
50
+ readonly clear?: "clear_all" | undefined;
51
+ readonly minimizeIcon?: "remove" | undefined;
52
+ readonly moreIcon?: "more_vert" | undefined;
53
+ readonly fullscreenIcon?: "fullscreen" | undefined;
54
+ readonly fullscreenExitIcon?: "fullscreen_exit" | undefined;
55
+ readonly hintText?: "Please Enter Here" | undefined;
56
+ readonly errorMessage?: "The message you submitted was too long." | undefined;
57
+ readonly appLogoUrl?: string | undefined;
58
+ readonly botAvatarUrl?: string | undefined;
59
59
  }
60
60
 
61
61
  /**
@@ -111,6 +111,10 @@ interface DoohbotApiConfig {
111
111
  */
112
112
  retryDelay?: number;
113
113
  }
114
+ /**
115
+ * Injection token for providing Doohbot API configuration
116
+ */
117
+ declare const DOOHBOT_API_CONFIG: InjectionToken<DoohbotApiConfig>;
114
118
 
115
119
  declare class HttpService {
116
120
  private http;
@@ -265,4 +269,90 @@ declare class Doohbot extends DoohbotInput implements OnDestroy {
265
269
  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; }; "primaryColor": { "alias": "primaryColor"; "required": false; }; "apiConfig": { "alias": "apiConfig"; "required": false; }; "userContext": { "alias": "userContext"; "required": false; }; }, {}, never, never, true, never>;
266
270
  }
267
271
 
268
- export { Doohbot };
272
+ /**
273
+ * Response from chat API
274
+ */
275
+ interface ChatApiResponse {
276
+ /**
277
+ * Bot's reply message
278
+ */
279
+ reply: string;
280
+ /**
281
+ * Optional confidence score (0-1)
282
+ */
283
+ confidence?: number;
284
+ /**
285
+ * Whether to show suggestion chips
286
+ */
287
+ showSuggestions?: boolean;
288
+ /**
289
+ * Optional suggested responses
290
+ */
291
+ suggestions?: string[];
292
+ /**
293
+ * Optional metadata from the API
294
+ */
295
+ metadata?: Record<string, any>;
296
+ /**
297
+ * Optional message ID from the backend
298
+ */
299
+ messageId?: string;
300
+ }
301
+
302
+ declare class ChatbotApiService {
303
+ private http;
304
+ private tenantContext;
305
+ private config;
306
+ /**
307
+ * Send a chat message to the API
308
+ * @param message User's message text
309
+ * @param history Optional message history for context
310
+ * @returns Observable of the API response
311
+ */
312
+ sendMessage(message: string, history?: Message[]): Observable<ChatApiResponse>;
313
+ /**
314
+ * Build request payload with current tenant context
315
+ */
316
+ private buildRequest;
317
+ /**
318
+ * Build HTTP headers
319
+ */
320
+ private buildHeaders;
321
+ /**
322
+ * Apply retry strategy based on configuration
323
+ */
324
+ private applyRetryStrategy;
325
+ /**
326
+ * Determine if error should trigger a retry
327
+ */
328
+ private shouldRetry;
329
+ /**
330
+ * Validate API response
331
+ */
332
+ private validateResponse;
333
+ /**
334
+ * Handle API errors
335
+ */
336
+ private handleError;
337
+ /**
338
+ * Check if API is enabled
339
+ */
340
+ isApiEnabled(): boolean;
341
+ /**
342
+ * Get current API configuration
343
+ */
344
+ getConfig(): DoohbotApiConfig;
345
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatbotApiService, never>;
346
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChatbotApiService>;
347
+ }
348
+
349
+ declare const appConst: {
350
+ APP_LOGO: string;
351
+ USER_AVATAR: string;
352
+ BOT_AVATAR: string;
353
+ };
354
+
355
+ declare const DOOHBOT_API_URL: InjectionToken<string>;
356
+
357
+ export { AccountService, AuthService, ChatbotApiService, DOOHBOT_API_CONFIG, DOOHBOT_API_URL, Doohbot, DoohbotInput, appConst };
358
+ export type { DoohbotApiConfig, UserContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aakash58/chatbot",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "Angular chatbot package",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.3.0",