bruce-models 6.4.7 → 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.
@@ -12712,6 +12712,41 @@ var User;
12712
12712
  // Access token. Used to gain access to related permissions.
12713
12713
  EType["AccessToken"] = "ACCESS_TOKEN";
12714
12714
  })(EType = User$$1.EType || (User$$1.EType = {}));
12715
+ /**
12716
+ * Returns an array of User Group IDs for the User that have been loaded.
12717
+ * Note, this does not perform an API lookup if the User instance hasn't loaded the specific account's details.
12718
+ * @param params
12719
+ * @returns
12720
+ */
12721
+ function UnpackRelatedUserGroupIDs(params) {
12722
+ var _a, _b;
12723
+ const { user, accountId } = params;
12724
+ if (!user || !accountId) {
12725
+ throw ("User and accountId are required.");
12726
+ }
12727
+ let accessPerms = user.AccessPermissions;
12728
+ if (!accessPerms || !Array.isArray(accessPerms) || accessPerms.length === 0) {
12729
+ return [];
12730
+ }
12731
+ for (const perm of accessPerms) {
12732
+ if (!perm || perm["ClientAccount.ID"] !== accountId) {
12733
+ continue;
12734
+ }
12735
+ else if ((_a = perm["UserGroup.ID"]) === null || _a === void 0 ? void 0 : _a.length) {
12736
+ return perm["UserGroup.ID"];
12737
+ }
12738
+ else if ((_b = perm.UserGroups) === null || _b === void 0 ? void 0 : _b.length) {
12739
+ if (typeof perm.UserGroups[0] === "string") {
12740
+ return perm.UserGroups;
12741
+ }
12742
+ else if (typeof perm.UserGroups[0] === "object") {
12743
+ return perm.UserGroups.map(group => group.ID);
12744
+ }
12745
+ }
12746
+ }
12747
+ return [];
12748
+ }
12749
+ User$$1.UnpackRelatedUserGroupIDs = UnpackRelatedUserGroupIDs;
12715
12750
  /**
12716
12751
  * Gets a user record.
12717
12752
  * @param params
@@ -16029,7 +16064,7 @@ var Tracking;
16029
16064
  })(Tracking || (Tracking = {}));
16030
16065
 
16031
16066
  // This is updated with the package.json version on build.
16032
- const VERSION = "6.4.7";
16067
+ const VERSION = "6.4.8";
16033
16068
 
16034
16069
  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, 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 };
16035
16070
  //# sourceMappingURL=bruce-models.es5.js.map