mftsccs-node 0.0.56 → 0.0.58
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 +1148 -11
- package/dist/bundle.js +1 -0
- package/dist/types/Api/Create/CreateTheCharacter.d.ts +45 -0
- package/dist/types/Api/Create/CreateTheConceptApi.d.ts +52 -0
- package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +53 -0
- package/dist/types/Api/Create/CreateTheTextData.d.ts +58 -0
- package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +44 -0
- package/dist/types/Api/DeleteConnectionApiBulk.d.ts +56 -0
- package/dist/types/Api/DeleteTheConcept.d.ts +65 -0
- package/dist/types/Api/DeleteTheConnection.d.ts +77 -0
- package/dist/types/Api/GetAiData.d.ts +37 -0
- package/dist/types/Api/GetAllConcepts.d.ts +43 -0
- package/dist/types/Api/GetAllConceptsByType.d.ts +46 -0
- package/dist/types/Api/GetAllConnections.d.ts +49 -0
- package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +82 -0
- package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +93 -0
- package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +54 -0
- package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +63 -0
- package/dist/types/Api/GetAllPrefetchConnections.d.ts +52 -0
- package/dist/types/Api/GetCharacterDataByCharacter.d.ts +33 -0
- package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +41 -0
- package/dist/types/Api/GetConcept.d.ts +49 -0
- package/dist/types/Api/GetConceptBulk.d.ts +71 -0
- package/dist/types/Api/GetConceptByCharacterAndType.d.ts +78 -0
- package/dist/types/Api/GetConceptByCharacterValue.d.ts +49 -0
- package/dist/types/Api/GetConnection.d.ts +51 -0
- package/dist/types/Api/GetConnectionBulk.d.ts +48 -0
- package/dist/types/Api/GetConnectionOfTheConcept.d.ts +52 -0
- package/dist/types/Api/GetConnectionToTheConcept.d.ts +58 -0
- package/dist/types/Api/GetReservedConnectionIds.d.ts +37 -0
- package/dist/types/Api/GetReservedIds.d.ts +38 -0
- package/dist/types/Api/Login.d.ts +39 -0
- package/dist/types/Api/MakeTheNameInBackend.d.ts +40 -0
- package/dist/types/Api/MakeTheTypeConceptApi.d.ts +42 -0
- package/dist/types/Api/RecursiveSearch.d.ts +44 -0
- package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +48 -0
- package/dist/types/Api/Search/Search.d.ts +68 -0
- package/dist/types/Api/Search/SearchInternalApi.d.ts +71 -0
- package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +92 -0
- package/dist/types/Api/Search/SearchWithLinker.d.ts +99 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +41 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +49 -0
- package/dist/types/Api/Session/CreateSession.d.ts +47 -0
- package/dist/types/Api/Session/CreateSessionVisit.d.ts +44 -0
- package/dist/types/Api/Signin.d.ts +51 -0
- package/dist/types/Api/Signup.d.ts +47 -0
- package/dist/types/Api/View/ViewInternalDataApi.d.ts +51 -0
- package/dist/types/Constants/ApiConstants.d.ts +249 -0
- package/dist/types/Constants/FormatConstants.d.ts +87 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +262 -0
- package/dist/types/DataStructures/BinaryCharacterTree.d.ts +227 -0
- package/dist/types/DataStructures/BinaryTree.d.ts +151 -0
- package/dist/types/DataStructures/BinaryTypeTree.d.ts +211 -0
- package/dist/types/DataStructures/CharacterRepository.d.ts +117 -0
- package/dist/types/DataStructures/Composition/Composition.d.ts +117 -0
- package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +114 -0
- package/dist/types/DataStructures/Composition/CompositionNode.d.ts +223 -0
- package/dist/types/DataStructures/Concept.d.ts +139 -0
- package/dist/types/DataStructures/ConceptData.d.ts +317 -0
- package/dist/types/DataStructures/ConceptsToDraw.d.ts +179 -0
- package/dist/types/DataStructures/Connection.d.ts +103 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +126 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +193 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +95 -0
- package/dist/types/DataStructures/ConnectionData.d.ts +209 -0
- package/dist/types/DataStructures/Count/CountInfo.d.ts +79 -0
- package/dist/types/DataStructures/FilterSearch.d.ts +93 -0
- package/dist/types/DataStructures/IdentifierFlags.d.ts +45 -0
- package/dist/types/DataStructures/Local/LConcept.d.ts +126 -0
- package/dist/types/DataStructures/Local/LConnection.d.ts +101 -0
- package/dist/types/DataStructures/Local/LNode.d.ts +217 -0
- package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +145 -0
- package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +147 -0
- package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +160 -0
- package/dist/types/DataStructures/Local/LocalConceptData.d.ts +114 -0
- package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +125 -0
- package/dist/types/DataStructures/Local/LocalSyncData.d.ts +103 -0
- package/dist/types/DataStructures/Node.d.ts +29 -0
- package/dist/types/DataStructures/PatcherStructure.d.ts +94 -0
- package/dist/types/DataStructures/ReferentInfo.d.ts +75 -0
- package/dist/types/DataStructures/ReservedIds.d.ts +111 -0
- package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +236 -0
- package/dist/types/DataStructures/Responses/StandardResponses.d.ts +71 -0
- package/dist/types/DataStructures/Returner.d.ts +66 -0
- package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +187 -0
- package/dist/types/DataStructures/Search/SearchStructure.d.ts +78 -0
- package/dist/types/DataStructures/SearchQuery.d.ts +146 -0
- package/dist/types/DataStructures/Security/TokenStorage.d.ts +51 -0
- package/dist/types/DataStructures/Session/SessionData.d.ts +131 -0
- package/dist/types/DataStructures/SettingData.d.ts +37 -0
- package/dist/types/DataStructures/Settings.d.ts +31 -0
- package/dist/types/DataStructures/SigninModel.d.ts +54 -0
- package/dist/types/DataStructures/SignupModel.d.ts +54 -0
- package/dist/types/DataStructures/SyncData.d.ts +232 -0
- package/dist/types/DataStructures/TheCharacter.d.ts +100 -0
- package/dist/types/DataStructures/TheTexts.d.ts +106 -0
- package/dist/types/DataStructures/Transaction/Transaction.d.ts +320 -0
- package/dist/types/DataStructures/User/UserBinaryTree.d.ts +132 -0
- package/dist/types/DataStructures/User/UserNode.d.ts +150 -0
- package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
- package/dist/types/Database/NoIndexDb.d.ts +178 -0
- package/dist/types/Database/indexdblocal.d.ts +45 -0
- package/dist/types/Database/indexeddb.d.ts +46 -0
- package/dist/types/Drawing/ConceptDraw.d.ts +29 -0
- package/dist/types/Drawing/ConceptEvents.d.ts +47 -0
- package/dist/types/Helpers/CheckIfExists.d.ts +169 -0
- package/dist/types/Helpers/RemoveFromArray.d.ts +72 -0
- package/dist/types/Helpers/UniqueInsert.d.ts +29 -0
- package/dist/types/Services/CheckForConnectionDeletion.d.ts +193 -0
- package/dist/types/Services/Common/DecodeCountInfo.d.ts +57 -0
- package/dist/types/Services/Common/ErrorPosting.d.ts +51 -0
- package/dist/types/Services/Common/RegexFunction.d.ts +29 -0
- package/dist/types/Services/Composition/BuildComposition.d.ts +40 -0
- package/dist/types/Services/Composition/CompositionCache.d.ts +93 -0
- package/dist/types/Services/Composition/CreateCompositionCache.d.ts +46 -0
- package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +5 -0
- package/dist/types/Services/Conversion/ConvertConcepts.d.ts +90 -0
- package/dist/types/Services/CreateBinaryTreeFromData.d.ts +39 -0
- package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +43 -0
- package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +211 -0
- package/dist/types/Services/CreateDefaultConcept.d.ts +117 -0
- package/dist/types/Services/CreateTheComposition.d.ts +103 -0
- package/dist/types/Services/CreateTheConcept.d.ts +184 -0
- package/dist/types/Services/CreateTheConnection.d.ts +61 -0
- package/dist/types/Services/CreateTheConnectionGeneral.d.ts +132 -0
- package/dist/types/Services/CreateTypeTreeFromData.d.ts +44 -0
- package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +60 -0
- package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +64 -0
- package/dist/types/Services/DeleteConcept.d.ts +137 -0
- package/dist/types/Services/DeleteConnection.d.ts +196 -0
- package/dist/types/Services/FindConeceptsFromConnection.d.ts +181 -0
- package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +159 -0
- package/dist/types/Services/GenerateHexNumber.d.ts +65 -0
- package/dist/types/Services/GetAccessIdOfUser.d.ts +0 -0
- package/dist/types/Services/GetComposition.d.ts +342 -0
- package/dist/types/Services/GetCompositionBulk.d.ts +259 -0
- package/dist/types/Services/GetCompositionList.d.ts +132 -0
- package/dist/types/Services/GetConceptByCharacter.d.ts +87 -0
- package/dist/types/Services/GetConnections.d.ts +74 -0
- package/dist/types/Services/GetDataFromIndexDb.d.ts +81 -0
- package/dist/types/Services/GetLink.d.ts +107 -0
- package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +102 -0
- package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +59 -0
- package/dist/types/Services/GetRelation.d.ts +167 -0
- package/dist/types/Services/GetTheConcept.d.ts +73 -0
- package/dist/types/Services/GetTheReferent.d.ts +76 -0
- package/dist/types/Services/InitializeSystem.d.ts +121 -0
- package/dist/types/Services/Local/CreateConnectionListFromDatat.d.ts +0 -0
- package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +50 -0
- package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +50 -0
- package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +55 -0
- package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +61 -0
- package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +72 -0
- package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +60 -0
- package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +58 -0
- package/dist/types/Services/Local/GetCompositionListLocal.d.ts +105 -0
- package/dist/types/Services/Local/GetCompositionLocal.d.ts +98 -0
- package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +58 -0
- package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +73 -0
- package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +91 -0
- package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +73 -0
- package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +103 -0
- package/dist/types/Services/MakeTheCharacter.d.ts +76 -0
- package/dist/types/Services/MakeTheCharacterData.d.ts +67 -0
- package/dist/types/Services/MakeTheConcept.d.ts +2 -0
- package/dist/types/Services/MakeTheInstanceConcept.d.ts +78 -0
- package/dist/types/Services/MakeTheLocalConcept.d.ts +0 -0
- package/dist/types/Services/MakeTheName.d.ts +83 -0
- package/dist/types/Services/MakeTheTimestamp.d.ts +70 -0
- package/dist/types/Services/MakeTheTypeConcept.d.ts +71 -0
- package/dist/types/Services/Mqtt/publishMessage.d.ts +28 -0
- package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
- package/dist/types/Services/PatchComposition.d.ts +107 -0
- package/dist/types/Services/Search/DataIdFormat.d.ts +104 -0
- package/dist/types/Services/Search/FormatData.d.ts +101 -0
- package/dist/types/Services/Search/JustIdFormat.d.ts +98 -0
- package/dist/types/Services/Search/SearchLinkInternal.d.ts +30 -0
- package/dist/types/Services/Search/SearchLinkMultiple.d.ts +61 -0
- package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +101 -0
- package/dist/types/Services/Search/orderingConnections.d.ts +36 -0
- package/dist/types/Services/Security/GetRequestHeader.d.ts +10 -0
- package/dist/types/Services/SplitStrings.d.ts +51 -0
- package/dist/types/Services/UpdateComposition.d.ts +125 -0
- package/dist/types/Services/User/UserTranslation.d.ts +108 -0
- package/dist/types/Services/View/ViewInternalData.d.ts +33 -0
- package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +159 -0
- package/dist/types/app.d.ts +162 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function GetRequestHeader(contentType?: string, Accept?: string): {
|
|
2
|
+
'Content-Type': string;
|
|
3
|
+
Authorization: string;
|
|
4
|
+
Accept: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function GetRequestHeaderWithAuthorization(contentType?: string, token?: string, Accept?: string): {
|
|
7
|
+
'Content-Type': string;
|
|
8
|
+
Authorization: string;
|
|
9
|
+
Accept: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview String utility module for splitting type strings in the CCS-JS system.
|
|
3
|
+
* This module provides functionality to parse type strings that follow a naming convention
|
|
4
|
+
* with underscore separators, commonly used for identifying concept types and their relationships.
|
|
5
|
+
* @module Services/SplitStrings
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Splits a type string into component parts based on the last underscore delimiter.
|
|
9
|
+
*
|
|
10
|
+
* This function is used throughout the CCS-JS system to parse type identifiers that follow
|
|
11
|
+
* a naming convention where the last underscore separates the base type from its suffix.
|
|
12
|
+
* For example, "concept_type_123" would be split into ["concept_type", "123"].
|
|
13
|
+
*
|
|
14
|
+
* The function uses the last occurrence of underscore as the split point, which allows
|
|
15
|
+
* for type names that contain underscores themselves. If no underscore is found, the
|
|
16
|
+
* original string is returned as a single-element array.
|
|
17
|
+
*
|
|
18
|
+
* @param typeString - The type identifier string to be split
|
|
19
|
+
* @returns An array containing the split components. Returns a two-element array [prefix, suffix]
|
|
20
|
+
* if an underscore is found, or a single-element array [typeString] if no underscore exists.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Split a composite type string
|
|
25
|
+
* const result = SplitStrings("user_profile_123");
|
|
26
|
+
* // Returns: ["user_profile", "123"]
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Handle string without underscore
|
|
32
|
+
* const result = SplitStrings("simpleType");
|
|
33
|
+
* // Returns: ["simpleType"]
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // Split concept type identifier
|
|
39
|
+
* const result = SplitStrings("concept_type");
|
|
40
|
+
* // Returns: ["concept", "type"]
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* The function specifically uses `lastIndexOf("_")` to find the splitting point, which means:
|
|
45
|
+
* - Only the last underscore is considered for splitting
|
|
46
|
+
* - All underscores before the last one remain part of the first element
|
|
47
|
+
* - The position check (pos > 0) ensures underscore is not the first character
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf | String.lastIndexOf}
|
|
50
|
+
*/
|
|
51
|
+
export declare function SplitStrings(typeString: string): string[];
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Composition update service for the CCS-JS system.
|
|
3
|
+
* This module provides comprehensive functionality for updating composition structures,
|
|
4
|
+
* managing the complex process of patching objects into compositions, handling nested
|
|
5
|
+
* compositions, updating caches, and synchronizing changes with the backend.
|
|
6
|
+
* @module Services/UpdateComposition
|
|
7
|
+
*/
|
|
8
|
+
import { PatcherStructure } from '../DataStructures/PatcherStructure';
|
|
9
|
+
/**
|
|
10
|
+
* Updates an existing composition by patching new data into it while maintaining cache consistency.
|
|
11
|
+
*
|
|
12
|
+
* This is a core function in the CCS-JS system that handles the complex process of updating
|
|
13
|
+
* compositions. It performs the following operations:
|
|
14
|
+
* 1. Retrieves the current composition and all its connections from the backend
|
|
15
|
+
* 2. Processes the patch object to create new concepts and connections
|
|
16
|
+
* 3. Identifies and removes outdated concepts and connections
|
|
17
|
+
* 4. Updates the composition cache and binary tree structure
|
|
18
|
+
* 5. Synchronizes changes with the backend
|
|
19
|
+
*
|
|
20
|
+
* The function handles both simple value updates and complex nested composition updates.
|
|
21
|
+
* It ensures data consistency by managing connection deletions, concept replacements, and
|
|
22
|
+
* cache invalidation across distributed servers.
|
|
23
|
+
*
|
|
24
|
+
* @param patcherStructure - Structure containing all necessary information for the update operation
|
|
25
|
+
* including compositionId, patchObject, userId, sessionId, and accessId
|
|
26
|
+
* @returns A promise that resolves to the updated composition cache data, or null if the composition
|
|
27
|
+
* cannot be found or updated. The returned data includes the updated concepts, connections,
|
|
28
|
+
* and subcompositions.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Update a simple composition with new values
|
|
33
|
+
* import UpdateComposition from './UpdateComposition';
|
|
34
|
+
* import { PatcherStructure } from '../DataStructures/PatcherStructure';
|
|
35
|
+
*
|
|
36
|
+
* const patcher: PatcherStructure = {
|
|
37
|
+
* compositionId: 123,
|
|
38
|
+
* patchObject: { name: "Updated Name", age: 30 },
|
|
39
|
+
* userId: 456,
|
|
40
|
+
* sessionId: 999,
|
|
41
|
+
* accessId: 4
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* const result = await UpdateComposition(patcher);
|
|
45
|
+
* console.log(result); // Updated composition data
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Update a nested composition
|
|
51
|
+
* const patcher: PatcherStructure = {
|
|
52
|
+
* compositionId: 123,
|
|
53
|
+
* ofTheCompositionId: 789, // Parent concept ID for nested update
|
|
54
|
+
* patchObject: {
|
|
55
|
+
* profile: {
|
|
56
|
+
* firstName: "John",
|
|
57
|
+
* lastName: "Doe"
|
|
58
|
+
* },
|
|
59
|
+
* settings: {
|
|
60
|
+
* theme: "dark"
|
|
61
|
+
* }
|
|
62
|
+
* },
|
|
63
|
+
* userId: 456,
|
|
64
|
+
* sessionId: 999,
|
|
65
|
+
* accessId: 4
|
|
66
|
+
* };
|
|
67
|
+
*
|
|
68
|
+
* const result = await UpdateComposition(patcher);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* // Handle local concept conversion (negative ID to positive ID)
|
|
74
|
+
* const patcher: PatcherStructure = {
|
|
75
|
+
* compositionId: -123, // Local concept ID
|
|
76
|
+
* patchObject: { status: "active" },
|
|
77
|
+
* userId: 456,
|
|
78
|
+
* sessionId: 999,
|
|
79
|
+
* accessId: 4
|
|
80
|
+
* };
|
|
81
|
+
*
|
|
82
|
+
* const result = await UpdateComposition(patcher);
|
|
83
|
+
* // Function will convert local ID to server ID before updating
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Complex behavior and important considerations:
|
|
88
|
+
*
|
|
89
|
+
* **Local Concept Handling:**
|
|
90
|
+
* - If compositionId is negative (local concept), the function attempts to find the persisted version
|
|
91
|
+
* - Returns null if the local concept hasn't been synced to the server yet
|
|
92
|
+
*
|
|
93
|
+
* **Cache Management:**
|
|
94
|
+
* - Marks the composition as "updating" to signal distributed servers to invalidate their cache
|
|
95
|
+
* - Rebuilds the composition cache with all updated concepts and connections
|
|
96
|
+
* - Updates the CompositionBinaryTree for fast access
|
|
97
|
+
*
|
|
98
|
+
* **Connection Management:**
|
|
99
|
+
* - Identifies existing concepts that match the new concepts being added
|
|
100
|
+
* - Removes old connections to those concepts before creating new ones
|
|
101
|
+
* - Deletes connections in bulk for efficiency
|
|
102
|
+
*
|
|
103
|
+
* **Nested Compositions:**
|
|
104
|
+
* - Supports updating subcompositions via the ofTheCompositionId parameter
|
|
105
|
+
* - Creates new composition concepts for object/array values
|
|
106
|
+
* - Recursively processes nested structures
|
|
107
|
+
*
|
|
108
|
+
* **Synchronization:**
|
|
109
|
+
* - Calls SyncData.SyncDataOnline() to push changes to the backend
|
|
110
|
+
* - Ensures consistency across distributed system
|
|
111
|
+
*
|
|
112
|
+
* **Performance Considerations:**
|
|
113
|
+
* - Fetches all connections from backend for latest data
|
|
114
|
+
* - Processes deletions and additions in batch
|
|
115
|
+
* - Uses caching to minimize redundant database queries
|
|
116
|
+
*
|
|
117
|
+
* @see {@link PatcherStructure} for the structure of the patcher parameter
|
|
118
|
+
* @see {@link CreateTheCompositionWithCache} for creating nested compositions
|
|
119
|
+
* @see {@link GetTheConcept} for concept retrieval
|
|
120
|
+
* @see {@link MakeTheInstanceConcept} for creating new concept instances
|
|
121
|
+
* @see {@link createTheConnection} for creating connections between concepts
|
|
122
|
+
* @see {@link DeleteConnectionById} for connection deletion
|
|
123
|
+
* @see {@link SyncData.SyncDataOnline} for backend synchronization
|
|
124
|
+
*/
|
|
125
|
+
export default function UpdateComposition(patcherStructure: PatcherStructure): Promise<any>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module UserTranslation
|
|
3
|
+
* @description Provides functions to translate between ghost IDs and real IDs for user-specific concepts and connections
|
|
4
|
+
*/
|
|
5
|
+
import { LConcept } from './../../DataStructures/Local/LConcept';
|
|
6
|
+
import { LConnection } from '../../app';
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a local concept (LConcept) by its ghost ID for a specific user.
|
|
9
|
+
* Ghost IDs are temporary IDs used before concepts are persisted.
|
|
10
|
+
*
|
|
11
|
+
* @async
|
|
12
|
+
* @param {number} userId - The user ID who owns the concept
|
|
13
|
+
* @param {number} ghostId - The temporary ghost ID of the concept
|
|
14
|
+
* @param {number} [sessionId=999] - The session ID (defaults to 999)
|
|
15
|
+
* @param {number} [randomizer=999] - Additional randomizer for tree lookup (defaults to 999)
|
|
16
|
+
* @returns {Promise<LConcept>} A promise that resolves to the LConcept, or default empty concept if not found
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const userId = 1;
|
|
21
|
+
* const ghostId = 12345;
|
|
22
|
+
* const concept = await GetUserGhostId(userId, ghostId);
|
|
23
|
+
* if (concept.id !== 0) {
|
|
24
|
+
* console.log("Found concept with real ID:", concept.id);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - Searches the UserBinaryTree for the user's concepts
|
|
30
|
+
* - Returns default empty LConcept if user or concept not found
|
|
31
|
+
* - Used during concept creation before IDs are assigned
|
|
32
|
+
* - Ghost IDs are temporary until persisted to backend
|
|
33
|
+
*/
|
|
34
|
+
export declare function GetUserGhostId(userId: number, ghostId: number, sessionId?: number, randomizer?: number): Promise<LConcept>;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves a local connection (LConnection) by its ghost ID for a specific user.
|
|
37
|
+
* Ghost IDs are temporary IDs used before connections are persisted.
|
|
38
|
+
*
|
|
39
|
+
* @async
|
|
40
|
+
* @param {number} userId - The user ID who owns the connection
|
|
41
|
+
* @param {number} ghostId - The temporary ghost ID of the connection
|
|
42
|
+
* @param {number} [sessionId=999] - The session ID (defaults to 999)
|
|
43
|
+
* @param {number} [randomizer=999] - Additional randomizer for tree lookup (defaults to 999)
|
|
44
|
+
* @returns {Promise<LConnection>} A promise that resolves to the LConnection, or default empty connection if not found
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const userId = 1;
|
|
49
|
+
* const connectionGhostId = 67890;
|
|
50
|
+
* const connection = await GetUserGhostConnectionId(userId, connectionGhostId);
|
|
51
|
+
* if (connection.id !== 0) {
|
|
52
|
+
* console.log("Found connection with real ID:", connection.id);
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* - Similar to GetUserGhostId but for connections instead of concepts
|
|
58
|
+
* - Searches UserBinaryTree's connection values
|
|
59
|
+
* - Returns default empty LConnection if not found
|
|
60
|
+
* - Used during connection creation before IDs are assigned
|
|
61
|
+
*/
|
|
62
|
+
export declare function GetUserGhostConnectionId(userId: number, ghostId: number, sessionId?: number, randomizer?: number): Promise<LConnection>;
|
|
63
|
+
/**
|
|
64
|
+
* Adds a ghost concept to the UserBinaryTree for temporary storage.
|
|
65
|
+
* Stores concepts with ghost IDs before they are persisted.
|
|
66
|
+
*
|
|
67
|
+
* @async
|
|
68
|
+
* @param {LConcept} concept - The local concept to add
|
|
69
|
+
* @param {number} userId - The user ID who owns the concept
|
|
70
|
+
* @param {number} [sessionId=999] - The session ID (defaults to 999)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const ghostConcept: LConcept = {
|
|
75
|
+
* ghostId: 12345,
|
|
76
|
+
* characterValue: "Test",
|
|
77
|
+
* ...
|
|
78
|
+
* };
|
|
79
|
+
* await AddGhostConcept(ghostConcept, 1, 999);
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* - Stores concept in UserBinaryTree indexed by userId and sessionId
|
|
84
|
+
* - Used for optimistic UI updates before backend persistence
|
|
85
|
+
* - No return value (void function)
|
|
86
|
+
*/
|
|
87
|
+
export declare function AddGhostConcept(concept: LConcept, userId: number, sessionId?: number): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Adds a ghost connection to the UserBinaryTree for temporary storage.
|
|
90
|
+
* Stores connections with ghost IDs before they are persisted.
|
|
91
|
+
*
|
|
92
|
+
* @async
|
|
93
|
+
* @param {LConnection} connection - The local connection to add
|
|
94
|
+
* @param {number} userId - The user ID who owns the connection
|
|
95
|
+
* @param {number} [sessionId=999] - The session ID (defaults to 999)
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const ghostConnection: LConnection = new LConnection(0, 12345, 123, 456, 999, 999);
|
|
100
|
+
* await AddGhostConnection(ghostConnection, 1, 999);
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* - Stores connection in UserBinaryTree indexed by userId and sessionId
|
|
105
|
+
* - Used for optimistic UI updates before backend persistence
|
|
106
|
+
* - No return value (void function)
|
|
107
|
+
*/
|
|
108
|
+
export declare function AddGhostConnection(connection: LConnection, userId: number, sessionId?: number): Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ViewInternalData
|
|
3
|
+
* @description Provides functionality to view and format internal composition data for multiple concepts
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves and formats internal data for multiple concepts by their IDs.
|
|
7
|
+
* Fetches internal connections and builds composition structures for each concept.
|
|
8
|
+
*
|
|
9
|
+
* @async
|
|
10
|
+
* @param {number[]} ids - Array of concept IDs to retrieve internal data for
|
|
11
|
+
* @returns {Promise<any[]>} A promise that resolves to array of formatted composition objects with id and data fields
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const conceptIds = [123, 456, 789];
|
|
16
|
+
* const internalData = await ViewInternalData(conceptIds);
|
|
17
|
+
* // internalData = [
|
|
18
|
+
* // { id: 123, data: { user: { name: "John", email: "john@example.com" } } },
|
|
19
|
+
* // { id: 456, data: { post: { title: "Hello", content: "World" } } },
|
|
20
|
+
* // { id: 789, data: { type: "value" } }
|
|
21
|
+
* // ]
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This function:
|
|
26
|
+
* - Fetches internal connections for all provided concept IDs
|
|
27
|
+
* - For concepts with connections: builds composition structure using recursiveFetch
|
|
28
|
+
* - For concepts without connections: returns concept's type and character value
|
|
29
|
+
* - Each result includes id field and data field
|
|
30
|
+
* - Handles missing connections gracefully
|
|
31
|
+
* - Useful for viewing composition internals in list format
|
|
32
|
+
*/
|
|
33
|
+
export declare function ViewInternalData(ids: number[]): Promise<any[]>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Observable wrapper for schema query operations in the CCS-JS system.
|
|
3
|
+
* @module WrapperFunctions/SchemaQueryObservable
|
|
4
|
+
*/
|
|
5
|
+
import { FreeschemaQuery } from "../DataStructures/Search/FreeschemaQuery";
|
|
6
|
+
/**
|
|
7
|
+
* Observable wrapper for handling multiple linked concept searches.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* SearchLinkMultipleAllObservable encapsulates the state and configuration for executing
|
|
11
|
+
* schema queries that retrieve multiple linked concepts. It maintains query parameters,
|
|
12
|
+
* formatting options, and the results of API calls including concept IDs, internal
|
|
13
|
+
* connections, linkers, and other relationship data.
|
|
14
|
+
*
|
|
15
|
+
* This class is designed to work with the FreeschemaQuery system and can format results
|
|
16
|
+
* in various output formats (NORMAL, DATAID, JUSTDATA, ALLID).
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const query = new FreeschemaQuery();
|
|
21
|
+
* query.outputFormat = DATAID;
|
|
22
|
+
* query.order = "ASC";
|
|
23
|
+
*
|
|
24
|
+
* const observable = new SearchLinkMultipleAllObservable(query, "auth-token");
|
|
25
|
+
* console.log(observable.format); // DATAID
|
|
26
|
+
* console.log(observable.order); // "ASC"
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class SearchLinkMultipleAllObservable {
|
|
30
|
+
/**
|
|
31
|
+
* Array of main composition IDs retrieved from the query.
|
|
32
|
+
* @defaultValue []
|
|
33
|
+
*/
|
|
34
|
+
mainCompositionIds: number[];
|
|
35
|
+
/**
|
|
36
|
+
* The FreeschemaQuery object containing query parameters and configuration.
|
|
37
|
+
* @defaultValue new FreeschemaQuery()
|
|
38
|
+
*/
|
|
39
|
+
query: FreeschemaQuery;
|
|
40
|
+
/**
|
|
41
|
+
* Array of encoded count information strings returned from the API.
|
|
42
|
+
* @defaultValue []
|
|
43
|
+
*/
|
|
44
|
+
countInfoStrings: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Sort order for the query results.
|
|
47
|
+
* @defaultValue "DESC"
|
|
48
|
+
*/
|
|
49
|
+
order: string;
|
|
50
|
+
/**
|
|
51
|
+
* Output format for the query results.
|
|
52
|
+
* @defaultValue DATAID
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* Valid values include NORMAL, DATAID, JUSTDATA, and ALLID from FormatConstants.
|
|
56
|
+
*/
|
|
57
|
+
format: number;
|
|
58
|
+
/**
|
|
59
|
+
* Flag indicating whether data has been loaded from the API.
|
|
60
|
+
* @defaultValue false
|
|
61
|
+
*/
|
|
62
|
+
isDataLoaded: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Array of concept IDs retrieved from the query.
|
|
65
|
+
* @defaultValue []
|
|
66
|
+
*/
|
|
67
|
+
conceptIds: number[];
|
|
68
|
+
/**
|
|
69
|
+
* Array of internal connection IDs showing relationships between concepts.
|
|
70
|
+
* @defaultValue []
|
|
71
|
+
*/
|
|
72
|
+
internalConnections: number[];
|
|
73
|
+
/**
|
|
74
|
+
* Array of linker IDs representing the types of connections.
|
|
75
|
+
* @defaultValue []
|
|
76
|
+
*/
|
|
77
|
+
linkers: number[];
|
|
78
|
+
/**
|
|
79
|
+
* Array of reverse relationship indicators.
|
|
80
|
+
* @defaultValue []
|
|
81
|
+
*/
|
|
82
|
+
reverse: number[];
|
|
83
|
+
/**
|
|
84
|
+
* The processed data result from the query.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The structure and content of this property depends on the format setting.
|
|
88
|
+
*/
|
|
89
|
+
data: any;
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new SearchLinkMultipleAllObservable instance.
|
|
92
|
+
*
|
|
93
|
+
* @param query - The FreeschemaQuery object containing query parameters
|
|
94
|
+
* @param token - Authentication token for API requests (currently unused in constructor)
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* The constructor initializes the observable with the provided query and extracts
|
|
98
|
+
* the output format and order settings from the query object. The token parameter
|
|
99
|
+
* is accepted but not currently stored or used within the constructor.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const query = new FreeschemaQuery();
|
|
104
|
+
* query.outputFormat = JUSTDATA;
|
|
105
|
+
* query.order = "ASC";
|
|
106
|
+
*
|
|
107
|
+
* const observable = new SearchLinkMultipleAllObservable(query, "my-token");
|
|
108
|
+
* console.log(observable.format); // JUSTDATA
|
|
109
|
+
* console.log(observable.order); // "ASC"
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
constructor(query: FreeschemaQuery, token: string);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Executes a schema query and formats the results according to the specified output format.
|
|
116
|
+
*
|
|
117
|
+
* @param query - The FreeschemaQuery object containing query parameters and configuration
|
|
118
|
+
* @param token - Authentication token for API requests
|
|
119
|
+
* @returns Promise resolving to formatted query results (structure varies by output format)
|
|
120
|
+
*
|
|
121
|
+
* @remarks
|
|
122
|
+
* This function serves as the main entry point for executing schema queries. It performs
|
|
123
|
+
* the following operations:
|
|
124
|
+
* 1. Temporarily changes the output format to ALLID to retrieve all relationship data
|
|
125
|
+
* 2. Calls the FreeschemaQueryApi to execute the query
|
|
126
|
+
* 3. Extracts concept IDs, connections, linkers, and metadata from the result
|
|
127
|
+
* 4. Decodes count information strings
|
|
128
|
+
* 5. Formats the data according to the original output format setting
|
|
129
|
+
*
|
|
130
|
+
* The function supports three output formats:
|
|
131
|
+
* - DATAID: Formatted with data IDs included
|
|
132
|
+
* - JUSTDATA: Formatted with only data, no IDs
|
|
133
|
+
* - NORMAL (or any other value): Standard formatting
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* // Create and configure a query
|
|
138
|
+
* const query = new FreeschemaQuery();
|
|
139
|
+
* query.outputFormat = DATAID;
|
|
140
|
+
* query.order = "DESC";
|
|
141
|
+
* // ... set other query parameters
|
|
142
|
+
*
|
|
143
|
+
* // Execute the query
|
|
144
|
+
* const results = await SchemaQueryListener(query, "auth-token");
|
|
145
|
+
* console.log(results); // Formatted results based on DATAID format
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* // Query with JUSTDATA format
|
|
151
|
+
* const query = new FreeschemaQuery();
|
|
152
|
+
* query.outputFormat = JUSTDATA;
|
|
153
|
+
* query.order = "ASC";
|
|
154
|
+
*
|
|
155
|
+
* const results = await SchemaQueryListener(query, "my-token");
|
|
156
|
+
* // Results contain only data without IDs
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
export declare function SchemaQueryListener(query: FreeschemaQuery, token: string): Promise<any>;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main application module for the Concept Connection System (CCS-JS).
|
|
3
|
+
* This module serves as the primary entry point and exports all public-facing APIs,
|
|
4
|
+
* data structures, and utilities for managing concepts, connections, and compositions.
|
|
5
|
+
*
|
|
6
|
+
* @module app
|
|
7
|
+
* @see {@link https://documentation.freeschema.com} for detailed documentation
|
|
8
|
+
*/
|
|
9
|
+
export { init, updateAccessToken };
|
|
10
|
+
export { SplitStrings } from './Services/SplitStrings';
|
|
11
|
+
export { GetCompositionList, GetCompositionListWithId } from './Services/GetCompositionList';
|
|
12
|
+
export { GetCompositionListLocal, GetCompositionListLocalWithId } from './Services/Local/GetCompositionListLocal';
|
|
13
|
+
export { GetAllConnectionsOfComposition } from './Api/GetAllConnectionsOfComposition';
|
|
14
|
+
export { GetComposition, GetCompositionWithId, recursiveFetch, GetCompositionWithAllIds } from './Services/GetComposition';
|
|
15
|
+
export { GetCompositionLocal, GetCompositionLocalWithId } from './Services/Local/GetCompositionLocal';
|
|
16
|
+
export { default as CreateComposition } from './Services/CreateTheComposition';
|
|
17
|
+
export { CreateTheCompositionLocal } from './Services/Local/CreateTheCompositionLocal';
|
|
18
|
+
export { CreateConnectionBetweenTwoConcepts, CreateConnectionBetweenTwoConceptsGeneral } from './Services/CreateConnectionBetweenTwoConcepts';
|
|
19
|
+
export { default as GetTheConcept } from './Services/GetTheConcept';
|
|
20
|
+
export { default as MakeTheInstanceConcept } from './Services/MakeTheInstanceConcept';
|
|
21
|
+
export { MakeTheInstanceConceptLocal } from './Services/Local/MakeTheInstanceConceptLocal';
|
|
22
|
+
export { storeToDatabase, getFromDatabaseWithType, getFromDatabaseWithTypeOld } from './Database/NoIndexDb';
|
|
23
|
+
export { createTheConnection as CreateTheConnection } from './Services/CreateTheConnection';
|
|
24
|
+
export { default as GetConceptByCharacter } from './Services/GetConceptByCharacter';
|
|
25
|
+
export { GetLink, GetLinkRaw } from './Services/GetLink';
|
|
26
|
+
export { CreateDefaultConcept } from './Services/CreateDefaultConcept';
|
|
27
|
+
export { MakeTheTypeConcept } from './Services/MakeTheTypeConcept';
|
|
28
|
+
export { MakeTheTypeConceptApi } from './Api/MakeTheTypeConceptApi';
|
|
29
|
+
export { GetLinkerConnectionFromConcepts, GetLinkerConnectionToConcepts } from './Services/GetLinkerConnectionFromConcept';
|
|
30
|
+
export { DeleteConceptById } from './Services/DeleteConcept';
|
|
31
|
+
export { DeleteConnectionById } from './Services/DeleteConnection';
|
|
32
|
+
export { TrashTheConcept } from './Api/Delete/DeleteConceptInBackend';
|
|
33
|
+
export { GetConnectionById } from './Services/GetConnections';
|
|
34
|
+
export { MakeTheTimestamp } from './Services/MakeTheTimestamp';
|
|
35
|
+
export { RecursiveSearchApi } from './Api/RecursiveSearch';
|
|
36
|
+
export { GetCompositionBulkWithDataId, GetCompositionBulk, GetCompositionFromConnectionsWithDataId } from './Services/GetCompositionBulk';
|
|
37
|
+
export { GetConceptBulk } from './Api/GetConceptBulk';
|
|
38
|
+
export { GetConnectionBulk } from './Api/GetConnectionBulk';
|
|
39
|
+
export { GetAllConnectionsOfCompositionBulk } from './Api/GetAllConnectionsOfCompositionBulk';
|
|
40
|
+
export { LoginToBackend } from './Api/Login';
|
|
41
|
+
export { GetConnectionOfTheConcept } from './Api/GetConnectionOfTheConcept';
|
|
42
|
+
export { default as Signup } from './Api/Signup';
|
|
43
|
+
export { default as Signin } from './Api/Signin';
|
|
44
|
+
export { default as UpdateComposition } from './Services/UpdateComposition';
|
|
45
|
+
export { SearchAllConcepts } from './Api/Search/Search';
|
|
46
|
+
export { SearchWithLinker } from './Api/Search/SearchWithLinker';
|
|
47
|
+
export { GetCompositionWithCache, GetCompositionWithDataIdWithCache, GetCompositionWithDataIdBulk } from './Services/Composition/CompositionCache';
|
|
48
|
+
export { CreateSession } from './Api/Session/CreateSession';
|
|
49
|
+
export { CreateSessionVisit } from './Api/Session/CreateSessionVisit';
|
|
50
|
+
export {} from './Api/GetConceptByCharacterAndType';
|
|
51
|
+
export { GetRelation, GetRelationRaw } from './Services/GetRelation';
|
|
52
|
+
export { recursiveFetchNew } from './Services/Composition/BuildComposition';
|
|
53
|
+
export { CreateTheCompositionWithCache } from './Services/Composition/CreateCompositionCache';
|
|
54
|
+
export { CreateDefaultLConcept } from './Services/Local/CreateDefaultLConcept';
|
|
55
|
+
export { CreateTheConnectionGeneral, CreateConnection } from './Services/CreateTheConnectionGeneral';
|
|
56
|
+
export { CreateTheConnectionLocal } from './Services/Local/CreateTheConnectionLocal';
|
|
57
|
+
export { GetUserGhostId, AddGhostConcept, GetUserGhostConnectionId, AddGhostConnection } from './Services/User/UserTranslation';
|
|
58
|
+
export { SearchLinkMultipleAll, FormatFromConnections } from './Services/Search/SearchLinkMultiple';
|
|
59
|
+
export { UpdateCompositionLocal } from './Services/Local/UpdateCompositionLocal';
|
|
60
|
+
export { GetCompositionFromConnectionsWithDataIdInObject } from './Services/GetCompositionBulk';
|
|
61
|
+
export { ViewInternalData } from './Services/View/ViewInternalData';
|
|
62
|
+
export { convertFromLConceptToConcept } from './Services/Conversion/ConvertConcepts';
|
|
63
|
+
export { SearchLinkInternal } from './Services/Search/SearchLinkInternal';
|
|
64
|
+
export { HandleHttpError } from './Services/Common/ErrorPosting';
|
|
65
|
+
export { GetConceptByCharacterAndType } from './Api/GetConceptByCharacterAndType';
|
|
66
|
+
export { GetConceptByCharacterAndCategoryDirectApi } from './Api/SearchConcept/GetConceptByCharacterAndCategoryDirect';
|
|
67
|
+
export { SearchLinkMultipleApi } from './Api/Search/SearchLinkMultipleApi';
|
|
68
|
+
export { GetCompositionWithIdFromMemoryFromConnections, GetCompositionWithIdFromMemory } from './Services/GetComposition';
|
|
69
|
+
export { GetConceptByTypeBulk } from './Api/GetConceptByCharacterAndType';
|
|
70
|
+
export { DeleteConnectionByTypeBulk, GetConnectionByTypeBulk } from './Services/Delete/DeleteConnectionByType';
|
|
71
|
+
export { SyncData } from './DataStructures/SyncData';
|
|
72
|
+
export { Concept } from './DataStructures/Concept';
|
|
73
|
+
export { LConcept } from './DataStructures/Local/LConcept';
|
|
74
|
+
export { LConnection } from './DataStructures/Local/LConnection';
|
|
75
|
+
export { Connection } from './DataStructures/Connection';
|
|
76
|
+
export { ConceptsData } from './DataStructures/ConceptData';
|
|
77
|
+
export { ConnectionData } from './DataStructures/ConnectionData';
|
|
78
|
+
export { BinaryTree } from './DataStructures/BinaryTree';
|
|
79
|
+
export { SearchQuery } from './DataStructures/SearchQuery';
|
|
80
|
+
export { SignupModel } from './DataStructures/SignupModel';
|
|
81
|
+
export { SigninModel } from './DataStructures/SigninModel';
|
|
82
|
+
export { FreeschemaResponse } from './DataStructures/Responses/StandardResponses';
|
|
83
|
+
export { PatcherStructure } from './DataStructures/PatcherStructure';
|
|
84
|
+
export { SessionData } from './DataStructures/Session/SessionData';
|
|
85
|
+
export { Composition } from './DataStructures/Composition/Composition';
|
|
86
|
+
export { CompositionBinaryTree } from './DataStructures/Composition/CompositionBinaryTree';
|
|
87
|
+
export { CompositionNode } from './DataStructures/Composition/CompositionNode';
|
|
88
|
+
export { UserBinaryTree } from './DataStructures/User/UserBinaryTree';
|
|
89
|
+
export { FilterSearch } from './DataStructures/FilterSearch';
|
|
90
|
+
export { SearchStructure } from './DataStructures/Search/SearchStructure';
|
|
91
|
+
export { FreeSchemaResponse } from './DataStructures/Responses/ErrorResponse';
|
|
92
|
+
export { BaseUrl } from './DataStructures/BaseUrl';
|
|
93
|
+
export { SchemaQueryListener } from './WrapperFunctions/SchemaQueryObservable';
|
|
94
|
+
export { FreeschemaQuery } from './DataStructures/Search/FreeschemaQuery';
|
|
95
|
+
export { GiveConnection, GetAllTheConnectionsByTypeAndOfTheConcept } from './Services/Delete/GetAllConnectionByType';
|
|
96
|
+
export { DATAID, NORMAL, JUSTDATA, ALLID, DATAIDDATE, RAW, LISTNORMAL } from './Constants/FormatConstants';
|
|
97
|
+
export { Transaction } from './DataStructures/Transaction/Transaction';
|
|
98
|
+
/**
|
|
99
|
+
* Updates the bearer access token used for authenticating API requests to the backend.
|
|
100
|
+
* This token is stored globally and used by all API calls that require authentication.
|
|
101
|
+
*
|
|
102
|
+
* @param accessToken - The new bearer access token to use for API authentication. Defaults to empty string if not provided.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* // Update the access token after user login
|
|
107
|
+
* updateAccessToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...');
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @see TokenStorage for token storage implementation
|
|
111
|
+
* @see https://documentation.freeschema.com for authentication details
|
|
112
|
+
*/
|
|
113
|
+
declare function updateAccessToken(accessToken?: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Initializes the Concept Connection System with backend URLs and authentication.
|
|
116
|
+
* This is the primary initialization function that must be called before using any CCS features.
|
|
117
|
+
* It performs the following operations asynchronously:
|
|
118
|
+
*
|
|
119
|
+
* 1. Sets up base URLs for the main API and AI services
|
|
120
|
+
* 2. Stores the authentication token for API requests
|
|
121
|
+
* 3. Initializes the system (database setup)
|
|
122
|
+
* 4. Creates binary trees from concept data for efficient querying (by ID, character, and type)
|
|
123
|
+
* 5. Creates local binary trees for offline/local concept management
|
|
124
|
+
* 6. Loads connection data from IndexedDB into memory
|
|
125
|
+
* 7. Loads local connection data for offline operations
|
|
126
|
+
*
|
|
127
|
+
* All data loading operations run in parallel for optimal performance. The IdentifierFlags
|
|
128
|
+
* are updated as each operation completes to indicate which data structures are ready for use.
|
|
129
|
+
*
|
|
130
|
+
* @param url - The base URL for the main backend API endpoint (e.g., 'https://api.example.com')
|
|
131
|
+
* @param aiurl - The base URL for the AI service endpoint (e.g., 'https://ai.example.com')
|
|
132
|
+
* @param accessToken - The bearer access token for authenticating API requests
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* // Initialize the system with backend URLs and auth token
|
|
137
|
+
* init(
|
|
138
|
+
* 'https://api.freeschema.com',
|
|
139
|
+
* 'https://ai.freeschema.com',
|
|
140
|
+
* 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
141
|
+
* );
|
|
142
|
+
*
|
|
143
|
+
* // After initialization, check if data is loaded before querying
|
|
144
|
+
* if (IdentifierFlags.isDataLoaded) {
|
|
145
|
+
* // Safe to query concepts
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* @remarks
|
|
150
|
+
* The initialization process is asynchronous but does not return a Promise. Instead,
|
|
151
|
+
* it uses IdentifierFlags to signal when different components are ready:
|
|
152
|
+
* - `isDataLoaded`, `isCharacterLoaded`, `isTypeLoaded` - Remote concept data ready
|
|
153
|
+
* - `isLocalDataLoaded`, `isLocalTypeLoaded`, `isLocalCharacterLoaded` - Local concept data ready
|
|
154
|
+
* - `isConnectionLoaded`, `isConnectionTypeLoaded` - Remote connection data ready
|
|
155
|
+
* - `isLocalConnectionLoaded` - Local connection data ready
|
|
156
|
+
*
|
|
157
|
+
* @see IdentifierFlags for checking initialization status
|
|
158
|
+
* @see InitializeSystem for database initialization details
|
|
159
|
+
* @see CreateBinaryTreeFromData for concept tree creation
|
|
160
|
+
* @see https://documentation.freeschema.com/#installation for setup guide
|
|
161
|
+
*/
|
|
162
|
+
declare function init(url?: string, aiurl?: string, accessToken?: string): void;
|