mftsccs-browser 2.2.42-beta → 2.2.43-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.
- package/README.md +8 -0
- package/dist/main.bundle.js +1 -1
- package/dist/serviceWorker.bundle.js +1 -1
- package/dist/types/Api/GetConnections/GetConnectionsBetweenApi.d.ts +40 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +1 -0
- package/dist/types/DataStructures/FetchConnection.d.ts +64 -0
- package/dist/types/DataStructures/environments/environments.d.ts +44 -1
- package/dist/types/Services/Transaction/LocalTransaction.d.ts +75 -3
- package/dist/types/Widgets/WidgetCacheManager.d.ts +14 -6
- package/dist/types/WrapperFunctions/QueryCacheManager.d.ts +11 -2
- package/dist/types/app.d.ts +9 -0
- package/package.json +7 -4
- package/dist/types/Api/GetAllConcepts.d.ts +0 -11
- package/dist/types/Api/GetAllConnections.d.ts +0 -11
- package/dist/types/Api/GetAllPrefetchConnections.d.ts +0 -12
- package/dist/types/Api/Prototype/CreatePrototype.d.ts +0 -14
- package/dist/types/DataStructures/ReferentInfo.d.ts +0 -7
- package/dist/types/Database/GetConceptFromIndexDb.d.ts +0 -0
- package/dist/types/Drawing/ConceptDraw.d.ts +0 -1
- package/dist/types/Drawing/ConceptEvents.d.ts +0 -1
- package/dist/types/Middleware/ErrorHandling.d.ts +0 -0
- package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +0 -5
- package/dist/types/Services/CreateTypeTreeFromData.d.ts +0 -1
- package/dist/types/Services/GenerateHexNumber.d.ts +0 -1
- package/dist/types/Services/GetAccessIdOfUser.d.ts +0 -0
- package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +0 -2
- package/dist/types/Services/GetTheReferent.d.ts +0 -2
- package/dist/types/Services/Local/CreateConnectionListFromDatat.d.ts +0 -0
- package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +0 -9
- package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +0 -9
- package/dist/types/Services/Mqtt/subscribeMessage.d.ts +0 -0
- package/dist/types/Services/PatchComposition.d.ts +0 -2
- package/dist/types/Services/Visualizations/VisualTree.d.ts +0 -9
- package/dist/types/Visualize/index.d.ts +0 -0
- package/dist/types/Widgets/mainView.class.d.ts +0 -27
- package/dist/types/prototype/getPrototype.service.d.ts +0 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FetchConnection } from "../../DataStructures/FetchConnection";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches connections matching the given criteria from POST /api/get-connection-between.
|
|
4
|
+
*
|
|
5
|
+
* Accepts an array so multiple independent queries can be resolved in one HTTP request.
|
|
6
|
+
* Each item in the array is resolved independently by the backend; results are returned
|
|
7
|
+
* in the same order with `connectionIds` and the resolved `typeId` populated.
|
|
8
|
+
*
|
|
9
|
+
* **Supported query permutations (per item):**
|
|
10
|
+
* 1. `ofTheConceptId` + `toTheConceptId` + `type` — connections between two specific concepts of that type
|
|
11
|
+
* 2. `ofTheConceptId` + `type` — all connections FROM a concept of that type
|
|
12
|
+
* 3. `toTheConceptId` + `type` — all connections TO a concept of that type
|
|
13
|
+
* 4. `typeId` + `isComposition: true` — all internal connections of a composition
|
|
14
|
+
*
|
|
15
|
+
* Fields not relevant to the chosen permutation should be left at their zero/empty defaults.
|
|
16
|
+
* Use {@link buildFetchConnection} to build items without specifying every field manually.
|
|
17
|
+
*
|
|
18
|
+
* @param fetchConnections - Array of query objects; each item is resolved independently.
|
|
19
|
+
* @returns The same array with `connectionIds` and resolved `typeId` populated by the backend.
|
|
20
|
+
* Returns an empty array on error (error is logged internally).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Single query — connections between two concepts
|
|
24
|
+
* const results = await GetConnectionsBetweenApi([
|
|
25
|
+
* buildFetchConnection({ ofTheConceptId: 103927382, toTheConceptId: 103927389, type: "the_project_s_page" })
|
|
26
|
+
* ]);
|
|
27
|
+
* console.log(results[0].connectionIds); // [18161211]
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Multiple queries in one request
|
|
31
|
+
* const results = await GetConnectionsBetweenApi([
|
|
32
|
+
* buildFetchConnection({ ofTheConceptId: 103927382, type: "the_project_s_page" }),
|
|
33
|
+
* buildFetchConnection({ typeId: 101490186, isComposition: true }),
|
|
34
|
+
* ]);
|
|
35
|
+
* const allIds = results.flatMap(r => r.connectionIds);
|
|
36
|
+
*
|
|
37
|
+
* @see {@link buildFetchConnection} for constructing query items without filling all defaults
|
|
38
|
+
* @see {@link FetchConnection} for the full field reference
|
|
39
|
+
*/
|
|
40
|
+
export declare function GetConnectionsBetweenApi(fetchConnections: FetchConnection[]): Promise<FetchConnection[]>;
|
|
@@ -82,6 +82,7 @@ export declare class BaseUrl {
|
|
|
82
82
|
static getLatestWidgetData(): string;
|
|
83
83
|
static getRecentWidgetData(): string;
|
|
84
84
|
static getConnectionsByTypes(): string;
|
|
85
|
+
static GetConnectionsBetweenUrl(): string;
|
|
85
86
|
static CreatePrototypeUrl(): string;
|
|
86
87
|
static GetCachedImage(ImageName: string): string;
|
|
87
88
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request/response shape for the POST /api/get-connection-between endpoint.
|
|
3
|
+
*
|
|
4
|
+
* Use only the fields relevant to your query permutation and leave the rest at their
|
|
5
|
+
* zero/empty defaults. The backend resolves `typeId` from the `type` string when
|
|
6
|
+
* `typeId` is 0, so you never need to supply both.
|
|
7
|
+
*
|
|
8
|
+
* **Query permutations:**
|
|
9
|
+
* 1. `ofTheConceptId` + `toTheConceptId` + `type` — connections between two specific concepts of that type
|
|
10
|
+
* 2. `ofTheConceptId` + `type` — all connections FROM a concept of that type
|
|
11
|
+
* 3. `toTheConceptId` + `type` — all connections TO a concept of that type
|
|
12
|
+
* 4. `typeId` + `isComposition: true` — all internal connections of a composition
|
|
13
|
+
*
|
|
14
|
+
* After the request, the backend populates `connectionIds` and the resolved `typeId`
|
|
15
|
+
* on each item and returns the same array.
|
|
16
|
+
*/
|
|
17
|
+
export interface FetchConnection {
|
|
18
|
+
/** Source concept ID. 0 means "not specified". */
|
|
19
|
+
ofTheConceptId: number;
|
|
20
|
+
/** Target concept ID. 0 means "not specified". */
|
|
21
|
+
toTheConceptId: number;
|
|
22
|
+
/** Resolved type concept ID. Set directly or leave 0 — backend resolves it from `type`. */
|
|
23
|
+
typeId: number;
|
|
24
|
+
/** Human-readable type string (e.g. "the_project_s_page"). Used when typeId is 0. */
|
|
25
|
+
type: string;
|
|
26
|
+
/** Legacy type string resolved relative to the source concept's type. Leave empty unless required. */
|
|
27
|
+
oldType: string;
|
|
28
|
+
/** When true, searches for connections in the reverse direction (toTheConceptId → ofTheConceptId). */
|
|
29
|
+
reverse: boolean;
|
|
30
|
+
/** When true, treats typeId as a composition ID and returns its internal connections. */
|
|
31
|
+
isComposition: boolean;
|
|
32
|
+
/** Populated by the backend after the request — the matching connection IDs. */
|
|
33
|
+
connectionIds: number[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Input-only shape for building a FetchConnection query.
|
|
37
|
+
* Omits `connectionIds` since that is an output field populated by the backend.
|
|
38
|
+
*/
|
|
39
|
+
export type FetchConnectionQuery = Omit<FetchConnection, 'connectionIds'>;
|
|
40
|
+
/**
|
|
41
|
+
* Builds a complete FetchConnection request object from a partial query,
|
|
42
|
+
* filling unspecified fields with their zero/empty defaults.
|
|
43
|
+
*
|
|
44
|
+
* Use this instead of constructing FetchConnection manually so you only
|
|
45
|
+
* need to specify the fields relevant to your query permutation.
|
|
46
|
+
*
|
|
47
|
+
* @param query - Partial query with only the fields you need.
|
|
48
|
+
* @returns A fully initialised FetchConnection ready to send to the API.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Between two concepts
|
|
52
|
+
* buildFetchConnection({ ofTheConceptId: 1, toTheConceptId: 2, type: "the_project_s_page" })
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // All connections from a concept
|
|
56
|
+
* buildFetchConnection({ ofTheConceptId: 1, type: "the_project_s_page" })
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // All internal connections of a composition
|
|
60
|
+
* buildFetchConnection({ typeId: 101490186, isComposition: true })
|
|
61
|
+
*
|
|
62
|
+
* @see {@link GetConnectionsBetweenApi} to send the built query to the backend
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildFetchConnection(query: Partial<FetchConnectionQuery>): FetchConnection;
|
|
@@ -1,5 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static key-value store for runtime configuration values.
|
|
3
|
+
*
|
|
4
|
+
* Used throughout the package for feature flags and settings that need to be
|
|
5
|
+
* readable anywhere without passing parameters down the call stack.
|
|
6
|
+
*
|
|
7
|
+
* **Built-in keys:**
|
|
8
|
+
* - `'enableCache'` — controls widget and query caching (default `true`).
|
|
9
|
+
* Set via `init()` parameters or toggled at runtime. Checked on every
|
|
10
|
+
* cache read/write in `QueryCacheManager` and `WidgetCacheManager`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Disable cache at runtime
|
|
14
|
+
* Environments.setValue('enableCache', false)
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Read with a default value (returned when key has never been set)
|
|
18
|
+
* const cacheOn = Environments.getValue('enableCache', true)
|
|
19
|
+
*/
|
|
1
20
|
export declare class Environments {
|
|
2
21
|
static environments: Record<string, any>;
|
|
3
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a stored value by key.
|
|
24
|
+
*
|
|
25
|
+
* @param key - The key to look up.
|
|
26
|
+
* @param defaultValue - Value returned when the key has never been set. Defaults to `null`.
|
|
27
|
+
* @returns The stored value, or `defaultValue` if the key is absent.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* Environments.getValue('enableCache', true) // true if never set
|
|
31
|
+
* Environments.getValue('myFlag', false) // false if never set
|
|
32
|
+
*/
|
|
33
|
+
static getValue(key: string, defaultValue?: any): any;
|
|
34
|
+
/**
|
|
35
|
+
* Stores a value under the given key. Overwrites any existing value.
|
|
36
|
+
* Takes effect immediately — the next call to `getValue` with the same key
|
|
37
|
+
* returns the new value.
|
|
38
|
+
*
|
|
39
|
+
* @param key - The key to store under.
|
|
40
|
+
* @param value - The value to store.
|
|
41
|
+
* @returns The `Environments` class itself for chaining.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* Environments.setValue('enableCache', false)
|
|
45
|
+
* Environments.setValue('myFlag', true).setValue('otherFlag', 42)
|
|
46
|
+
*/
|
|
4
47
|
static setValue(key: string, value: any): typeof Environments;
|
|
5
48
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Concept, InnerActions } from "../../app";
|
|
2
|
+
import { FetchConnectionQuery } from "../../DataStructures/FetchConnection";
|
|
2
3
|
export declare class LocalTransaction {
|
|
3
4
|
protected transactionId: string;
|
|
4
5
|
actions: InnerActions;
|
|
5
6
|
protected success: boolean;
|
|
7
|
+
protected pendingConnectionDeletions: number[];
|
|
6
8
|
constructor();
|
|
7
9
|
/**
|
|
8
10
|
* Method to initialize the transactions for specified transaction
|
|
@@ -12,9 +14,6 @@ export declare class LocalTransaction {
|
|
|
12
14
|
* Method to commi the created Transactions
|
|
13
15
|
*/
|
|
14
16
|
commitTransaction(): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Method to commi the created Transactions
|
|
17
|
-
*/
|
|
18
17
|
commitTransactionWithoutAuth(): Promise<void>;
|
|
19
18
|
/**
|
|
20
19
|
* Method to rollback all the tranctions occured
|
|
@@ -25,6 +24,79 @@ export declare class LocalTransaction {
|
|
|
25
24
|
* @param concept Concept
|
|
26
25
|
*/
|
|
27
26
|
protected markAction(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Deletions
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Queries the backend for connections matching the given criteria and queues all
|
|
32
|
+
* returned connection IDs for bulk deletion when commitTransaction() is called.
|
|
33
|
+
*
|
|
34
|
+
* **Nothing is deleted until commitTransaction() is called.**
|
|
35
|
+
* Calling rollbackTransaction() discards the queue without touching the backend.
|
|
36
|
+
*
|
|
37
|
+
* Supported query permutations:
|
|
38
|
+
* 1. `ofTheConceptId` + `toTheConceptId` + `type` — connections between two specific concepts
|
|
39
|
+
* 2. `ofTheConceptId` + `type` — all connections FROM a concept of that type
|
|
40
|
+
* 3. `toTheConceptId` + `type` — all connections TO a concept of that type
|
|
41
|
+
* 4. `typeId` + `isComposition: true` — all internal connections of a composition
|
|
42
|
+
*
|
|
43
|
+
* For multiple queries in one go use {@link DeleteConnectionsBetweenBulk} — it sends
|
|
44
|
+
* all queries in a single HTTP request.
|
|
45
|
+
*
|
|
46
|
+
* @param query - Partial FetchConnectionQuery with only the fields relevant to your permutation.
|
|
47
|
+
* @returns The connection IDs queued for deletion by this call.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Delete all connections of type "the_project_s_page" from concept 103927382
|
|
51
|
+
* const ids = await transaction.DeleteConnectionsBetween({
|
|
52
|
+
* ofTheConceptId: 103927382,
|
|
53
|
+
* type: "the_project_s_page"
|
|
54
|
+
* });
|
|
55
|
+
* await transaction.commitTransaction(); // deletion fires here
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Delete connections between two specific concepts
|
|
59
|
+
* await transaction.DeleteConnectionsBetween({
|
|
60
|
+
* ofTheConceptId: 103927382,
|
|
61
|
+
* toTheConceptId: 103927389,
|
|
62
|
+
* type: "the_project_s_page"
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Delete all internal connections of a composition
|
|
67
|
+
* await transaction.DeleteConnectionsBetween({
|
|
68
|
+
* typeId: 101490186,
|
|
69
|
+
* isComposition: true
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @see {@link DeleteConnectionsBetweenBulk} for sending multiple queries in one HTTP request
|
|
73
|
+
* @see {@link commitTransaction} where the queued deletions are executed via bulk delete
|
|
74
|
+
*/
|
|
75
|
+
DeleteConnectionsBetween(query: Partial<FetchConnectionQuery>): Promise<number[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Same as {@link DeleteConnectionsBetween} but resolves multiple queries in a single
|
|
78
|
+
* HTTP request to POST /api/get-connection-between.
|
|
79
|
+
*
|
|
80
|
+
* Prefer this over looping DeleteConnectionsBetween — all queries go to the backend
|
|
81
|
+
* in one round trip, and all returned IDs are merged into the same pending-deletion queue.
|
|
82
|
+
* The actual deletion still fires as a single bulk call inside commitTransaction().
|
|
83
|
+
*
|
|
84
|
+
* @param queries - Array of partial FetchConnectionQuery objects, one per query permutation.
|
|
85
|
+
* @returns All connection IDs queued for deletion across every query in this call.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // Three different queries → one HTTP request to get IDs → one bulk delete on commit
|
|
89
|
+
* await transaction.DeleteConnectionsBetweenBulk([
|
|
90
|
+
* { ofTheConceptId: 103927382, type: "the_project_s_page" },
|
|
91
|
+
* { ofTheConceptId: 103927382, type: "the_project_s_tag" },
|
|
92
|
+
* { typeId: 101490186, isComposition: true },
|
|
93
|
+
* ]);
|
|
94
|
+
* await transaction.commitTransaction();
|
|
95
|
+
*
|
|
96
|
+
* @see {@link DeleteConnectionsBetween} for the single-query convenience wrapper
|
|
97
|
+
* @see {@link commitTransaction} where the queued deletions are executed via bulk delete
|
|
98
|
+
*/
|
|
99
|
+
DeleteConnectionsBetweenBulk(queries: Partial<FetchConnectionQuery>[]): Promise<number[]>;
|
|
28
100
|
/**
|
|
29
101
|
* Concepts
|
|
30
102
|
*/
|
|
@@ -24,18 +24,24 @@ export declare class WidgetCacheManager {
|
|
|
24
24
|
private static recentMap;
|
|
25
25
|
/**
|
|
26
26
|
* Loads all persisted widget cache data from IndexedDB into memory.
|
|
27
|
-
*
|
|
27
|
+
* Called automatically during `init()` / `initConceptConnection()`.
|
|
28
28
|
* Safe to call multiple times — just overwrites the Maps.
|
|
29
|
+
*
|
|
30
|
+
* Skips entirely when `Environments.getValue('enableCache', true)` is `false`,
|
|
31
|
+
* keeping all three maps empty so no stale data is ever served.
|
|
29
32
|
*/
|
|
30
33
|
static init(): Promise<void>;
|
|
31
34
|
/**
|
|
32
35
|
* Retrieves cached widget data by widget ID (synchronous, from memory).
|
|
36
|
+
* Returns `null` when cache is disabled via `Environments.setValue('enableCache', false)`,
|
|
37
|
+
* causing `BuildWidgetFromId` to always fetch fresh from the backend.
|
|
33
38
|
* @param id - The widget ID to look up
|
|
34
|
-
* @returns The cached data object, or null if not cached
|
|
39
|
+
* @returns The cached data object, or null if not cached or cache is disabled
|
|
35
40
|
*/
|
|
36
41
|
static getWidget(id: number): any | null;
|
|
37
42
|
/**
|
|
38
43
|
* Stores widget data in memory and persists to IndexedDB in the background.
|
|
44
|
+
* No-ops when cache is disabled via `Environments.setValue('enableCache', false)`.
|
|
39
45
|
* Skips if data is identical to what's already cached (dedup guard).
|
|
40
46
|
* @param id - The widget ID
|
|
41
47
|
* @param data - The widget data object to cache
|
|
@@ -48,13 +54,14 @@ export declare class WidgetCacheManager {
|
|
|
48
54
|
static removeWidget(id: number): void;
|
|
49
55
|
/**
|
|
50
56
|
* Retrieves cached latest-version widget data (synchronous, from memory).
|
|
57
|
+
* Returns `null` when cache is disabled, causing a live backend fetch.
|
|
51
58
|
* @param id - The origin widget ID
|
|
52
|
-
* @returns The cached data object, or null if not cached
|
|
59
|
+
* @returns The cached data object, or null if not cached or cache is disabled
|
|
53
60
|
*/
|
|
54
61
|
static getLatest(id: number): any | null;
|
|
55
62
|
/**
|
|
56
63
|
* Stores latest-version widget data in memory and persists to IndexedDB.
|
|
57
|
-
* Skips if data is identical to what's already cached.
|
|
64
|
+
* No-ops when cache is disabled. Skips if data is identical to what's already cached.
|
|
58
65
|
* @param id - The origin widget ID
|
|
59
66
|
* @param data - The latest widget data to cache
|
|
60
67
|
*/
|
|
@@ -66,13 +73,14 @@ export declare class WidgetCacheManager {
|
|
|
66
73
|
static removeLatest(id: number): void;
|
|
67
74
|
/**
|
|
68
75
|
* Retrieves cached recent-version widget data (synchronous, from memory).
|
|
76
|
+
* Returns `null` when cache is disabled, causing a live backend fetch.
|
|
69
77
|
* @param id - The origin widget ID
|
|
70
|
-
* @returns The cached data object, or null if not cached
|
|
78
|
+
* @returns The cached data object, or null if not cached or cache is disabled
|
|
71
79
|
*/
|
|
72
80
|
static getRecent(id: number): any | null;
|
|
73
81
|
/**
|
|
74
82
|
* Stores recent-version widget data in memory and persists to IndexedDB.
|
|
75
|
-
* Skips if data is identical to what's already cached.
|
|
83
|
+
* No-ops when cache is disabled. Skips if data is identical to what's already cached.
|
|
76
84
|
* @param id - The origin widget ID
|
|
77
85
|
* @param data - The recent widget data to cache
|
|
78
86
|
*/
|
|
@@ -26,8 +26,11 @@ export declare class QueryCacheManager {
|
|
|
26
26
|
private static cacheMap;
|
|
27
27
|
/**
|
|
28
28
|
* Loads all persisted query cache data from IndexedDB into memory.
|
|
29
|
-
* Call this once during app initialization.
|
|
29
|
+
* Call this once during app initialization (handled automatically by `init()`).
|
|
30
30
|
* Safe to call multiple times — just overwrites the Map.
|
|
31
|
+
*
|
|
32
|
+
* Skips entirely when `Environments.getValue('enableCache', true)` is `false`,
|
|
33
|
+
* which is set by the `enableCache` parameter passed to `init()`.
|
|
31
34
|
*/
|
|
32
35
|
static init(): Promise<void>;
|
|
33
36
|
/**
|
|
@@ -43,8 +46,11 @@ export declare class QueryCacheManager {
|
|
|
43
46
|
/**
|
|
44
47
|
* Retrieves cached query results by hash key (synchronous, from memory).
|
|
45
48
|
*
|
|
49
|
+
* Returns `null` immediately when `Environments.getValue('enableCache', true)` is `false`,
|
|
50
|
+
* causing `FreeschemaQueryApi` to fall through to a live backend fetch.
|
|
51
|
+
*
|
|
46
52
|
* @param hash - The SHA-256 hash of the query (from getHash)
|
|
47
|
-
* @returns The cached result data, or null if not found
|
|
53
|
+
* @returns The cached result data, or null if not found or cache is disabled
|
|
48
54
|
*/
|
|
49
55
|
static get(hash: string): any | null;
|
|
50
56
|
/**
|
|
@@ -54,6 +60,9 @@ export declare class QueryCacheManager {
|
|
|
54
60
|
* what's already in memory, the write and event dispatch are both skipped.
|
|
55
61
|
* This prevents infinite revalidation loops (set → event → fetch → set → ...).
|
|
56
62
|
*
|
|
63
|
+
* No-ops entirely when `Environments.getValue('enableCache', true)` is `false`
|
|
64
|
+
* so neither memory nor IndexedDB is written to.
|
|
65
|
+
*
|
|
57
66
|
* @param hash - The SHA-256 hash key for this query
|
|
58
67
|
* @param data - The query result data to cache
|
|
59
68
|
*/
|
package/dist/types/app.d.ts
CHANGED
|
@@ -115,6 +115,8 @@ export { createFormFieldData } from './Validator/utils';
|
|
|
115
115
|
export { BaseUrl } from './DataStructures/BaseUrl';
|
|
116
116
|
export { StatefulWidget } from './Widgets/StatefulWidget';
|
|
117
117
|
export { DeleteConnectionByType, DeleteConnectionByTypeBulk, GetAllTheConnectionsByTypeAndOfTheConcept } from './Services/DeleteConnectionByType';
|
|
118
|
+
export { GetConnectionsBetweenApi } from './Api/GetConnections/GetConnectionsBetweenApi';
|
|
119
|
+
export { FetchConnection, FetchConnectionQuery, buildFetchConnection } from './DataStructures/FetchConnection';
|
|
118
120
|
export { FreeschemaQuery } from './DataStructures/Search/FreeschemaQuery';
|
|
119
121
|
export { FreeschemaQueryApi } from './Api/Search/FreeschemaQueryApi';
|
|
120
122
|
export { SchemaQueryListener, SchemaQuery } from './WrapperFunctions/SchemaQueryObservable';
|
|
@@ -283,6 +285,12 @@ declare function updateAccessToken(accessToken?: string, session?: any): void;
|
|
|
283
285
|
*
|
|
284
286
|
* @param parameters - Additional configuration parameters:
|
|
285
287
|
* - logserver: string - Custom log server URL (default: "https://logdev.freeschema.com")
|
|
288
|
+
* - isPwa: boolean - Enable PWA offline persistence to IndexedDB (default: false)
|
|
289
|
+
* - enableCache: boolean - Enable/disable widget and FreeschemaQuery caching.
|
|
290
|
+
* When false, QueryCacheManager and WidgetCacheManager skip all reads and writes
|
|
291
|
+
* (memory and IndexedDB). Stored in Environments under key 'enableCache' so it
|
|
292
|
+
* can be read or changed at runtime via Environments.getValue/setValue.
|
|
293
|
+
* Default: true.
|
|
286
294
|
*
|
|
287
295
|
* @returns Promise<boolean> - Returns true if initialization succeeds, undefined if it fails.
|
|
288
296
|
* On failure, falls back to main thread operation and logs warnings.
|
|
@@ -351,6 +359,7 @@ declare function init(url?: string, aiurl?: string, accessToken?: string, nodeUr
|
|
|
351
359
|
}, parameters?: {
|
|
352
360
|
logserver?: string;
|
|
353
361
|
isPwa?: boolean;
|
|
362
|
+
enableCache?: boolean;
|
|
354
363
|
}, accessControlUrl?: string): Promise<true | undefined>;
|
|
355
364
|
/**
|
|
356
365
|
* Method to send message to the service worker from main thread
|
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mftsccs-browser",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.43-beta",
|
|
4
4
|
"environment": "production",
|
|
5
5
|
"description": "Full Pack of concept and connection system",
|
|
6
6
|
"main": "dist/main.bundle.js",
|
|
7
7
|
"types": "dist/types/app.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
-
"scripts",
|
|
11
|
-
"LICENSE",
|
|
10
|
+
"scripts/postinstall.js",
|
|
12
11
|
"README.md",
|
|
13
12
|
"package.json"
|
|
14
13
|
],
|
|
15
14
|
"scripts": {
|
|
15
|
+
"generate-autocomplete-metadata": "node ./scripts/generate-autocomplete-metadata.cjs",
|
|
16
16
|
"start": "npx webpack",
|
|
17
17
|
"dev": "webpack --env NODE_ENV=development --mode development",
|
|
18
18
|
"build": "webpack --config webpack.config.js",
|
|
19
|
+
"prebuild:wico": "npm run generate-autocomplete-metadata",
|
|
20
|
+
"build:wico": "webpack --config webpack.wico.config.js",
|
|
21
|
+
"postbuild:wico": "node ./scripts/create-wico-package.cjs",
|
|
19
22
|
"postinstall": "node ./scripts/postinstall.js",
|
|
20
23
|
"test": "jest"
|
|
21
24
|
},
|
|
@@ -48,4 +51,4 @@
|
|
|
48
51
|
"dependencies": {
|
|
49
52
|
"ncp": "^2.0.0"
|
|
50
53
|
}
|
|
51
|
-
}
|
|
54
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves all concepts belonging to a specific user.
|
|
3
|
-
* Fetches user's concepts from backend and caches them in ConceptsData.
|
|
4
|
-
*
|
|
5
|
-
* @param userId - ID of the user whose concepts to retrieve
|
|
6
|
-
* @returns void - Updates ConceptsData cache with user's concepts
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* await GetAllUserConcepts(123); // Loads all concepts for user 123
|
|
10
|
-
*/
|
|
11
|
-
export declare function GetAllUserConcepts(userId: number): Promise<void>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves all connections belonging to a specific user.
|
|
3
|
-
* Fetches user's connections from backend and caches them in ConnectionData.
|
|
4
|
-
*
|
|
5
|
-
* @param userId - ID of the user whose connections to retrieve
|
|
6
|
-
* @returns void - Updates ConnectionData cache with user's connections
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* await GetAllUserConnections(123); // Loads all connections for user 123
|
|
10
|
-
*/
|
|
11
|
-
export declare function GetAllUserConnections(userId: number): Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prefetches connections for a user with pagination.
|
|
3
|
-
* Loads connections into local storage for improved performance.
|
|
4
|
-
*
|
|
5
|
-
* @param userId - ID of the user whose connections to prefetch
|
|
6
|
-
* @param inpage - Number of connections per page
|
|
7
|
-
* @returns void - Updates ConnectionData storage with prefetched connections
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* await GetAllPrefetchConnections(123, 50); // Prefetch 50 connections for user 123
|
|
11
|
-
*/
|
|
12
|
-
export declare function GetAllPrefetchConnections(userId: number, inpage: number): Promise<void>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Prototype } from "../../DataStructures/Prototype/Prototype";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a new prototype in the backend.
|
|
4
|
-
* Prototypes serve as templates for creating similar concepts.
|
|
5
|
-
*
|
|
6
|
-
* @param prototype - Prototype object containing template definition
|
|
7
|
-
* @returns Created Concept object representing the prototype, or undefined on error
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* const prototype = new Prototype();
|
|
11
|
-
* prototype.name = "PersonTemplate";
|
|
12
|
-
* const result = await CreatePrototypeApi(prototype);
|
|
13
|
-
*/
|
|
14
|
-
export declare function CreatePrototypeApi(prototype: Prototype): Promise<any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare class ReferentInfo {
|
|
2
|
-
conceptDataId: number;
|
|
3
|
-
conceptDataUserId: number;
|
|
4
|
-
characterDataId: number;
|
|
5
|
-
characterDataUserId: number;
|
|
6
|
-
constructor(conceptDataId: number, conceptDataUserId: number, characterDataId: number, characterDataUserId: number);
|
|
7
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DrawingLoop(): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function selectConceptObject(mouse_x_coordinate: number, mouse_y_coordinate: number): import("../app").Concept | null;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CreateTypeTreeFromData(): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function genHexString(len: number): number;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a binary search tree indexed by typeId for fast type-based concept lookup.
|
|
3
|
-
*
|
|
4
|
-
* Loads all local concepts from IndexedDB and organizes them into a binary tree
|
|
5
|
-
* structure where each node is keyed by typeId. Enables O(log n) lookups by type.
|
|
6
|
-
*
|
|
7
|
-
* @throws Error if IndexedDB read or tree construction fails
|
|
8
|
-
*/
|
|
9
|
-
export declare function CreateLocalBinaryTypeTreeFromData(): Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a binary search tree indexed by characterValue for fast text-based concept lookup.
|
|
3
|
-
*
|
|
4
|
-
* Loads all local concepts from IndexedDB and organizes them into a binary tree
|
|
5
|
-
* structure where each node is keyed by characterValue. Enables O(log n) lookups by text.
|
|
6
|
-
*
|
|
7
|
-
* @throws Error if IndexedDB read or tree construction fails
|
|
8
|
-
*/
|
|
9
|
-
export declare function CreateLocalCharacterBinaryTreeFromData(): Promise<void>;
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Concept, Connection, LocalTransaction } from "../../app";
|
|
2
|
-
export declare class VisualTree {
|
|
3
|
-
static concepts: Concept[];
|
|
4
|
-
static connections: Connection[];
|
|
5
|
-
static transactions: LocalTransaction[];
|
|
6
|
-
static setTransaction(transaction: LocalTransaction): void;
|
|
7
|
-
static renderVisualTree(): void;
|
|
8
|
-
static getLocalConcepts(): Promise<void>;
|
|
9
|
-
}
|
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base view class for page-level components.
|
|
3
|
-
*
|
|
4
|
-
* Provides basic page functionality including title management and HTML generation.
|
|
5
|
-
*/
|
|
6
|
-
export default class {
|
|
7
|
-
/** Parameters passed to the view */
|
|
8
|
-
params: any;
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new view instance.
|
|
11
|
-
*
|
|
12
|
-
* @param params - Configuration parameters for the view
|
|
13
|
-
*/
|
|
14
|
-
constructor(params: any);
|
|
15
|
-
/**
|
|
16
|
-
* Sets the browser document title.
|
|
17
|
-
*
|
|
18
|
-
* @param title - The new document title
|
|
19
|
-
*/
|
|
20
|
-
setTitle(title: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Generates the HTML content for this view.
|
|
23
|
-
*
|
|
24
|
-
* @returns HTML string for the view
|
|
25
|
-
*/
|
|
26
|
-
getHtml(): Promise<string>;
|
|
27
|
-
}
|