bruce-models 7.0.19 → 7.1.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/dist/bruce-models.es5.js +85 -241
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +85 -241
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-limits.js +1 -1
- package/dist/lib/account/account-limits.js.map +1 -1
- package/dist/lib/account/account.js +13 -86
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/change-set/change-set.js +9 -0
- package/dist/lib/change-set/change-set.js.map +1 -1
- package/dist/lib/user/session.js +19 -72
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +8 -10
- package/dist/lib/user/user-group.js.map +1 -1
- package/dist/lib/user/user.js +33 -70
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/account/account.d.ts +6 -36
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/change-set/change-set.d.ts +10 -2
- package/dist/types/user/session.d.ts +1 -19
- package/dist/types/user/user-group.d.ts +2 -1
- package/dist/types/user/user.d.ts +12 -13
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -12268,7 +12268,7 @@ var Account;
|
|
|
12268
12268
|
}
|
|
12269
12269
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
12270
12270
|
try {
|
|
12271
|
-
let url = `
|
|
12271
|
+
let url = `v3/account/${id}`;
|
|
12272
12272
|
let added = false;
|
|
12273
12273
|
if (expandParam) {
|
|
12274
12274
|
url += (added ? "&" : "?") + `Expand=${expandParam}`;
|
|
@@ -12304,63 +12304,18 @@ var Account;
|
|
|
12304
12304
|
});
|
|
12305
12305
|
}
|
|
12306
12306
|
Account.Get = Get;
|
|
12307
|
-
/**
|
|
12308
|
-
* Returns a client account record by subdomain or ID.
|
|
12309
|
-
* @deprecated use Get() as both will check against ID and subdomain.
|
|
12310
|
-
* @param params
|
|
12311
|
-
* @returns
|
|
12312
|
-
*/
|
|
12313
|
-
function GetBySubdomain(params) {
|
|
12314
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
12315
|
-
let { api, subdomain, req: reqParams } = params;
|
|
12316
|
-
if (!api) {
|
|
12317
|
-
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
12318
|
-
}
|
|
12319
|
-
const cacheKey = GetCacheKey(api.GetSessionId(), subdomain);
|
|
12320
|
-
const cache = api.GetCacheItem(cacheKey, reqParams);
|
|
12321
|
-
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
12322
|
-
return cache.data;
|
|
12323
|
-
}
|
|
12324
|
-
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
12325
|
-
try {
|
|
12326
|
-
const data = yield api.GET(`account/${subdomain}`, reqParams);
|
|
12327
|
-
// Update the cache by ID as well in case it's different to the subdomain.
|
|
12328
|
-
if ((data === null || data === void 0 ? void 0 : data.ID) && (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) != false) {
|
|
12329
|
-
api.SetCacheItem({
|
|
12330
|
-
key: data.ID,
|
|
12331
|
-
value: prom,
|
|
12332
|
-
req: reqParams
|
|
12333
|
-
});
|
|
12334
|
-
}
|
|
12335
|
-
res({
|
|
12336
|
-
account: data
|
|
12337
|
-
});
|
|
12338
|
-
}
|
|
12339
|
-
catch (e) {
|
|
12340
|
-
rej(e);
|
|
12341
|
-
}
|
|
12342
|
-
}));
|
|
12343
|
-
api.SetCacheItem({
|
|
12344
|
-
key: cacheKey,
|
|
12345
|
-
value: prom,
|
|
12346
|
-
req: reqParams
|
|
12347
|
-
});
|
|
12348
|
-
return prom;
|
|
12349
|
-
});
|
|
12350
|
-
}
|
|
12351
|
-
Account.GetBySubdomain = GetBySubdomain;
|
|
12352
12307
|
/**
|
|
12353
12308
|
* Gets a list of client accounts related to the current session user.
|
|
12354
12309
|
* @param params
|
|
12355
12310
|
* @returns
|
|
12356
12311
|
*/
|
|
12357
|
-
function
|
|
12312
|
+
function GetList(params) {
|
|
12358
12313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12359
|
-
let { api, req: reqParams,
|
|
12314
|
+
let { api, req: reqParams, ownedByUserId, userId } = params;
|
|
12360
12315
|
if (!api) {
|
|
12361
12316
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
12362
12317
|
}
|
|
12363
|
-
const cacheKey = GetListCacheKey(api.GetSessionId(), userId,
|
|
12318
|
+
const cacheKey = GetListCacheKey(api.GetSessionId(), userId, ownedByUserId);
|
|
12364
12319
|
const cache = api.GetCacheItem(cacheKey, reqParams);
|
|
12365
12320
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
12366
12321
|
return cache.data;
|
|
@@ -12369,7 +12324,10 @@ var Account;
|
|
|
12369
12324
|
if (userId) {
|
|
12370
12325
|
urlParams.append("UserID", userId);
|
|
12371
12326
|
}
|
|
12372
|
-
let url =
|
|
12327
|
+
let url = "v3/accounts";
|
|
12328
|
+
if (ownedByUserId) {
|
|
12329
|
+
urlParams.append("Owner", ownedByUserId);
|
|
12330
|
+
}
|
|
12373
12331
|
if (urlParams.toString()) {
|
|
12374
12332
|
url += "?" + urlParams.toString();
|
|
12375
12333
|
}
|
|
@@ -12394,7 +12352,7 @@ var Account;
|
|
|
12394
12352
|
return prom;
|
|
12395
12353
|
});
|
|
12396
12354
|
}
|
|
12397
|
-
Account.
|
|
12355
|
+
Account.GetList = GetList;
|
|
12398
12356
|
/**
|
|
12399
12357
|
* Gets application settings for a specific client account.
|
|
12400
12358
|
* @param params
|
|
@@ -12454,37 +12412,6 @@ var Account;
|
|
|
12454
12412
|
});
|
|
12455
12413
|
}
|
|
12456
12414
|
Account.UpdateAppSettings = UpdateAppSettings;
|
|
12457
|
-
/**
|
|
12458
|
-
* Creates a new Nextspace account using given details.
|
|
12459
|
-
* @param params
|
|
12460
|
-
* @returns
|
|
12461
|
-
*/
|
|
12462
|
-
function Create(params) {
|
|
12463
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
12464
|
-
let { api, accountId: id, name, hostingLocationKey, starterContent, req: reqParams } = params;
|
|
12465
|
-
if (!id || !name || !hostingLocationKey) {
|
|
12466
|
-
throw new Error("Id, Name and hostingLocationKey are required.");
|
|
12467
|
-
}
|
|
12468
|
-
if (!api) {
|
|
12469
|
-
api = ENVIRONMENT.Api().GetBruceApi();
|
|
12470
|
-
}
|
|
12471
|
-
if (!starterContent) {
|
|
12472
|
-
starterContent = EStarterContent.None;
|
|
12473
|
-
}
|
|
12474
|
-
const reqData = {
|
|
12475
|
-
"Name": name,
|
|
12476
|
-
"HostingLocation.Key": hostingLocationKey,
|
|
12477
|
-
"StarterContent": starterContent
|
|
12478
|
-
};
|
|
12479
|
-
const res = yield api.POST(`clientAccount/${id}`, reqData, Api.PrepReqParams(reqParams));
|
|
12480
|
-
const resData = {
|
|
12481
|
-
account: res
|
|
12482
|
-
};
|
|
12483
|
-
api.Cache.RemoveByContains(GetListCacheKey(api.GetSessionId()));
|
|
12484
|
-
return resData;
|
|
12485
|
-
});
|
|
12486
|
-
}
|
|
12487
|
-
Account.Create = Create;
|
|
12488
12415
|
/**
|
|
12489
12416
|
* Call to start a cleanup job. Do not start multiple cleanups at once.
|
|
12490
12417
|
* @param params
|
|
@@ -12544,9 +12471,9 @@ var Account;
|
|
|
12544
12471
|
* @param ssid
|
|
12545
12472
|
* @returns
|
|
12546
12473
|
*/
|
|
12547
|
-
function GetListCacheKey(ssid, userId,
|
|
12548
|
-
if (!
|
|
12549
|
-
|
|
12474
|
+
function GetListCacheKey(ssid, userId, ownedByUserId) {
|
|
12475
|
+
if (!ownedByUserId) {
|
|
12476
|
+
ownedByUserId = "";
|
|
12550
12477
|
}
|
|
12551
12478
|
if (!ssid) {
|
|
12552
12479
|
ssid = "anonymous";
|
|
@@ -12554,7 +12481,7 @@ var Account;
|
|
|
12554
12481
|
if (!userId) {
|
|
12555
12482
|
userId = "anonymous";
|
|
12556
12483
|
}
|
|
12557
|
-
return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid + Api.ECacheKey.Id +
|
|
12484
|
+
return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid + Api.ECacheKey.Id + ownedByUserId + Api.ECacheKey.User + Api.ECacheKey.Id + userId;
|
|
12558
12485
|
}
|
|
12559
12486
|
Account.GetListCacheKey = GetListCacheKey;
|
|
12560
12487
|
/**
|
|
@@ -12834,7 +12761,7 @@ var Session;
|
|
|
12834
12761
|
}
|
|
12835
12762
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
12836
12763
|
try {
|
|
12837
|
-
const data = yield api.GET(`session/${sessionId}${accountId ? `?account=${accountId}` : ""}`, reqParams);
|
|
12764
|
+
const data = yield api.GET(`v3/session/${sessionId}${accountId ? `?account=${accountId}` : ""}`, reqParams);
|
|
12838
12765
|
res({
|
|
12839
12766
|
session: data
|
|
12840
12767
|
});
|
|
@@ -12865,7 +12792,7 @@ var Session;
|
|
|
12865
12792
|
if (!api) {
|
|
12866
12793
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
12867
12794
|
}
|
|
12868
|
-
const data = yield api.POST("login", {
|
|
12795
|
+
const data = yield api.POST("v3/login", {
|
|
12869
12796
|
account: accountId ? accountId : "",
|
|
12870
12797
|
login: username,
|
|
12871
12798
|
password: password,
|
|
@@ -12900,7 +12827,7 @@ var Session;
|
|
|
12900
12827
|
}
|
|
12901
12828
|
const ssid = api.GetSessionId();
|
|
12902
12829
|
if (ssid) {
|
|
12903
|
-
yield api.POST("logout", null, reqParams);
|
|
12830
|
+
yield api.POST("v3/logout", null, reqParams);
|
|
12904
12831
|
api.SetSessionId(null);
|
|
12905
12832
|
api.Cache.Remove(GetCacheKey(ssid));
|
|
12906
12833
|
}
|
|
@@ -12915,54 +12842,24 @@ var Session;
|
|
|
12915
12842
|
* @returns
|
|
12916
12843
|
*/
|
|
12917
12844
|
function IsPermEnabled(params) {
|
|
12918
|
-
var _a, _b, _c
|
|
12845
|
+
var _a, _b, _c;
|
|
12919
12846
|
let { session, accountId, perm } = params;
|
|
12920
12847
|
if (!perm) {
|
|
12921
12848
|
throw ("Perm is required.");
|
|
12922
12849
|
}
|
|
12923
12850
|
perm = perm.toLocaleUpperCase();
|
|
12924
12851
|
accountId = accountId.toLowerCase();
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
const aPerms = session.User.AccessPermissions[i];
|
|
12852
|
+
if ((_b = (_a = session === null || session === void 0 ? void 0 : session.User) === null || _a === void 0 ? void 0 : _a.Permissions) === null || _b === void 0 ? void 0 : _b.length) {
|
|
12853
|
+
for (let i = 0; i < session.User.Permissions.length; i++) {
|
|
12854
|
+
const aPerms = session.User.Permissions[i];
|
|
12929
12855
|
const permsAccountId = String(aPerms["ClientAccount.ID"]).toLowerCase();
|
|
12930
|
-
// Found account, woo.
|
|
12931
12856
|
if (permsAccountId == accountId) {
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
//therefor we also do a group check after..
|
|
12935
|
-
if ((_c = aPerms.EnabledFeatures) === null || _c === void 0 ? void 0 : _c.length) {
|
|
12936
|
-
return aPerms.EnabledFeatures.findIndex(x => x.toLocaleUpperCase() == perm) > -1;
|
|
12937
|
-
}
|
|
12938
|
-
// Fallback to group check.
|
|
12939
|
-
if (((_d = aPerms.UserGroups) === null || _d === void 0 ? void 0 : _d.length) && typeof aPerms.UserGroups[0] != "string") {
|
|
12940
|
-
for (let j = 0; j < aPerms.UserGroups.length; j++) {
|
|
12941
|
-
const group = aPerms.UserGroups[j];
|
|
12942
|
-
if ((_e = group === null || group === void 0 ? void 0 : group.Features) === null || _e === void 0 ? void 0 : _e.length) {
|
|
12943
|
-
const gPerms = group.Features;
|
|
12944
|
-
if (gPerms && gPerms.findIndex(x => x.toLocaleUpperCase() == perm) > -1) {
|
|
12945
|
-
return true;
|
|
12946
|
-
}
|
|
12947
|
-
}
|
|
12948
|
-
}
|
|
12857
|
+
if ((_c = aPerms.Features) === null || _c === void 0 ? void 0 : _c.length) {
|
|
12858
|
+
return aPerms.Features.findIndex(x => x.toLocaleUpperCase() == perm) > -1;
|
|
12949
12859
|
}
|
|
12950
12860
|
}
|
|
12951
12861
|
}
|
|
12952
12862
|
}
|
|
12953
|
-
// Fallback to the session perm info.
|
|
12954
|
-
// This is deprecated and old as it's only for one account.
|
|
12955
|
-
const perms = session === null || session === void 0 ? void 0 : session.AccessPermissions;
|
|
12956
|
-
if (!perms) {
|
|
12957
|
-
return false;
|
|
12958
|
-
}
|
|
12959
|
-
const pAccountId = String(perms["ClientAccount.ID"]).toLowerCase();
|
|
12960
|
-
if (pAccountId != accountId) {
|
|
12961
|
-
return false;
|
|
12962
|
-
}
|
|
12963
|
-
if ((_f = perms.EnabledFeatures) === null || _f === void 0 ? void 0 : _f.length) {
|
|
12964
|
-
return perms.EnabledFeatures.findIndex(x => x.toLocaleUpperCase() == perm) > -1;
|
|
12965
|
-
}
|
|
12966
12863
|
return false;
|
|
12967
12864
|
}
|
|
12968
12865
|
Session.IsPermEnabled = IsPermEnabled;
|
|
@@ -12974,7 +12871,7 @@ var Session;
|
|
|
12974
12871
|
* @returns
|
|
12975
12872
|
*/
|
|
12976
12873
|
function IsSuperPermEnabled(params) {
|
|
12977
|
-
var _a, _b
|
|
12874
|
+
var _a, _b;
|
|
12978
12875
|
let { session, perm } = params;
|
|
12979
12876
|
if (!perm) {
|
|
12980
12877
|
throw ("Perm is required.");
|
|
@@ -12983,39 +12880,16 @@ var Session;
|
|
|
12983
12880
|
return false;
|
|
12984
12881
|
}
|
|
12985
12882
|
perm = perm.toLocaleUpperCase();
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
// Newer API versions always specify accountId in the collections.
|
|
12997
|
-
// If it's set we can do a super account check early.
|
|
12998
|
-
if (perms["ClientAccount.ID"] != null) {
|
|
12999
|
-
const pAccountId = String(perms["ClientAccount.ID"]).toLowerCase();
|
|
13000
|
-
if (pAccountId != Api.SUPER_ACCOUNT_ID) {
|
|
13001
|
-
continue;
|
|
13002
|
-
}
|
|
13003
|
-
accIdChecked = true;
|
|
13004
|
-
}
|
|
13005
|
-
if ((_d = perms === null || perms === void 0 ? void 0 : perms.UserGroups) === null || _d === void 0 ? void 0 : _d.length) {
|
|
13006
|
-
for (let j = 0; j < perms.UserGroups.length; j++) {
|
|
13007
|
-
const group = perms.UserGroups[j];
|
|
13008
|
-
if (typeof group != "string") {
|
|
13009
|
-
const gAccountId = String(group["ClientAccount.ID"]).toLowerCase();
|
|
13010
|
-
if (gAccountId != Api.SUPER_ACCOUNT_ID && !accIdChecked) {
|
|
13011
|
-
continue;
|
|
13012
|
-
}
|
|
13013
|
-
const features = group.Features;
|
|
13014
|
-
if (features && features.findIndex(x => x.toLocaleUpperCase() == perm) > -1) {
|
|
13015
|
-
return true;
|
|
13016
|
-
}
|
|
13017
|
-
}
|
|
13018
|
-
}
|
|
12883
|
+
if ((_b = (_a = session === null || session === void 0 ? void 0 : session.User) === null || _a === void 0 ? void 0 : _a.Permissions) === null || _b === void 0 ? void 0 : _b.length) {
|
|
12884
|
+
for (let i = 0; i < session.User.Permissions.length; i++) {
|
|
12885
|
+
const perms = session.User.Permissions[i];
|
|
12886
|
+
const pAccountId = String(perms["ClientAccount.ID"]).toLowerCase();
|
|
12887
|
+
if (pAccountId != Api.SUPER_ACCOUNT_ID) {
|
|
12888
|
+
continue;
|
|
12889
|
+
}
|
|
12890
|
+
const features = perms === null || perms === void 0 ? void 0 : perms.Features;
|
|
12891
|
+
if (features && features.findIndex(x => x.toLocaleUpperCase() == perm) > -1) {
|
|
12892
|
+
return true;
|
|
13019
12893
|
}
|
|
13020
12894
|
}
|
|
13021
12895
|
}
|
|
@@ -13104,12 +12978,12 @@ var User;
|
|
|
13104
12978
|
* @returns
|
|
13105
12979
|
*/
|
|
13106
12980
|
function UnpackRelatedUserGroupIDs(params) {
|
|
13107
|
-
var _a
|
|
12981
|
+
var _a;
|
|
13108
12982
|
const { user, accountId } = params;
|
|
13109
12983
|
if (!user || !accountId) {
|
|
13110
12984
|
throw ("User and accountId are required.");
|
|
13111
12985
|
}
|
|
13112
|
-
let accessPerms = user.
|
|
12986
|
+
let accessPerms = user.Permissions;
|
|
13113
12987
|
if (!accessPerms || !Array.isArray(accessPerms) || accessPerms.length === 0) {
|
|
13114
12988
|
return [];
|
|
13115
12989
|
}
|
|
@@ -13120,14 +12994,6 @@ var User;
|
|
|
13120
12994
|
else if ((_a = perm["UserGroup.ID"]) === null || _a === void 0 ? void 0 : _a.length) {
|
|
13121
12995
|
return perm["UserGroup.ID"];
|
|
13122
12996
|
}
|
|
13123
|
-
else if ((_b = perm.UserGroups) === null || _b === void 0 ? void 0 : _b.length) {
|
|
13124
|
-
if (typeof perm.UserGroups[0] === "string") {
|
|
13125
|
-
return perm.UserGroups;
|
|
13126
|
-
}
|
|
13127
|
-
else if (typeof perm.UserGroups[0] === "object") {
|
|
13128
|
-
return perm.UserGroups.map(group => group.ID);
|
|
13129
|
-
}
|
|
13130
|
-
}
|
|
13131
12997
|
}
|
|
13132
12998
|
return [];
|
|
13133
12999
|
}
|
|
@@ -13155,12 +13021,12 @@ var User;
|
|
|
13155
13021
|
try {
|
|
13156
13022
|
const urlParams = new URLSearchParams();
|
|
13157
13023
|
if (accountId) {
|
|
13158
|
-
urlParams.append("
|
|
13024
|
+
urlParams.append("Account", accountId);
|
|
13159
13025
|
}
|
|
13160
13026
|
if (expand) {
|
|
13161
|
-
urlParams.append("
|
|
13027
|
+
urlParams.append("Expand", expand);
|
|
13162
13028
|
}
|
|
13163
|
-
let url = `user/${id}`;
|
|
13029
|
+
let url = `v3/user/${id}`;
|
|
13164
13030
|
if (urlParams.toString().length) {
|
|
13165
13031
|
url += "?" + urlParams.toString();
|
|
13166
13032
|
}
|
|
@@ -13188,7 +13054,6 @@ var User;
|
|
|
13188
13054
|
* @returns
|
|
13189
13055
|
*/
|
|
13190
13056
|
function Update(params) {
|
|
13191
|
-
var _a;
|
|
13192
13057
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13193
13058
|
let { api, user: data, req: reqParams } = params;
|
|
13194
13059
|
if (!(data === null || data === void 0 ? void 0 : data.ID) || !(data === null || data === void 0 ? void 0 : data.Type)) {
|
|
@@ -13197,20 +13062,7 @@ var User;
|
|
|
13197
13062
|
if (!api) {
|
|
13198
13063
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13199
13064
|
}
|
|
13200
|
-
|
|
13201
|
-
// We can make up the difference here.
|
|
13202
|
-
if ((_a = data.AccessPermissions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
13203
|
-
for (let i = 0; i < data.AccessPermissions.length; i++) {
|
|
13204
|
-
const perm = data.AccessPermissions[i];
|
|
13205
|
-
if (!perm["UserGroup.ID"] && perm.UserGroups && typeof perm.UserGroups != "string") {
|
|
13206
|
-
perm["UserGroup.ID"] = [];
|
|
13207
|
-
for (let j = 0; j < perm.UserGroups.length; j++) {
|
|
13208
|
-
perm["UserGroup.ID"].push(perm.UserGroups[j].ID);
|
|
13209
|
-
}
|
|
13210
|
-
}
|
|
13211
|
-
}
|
|
13212
|
-
}
|
|
13213
|
-
const res = yield api.POST(`user/${data.ID}`, data, reqParams);
|
|
13065
|
+
const res = yield api.POST(`v3/user/${data.ID}`, data, reqParams);
|
|
13214
13066
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + data.ID);
|
|
13215
13067
|
if (data.Type == EType.AccessToken) {
|
|
13216
13068
|
api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
|
|
@@ -13245,7 +13097,7 @@ var User;
|
|
|
13245
13097
|
if (!data.ID) {
|
|
13246
13098
|
data.ID = ObjectUtils.UId();
|
|
13247
13099
|
}
|
|
13248
|
-
const res = yield api.POST("user", data, reqParams);
|
|
13100
|
+
const res = yield api.POST("v3/user", data, reqParams);
|
|
13249
13101
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + data.ID);
|
|
13250
13102
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Account);
|
|
13251
13103
|
return {
|
|
@@ -13403,38 +13255,16 @@ var User;
|
|
|
13403
13255
|
* Returns a user by their email address.
|
|
13404
13256
|
* @param params
|
|
13405
13257
|
* @returns
|
|
13258
|
+
* @deprecated Get() checks ID, Username, Email, and Mobile.
|
|
13406
13259
|
*/
|
|
13407
13260
|
function GetByEmail(params) {
|
|
13408
13261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13415
|
-
}
|
|
13416
|
-
const cacheKey = GetEmailCacheKey(api.GetSessionId(), email, accountId);
|
|
13417
|
-
const cache = api.GetCacheItem(cacheKey, reqParams);
|
|
13418
|
-
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13419
|
-
return cache.data;
|
|
13420
|
-
}
|
|
13421
|
-
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
13422
|
-
try {
|
|
13423
|
-
const data = yield api.GET(`userByEmail/${email}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
|
|
13424
|
-
res({
|
|
13425
|
-
user: data
|
|
13426
|
-
});
|
|
13427
|
-
}
|
|
13428
|
-
catch (e) {
|
|
13429
|
-
rej(e);
|
|
13430
|
-
}
|
|
13431
|
-
}));
|
|
13432
|
-
api.SetCacheItem({
|
|
13433
|
-
key: cacheKey,
|
|
13434
|
-
value: prom,
|
|
13435
|
-
req: reqParams
|
|
13262
|
+
return Get({
|
|
13263
|
+
userId: params.email,
|
|
13264
|
+
accountId: params.accountId,
|
|
13265
|
+
req: params.req,
|
|
13266
|
+
api: params.api
|
|
13436
13267
|
});
|
|
13437
|
-
return prom;
|
|
13438
13268
|
});
|
|
13439
13269
|
}
|
|
13440
13270
|
LoginUser.GetByEmail = GetByEmail;
|
|
@@ -13462,15 +13292,15 @@ var User;
|
|
|
13462
13292
|
try {
|
|
13463
13293
|
const urlParams = new URLSearchParams();
|
|
13464
13294
|
if (accountId) {
|
|
13465
|
-
urlParams.append("
|
|
13295
|
+
urlParams.append("Account", accountId);
|
|
13466
13296
|
}
|
|
13467
13297
|
if (search) {
|
|
13468
|
-
urlParams.append("
|
|
13298
|
+
urlParams.append("Search", search);
|
|
13469
13299
|
}
|
|
13470
13300
|
if (exclusive) {
|
|
13471
13301
|
urlParams.append("allExcludingClientAccount", "true");
|
|
13472
13302
|
}
|
|
13473
|
-
const data = yield api.GET(`users?${urlParams.toString()}`, reqParams);
|
|
13303
|
+
const data = yield api.GET(`v3/users?${urlParams.toString()}`, reqParams);
|
|
13474
13304
|
res({
|
|
13475
13305
|
users: data.Items
|
|
13476
13306
|
});
|
|
@@ -13548,17 +13378,20 @@ var User;
|
|
|
13548
13378
|
function SignupComplete(params) {
|
|
13549
13379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13550
13380
|
let { api, code, user: data, accountId, req: reqParams } = params;
|
|
13551
|
-
if (!code || !(data === null || data === void 0 ? void 0 : data.
|
|
13552
|
-
throw ("
|
|
13381
|
+
if (!code || !(data === null || data === void 0 ? void 0 : data.Username) || !(data === null || data === void 0 ? void 0 : data.Password)) {
|
|
13382
|
+
throw ("Username, password, and activation code are required.");
|
|
13553
13383
|
}
|
|
13554
13384
|
if (!api) {
|
|
13555
13385
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13556
13386
|
}
|
|
13557
13387
|
data = JSON.parse(JSON.stringify(data));
|
|
13558
|
-
data.
|
|
13559
|
-
data.IsDisabled = false;
|
|
13388
|
+
data.Disabled = false;
|
|
13560
13389
|
data.key = code;
|
|
13561
|
-
|
|
13390
|
+
let url = "v3/userForgotPassword/complete";
|
|
13391
|
+
if (accountId) {
|
|
13392
|
+
url += "?Account=" + accountId;
|
|
13393
|
+
}
|
|
13394
|
+
const res = yield api.POST(url, data, reqParams);
|
|
13562
13395
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + res.ID);
|
|
13563
13396
|
if (data.Email) {
|
|
13564
13397
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.UserEmail + data.Email);
|
|
@@ -13583,7 +13416,11 @@ var User;
|
|
|
13583
13416
|
if (!api) {
|
|
13584
13417
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13585
13418
|
}
|
|
13586
|
-
|
|
13419
|
+
let url = "v3/userForgotPassword";
|
|
13420
|
+
if (accountId) {
|
|
13421
|
+
url += "?Account=" + accountId;
|
|
13422
|
+
}
|
|
13423
|
+
const req = api.POST(url, {
|
|
13587
13424
|
Email: email
|
|
13588
13425
|
}, reqParams);
|
|
13589
13426
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -13618,7 +13455,7 @@ var User;
|
|
|
13618
13455
|
accountId: "",
|
|
13619
13456
|
req: reqParams
|
|
13620
13457
|
});
|
|
13621
|
-
const res = yield api.POST("
|
|
13458
|
+
const res = yield api.POST("v3/userForgotPassword/complete", {
|
|
13622
13459
|
ID: userId,
|
|
13623
13460
|
Email: user.Email,
|
|
13624
13461
|
ActivationCode: code,
|
|
@@ -13673,7 +13510,7 @@ var User;
|
|
|
13673
13510
|
}
|
|
13674
13511
|
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
13675
13512
|
try {
|
|
13676
|
-
const data = yield api.GET(
|
|
13513
|
+
const data = yield api.GET(`v3/account/${accountId}/accessTokens`, reqParams);
|
|
13677
13514
|
res({
|
|
13678
13515
|
users: data.Items
|
|
13679
13516
|
});
|
|
@@ -13701,7 +13538,7 @@ var User;
|
|
|
13701
13538
|
if (!api) {
|
|
13702
13539
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13703
13540
|
}
|
|
13704
|
-
yield api.DELETE(`accessToken/${id}`, reqParams);
|
|
13541
|
+
yield api.DELETE(`v3/accessToken/${id}`, reqParams);
|
|
13705
13542
|
api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + id);
|
|
13706
13543
|
api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
|
|
13707
13544
|
});
|
|
@@ -13727,7 +13564,7 @@ var User;
|
|
|
13727
13564
|
if (!data.Type) {
|
|
13728
13565
|
data.Type = EType.AccessToken;
|
|
13729
13566
|
}
|
|
13730
|
-
data = yield api.POST("
|
|
13567
|
+
data = yield api.POST("v3/createAccessToken", data, reqParams);
|
|
13731
13568
|
api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
|
|
13732
13569
|
return {
|
|
13733
13570
|
user: data
|
|
@@ -13850,7 +13687,7 @@ var UserGroup;
|
|
|
13850
13687
|
if (!api) {
|
|
13851
13688
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13852
13689
|
}
|
|
13853
|
-
const data = yield api.GET(`
|
|
13690
|
+
const data = yield api.GET(`v3/userGroup/${groupId}`, reqParams);
|
|
13854
13691
|
return {
|
|
13855
13692
|
group: data
|
|
13856
13693
|
};
|
|
@@ -13860,6 +13697,7 @@ var UserGroup;
|
|
|
13860
13697
|
/**
|
|
13861
13698
|
* Returns a user group by its name.
|
|
13862
13699
|
* @param params
|
|
13700
|
+
* @deprecated
|
|
13863
13701
|
* @returns
|
|
13864
13702
|
*/
|
|
13865
13703
|
function GetByName(params) {
|
|
@@ -13900,7 +13738,7 @@ var UserGroup;
|
|
|
13900
13738
|
if (!accountId) {
|
|
13901
13739
|
accountId = "";
|
|
13902
13740
|
}
|
|
13903
|
-
const data = yield api.GET(`
|
|
13741
|
+
const data = yield api.GET(`v3/account/${accountId || ""}/userGroup/${id}/users`, reqParams);
|
|
13904
13742
|
return {
|
|
13905
13743
|
users: data.Items
|
|
13906
13744
|
};
|
|
@@ -13910,6 +13748,7 @@ var UserGroup;
|
|
|
13910
13748
|
/**
|
|
13911
13749
|
* Returns list of user groups that have a specific permission enabled.
|
|
13912
13750
|
* @param params
|
|
13751
|
+
* @deprecated
|
|
13913
13752
|
* @returns
|
|
13914
13753
|
*/
|
|
13915
13754
|
function GetListByPerm(params) {
|
|
@@ -13947,7 +13786,7 @@ var UserGroup;
|
|
|
13947
13786
|
if (!accountId) {
|
|
13948
13787
|
accountId = "";
|
|
13949
13788
|
}
|
|
13950
|
-
const data = yield api.GET(`
|
|
13789
|
+
const data = yield api.GET(`v3/account/${accountId}/userGroups`, reqParams);
|
|
13951
13790
|
return {
|
|
13952
13791
|
groups: data.Items
|
|
13953
13792
|
};
|
|
@@ -13961,18 +13800,14 @@ var UserGroup;
|
|
|
13961
13800
|
*/
|
|
13962
13801
|
function Delete(params) {
|
|
13963
13802
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13964
|
-
let { api,
|
|
13803
|
+
let { api, groupId: id, req: reqParams } = params;
|
|
13965
13804
|
if (!id) {
|
|
13966
13805
|
throw ("ID is required.");
|
|
13967
13806
|
}
|
|
13968
13807
|
if (!api) {
|
|
13969
13808
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13970
13809
|
}
|
|
13971
|
-
|
|
13972
|
-
if (!accountId) {
|
|
13973
|
-
accountId = "";
|
|
13974
|
-
}
|
|
13975
|
-
return api.DELETE(`account/${accountId}/userGroupID/${id}`, reqParams);
|
|
13810
|
+
return api.DELETE(`v3/userGroup/${id}`, reqParams);
|
|
13976
13811
|
});
|
|
13977
13812
|
}
|
|
13978
13813
|
UserGroup.Delete = Delete;
|
|
@@ -13994,7 +13829,7 @@ var UserGroup;
|
|
|
13994
13829
|
if (!api) {
|
|
13995
13830
|
api = ENVIRONMENT.Api().GetGuardianApi();
|
|
13996
13831
|
}
|
|
13997
|
-
const res = yield api.POST(`userGroup${data.ID ? ("/" + data.ID) : ""}`, data, reqParams);
|
|
13832
|
+
const res = yield api.POST(`v3/userGroup${data.ID ? ("/" + data.ID) : ""}`, data, reqParams);
|
|
13998
13833
|
return {
|
|
13999
13834
|
group: res
|
|
14000
13835
|
};
|
|
@@ -14444,7 +14279,7 @@ var AccountLimits;
|
|
|
14444
14279
|
expand: ["limit"],
|
|
14445
14280
|
appId: ENVIRONMENT.PARAMS.appId
|
|
14446
14281
|
});
|
|
14447
|
-
const limits = account["
|
|
14282
|
+
const limits = account["Limit"] || {};
|
|
14448
14283
|
return {
|
|
14449
14284
|
limits: limits
|
|
14450
14285
|
};
|
|
@@ -17048,6 +16883,15 @@ class NavigatorMcpWebSocketClient {
|
|
|
17048
16883
|
|
|
17049
16884
|
var ChangeSet;
|
|
17050
16885
|
(function (ChangeSet) {
|
|
16886
|
+
/**
|
|
16887
|
+
* Valid values for the Change Set Status.
|
|
16888
|
+
*/
|
|
16889
|
+
let BruceChangeStatus;
|
|
16890
|
+
(function (BruceChangeStatus) {
|
|
16891
|
+
BruceChangeStatus["UNCOMMITTED"] = "Uncommitted";
|
|
16892
|
+
BruceChangeStatus["COMMITTED"] = "Committed";
|
|
16893
|
+
BruceChangeStatus["CANCELLED"] = "Cancelled";
|
|
16894
|
+
})(BruceChangeStatus = ChangeSet.BruceChangeStatus || (ChangeSet.BruceChangeStatus = {}));
|
|
17051
16895
|
/**
|
|
17052
16896
|
* Updates existing or crates new Change Set record.
|
|
17053
16897
|
*/
|
|
@@ -17120,7 +16964,7 @@ var ChangeSet;
|
|
|
17120
16964
|
})(ChangeSet || (ChangeSet = {}));
|
|
17121
16965
|
|
|
17122
16966
|
// This is updated with the package.json version on build.
|
|
17123
|
-
const VERSION = "7.0
|
|
16967
|
+
const VERSION = "7.1.0";
|
|
17124
16968
|
|
|
17125
16969
|
export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NavigatorChatClient, NavigatorMcpWebSocketClient, ChangeSet };
|
|
17126
16970
|
//# sourceMappingURL=bruce-models.es5.js.map
|