mftsccs-browser 2.2.40-beta → 2.2.41-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.
@@ -0,0 +1,3 @@
1
+ import { Connection } from "../../app";
2
+ import { GetConnectionsByTypes } from "../../DataStructures/ConnectionByType/GetConnectionsByType";
3
+ export declare function GetConnectionsByApiTypes(connectionTypes: GetConnectionsByTypes): Promise<Connection[]>;
@@ -0,0 +1,4 @@
1
+ export declare class GetConnectionsByTypes {
2
+ ofTheConceptId: number;
3
+ connectionTypes: string[];
4
+ }
@@ -0,0 +1,25 @@
1
+ import { Concept } from "./Concept";
2
+ import { Connection } from "./Connection";
3
+ /**
4
+ * Manages localStorage persistence for PWA mode.
5
+ *
6
+ * Strategy:
7
+ * - Reads: always from memory (BinaryTree), never from localStorage at runtime
8
+ * - Writes: batched and deferred to avoid blocking the main thread
9
+ * - Startup: bulk load from localStorage into memory once
10
+ */
11
+ export declare class PwaStorageManager {
12
+ private static CONCEPT_PREFIX;
13
+ private static CONNECTION_PREFIX;
14
+ private static writeQueue;
15
+ private static deleteQueue;
16
+ private static flushTimer;
17
+ private static scheduleFlush;
18
+ static saveConcept(concept: Concept): void;
19
+ static saveConnection(connection: Connection): void;
20
+ static removeConcept(id: number): void;
21
+ static removeConnection(id: number): void;
22
+ static loadAllConcepts(): Concept[];
23
+ static loadAllConnections(): Connection[];
24
+ static clearAll(): void;
25
+ }
@@ -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
  */
@@ -0,0 +1 @@
1
+ export declare function DeleteConnectionByIdLocal(toDeleteIds: number[]): void;
@@ -0,0 +1,23 @@
1
+ import { Connection } from "../../app";
2
+ /**
3
+ * ## Format Just-Id ##
4
+ * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.
5
+ * This is then passed on further for stiching.
6
+ * @param connections
7
+ * @param compositionData
8
+ * @param reverse
9
+ * @returns
10
+ */
11
+ export declare function FormatFunctionDataForClean(connections: Connection[], compositionData: any[], reverse?: number[]): Promise<any[]>;
12
+ /**
13
+ * ############ Format is Just Id and is used for list. ############
14
+ * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list
15
+ * The list format is helpful because you do not have to go over each individual query.
16
+ * @param connections the type connections that need (external connections) to be passed
17
+ * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}
18
+ * @param mainComposition this is list of ids of the main composition that builds the tree
19
+ * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)
20
+ * @returns
21
+ */
22
+ export declare function FormatFromConnectionsAlteredArrayExternalClean(connections: Connection[], compositionData: any[], mainComposition: number[], reverse: number[] | undefined, CountDictionary: any[]): Promise<any[]>;
23
+ export declare function AddCount(ofTheConceptId: number, CountDictionary: any, newData: any): void;
@@ -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>;
@@ -0,0 +1,2 @@
1
+ import { Concept } from "../../app";
2
+ export declare function UpdateData(json: any, ofConcept: Concept, typeStrings?: string[]): Promise<void>;
@@ -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.41-beta",
5
4
  "environment": "production",
6
5
  "description": "Full Pack of concept and connection system",
7
6
  "main": "dist/main.bundle.js",