@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.
- package/NOTICES +92 -808
- package/lib/bundles/client.umd.js +23 -0
- package/lib/bundles/client.umd.js.map +1 -1
- package/lib/bundles/client.umd.min.js +1 -1
- package/lib/bundles/client.umd.min.js.map +1 -1
- package/lib/cjs/src/application/ApplicationService.js +13 -0
- package/lib/cjs/src/application/ApplicationService.js.map +1 -1
- package/lib/cjs/src/user/UserService.js +7 -0
- package/lib/cjs/src/user/UserService.js.map +1 -1
- package/lib/esm2015/src/application/ApplicationService.js +15 -0
- package/lib/esm2015/src/application/ApplicationService.js.map +1 -1
- package/lib/esm2015/src/user/UserService.js +8 -0
- package/lib/esm2015/src/user/UserService.js.map +1 -1
- package/lib/src/application/ApplicationService.d.ts +5 -0
- package/lib/src/user/IUser.d.ts +1 -0
- package/lib/src/user/UserService.d.ts +2 -0
- package/lib/src/user-group/IUserGroup.d.ts +4 -0
- package/package.json +1 -1
|
@@ -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
|
*
|