mftsccs-browser 2.2.40-beta → 2.2.42-beta

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Encrypts and stores a profile object in sessionStorage.
2
+ * Encrypts and stores a profile object in localStorage.
3
3
  * Uses AES-GCM with a browser-bound derived key so the ciphertext
4
4
  * is not portable to other origins or browsers.
5
5
  */
@@ -2,17 +2,20 @@ export declare class TokenStorage {
2
2
  static BearerAccessToken: string;
3
3
  static refreshToken: string;
4
4
  static sessionId: number;
5
+ /** In-memory cache of the decrypted profile — populated by saveUserProfile or hydrateProfile */
6
+ static profileCache: Record<string, any> | null;
5
7
  static setSession(sessionId: any): void;
6
8
  /**
7
9
  * Stores user profile securely (encrypted in sessionStorage)
8
10
  * and keeps the token in memory for API calls.
11
+ * Also populates profileCache so getUserDetails() works synchronously.
9
12
  */
10
13
  static saveUserProfile(signinResponse: any): Promise<boolean>;
11
14
  /**
12
- * Restores profile metadata from encrypted sessionStorage.
13
- * Tokens are NOT persisted they must come from a fresh login or refresh.
15
+ * Call once at app startup (e.g. in init()) to decrypt the stored profile
16
+ * into memory so that getUserDetails() can read it synchronously.
14
17
  */
15
- static restoreProfile(): Promise<Record<string, any> | null>;
18
+ static hydrateProfile(): Promise<void>;
16
19
  /**
17
20
  * Clears all stored credentials and profile data.
18
21
  */
@@ -1,29 +1,5 @@
1
1
  /**
2
- * Synchronous reads from in-memory token + falls back to plain-text
3
- * localStorage("profile") for backward compatibility.
4
- * @deprecated Migrate callers to getUserDetailsAsync() which uses encrypted storage.
2
+ * Returns user details synchronously.
3
+ * Priority: in-memory profileCache (encrypted) → legacy localStorage("profile") fallback.
5
4
  */
6
- export declare function getUserDetails(): {
7
- entity: number;
8
- userConcept: number;
9
- userId: number;
10
- token: string;
11
- };
12
- /**
13
- * Async version — prefers encrypted sessionStorage, falls back to
14
- * plain-text localStorage for backward compatibility.
15
- * This is the recommended replacement for getUserDetails().
16
- */
17
- export declare function getUserDetailsAsync(): Promise<{
18
- entity: any;
19
- userConcept: any;
20
- userId: any;
21
- token: string;
22
- roles: any;
23
- } | {
24
- entity: any;
25
- userConcept: any;
26
- userId: any;
27
- token: any;
28
- roles: never[];
29
- }>;
5
+ export declare function getUserDetails(): Record<string, any>;
@@ -108,7 +108,7 @@ export declare class BuilderStatefulWidget extends StatefulWidget {
108
108
  * const userId = await widget.getUserId();
109
109
  * console.log('Current user:', userId);
110
110
  */
111
- getUserId(): Promise<any>;
111
+ getUserId(): any;
112
112
  /**
113
113
  * Fetches a list of type values from the backend based on the widget's type.
114
114
  *
@@ -125,7 +125,7 @@ export { CreateConnectionBetweenEntityLocal } from './Services/CreateConnection/
125
125
  export { BuildWidgetFromId } from './Widgets/WidgetBuild';
126
126
  export { clearAllCaches } from './Services/CacheClear';
127
127
  export { removeAllChildren } from './Services/Common/RemoveAllChild';
128
- export { getUserDetails, getUserDetailsAsync } from './Services/User/UserFromLocalStorage';
128
+ export { getUserDetails } from './Services/User/UserFromLocalStorage';
129
129
  export { TokenStorage } from './DataStructures/Security/TokenStorage';
130
130
  export { CountInfo } from './DataStructures/Count/CountInfo';
131
131
  export { LogEvent } from './Services/Logs/LogEvent';
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "mftsccs-browser",
3
- "version": "2.2.40-beta",
4
-
3
+ "version": "2.2.42-beta",
5
4
  "environment": "production",
6
5
  "description": "Full Pack of concept and connection system",
7
6
  "main": "dist/main.bundle.js",