@progalaxyelabs/ngx-stonescriptphp-client 1.18.3 → 1.19.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, Injectable, Inject, EventEmitter, Output, Input, Component, Optional } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, Injectable, Inject, Optional, EventEmitter, Output, Input, Component } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import * as i3 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
@@ -8,6 +8,13 @@ import { FormsModule } from '@angular/forms';
8
8
 
9
9
  class MyEnvironmentModel {
10
10
  production = true;
11
+ /**
12
+ * Enable debug logging across the app.
13
+ * Set to true in development environments to see [DEBUG] logs in the browser console.
14
+ * Always false in production.
15
+ * @default false
16
+ */
17
+ debug = false;
11
18
  /**
12
19
  * Platform code identifier (e.g., 'progalaxy', 'hr', 'admin').
13
20
  * Used for multi-tenant authentication.
@@ -1448,6 +1455,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
1448
1455
  }]
1449
1456
  }], ctorParameters: () => [] });
1450
1457
 
1458
+ /**
1459
+ * LogService — debug logger for ProgalaxyELabs Angular platforms.
1460
+ *
1461
+ * Reads environment.debug from MyEnvironmentModel (set via provideNgxStoneScriptPhpClient).
1462
+ * All output is silenced when debug = false (production default).
1463
+ *
1464
+ * Usage in components / services:
1465
+ * ```typescript
1466
+ * constructor(private log: LogService) {}
1467
+ *
1468
+ * this.log.debug('MyComponent', 'event fired', { data });
1469
+ * ```
1470
+ *
1471
+ * Configure in app:
1472
+ * ```typescript
1473
+ * // environment.ts
1474
+ * export const environment = { production: false, debug: true, ... };
1475
+ *
1476
+ * // app.config.ts
1477
+ * provideNgxStoneScriptPhpClient(environment) // LogService picks up environment.debug automatically
1478
+ * ```
1479
+ */
1480
+ class LogService {
1481
+ _debug = false;
1482
+ constructor(env) {
1483
+ this._debug = env?.debug ?? false;
1484
+ }
1485
+ /** Log a debug message. No-op when environment.debug = false. */
1486
+ debug(context, message, ...args) {
1487
+ if (this._debug) {
1488
+ console.log(`[DEBUG][${context}] ${message}`, ...args);
1489
+ }
1490
+ }
1491
+ /** Log a warning. Always visible regardless of debug flag. */
1492
+ warn(context, message, ...args) {
1493
+ console.warn(`[WARN][${context}] ${message}`, ...args);
1494
+ }
1495
+ /** Log an error. Always visible regardless of debug flag. */
1496
+ error(context, message, ...args) {
1497
+ console.error(`[ERROR][${context}] ${message}`, ...args);
1498
+ }
1499
+ /** Returns true if debug mode is on (useful for conditional expensive logging). */
1500
+ get isDebug() {
1501
+ return this._debug;
1502
+ }
1503
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: LogService, deps: [{ token: MyEnvironmentModel, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1504
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: LogService, providedIn: 'root' });
1505
+ }
1506
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: LogService, decorators: [{
1507
+ type: Injectable,
1508
+ args: [{ providedIn: 'root' }]
1509
+ }], ctorParameters: () => [{ type: MyEnvironmentModel, decorators: [{
1510
+ type: Optional
1511
+ }] }] });
1512
+
1451
1513
  /**
1452
1514
  * CSRF Token Service
1453
1515
  *
@@ -4221,5 +4283,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
4221
4283
  * Generated bundle index. Do not edit.
4222
4284
  */
4223
4285
 
4224
- export { AUTH_PLUGIN, ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, FilesService, LoginDialogComponent, MyEnvironmentModel, ProgalaxyElabsAuth, ProviderRegistryService, RegisterComponent, SigninStatusService, StoneScriptPHPAuth, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus, provideNgxStoneScriptPhpClient };
4286
+ export { AUTH_PLUGIN, ApiConnectionService, ApiResponse, AuthPageComponent, AuthService, CsrfService, DbService, FilesService, LogService, LoginDialogComponent, MyEnvironmentModel, ProgalaxyElabsAuth, ProviderRegistryService, RegisterComponent, SigninStatusService, StoneScriptPHPAuth, TenantLoginComponent, TenantLoginDialogComponent, TenantRegisterComponent, TenantRegisterDialogComponent, TokenService, VerifyStatus, provideNgxStoneScriptPhpClient };
4225
4287
  //# sourceMappingURL=progalaxyelabs-ngx-stonescriptphp-client.mjs.map