bruce-models 6.3.1 → 6.3.2

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.
@@ -1683,8 +1683,46 @@ class BruceEvent {
1683
1683
 
1684
1684
  // Global instance for smaller use-cases where you don't want to manage the getters yourself.
1685
1685
  let _getters;
1686
+ const LOCAL_STORAGE_SESSION_ID = "nxt-ssid";
1687
+ function setLocalValue(key, value) {
1688
+ if (typeof window !== "undefined" && window["localStorage"]) {
1689
+ window["localStorage"].setItem(key, value);
1690
+ }
1691
+ }
1692
+ function getLocalValue(key) {
1693
+ if (typeof window !== "undefined" && window["localStorage"]) {
1694
+ return window["localStorage"].getItem(key);
1695
+ }
1696
+ return null;
1697
+ }
1686
1698
  var ENVIRONMENT;
1687
1699
  (function (ENVIRONMENT) {
1700
+ /**
1701
+ * Sets the local-storage session ID.
1702
+ * This is read by default when the ENVIRONMENT is initially created on load.
1703
+ * This is used by scenarios where the app doesn't manage its own session ID.
1704
+ *
1705
+ * If you want to override this logic so default widgets call your function, simply re-assign this function to your own.
1706
+ * Eg: ENVIRONMENT.SetPageLoadSessionId = (sessionId: string) => { ... };
1707
+ * @param sessionId
1708
+ */
1709
+ ENVIRONMENT.SetPageLoadSessionId = (sessionId) => {
1710
+ setLocalValue(LOCAL_STORAGE_SESSION_ID, sessionId ? sessionId : "anonymous");
1711
+ };
1712
+ /**
1713
+ * Loads the session ID from local-storage.
1714
+ * This is used by default when the ENVIRONMENT is initially created on load.
1715
+ * This is used by scenarios where the app doesn't manage its own session ID.
1716
+ *
1717
+ * If you want to override this logic so default widgets call your function, simply re-assign this function to your own.
1718
+ * Eg: ENVIRONMENT.GetPageLoadSessionId = () => { ... };
1719
+ * @param sessionId
1720
+ * @returns
1721
+ */
1722
+ ENVIRONMENT.GetPageLoadSessionId = () => {
1723
+ const ssid = getLocalValue(LOCAL_STORAGE_SESSION_ID);
1724
+ return ssid ? ssid : "anonymous";
1725
+ };
1688
1726
  // If true, then defaults are not touched and it's assumed this is being managed.
1689
1727
  ENVIRONMENT.IS_SELF_MANAGED = false;
1690
1728
  // Unused if IS_SELF_MANAGED is false.
@@ -1692,9 +1730,9 @@ var ENVIRONMENT;
1692
1730
  // Default client account ID.
1693
1731
  accountId: "",
1694
1732
  // Default environment.
1695
- env: Api.EEnv.UAT,
1733
+ env: Api.EEnv.PROD,
1696
1734
  // Default session ID.
1697
- sessionId: ""
1735
+ sessionId: ENVIRONMENT.GetPageLoadSessionId()
1698
1736
  };
1699
1737
  // Subscribe to get notified when someone calls Reset.
1700
1738
  // If you are manually updating params, call OnParamsChange.Trigger() to notify others.
@@ -15941,7 +15979,7 @@ var Tracking;
15941
15979
  })(Tracking || (Tracking = {}));
15942
15980
 
15943
15981
  // This is updated with the package.json version on build.
15944
- const VERSION = "6.3.1";
15982
+ const VERSION = "6.3.2";
15945
15983
 
15946
15984
  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 };
15947
15985
  //# sourceMappingURL=bruce-models.es5.js.map