bruce-models 6.4.6 → 6.4.8
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/dist/bruce-models.es5.js +44 -9
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +44 -9
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/data-lab/data-lab-group.js.map +1 -1
- package/dist/lib/data-lab/data-lab.js +2 -2
- package/dist/lib/data-lab/data-lab.js.map +1 -1
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/lib/project/zoom-control.js.map +1 -1
- package/dist/lib/style/style.js +6 -6
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/user/user.js +35 -0
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/data-lab/data-lab-group.d.ts +1 -0
- package/dist/types/data-lab/data-lab.d.ts +2 -1
- package/dist/types/project/menu-item.d.ts +5 -5
- package/dist/types/project/zoom-control.d.ts +1 -1
- package/dist/types/style/style.d.ts +3 -2
- package/dist/types/user/user.d.ts +10 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -8204,20 +8204,20 @@
|
|
|
8204
8204
|
*/
|
|
8205
8205
|
function Get(params) {
|
|
8206
8206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8207
|
-
let { api, styleId
|
|
8208
|
-
if (!
|
|
8209
|
-
throw ("
|
|
8207
|
+
let { api, styleId, req: reqParams } = params;
|
|
8208
|
+
if (!styleId) {
|
|
8209
|
+
throw ("styleId is required.");
|
|
8210
8210
|
}
|
|
8211
8211
|
if (!api) {
|
|
8212
8212
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
8213
8213
|
}
|
|
8214
|
-
const cache = api.GetCacheItem(GetCacheKey(
|
|
8214
|
+
const cache = api.GetCacheItem(GetCacheKey(styleId), reqParams);
|
|
8215
8215
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8216
8216
|
return cache.data;
|
|
8217
8217
|
}
|
|
8218
8218
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
8219
8219
|
try {
|
|
8220
|
-
const data = yield api.GET(`ui.entityDisplaySetting/${
|
|
8220
|
+
const data = yield api.GET(`ui.entityDisplaySetting/${styleId}`, exports.Api.PrepReqParams(reqParams));
|
|
8221
8221
|
res({
|
|
8222
8222
|
style: data
|
|
8223
8223
|
});
|
|
@@ -8227,7 +8227,7 @@
|
|
|
8227
8227
|
}
|
|
8228
8228
|
}));
|
|
8229
8229
|
api.SetCacheItem({
|
|
8230
|
-
key: GetCacheKey(
|
|
8230
|
+
key: GetCacheKey(styleId),
|
|
8231
8231
|
value: prom,
|
|
8232
8232
|
req: reqParams
|
|
8233
8233
|
});
|
|
@@ -12466,6 +12466,41 @@
|
|
|
12466
12466
|
// Access token. Used to gain access to related permissions.
|
|
12467
12467
|
EType["AccessToken"] = "ACCESS_TOKEN";
|
|
12468
12468
|
})(EType = User.EType || (User.EType = {}));
|
|
12469
|
+
/**
|
|
12470
|
+
* Returns an array of User Group IDs for the User that have been loaded.
|
|
12471
|
+
* Note, this does not perform an API lookup if the User instance hasn't loaded the specific account's details.
|
|
12472
|
+
* @param params
|
|
12473
|
+
* @returns
|
|
12474
|
+
*/
|
|
12475
|
+
function UnpackRelatedUserGroupIDs(params) {
|
|
12476
|
+
var _a, _b;
|
|
12477
|
+
const { user, accountId } = params;
|
|
12478
|
+
if (!user || !accountId) {
|
|
12479
|
+
throw ("User and accountId are required.");
|
|
12480
|
+
}
|
|
12481
|
+
let accessPerms = user.AccessPermissions;
|
|
12482
|
+
if (!accessPerms || !Array.isArray(accessPerms) || accessPerms.length === 0) {
|
|
12483
|
+
return [];
|
|
12484
|
+
}
|
|
12485
|
+
for (const perm of accessPerms) {
|
|
12486
|
+
if (!perm || perm["ClientAccount.ID"] !== accountId) {
|
|
12487
|
+
continue;
|
|
12488
|
+
}
|
|
12489
|
+
else if ((_a = perm["UserGroup.ID"]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
12490
|
+
return perm["UserGroup.ID"];
|
|
12491
|
+
}
|
|
12492
|
+
else if ((_b = perm.UserGroups) === null || _b === void 0 ? void 0 : _b.length) {
|
|
12493
|
+
if (typeof perm.UserGroups[0] === "string") {
|
|
12494
|
+
return perm.UserGroups;
|
|
12495
|
+
}
|
|
12496
|
+
else if (typeof perm.UserGroups[0] === "object") {
|
|
12497
|
+
return perm.UserGroups.map(group => group.ID);
|
|
12498
|
+
}
|
|
12499
|
+
}
|
|
12500
|
+
}
|
|
12501
|
+
return [];
|
|
12502
|
+
}
|
|
12503
|
+
User.UnpackRelatedUserGroupIDs = UnpackRelatedUserGroupIDs;
|
|
12469
12504
|
/**
|
|
12470
12505
|
* Gets a user record.
|
|
12471
12506
|
* @param params
|
|
@@ -14389,8 +14424,8 @@
|
|
|
14389
14424
|
function Get(params) {
|
|
14390
14425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14391
14426
|
let { api, queryId, req } = params;
|
|
14392
|
-
if (!queryId
|
|
14393
|
-
throw new Error("queryId
|
|
14427
|
+
if (!queryId) {
|
|
14428
|
+
throw new Error("queryId must be provided.");
|
|
14394
14429
|
}
|
|
14395
14430
|
if (!api) {
|
|
14396
14431
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
@@ -15715,7 +15750,7 @@
|
|
|
15715
15750
|
})(exports.Tracking || (exports.Tracking = {}));
|
|
15716
15751
|
|
|
15717
15752
|
// This is updated with the package.json version on build.
|
|
15718
|
-
const VERSION = "6.4.
|
|
15753
|
+
const VERSION = "6.4.8";
|
|
15719
15754
|
|
|
15720
15755
|
exports.VERSION = VERSION;
|
|
15721
15756
|
exports.AbstractApi = AbstractApi;
|