@aakash58/chatbot 1.1.12 → 1.1.13

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.
@@ -4197,7 +4197,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
4197
4197
 
4198
4198
  class LicenseService {
4199
4199
  http = inject(HttpClient);
4200
- tokenStorage = inject(StorageService);
4201
4200
  registry = signal(null, ...(ngDevMode ? [{ debugName: "registry" }] : []));
4202
4201
  /**
4203
4202
  * Load the license configuration from a JSON file.
@@ -4291,14 +4290,6 @@ class LicenseService {
4291
4290
  }
4292
4291
  return null;
4293
4292
  }
4294
- resolveFromAppConst(packageId) {
4295
- const licenseKeys = AppConst.data?.licenseKeys;
4296
- if (licenseKeys && licenseKeys[packageId]) {
4297
- Logger.debug(`[LicenseService] Resolved key for ${packageId} via AppConst.licenseKeys`);
4298
- return licenseKeys[packageId];
4299
- }
4300
- return null;
4301
- }
4302
4293
  /**
4303
4294
  * Resolves the license key for the current tenant.
4304
4295
  * Auto-discovers tenant from URL or optional appBaseUrl pattern.
@@ -4344,6 +4335,93 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
4344
4335
  }]
4345
4336
  }] });
4346
4337
 
4338
+ class EnvironmentDiagnosticService {
4339
+ /**
4340
+ * Collects all diagnostic information from the environment.
4341
+ */
4342
+ getDiagnosticReport() {
4343
+ const report = {
4344
+ timestamp: new Date().toISOString(),
4345
+ url: window.location.href,
4346
+ storage: {
4347
+ localStorage: this.getLocalStorage(),
4348
+ sessionStorage: this.getSessionStorage(),
4349
+ },
4350
+ cookies: this.getCookies(),
4351
+ abpContext: this.getAbpContext(),
4352
+ };
4353
+ Logger.info('[EnvironmentDiagnostic] Full Diagnostic Report:', report);
4354
+ return report;
4355
+ }
4356
+ /**
4357
+ * Retrieves all items from localStorage.
4358
+ */
4359
+ getLocalStorage() {
4360
+ const result = {};
4361
+ for (let i = 0; i < localStorage.length; i++) {
4362
+ const key = localStorage.key(i);
4363
+ if (key) {
4364
+ result[key] = localStorage.getItem(key) || '';
4365
+ }
4366
+ }
4367
+ Logger.info('[EnvironmentDiagnostic] LocalStorage:', result);
4368
+ return result;
4369
+ }
4370
+ /**
4371
+ * Retrieves all items from sessionStorage.
4372
+ */
4373
+ getSessionStorage() {
4374
+ const result = {};
4375
+ for (let i = 0; i < sessionStorage.length; i++) {
4376
+ const key = sessionStorage.key(i);
4377
+ if (key) {
4378
+ result[key] = sessionStorage.getItem(key) || '';
4379
+ }
4380
+ }
4381
+ Logger.info('[EnvironmentDiagnostic] SessionStorage:', result);
4382
+ return result;
4383
+ }
4384
+ /**
4385
+ * Parses and retrieves all cookies.
4386
+ */
4387
+ getCookies() {
4388
+ const result = {};
4389
+ const cookies = document.cookie.split(';');
4390
+ for (let cookie of cookies) {
4391
+ const [key, value] = cookie.trim().split('=');
4392
+ if (key) {
4393
+ result[key] = decodeURIComponent(value || '');
4394
+ }
4395
+ }
4396
+ Logger.info('[EnvironmentDiagnostic] Cookies:', result);
4397
+ return result;
4398
+ }
4399
+ /**
4400
+ * Checks for ABP-specific global variables.
4401
+ */
4402
+ getAbpContext() {
4403
+ const win = window;
4404
+ const context = {
4405
+ hasAbp: !!win.abp,
4406
+ hasAppPreBootstrap: !!win.AppPreBootstrap,
4407
+ hasAppConsts: !!win.AppConsts,
4408
+ abpAuthToken: win.abp?.auth?.getToken ? 'FUNCTION_EXISTS' : 'NOT_FOUND',
4409
+ appConstsAppBaseUrl: win.AppConsts?.appBaseUrl || 'NOT_FOUND',
4410
+ tenancyName: win.AppPreBootstrap?.resolveTenancyName ? 'RESOLVER_EXISTS' : 'NOT_FOUND',
4411
+ };
4412
+ Logger.info('[EnvironmentDiagnostic] ABP Context:', context);
4413
+ return context;
4414
+ }
4415
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: EnvironmentDiagnosticService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4416
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: EnvironmentDiagnosticService, providedIn: 'root' });
4417
+ }
4418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: EnvironmentDiagnosticService, decorators: [{
4419
+ type: Injectable,
4420
+ args: [{
4421
+ providedIn: 'root',
4422
+ }]
4423
+ }] });
4424
+
4347
4425
  class Doohbot extends DoohbotInput {
4348
4426
  elementRef;
4349
4427
  renderer;
@@ -4364,6 +4442,7 @@ class Doohbot extends DoohbotInput {
4364
4442
  snackbarService = inject(SnackbarService);
4365
4443
  personalization = inject(PersonalizationService);
4366
4444
  licenseService = inject(LicenseService);
4445
+ diagnosticService = inject(EnvironmentDiagnosticService);
4367
4446
  //! ========================= EXPOSED STATE FROM SERVICES ============================
4368
4447
  // UI State signals
4369
4448
  isChatOpen = this.uiState.isChatOpen;
@@ -4423,6 +4502,8 @@ class Doohbot extends DoohbotInput {
4423
4502
  // Corrected structural integrity.
4424
4503
  ngOnInit() {
4425
4504
  Logger.log('Initializing Doohbot component...');
4505
+ // Run diagnostics
4506
+ this.diagnosticService.getDiagnosticReport();
4426
4507
  // Run validation once on startup
4427
4508
  this.authService.validateStoredToken().subscribe();
4428
4509
  // React to auth status changes
@@ -4963,5 +5044,5 @@ function provideDoohbot() {
4963
5044
  * Generated bundle index. Do not edit.
4964
5045
  */
4965
5046
 
4966
- export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotConst, DoohbotInput, DropdownMenu, MenuItem, SnackBar, initializeApp, initializeDoohbotApp, provideDoohbot };
5047
+ export { Chips, DOOHBOT_API_CONFIG, DialogComponent, DialogService, Doohbot, DoohbotConst, DoohbotInput, DropdownMenu, EnvironmentDiagnosticService, MenuItem, SnackBar, initializeApp, initializeDoohbotApp, provideDoohbot };
4967
5048
  //# sourceMappingURL=aakash58-chatbot.mjs.map