@routebot/constants 0.3.57 → 0.3.59

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.
@@ -21,7 +21,19 @@ const isPermissionAvailableForCompanyFeature = (companyFeatures = {}, permission
21
21
  return featureKeys.some((featureKey) => !!companyFeatures[featureKey]);
22
22
  };
23
23
 
24
+ const isTelemetryEnabledForCompany = (company = {}) => !!company?.arventoConfig?.enabled;
25
+
26
+ const isPermissionAvailableForCompany = (company = {}, permissionType) => {
27
+ if (permissionType === PERMISSION_TYPES.ACCESS_TO_TELEMETRY) {
28
+ return isTelemetryEnabledForCompany(company);
29
+ }
30
+
31
+ return isPermissionAvailableForCompanyFeature(company?.features || {}, permissionType);
32
+ };
33
+
24
34
  module.exports = {
25
35
  FEATURE_PERMISSION_DEPENDENCIES,
26
36
  isPermissionAvailableForCompanyFeature,
37
+ isTelemetryEnabledForCompany,
38
+ isPermissionAvailableForCompany,
27
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routebot/constants",
3
- "version": "0.3.57",
3
+ "version": "0.3.59",
4
4
  "description": "Shared constants for RouteBot FE/BE",
5
5
  "main": "index.js",
6
6
  "files": [