@aakash58/chatbot 1.1.16 → 1.1.18
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/esm2022/aakash58-chatbot.mjs +5 -0
- package/esm2022/lib/app/chat/chat-ui-state.service.mjs +170 -0
- package/esm2022/lib/app/chat/chat.service.mjs +445 -0
- package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +50 -0
- package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +12 -0
- package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +66 -0
- package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +186 -0
- package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +312 -0
- package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +36 -0
- package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +115 -0
- package/esm2022/lib/app/chat/model/chat-history.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-request.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-response.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-session.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +2 -0
- package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +2 -0
- package/esm2022/lib/app/chat/services/chat-api.service.mjs +61 -0
- package/esm2022/lib/app/chat/services/chat-audio.service.mjs +50 -0
- package/esm2022/lib/app/chat/services/chat-history.service.mjs +252 -0
- package/esm2022/lib/app/login/login-form.component.mjs +46 -0
- package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +194 -0
- package/esm2022/lib/app/personalization/personalization.service.mjs +149 -0
- package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +122 -0
- package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +86 -0
- package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +115 -0
- package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +29 -0
- package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +30 -0
- package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +12 -0
- package/esm2022/lib/constant/doohbot-constant.mjs +28 -0
- package/esm2022/lib/constant/html-entities.mjs +9 -0
- package/esm2022/lib/constant/utf8.mjs +10 -0
- package/esm2022/lib/core/app-const.mjs +61 -0
- package/esm2022/lib/core/auth/account-api.service.mjs +40 -0
- package/esm2022/lib/core/auth/auth.service.mjs +391 -0
- package/esm2022/lib/core/auth/models/auth-result.model.mjs +3 -0
- package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +6 -0
- package/esm2022/lib/core/auth/models/login-request.model.mjs +6 -0
- package/esm2022/lib/core/auth/storage.service.mjs +110 -0
- package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +112 -0
- package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +55 -0
- package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +179 -0
- package/esm2022/lib/core/environments/environment.mjs +15 -0
- package/esm2022/lib/core/environments/environment.prod.mjs +15 -0
- package/esm2022/lib/core/helpers/crypto-helper.service.mjs +52 -0
- package/esm2022/lib/core/http/http-stream.service.mjs +97 -0
- package/esm2022/lib/core/http/http.service.mjs +103 -0
- package/esm2022/lib/core/interceptors/auth.interceptor.mjs +96 -0
- package/esm2022/lib/core/interceptors/license.interceptor.mjs +44 -0
- package/esm2022/lib/core/models/api-config.model.mjs +18 -0
- package/esm2022/lib/core/models/api-request.model.mjs +2 -0
- package/esm2022/lib/core/models/api-response.model.mjs +8 -0
- package/esm2022/lib/core/models/doohbot-config.model.mjs +18 -0
- package/esm2022/lib/core/models/license.model.mjs +2 -0
- package/esm2022/lib/core/models/message.mjs +2 -0
- package/esm2022/lib/core/models/theme-config.model.mjs +2 -0
- package/esm2022/lib/core/services/core-config.service.mjs +52 -0
- package/esm2022/lib/core/services/license.service.mjs +145 -0
- package/esm2022/lib/core/services/markdown.service.mjs +64 -0
- package/esm2022/lib/core/services/theme.service.mjs +248 -0
- package/esm2022/lib/core/types/auth-mode.type.mjs +2 -0
- package/esm2022/lib/core/types/auth-status.type.mjs +5 -0
- package/esm2022/lib/core/types/chat-stream.type.mjs +2 -0
- package/esm2022/lib/core/types/message-role.type.mjs +2 -0
- package/esm2022/lib/core/types/prompt-mode.type.mjs +5 -0
- package/esm2022/lib/core/types/snackbar-error.type.mjs +5 -0
- package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +2 -0
- package/esm2022/lib/core/utils/logger.service.mjs +42 -0
- package/esm2022/lib/doohbot-input.mjs +20 -0
- package/esm2022/lib/doohbot.component.mjs +444 -0
- package/esm2022/lib/predefined_messages.mjs +15 -0
- package/esm2022/lib/shared/chips/chips.component.mjs +28 -0
- package/esm2022/lib/shared/dialog/dialog.component.mjs +36 -0
- package/esm2022/lib/shared/dialog/dialog.service.mjs +64 -0
- package/esm2022/lib/shared/dialog/dialog.utils.mjs +85 -0
- package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +29 -0
- package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +38 -0
- package/esm2022/lib/shared/menu-item/menu-item.component.mjs +24 -0
- package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +27 -0
- package/esm2022/lib/shared/snackbar/snackbar.component.mjs +43 -0
- package/esm2022/lib/shared/snackbar/snackbar.service.mjs +46 -0
- package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +43 -0
- package/esm2022/public-api.mjs +37 -0
- package/fesm2022/aakash58-chatbot.mjs +1037 -827
- package/fesm2022/aakash58-chatbot.mjs.map +1 -1
- package/index.d.ts +3 -373
- package/lib/app/chat/chat-ui-state.service.d.ts +96 -0
- package/lib/app/chat/chat.service.d.ts +88 -0
- package/lib/app/chat/components/chat-button/chat-button.component.d.ts +16 -0
- package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +5 -0
- package/lib/app/chat/components/chat-header/chat-header.component.d.ts +24 -0
- package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +49 -0
- package/lib/app/chat/components/chat-window/chat-window.component.d.ts +107 -0
- package/lib/app/chat/components/message-input/message-input.component.d.ts +12 -0
- package/lib/app/chat/components/message-list/message-list.component.d.ts +40 -0
- package/lib/app/chat/model/chat-history.model.d.ts +51 -0
- package/lib/app/chat/model/chat-request.model.d.ts +10 -0
- package/lib/app/chat/model/chat-response.model.d.ts +9 -0
- package/lib/app/chat/model/chat-session.model.d.ts +12 -0
- package/lib/app/chat/model/chat-stream-message.model.d.ts +5 -0
- package/lib/app/chat/model/chat-stream-response.model.d.ts +10 -0
- package/lib/app/chat/services/chat-api.service.d.ts +30 -0
- package/lib/app/chat/services/chat-audio.service.d.ts +19 -0
- package/lib/app/chat/services/chat-history.service.d.ts +53 -0
- package/lib/app/login/login-form.component.d.ts +20 -0
- package/lib/app/personalization/personalization-dialog.component.d.ts +53 -0
- package/lib/app/personalization/personalization.service.d.ts +66 -0
- package/lib/app/personalization/sections/account/account-section.component.d.ts +30 -0
- package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +17 -0
- package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +27 -0
- package/lib/app/personalization/sections/profile/profile-section.component.d.ts +17 -0
- package/lib/app/personalization/sections/settings/setting-section.component.d.ts +10 -0
- package/lib/app/personalization/sections/terms/terms-section.component.d.ts +5 -0
- package/lib/constant/doohbot-constant.d.ts +12 -0
- package/lib/constant/html-entities.d.ts +8 -0
- package/lib/constant/utf8.d.ts +9 -0
- package/lib/core/app-const.d.ts +11 -0
- package/lib/core/auth/account-api.service.d.ts +20 -0
- package/lib/core/auth/auth.service.d.ts +90 -0
- package/lib/core/auth/models/auth-result.model.d.ts +4 -0
- package/lib/core/auth/models/federated-login-request.model.d.ts +5 -0
- package/lib/core/auth/models/login-request.model.d.ts +6 -0
- package/lib/core/auth/storage.service.d.ts +21 -0
- package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +23 -0
- package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +14 -0
- package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +30 -0
- package/lib/core/environments/environment.d.ts +7 -0
- package/lib/core/environments/environment.prod.d.ts +7 -0
- package/lib/core/helpers/crypto-helper.service.d.ts +12 -0
- package/lib/core/http/http-stream.service.d.ts +18 -0
- package/lib/core/http/http.service.d.ts +20 -0
- package/lib/core/interceptors/auth.interceptor.d.ts +18 -0
- package/lib/core/interceptors/license.interceptor.d.ts +11 -0
- package/lib/core/models/api-config.model.d.ts +58 -0
- package/lib/core/models/api-request.model.d.ts +77 -0
- package/lib/core/models/api-response.model.d.ts +6 -0
- package/lib/core/models/doohbot-config.model.d.ts +81 -0
- package/lib/core/models/license.model.d.ts +23 -0
- package/lib/core/models/message.d.ts +16 -0
- package/lib/core/models/theme-config.model.d.ts +28 -0
- package/lib/core/services/core-config.service.d.ts +23 -0
- package/lib/core/services/license.service.d.ts +33 -0
- package/lib/core/services/markdown.service.d.ts +8 -0
- package/lib/core/services/theme.service.d.ts +40 -0
- package/lib/core/types/auth-mode.type.d.ts +4 -0
- package/lib/core/types/auth-status.type.d.ts +4 -0
- package/lib/core/types/chat-stream.type.d.ts +4 -0
- package/lib/core/types/message-role.type.d.ts +4 -0
- package/lib/core/types/prompt-mode.type.d.ts +4 -0
- package/lib/core/types/snackbar-error.type.d.ts +4 -0
- package/lib/core/types/tenant-resolution-strategy.type.d.ts +4 -0
- package/lib/core/utils/logger.service.d.ts +11 -0
- package/lib/doohbot-input.d.ts +19 -0
- package/lib/doohbot.component.d.ts +108 -0
- package/lib/predefined_messages.d.ts +2 -0
- package/lib/shared/chips/chips.component.d.ts +10 -0
- package/lib/shared/dialog/dialog.component.d.ts +19 -0
- package/lib/shared/dialog/dialog.service.d.ts +29 -0
- package/lib/shared/dialog/dialog.utils.d.ts +41 -0
- package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +11 -0
- package/lib/shared/input-dialog/input-dialog.component.d.ts +20 -0
- package/lib/shared/menu-item/menu-item.component.d.ts +9 -0
- package/lib/shared/pipes/simple-markdown.pipe.d.ts +10 -0
- package/lib/shared/snackbar/snackbar.component.d.ts +14 -0
- package/lib/shared/snackbar/snackbar.service.d.ts +19 -0
- package/lib/shared/snackbar/snackbar.utils.d.ts +33 -0
- package/package.json +4 -2
- package/public-api.d.ts +11 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReplaySubject } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AppConst {
|
|
4
|
+
static appBaseUrl: string;
|
|
5
|
+
static data: any;
|
|
6
|
+
config$: ReplaySubject<any>;
|
|
7
|
+
constructor();
|
|
8
|
+
load(): Promise<any>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppConst, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AppConst>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { HttpService } from '../http/http.service';
|
|
3
|
+
import { AuthResult } from './models/auth-result.model';
|
|
4
|
+
import { ApiResponse } from '../models/api-response.model';
|
|
5
|
+
import { LoginRequest } from './models/login-request.model';
|
|
6
|
+
import { FederatedLoginRequest } from './models/federated-login-request.model';
|
|
7
|
+
import { StorageService } from './storage.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class AccountService {
|
|
10
|
+
private http;
|
|
11
|
+
private tokenStorage;
|
|
12
|
+
constructor(http: HttpService, tokenStorage: StorageService);
|
|
13
|
+
login(param?: LoginRequest, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
|
|
14
|
+
federateLogin(param?: FederatedLoginRequest, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
|
|
15
|
+
private buildLicenceHeader;
|
|
16
|
+
refreshLogin(param?: object, showLoader?: boolean): Observable<ApiResponse<AuthResult>>;
|
|
17
|
+
logout(refreshToken: string, showLoader?: boolean): Observable<ApiResponse<void>>;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CoreConfigService } from '../services/core-config.service';
|
|
2
|
+
import { DoohbotInput } from '../../doohbot-input';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { AuthResult } from './models/auth-result.model';
|
|
5
|
+
import { FederatedLoginRequest } from './models/federated-login-request.model';
|
|
6
|
+
import { LoginRequest } from './models/login-request.model';
|
|
7
|
+
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
8
|
+
import { CryptoHelperService } from '../helpers/crypto-helper.service';
|
|
9
|
+
import { StorageService } from './storage.service';
|
|
10
|
+
import { AuthStatus } from '../types/auth-status.type';
|
|
11
|
+
import { AccountService } from './account-api.service';
|
|
12
|
+
import { Router } from '@angular/router';
|
|
13
|
+
import { LicensingContext } from '../models/license.model';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
declare global {
|
|
16
|
+
interface Window {
|
|
17
|
+
storageEventAdded?: boolean;
|
|
18
|
+
tabCLoseEventAdded?: boolean;
|
|
19
|
+
abp?: any;
|
|
20
|
+
AppPreBootstrap?: any;
|
|
21
|
+
AppConsts?: any;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export declare class AuthService {
|
|
25
|
+
private accountService;
|
|
26
|
+
private cryptoHelper;
|
|
27
|
+
private tokenStorage;
|
|
28
|
+
private router;
|
|
29
|
+
private coreConfig;
|
|
30
|
+
get apiUrl(): string;
|
|
31
|
+
get storageKey(): string;
|
|
32
|
+
get secretKey(): string;
|
|
33
|
+
get companyCode(): string;
|
|
34
|
+
jwtHelper: JwtHelperService;
|
|
35
|
+
private advancedConfig;
|
|
36
|
+
private authStatusSubject;
|
|
37
|
+
authStatus$: Observable<AuthStatus>;
|
|
38
|
+
isLoggingIn: import("@angular/core").WritableSignal<boolean>;
|
|
39
|
+
authError: import("@angular/core").WritableSignal<string | null>;
|
|
40
|
+
authSuccess: import("@angular/core").WritableSignal<string | null>;
|
|
41
|
+
constructor(accountService: AccountService, cryptoHelper: CryptoHelperService, tokenStorage: StorageService, router: Router, coreConfig: CoreConfigService);
|
|
42
|
+
/**
|
|
43
|
+
* Updates the service configuration from the component input
|
|
44
|
+
*/
|
|
45
|
+
updateConfig(config: DoohbotInput): void;
|
|
46
|
+
getLoggedInUserName(): string;
|
|
47
|
+
getLoggedInUserImageUrl(): string | null;
|
|
48
|
+
getLoggedInUserRole(): string;
|
|
49
|
+
get authStatus(): AuthStatus;
|
|
50
|
+
/**
|
|
51
|
+
* Resolves a federated token from browser storage
|
|
52
|
+
*/
|
|
53
|
+
private resolveSilentToken;
|
|
54
|
+
/**
|
|
55
|
+
* Authenticate user with federated credentials
|
|
56
|
+
*/
|
|
57
|
+
federatedLogin(credentials: Partial<FederatedLoginRequest>, silent?: boolean): Promise<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* Authenticate user with credentials
|
|
60
|
+
*/
|
|
61
|
+
login(credentials: LoginRequest, silent?: boolean): Promise<boolean>;
|
|
62
|
+
logout(refreshToken?: string): Promise<boolean>;
|
|
63
|
+
setSession(session: AuthResult, rememberMe?: boolean): void;
|
|
64
|
+
getOrganizationId(): string | null;
|
|
65
|
+
getRefreshToken(): string | null;
|
|
66
|
+
refreshToken(): Observable<AuthResult>;
|
|
67
|
+
isAuthenticated(): boolean;
|
|
68
|
+
isTokenExpired(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Validate stored token on app startup
|
|
71
|
+
*/
|
|
72
|
+
validateStoredToken(): Observable<AuthStatus>;
|
|
73
|
+
getUserId(): any;
|
|
74
|
+
getLicensingContext(): LicensingContext;
|
|
75
|
+
get licenseKey(): string;
|
|
76
|
+
get isFederated(): boolean;
|
|
77
|
+
setLicenseKey(key: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Clear all authentication related data from local storage, session storage, cache, and tokens.
|
|
80
|
+
* This method is called when the user logs out.
|
|
81
|
+
*/
|
|
82
|
+
clearAuth(): void;
|
|
83
|
+
clearSession(): void;
|
|
84
|
+
clearTabInfo(): void;
|
|
85
|
+
clearStorage(): void;
|
|
86
|
+
clearLocalStorage(): void;
|
|
87
|
+
clearCache(): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
|
|
89
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CoreConfigService } from '../services/core-config.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class StorageService {
|
|
4
|
+
private coreConfig;
|
|
5
|
+
get storageKey(): string;
|
|
6
|
+
get secretKey(): string;
|
|
7
|
+
private storage;
|
|
8
|
+
constructor(coreConfig: CoreConfigService);
|
|
9
|
+
setRememberMe(rememberMe: boolean): void;
|
|
10
|
+
set(key: string, value: any): void;
|
|
11
|
+
get(key: string): any;
|
|
12
|
+
/**
|
|
13
|
+
* Check if storage is valid (can be decrypted) without side effects
|
|
14
|
+
*/
|
|
15
|
+
isValid(): boolean;
|
|
16
|
+
clear(): void;
|
|
17
|
+
private encrypt;
|
|
18
|
+
private decrypt;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StorageService, never>;
|
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StorageService>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementRef, OnInit, Renderer2, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DraggableDialogDirective implements OnInit, OnChanges {
|
|
4
|
+
private el;
|
|
5
|
+
private renderer;
|
|
6
|
+
private isDragging;
|
|
7
|
+
private startX;
|
|
8
|
+
private startY;
|
|
9
|
+
private offsetX;
|
|
10
|
+
private offsetY;
|
|
11
|
+
dragHandleSelector: string | undefined;
|
|
12
|
+
enableDrag: boolean;
|
|
13
|
+
private dragHandle;
|
|
14
|
+
constructor(el: ElementRef, renderer: Renderer2);
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
+
private updateDragState;
|
|
18
|
+
onMouseDown(event: MouseEvent): void;
|
|
19
|
+
onMouseMove(event: MouseEvent): void;
|
|
20
|
+
onMouseUp(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DraggableDialogDirective, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DraggableDialogDirective, "[draggableDialog]", never, { "dragHandleSelector": { "alias": "dragHandle"; "required": false; }; "enableDrag": { "alias": "enableDrag"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FullscreenDirective {
|
|
4
|
+
private el;
|
|
5
|
+
private renderer;
|
|
6
|
+
private isFullScreen;
|
|
7
|
+
private preFullscreenState;
|
|
8
|
+
fullscreenTarget: string;
|
|
9
|
+
constructor(el: ElementRef, renderer: Renderer2);
|
|
10
|
+
toggle(): void;
|
|
11
|
+
getFullscreenState(): boolean;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FullscreenDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FullscreenDirective, "[appFullscreen]", never, { "fullscreenTarget": { "alias": "fullscreenTarget"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementRef, Renderer2, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ResizableDialogDirective implements OnInit, OnDestroy, OnChanges {
|
|
4
|
+
private el;
|
|
5
|
+
private renderer;
|
|
6
|
+
private resizeHandles;
|
|
7
|
+
private activeHandle;
|
|
8
|
+
private startX;
|
|
9
|
+
private startY;
|
|
10
|
+
private startWidth;
|
|
11
|
+
private startHeight;
|
|
12
|
+
private startLeft;
|
|
13
|
+
private startTop;
|
|
14
|
+
enableResize: boolean;
|
|
15
|
+
private directions;
|
|
16
|
+
constructor(el: ElementRef<HTMLElement>, renderer: Renderer2);
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
19
|
+
private updateResizeState;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
private setStyle;
|
|
22
|
+
private createResizeHandles;
|
|
23
|
+
private removeResizeHandles;
|
|
24
|
+
onMouseDown(event: MouseEvent): void;
|
|
25
|
+
onMouseMove(event: MouseEvent): void;
|
|
26
|
+
onMouseUp(): void;
|
|
27
|
+
private getComputedStyleValue;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizableDialogDirective, never>;
|
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ResizableDialogDirective, "[resizableDialog]", never, { "enableResize": { "alias": "enableResize"; "required": false; }; }, {}, never, never, true, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class CryptoHelperService {
|
|
3
|
+
private encoder;
|
|
4
|
+
private decoder;
|
|
5
|
+
private secretKey;
|
|
6
|
+
setSecretKey(key: string): void;
|
|
7
|
+
private getKey;
|
|
8
|
+
encrypt(value: string): Promise<string | null>;
|
|
9
|
+
decrypt(value: string): Promise<string | null>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CryptoHelperService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CryptoHelperService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { StorageService } from '../auth/storage.service';
|
|
5
|
+
import { ChatStreamResponse } from '../../app/chat/model/chat-stream-response.model';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class HttpStreamService {
|
|
8
|
+
private ngZone;
|
|
9
|
+
private tokenStorage;
|
|
10
|
+
private http;
|
|
11
|
+
constructor(ngZone: NgZone, tokenStorage: StorageService, http: HttpClient);
|
|
12
|
+
/**
|
|
13
|
+
* Creates a POST-based HTTP streaming connection using fetch()
|
|
14
|
+
*/
|
|
15
|
+
createHttpStream(url: string, body: any, headers?: Record<string, string>): Observable<ChatStreamResponse>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HttpStreamService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HttpStreamService>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { CoreConfigService } from '../services/core-config.service';
|
|
4
|
+
import { StorageService } from '../auth/storage.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class HttpService {
|
|
7
|
+
private http;
|
|
8
|
+
private tokenStorage;
|
|
9
|
+
private coreConfig;
|
|
10
|
+
get apiUrl(): string;
|
|
11
|
+
constructor(http: HttpClient, tokenStorage: StorageService, coreConfig: CoreConfigService);
|
|
12
|
+
get(url: string, param?: object, nestedParam?: boolean, showLoader?: boolean, refresh?: boolean, headers?: HttpHeaders): Observable<any>;
|
|
13
|
+
private buildHttpParams;
|
|
14
|
+
post(url: string, param?: object, showLoader?: boolean, headers?: HttpHeaders): Observable<any>;
|
|
15
|
+
patch(url: string, param?: object, showLoader?: boolean, headers?: HttpHeaders): Observable<any>;
|
|
16
|
+
delete(url: string, param?: object, showLoader?: boolean, headers?: HttpHeaders): Observable<any>;
|
|
17
|
+
private returnResponse;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HttpService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { StorageService } from '../auth/storage.service';
|
|
4
|
+
import { Injector } from '@angular/core';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class AuthInterceptor implements HttpInterceptor {
|
|
7
|
+
private tokenStorage;
|
|
8
|
+
private injector;
|
|
9
|
+
private isRefreshing;
|
|
10
|
+
private clearingAuth;
|
|
11
|
+
private refreshTokenSubject;
|
|
12
|
+
constructor(tokenStorage: StorageService, injector: Injector);
|
|
13
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
14
|
+
private handle401Error;
|
|
15
|
+
getRequestWithHeaders(req: HttpRequest<any>): HttpRequest<any>;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthInterceptor, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthInterceptor>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
2
|
+
import { Injector } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class LicenseInterceptor implements HttpInterceptor {
|
|
6
|
+
private injector;
|
|
7
|
+
constructor(injector: Injector);
|
|
8
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LicenseInterceptor, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LicenseInterceptor>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for Doohbot API integration
|
|
4
|
+
*/
|
|
5
|
+
export interface DoohbotApiConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Backend API endpoint URL
|
|
8
|
+
* Example: 'https://api.example.com/chat'
|
|
9
|
+
*/
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional API key for authentication
|
|
13
|
+
*/
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Request timeout in milliseconds
|
|
17
|
+
* @default 30000 (30 seconds)
|
|
18
|
+
*/
|
|
19
|
+
timeout?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Enable API mode (true) or use local intent matching (false)
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
enableApi?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Include message history in API requests
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
includeHistory?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Maximum number of history messages to include in requests
|
|
32
|
+
* @default 10
|
|
33
|
+
*/
|
|
34
|
+
maxHistoryMessages?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Custom headers to include in API requests
|
|
37
|
+
*/
|
|
38
|
+
customHeaders?: Record<string, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Enable retry on failure
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
enableRetry?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Number of retry attempts
|
|
46
|
+
* @default 2
|
|
47
|
+
*/
|
|
48
|
+
retryAttempts?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Delay between retries in milliseconds
|
|
51
|
+
* @default 1000
|
|
52
|
+
*/
|
|
53
|
+
retryDelay?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Injection token for providing Doohbot API configuration
|
|
57
|
+
*/
|
|
58
|
+
export declare const DOOHBOT_API_CONFIG: InjectionToken<DoohbotApiConfig>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { PromptMode } from '../types/prompt-mode.type';
|
|
2
|
+
import { Message } from './message';
|
|
3
|
+
/**
|
|
4
|
+
* Request payload for chat API
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatApiRequest {
|
|
7
|
+
/**
|
|
8
|
+
* User's message text
|
|
9
|
+
*/
|
|
10
|
+
message: string;
|
|
11
|
+
/**
|
|
12
|
+
* Prompt mode
|
|
13
|
+
*/
|
|
14
|
+
prompt_mode?: PromptMode;
|
|
15
|
+
/**
|
|
16
|
+
* Optional message history for context
|
|
17
|
+
*/
|
|
18
|
+
history?: Message[];
|
|
19
|
+
/**
|
|
20
|
+
* Optional metadata
|
|
21
|
+
*/
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
/**
|
|
24
|
+
* Timestamp of the request
|
|
25
|
+
*/
|
|
26
|
+
timestamp?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Response from chat API
|
|
30
|
+
*/
|
|
31
|
+
export interface ChatApiResponse {
|
|
32
|
+
/**
|
|
33
|
+
* Bot's reply message
|
|
34
|
+
*/
|
|
35
|
+
reply: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional confidence score (0-1)
|
|
38
|
+
*/
|
|
39
|
+
confidence?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Whether to show suggestion chips
|
|
42
|
+
*/
|
|
43
|
+
showSuggestions?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Optional suggested responses
|
|
46
|
+
*/
|
|
47
|
+
suggestions?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Optional metadata from the API
|
|
50
|
+
*/
|
|
51
|
+
metadata?: Record<string, any>;
|
|
52
|
+
/**
|
|
53
|
+
* Optional message ID from the backend
|
|
54
|
+
*/
|
|
55
|
+
messageId?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Error response from chat API
|
|
59
|
+
*/
|
|
60
|
+
export interface ChatApiError {
|
|
61
|
+
/**
|
|
62
|
+
* Error message
|
|
63
|
+
*/
|
|
64
|
+
message: string;
|
|
65
|
+
/**
|
|
66
|
+
* Error code
|
|
67
|
+
*/
|
|
68
|
+
code?: string;
|
|
69
|
+
/**
|
|
70
|
+
* HTTP status code
|
|
71
|
+
*/
|
|
72
|
+
statusCode?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Additional error details
|
|
75
|
+
*/
|
|
76
|
+
details?: any;
|
|
77
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { AuthMode } from '../types/auth-mode.type';
|
|
3
|
+
import { TenantResolutionStrategy } from '../types/tenant-resolution-strategy.type';
|
|
4
|
+
import { PromptMode } from '../types/prompt-mode.type';
|
|
5
|
+
/**
|
|
6
|
+
* Advanced configuration for DoohBot package
|
|
7
|
+
* Supports both simple and complex use cases
|
|
8
|
+
*/
|
|
9
|
+
export interface DoohbotAdvancedConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Authentication mode
|
|
12
|
+
* - 'manual': You provide platformTenant, subTenant, agent manually
|
|
13
|
+
* - 'auto': Package reads from your auth service via resolver
|
|
14
|
+
* @default 'manual'
|
|
15
|
+
*/
|
|
16
|
+
authMode?: AuthMode;
|
|
17
|
+
/**
|
|
18
|
+
* Tenant resolution strategy
|
|
19
|
+
* - 'static': Use fixed values provided via inputs
|
|
20
|
+
* - 'dynamic': Automatically update when auth state changes
|
|
21
|
+
* - 'callback': Use custom resolver function
|
|
22
|
+
* @default 'static'
|
|
23
|
+
*/
|
|
24
|
+
tenantResolution?: TenantResolutionStrategy;
|
|
25
|
+
/**
|
|
26
|
+
* Auto-configure from localStorage key
|
|
27
|
+
* If provided, package will read auth data from localStorage
|
|
28
|
+
* Example: 'auth_user' or 'saas_session'
|
|
29
|
+
*/
|
|
30
|
+
autoConfigFromStorage?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Enable multi-tenant mode
|
|
33
|
+
* Allows switching between different tenant contexts
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
enableMultiTenant?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Persist chat history per tenant
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
persistChatPerTenant?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Custom authentication header name
|
|
44
|
+
* @default 'Authorization'
|
|
45
|
+
*/
|
|
46
|
+
authHeaderName?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Custom authentication header format
|
|
49
|
+
* Use {token} as placeholder
|
|
50
|
+
* @default 'Bearer {token}'
|
|
51
|
+
*/
|
|
52
|
+
authHeaderFormat?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Enable role-based features
|
|
55
|
+
* Shows/hides features based on user permissions
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
enableRoleBasedFeatures?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* User permissions (for role-based features)
|
|
61
|
+
*/
|
|
62
|
+
userPermissions?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* Callback when authentication fails
|
|
65
|
+
*/
|
|
66
|
+
onAuthFailure?: (error: any) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Enable debug mode (logs configuration and requests)
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
debugMode?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Prompt mode for chat responses
|
|
74
|
+
* @default 'markdown'
|
|
75
|
+
*/
|
|
76
|
+
promptMode?: PromptMode;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Injection token for advanced configuration
|
|
80
|
+
*/
|
|
81
|
+
export declare const DOOHBOT_ADVANCED_CONFIG: InjectionToken<DoohbotAdvancedConfig>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface LicensingContext {
|
|
2
|
+
tenantId: string;
|
|
3
|
+
principalId: string;
|
|
4
|
+
roles?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface LicensePackage {
|
|
7
|
+
[packageId: string]: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SubjectLicense {
|
|
10
|
+
subjectType: 'user' | 'role' | 'tenant';
|
|
11
|
+
subjectId: string;
|
|
12
|
+
packages: LicensePackage;
|
|
13
|
+
}
|
|
14
|
+
export interface LicenseFileContent {
|
|
15
|
+
accountId: string;
|
|
16
|
+
issuedBy: string;
|
|
17
|
+
issuedAt: string;
|
|
18
|
+
licenses: SubjectLicense[];
|
|
19
|
+
}
|
|
20
|
+
export interface LicenseRegistry {
|
|
21
|
+
accountId: string;
|
|
22
|
+
subjectLicenses: Map<string, LicensePackage>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MessageRole } from '../types/message-role.type';
|
|
2
|
+
export interface Message {
|
|
3
|
+
id: string;
|
|
4
|
+
sender: MessageRole;
|
|
5
|
+
senderName?: string;
|
|
6
|
+
text: string;
|
|
7
|
+
chunks?: string[];
|
|
8
|
+
timestamp?: Date;
|
|
9
|
+
showSuggestions?: boolean;
|
|
10
|
+
platformTenant?: string;
|
|
11
|
+
subTenant?: string;
|
|
12
|
+
agent?: string;
|
|
13
|
+
completed: boolean | true;
|
|
14
|
+
isHistory: boolean | true;
|
|
15
|
+
copied?: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface DoohbotThemeConfig {
|
|
2
|
+
fontFamily?: string;
|
|
3
|
+
primaryColor?: string;
|
|
4
|
+
secondaryColor?: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
chatInputColor?: string;
|
|
7
|
+
textAltColor?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
secondaryTextColor?: string;
|
|
10
|
+
hintTextColor?: string;
|
|
11
|
+
buttonColor?: string;
|
|
12
|
+
userMessageColor?: string;
|
|
13
|
+
botMessageColor?: string;
|
|
14
|
+
userTextColor?: string;
|
|
15
|
+
botTextColor?: string;
|
|
16
|
+
borderColor?: string;
|
|
17
|
+
borderShadowColor?: string;
|
|
18
|
+
borderTopColor?: string;
|
|
19
|
+
typingIndicatorColor?: string;
|
|
20
|
+
white?: string;
|
|
21
|
+
black?: string;
|
|
22
|
+
grey?: string;
|
|
23
|
+
red?: string;
|
|
24
|
+
yellow?: string;
|
|
25
|
+
orange?: string;
|
|
26
|
+
green?: string;
|
|
27
|
+
blue?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DoohbotInput } from '../../doohbot-input';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CoreConfigService {
|
|
4
|
+
private configSignal;
|
|
5
|
+
config$: import("@angular/core").Signal<DoohbotInput>;
|
|
6
|
+
/**
|
|
7
|
+
* Updates the global library configuration
|
|
8
|
+
*/
|
|
9
|
+
updateConfig(config: DoohbotInput): void;
|
|
10
|
+
/**
|
|
11
|
+
* Dynamic getters for common config properties
|
|
12
|
+
*/
|
|
13
|
+
get apiUrl(): string;
|
|
14
|
+
get storageKey(): string;
|
|
15
|
+
get secretKey(): string;
|
|
16
|
+
get companyCode(): string;
|
|
17
|
+
get tenancyName(): string;
|
|
18
|
+
get licenseKey(): string;
|
|
19
|
+
get licenseFilePath(): string;
|
|
20
|
+
get rememberMe(): boolean;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CoreConfigService, never>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CoreConfigService>;
|
|
23
|
+
}
|