bruce-models 4.1.3 → 4.1.5
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 +48 -29
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +27 -8
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/tileset/tileset.js +27 -7
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/types/account/account-settings.d.ts +3 -0
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/project/project-view-bookmark.d.ts +1 -0
- package/dist/types/tileset/tileset.d.ts +2 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -8385,7 +8385,7 @@
|
|
|
8385
8385
|
*/
|
|
8386
8386
|
function IsAccessAllowed(params) {
|
|
8387
8387
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8388
|
-
let { tilesetId, sourceAccountId,
|
|
8388
|
+
let { tilesetId, sourceAccountId, getters, forAccountId, req } = params;
|
|
8389
8389
|
if (!forAccountId) {
|
|
8390
8390
|
forAccountId = exports.ENVIRONMENT.PARAMS.accountId;
|
|
8391
8391
|
}
|
|
@@ -8394,31 +8394,50 @@
|
|
|
8394
8394
|
if (forAccountId == sourceAccountId || !sourceAccountId) {
|
|
8395
8395
|
return true;
|
|
8396
8396
|
}
|
|
8397
|
-
if (!
|
|
8398
|
-
|
|
8397
|
+
if (!getters) {
|
|
8398
|
+
getters = exports.ENVIRONMENT.Api();
|
|
8399
8399
|
}
|
|
8400
8400
|
req = exports.Api.PrepReqParams(req);
|
|
8401
|
+
const globalApi = getters.GetGlobalApi();
|
|
8401
8402
|
const key = GetAccessAllowedCacheKey(tilesetId, sourceAccountId, forAccountId);
|
|
8402
|
-
const cacheData =
|
|
8403
|
+
const cacheData = globalApi.GetCacheItem(key, req);
|
|
8403
8404
|
if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
|
|
8404
8405
|
return cacheData.data;
|
|
8405
8406
|
}
|
|
8406
8407
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
8408
|
+
var _a;
|
|
8407
8409
|
try {
|
|
8408
8410
|
// We try find the published record for the tileset.
|
|
8409
8411
|
// If it doesn't exist, then it's not published.
|
|
8410
8412
|
const { published } = yield GetList({
|
|
8411
8413
|
accountId: forAccountId,
|
|
8412
|
-
api:
|
|
8414
|
+
api: globalApi,
|
|
8413
8415
|
});
|
|
8414
8416
|
const tileset = published.find(x => x["Tileset.ID"] == tilesetId && x["PublishedBy.ClientAccount.ID"] == sourceAccountId);
|
|
8415
|
-
|
|
8417
|
+
const allowed = tileset != null;
|
|
8418
|
+
if (allowed) {
|
|
8419
|
+
res(true);
|
|
8420
|
+
}
|
|
8421
|
+
// If not allowed we'll check if this is a CC3D tileset and if it's set as the selected "free" one.
|
|
8422
|
+
// This is a placeholder feature until a marketplace system is made.
|
|
8423
|
+
if (String(sourceAccountId).toLowerCase().trim() == "cc3d") {
|
|
8424
|
+
const settings = (yield exports.Account.GetAppSettings({
|
|
8425
|
+
accountId: forAccountId,
|
|
8426
|
+
appId: exports.Account.EAppId.Navigator,
|
|
8427
|
+
api: getters.GetGuardianApi()
|
|
8428
|
+
})).settings;
|
|
8429
|
+
const cc3dTilesetId = (_a = settings === null || settings === void 0 ? void 0 : settings.published) === null || _a === void 0 ? void 0 : _a.freeCC3dTilesetId;
|
|
8430
|
+
if (cc3dTilesetId == tilesetId) {
|
|
8431
|
+
res(true);
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
res(false);
|
|
8416
8435
|
}
|
|
8417
8436
|
catch (e) {
|
|
8418
8437
|
rej(e);
|
|
8419
8438
|
}
|
|
8420
8439
|
}));
|
|
8421
|
-
|
|
8440
|
+
globalApi.SetCacheItem({
|
|
8422
8441
|
key: key,
|
|
8423
8442
|
value: prom,
|
|
8424
8443
|
req: req
|
|
@@ -11665,7 +11684,7 @@
|
|
|
11665
11684
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
11666
11685
|
|
|
11667
11686
|
// This is updated with the package.json version on build.
|
|
11668
|
-
const VERSION = "4.1.
|
|
11687
|
+
const VERSION = "4.1.5";
|
|
11669
11688
|
|
|
11670
11689
|
exports.VERSION = VERSION;
|
|
11671
11690
|
exports.AbstractApi = AbstractApi;
|