@c8y/client 1016.247.0 → 1016.253.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.
@@ -7704,6 +7704,9 @@
7704
7704
  hasAnyRole(user, roleIds) {
7705
7705
  return roleIds.some(roleId => this.hasRole(user, roleId));
7706
7706
  }
7707
+ hasAnyGlobalRole(user, globalRoleIds) {
7708
+ return globalRoleIds.some(globalRoleId => this.hasGlobalRoleInUser(user, globalRoleId));
7709
+ }
7707
7710
  isDeviceUser(user) {
7708
7711
  return user.id.match(/^device_/);
7709
7712
  }
@@ -7744,6 +7747,11 @@
7744
7747
  changeUserPasswordUrl(entityOrId) {
7745
7748
  return `${this.client.tenant}/users/${this.getId(entityOrId)}/password`;
7746
7749
  }
7750
+ hasGlobalRoleInUser(user, globalRoleId) {
7751
+ var _a;
7752
+ const groupReferencesIds = (((_a = user === null || user === void 0 ? void 0 : user.groups) === null || _a === void 0 ? void 0 : _a.references) || []).map(gR => { var _a; return (_a = gR === null || gR === void 0 ? void 0 : gR.group) === null || _a === void 0 ? void 0 : _a.id; });
7753
+ return groupReferencesIds.some(id => id === globalRoleId);
7754
+ }
7747
7755
  }
7748
7756
 
7749
7757
  (function (PasswordStrength) {
@@ -8401,6 +8409,21 @@
8401
8409
  return { res, data };
8402
8410
  });
8403
8411
  }
8412
+ /**
8413
+ * Retrieves the manifest of the application behind the given context path.
8414
+ * @param contextPath
8415
+ */
8416
+ getManifestOfContextPath(contextPath) {
8417
+ return __awaiter$16(this, void 0, void 0, function* () {
8418
+ const url = `${this.getDetailUrl(contextPath)}/manifest`;
8419
+ const res = yield this.fetch(url);
8420
+ const { application } = yield res.json();
8421
+ return {
8422
+ res,
8423
+ data: application
8424
+ };
8425
+ });
8426
+ }
8404
8427
  /**
8405
8428
  * Removes package version.
8406
8429
  *