@posiwise/common-services 0.2.16 → 0.2.19
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.
|
@@ -1409,6 +1409,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
|
|
|
1409
1409
|
}]
|
|
1410
1410
|
}], ctorParameters: () => [{ type: i1$4.Meta }, { type: i1$4.Title }] });
|
|
1411
1411
|
|
|
1412
|
+
/**
|
|
1413
|
+
* Centralized feature flag evaluation service.
|
|
1414
|
+
* Reads the `feature_flags` hash from the current user object
|
|
1415
|
+
* (populated by the backend FeatureFlags::Evaluator via GET /v1/user).
|
|
1416
|
+
*
|
|
1417
|
+
* Usage (programmatic):
|
|
1418
|
+
* if (this.featureFlagService.isEnabled('smart_crm_dashboard')) { ... }
|
|
1419
|
+
*
|
|
1420
|
+
* Usage (template — via *featureFlag directive):
|
|
1421
|
+
* <div *featureFlag="'smart_crm_dashboard'">...</div>
|
|
1422
|
+
*/
|
|
1423
|
+
class FeatureFlagService {
|
|
1424
|
+
/**
|
|
1425
|
+
* Returns true if the given flag key is enabled for the current user.
|
|
1426
|
+
* Defaults to false when the flag is missing or user is not set.
|
|
1427
|
+
*/
|
|
1428
|
+
isEnabled(flagKey) {
|
|
1429
|
+
return this.user?.feature_flags?.[flagKey] ?? false;
|
|
1430
|
+
}
|
|
1431
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FeatureFlagService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1432
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FeatureFlagService, providedIn: 'root' }); }
|
|
1433
|
+
}
|
|
1434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FeatureFlagService, decorators: [{
|
|
1435
|
+
type: Injectable,
|
|
1436
|
+
args: [{ providedIn: 'root' }]
|
|
1437
|
+
}] });
|
|
1438
|
+
|
|
1412
1439
|
class PermissionService {
|
|
1413
1440
|
constructor(api) {
|
|
1414
1441
|
this.api = api;
|
|
@@ -3609,5 +3636,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
|
|
|
3609
3636
|
* Generated bundle index. Do not edit.
|
|
3610
3637
|
*/
|
|
3611
3638
|
|
|
3612
|
-
export { AbTestService, AhoyService, AuthService, BaseHttpService, BrainApiHttpService, BrainApiService, CommonService, CommonServicesModule, CustomPreloadingStrategy, CustomToastService, DashboardService, DataService, FormHelperService, GeoService, GoogleAnalyticsService, GroupService, HopscotchService, IntegrationsApiHttpService, LinkService, LocalStorage, LogoCacheService, MailBoxService, MainApiHttpService, McpJsonRpcService, NgbDateCustomParserFormatter, NotificationService, NumberPickerService, PermissionService, PrimeNgHelper, ProductService, ProfileService, QualificationService, ScriptLoaderService, SecureTokenStorageService, SentryErrorHandler, SeoService, SubscriptionService, TagService, TipsService, UserEffects, UserService, ValidationService, WebsocketService, WindowService };
|
|
3639
|
+
export { AbTestService, AhoyService, AuthService, BaseHttpService, BrainApiHttpService, BrainApiService, CommonService, CommonServicesModule, CustomPreloadingStrategy, CustomToastService, DashboardService, DataService, FeatureFlagService, FormHelperService, GeoService, GoogleAnalyticsService, GroupService, HopscotchService, IntegrationsApiHttpService, LinkService, LocalStorage, LogoCacheService, MailBoxService, MainApiHttpService, McpJsonRpcService, NgbDateCustomParserFormatter, NotificationService, NumberPickerService, PermissionService, PrimeNgHelper, ProductService, ProfileService, QualificationService, ScriptLoaderService, SecureTokenStorageService, SentryErrorHandler, SeoService, SubscriptionService, TagService, TipsService, UserEffects, UserService, ValidationService, WebsocketService, WindowService };
|
|
3613
3640
|
//# sourceMappingURL=posiwise-common-services.mjs.map
|