mftsccs-node 0.0.57 → 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/types/Api/Create/CreateTheCharacter.d.ts +42 -0
- package/dist/types/Api/Create/CreateTheConceptApi.d.ts +50 -0
- package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +51 -0
- package/dist/types/Api/Create/CreateTheTextData.d.ts +56 -0
- package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +43 -0
- package/dist/types/Api/DeleteConnectionApiBulk.d.ts +55 -0
- package/dist/types/Api/DeleteTheConcept.d.ts +64 -0
- package/dist/types/Api/DeleteTheConnection.d.ts +76 -0
- package/dist/types/Api/GetAiData.d.ts +36 -0
- package/dist/types/Api/GetAllConcepts.d.ts +42 -0
- package/dist/types/Api/GetAllConceptsByType.d.ts +45 -0
- package/dist/types/Api/GetAllConnections.d.ts +48 -0
- package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +79 -0
- package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +90 -0
- package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +52 -0
- package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +61 -0
- package/dist/types/Api/GetAllPrefetchConnections.d.ts +51 -0
- package/dist/types/Api/GetCharacterDataByCharacter.d.ts +31 -0
- package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +39 -0
- package/dist/types/Api/GetConcept.d.ts +47 -0
- package/dist/types/Api/GetConceptBulk.d.ts +68 -0
- package/dist/types/Api/GetConceptByCharacterAndType.d.ts +75 -0
- package/dist/types/Api/GetConceptByCharacterValue.d.ts +47 -0
- package/dist/types/Api/GetConnection.d.ts +49 -0
- package/dist/types/Api/GetConnectionBulk.d.ts +46 -0
- package/dist/types/Api/GetConnectionOfTheConcept.d.ts +50 -0
- package/dist/types/Api/GetConnectionToTheConcept.d.ts +56 -0
- package/dist/types/Api/GetReservedConnectionIds.d.ts +36 -0
- package/dist/types/Api/GetReservedIds.d.ts +37 -0
- package/dist/types/Api/Login.d.ts +38 -0
- package/dist/types/Api/MakeTheNameInBackend.d.ts +39 -0
- package/dist/types/Api/MakeTheTypeConceptApi.d.ts +40 -0
- package/dist/types/Api/RecursiveSearch.d.ts +43 -0
- package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +46 -0
- package/dist/types/Api/Search/Search.d.ts +67 -0
- package/dist/types/Api/Search/SearchInternalApi.d.ts +69 -0
- package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +90 -0
- package/dist/types/Api/Search/SearchWithLinker.d.ts +97 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +39 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +47 -0
- package/dist/types/Api/Session/CreateSession.d.ts +45 -0
- package/dist/types/Api/Session/CreateSessionVisit.d.ts +43 -0
- package/dist/types/Api/Signin.d.ts +48 -0
- package/dist/types/Api/Signup.d.ts +44 -0
- package/dist/types/Api/View/ViewInternalDataApi.d.ts +50 -0
- package/dist/types/Constants/ApiConstants.d.ts +226 -0
- package/dist/types/Constants/FormatConstants.d.ts +80 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +210 -0
- package/dist/types/DataStructures/BinaryCharacterTree.d.ts +211 -0
- package/dist/types/DataStructures/BinaryTree.d.ts +139 -0
- package/dist/types/DataStructures/BinaryTypeTree.d.ts +196 -0
- package/dist/types/DataStructures/CharacterRepository.d.ts +109 -0
- package/dist/types/DataStructures/Composition/Composition.d.ts +103 -0
- package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +104 -0
- package/dist/types/DataStructures/Composition/CompositionNode.d.ts +202 -0
- package/dist/types/DataStructures/Concept.d.ts +110 -0
- package/dist/types/DataStructures/ConceptData.d.ts +292 -0
- package/dist/types/DataStructures/ConceptsToDraw.d.ts +168 -0
- package/dist/types/DataStructures/Connection.d.ts +76 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +115 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +169 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +82 -0
- package/dist/types/DataStructures/ConnectionData.d.ts +191 -0
- package/dist/types/DataStructures/Count/CountInfo.d.ts +73 -0
- package/dist/types/DataStructures/FilterSearch.d.ts +84 -0
- package/dist/types/DataStructures/IdentifierFlags.d.ts +34 -0
- package/dist/types/DataStructures/Local/LConcept.d.ts +105 -0
- package/dist/types/DataStructures/Local/LConnection.d.ts +83 -0
- package/dist/types/DataStructures/Local/LNode.d.ts +190 -0
- package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +133 -0
- package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +135 -0
- package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +147 -0
- package/dist/types/DataStructures/Local/LocalConceptData.d.ts +100 -0
- package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +109 -0
- package/dist/types/DataStructures/Local/LocalSyncData.d.ts +89 -0
- package/dist/types/DataStructures/PatcherStructure.d.ts +86 -0
- package/dist/types/DataStructures/ReferentInfo.d.ts +68 -0
- package/dist/types/DataStructures/ReservedIds.d.ts +101 -0
- package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +184 -22
- package/dist/types/DataStructures/Responses/StandardResponses.d.ts +65 -0
- package/dist/types/DataStructures/Returner.d.ts +59 -0
- package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +165 -0
- package/dist/types/DataStructures/Search/SearchStructure.d.ts +69 -0
- package/dist/types/DataStructures/SearchQuery.d.ts +130 -0
- package/dist/types/DataStructures/Security/TokenStorage.d.ts +48 -0
- package/dist/types/DataStructures/Session/SessionData.d.ts +118 -0
- package/dist/types/DataStructures/SettingData.d.ts +32 -0
- package/dist/types/DataStructures/Settings.d.ts +27 -0
- package/dist/types/DataStructures/SigninModel.d.ts +50 -0
- package/dist/types/DataStructures/SignupModel.d.ts +50 -0
- package/dist/types/DataStructures/SyncData.d.ts +206 -0
- package/dist/types/DataStructures/TheCharacter.d.ts +87 -0
- package/dist/types/DataStructures/TheTexts.d.ts +92 -0
- package/dist/types/DataStructures/Transaction/Transaction.d.ts +294 -4
- package/dist/types/DataStructures/User/UserBinaryTree.d.ts +117 -0
- package/dist/types/DataStructures/User/UserNode.d.ts +130 -0
- package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
- package/dist/types/Database/NoIndexDb.d.ts +169 -0
- package/dist/types/Database/indexdblocal.d.ts +42 -0
- package/dist/types/Database/indexeddb.d.ts +43 -0
- package/dist/types/Drawing/ConceptDraw.d.ts +28 -0
- package/dist/types/Drawing/ConceptEvents.d.ts +46 -0
- package/dist/types/Helpers/CheckIfExists.d.ts +159 -0
- package/dist/types/Helpers/RemoveFromArray.d.ts +66 -0
- package/dist/types/Helpers/UniqueInsert.d.ts +28 -0
- package/dist/types/Services/CheckForConnectionDeletion.d.ts +190 -0
- package/dist/types/Services/Common/DecodeCountInfo.d.ts +54 -0
- package/dist/types/Services/Common/ErrorPosting.d.ts +49 -0
- package/dist/types/Services/Common/RegexFunction.d.ts +28 -0
- package/dist/types/Services/Composition/BuildComposition.d.ts +37 -0
- package/dist/types/Services/Composition/CompositionCache.d.ts +89 -0
- package/dist/types/Services/Composition/CreateCompositionCache.d.ts +43 -0
- package/dist/types/Services/Conversion/ConvertConcepts.d.ts +83 -0
- package/dist/types/Services/CreateBinaryTreeFromData.d.ts +38 -0
- package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +42 -0
- package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +206 -0
- package/dist/types/Services/CreateDefaultConcept.d.ts +114 -0
- package/dist/types/Services/CreateTheComposition.d.ts +101 -0
- package/dist/types/Services/CreateTheConcept.d.ts +179 -0
- package/dist/types/Services/CreateTheConnection.d.ts +59 -0
- package/dist/types/Services/CreateTheConnectionGeneral.d.ts +127 -0
- package/dist/types/Services/CreateTypeTreeFromData.d.ts +43 -0
- package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +52 -5
- package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +57 -9
- package/dist/types/Services/DeleteConcept.d.ts +136 -0
- package/dist/types/Services/DeleteConnection.d.ts +194 -0
- package/dist/types/Services/FindConeceptsFromConnection.d.ts +179 -0
- package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +157 -0
- package/dist/types/Services/GenerateHexNumber.d.ts +64 -0
- package/dist/types/Services/GetComposition.d.ts +331 -0
- package/dist/types/Services/GetCompositionBulk.d.ts +251 -3
- package/dist/types/Services/GetCompositionList.d.ts +130 -0
- package/dist/types/Services/GetConceptByCharacter.d.ts +84 -0
- package/dist/types/Services/GetConnections.d.ts +72 -0
- package/dist/types/Services/GetDataFromIndexDb.d.ts +79 -0
- package/dist/types/Services/GetLink.d.ts +104 -0
- package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +99 -0
- package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +57 -0
- package/dist/types/Services/GetRelation.d.ts +162 -0
- package/dist/types/Services/GetTheConcept.d.ts +71 -0
- package/dist/types/Services/GetTheReferent.d.ts +74 -0
- package/dist/types/Services/InitializeSystem.d.ts +119 -0
- package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +48 -0
- package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +49 -0
- package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +54 -0
- package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +60 -0
- package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +70 -0
- package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +58 -0
- package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +56 -0
- package/dist/types/Services/Local/GetCompositionListLocal.d.ts +103 -0
- package/dist/types/Services/Local/GetCompositionLocal.d.ts +96 -0
- package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +57 -0
- package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +71 -0
- package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +89 -0
- package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +71 -0
- package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +101 -0
- package/dist/types/Services/MakeTheCharacter.d.ts +74 -0
- package/dist/types/Services/MakeTheCharacterData.d.ts +65 -0
- package/dist/types/Services/MakeTheInstanceConcept.d.ts +75 -0
- package/dist/types/Services/MakeTheName.d.ts +81 -0
- package/dist/types/Services/MakeTheTimestamp.d.ts +68 -0
- package/dist/types/Services/MakeTheTypeConcept.d.ts +68 -0
- package/dist/types/Services/Mqtt/publishMessage.d.ts +27 -0
- package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
- package/dist/types/Services/PatchComposition.d.ts +105 -0
- package/dist/types/Services/Search/DataIdFormat.d.ts +96 -24
- package/dist/types/Services/Search/FormatData.d.ts +92 -17
- package/dist/types/Services/Search/JustIdFormat.d.ts +91 -16
- package/dist/types/Services/Search/SearchLinkInternal.d.ts +28 -0
- package/dist/types/Services/Search/SearchLinkMultiple.d.ts +58 -0
- package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +91 -24
- package/dist/types/Services/Search/orderingConnections.d.ts +34 -0
- package/dist/types/Services/SplitStrings.d.ts +50 -0
- package/dist/types/Services/UpdateComposition.d.ts +123 -0
- package/dist/types/Services/User/UserTranslation.d.ts +102 -0
- package/dist/types/Services/View/ViewInternalData.d.ts +32 -0
- package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +140 -5
- package/dist/types/app.d.ts +71 -0
- package/package.json +1 -1
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character creation API module for the Concept Connection System.
|
|
3
|
+
* This module handles the creation and persistence of character data in the CCS database,
|
|
4
|
+
* managing both local repository caching and remote server synchronization.
|
|
5
|
+
*
|
|
6
|
+
* @module Api/Create/CreateTheCharacter
|
|
7
|
+
* @see https://documentation.freeschema.com for CCS API reference
|
|
8
|
+
*/
|
|
1
9
|
import { Returner } from "../../DataStructures/Returner";
|
|
2
10
|
import { TheCharacter } from "../../DataStructures/TheCharacter";
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new character in the Concept Connection System database.
|
|
13
|
+
* This function checks if the character already exists in the local repository
|
|
14
|
+
* before making an API call. If the character doesn't exist (id == 0), it sends
|
|
15
|
+
* a POST request to create the character on the server and caches it locally.
|
|
16
|
+
* If the character already exists, it returns the existing character data without
|
|
17
|
+
* making a network request.
|
|
18
|
+
*
|
|
19
|
+
* @param characterData - The character object containing the data to be created
|
|
20
|
+
* @returns A promise that resolves to a Returner object containing the character ID,
|
|
21
|
+
* user ID, and creation status information
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const newCharacter = new TheCharacter(userId, "A", 0, 0, 4, 4, 999, 999, "", false);
|
|
26
|
+
* const result = await CreateTheCharacter(newCharacter);
|
|
27
|
+
* console.log(`Created character with ID: ${result.id}`);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* This function implements a dual-write pattern:
|
|
32
|
+
* 1. First checks the local CharacterRepository for existing character
|
|
33
|
+
* 2. If not found (id == 0), creates the character on the server via API
|
|
34
|
+
* 3. Caches the newly created character in the local repository
|
|
35
|
+
* 4. Returns either the new character data or existing character reference
|
|
36
|
+
*
|
|
37
|
+
* The function uses GetRequestHeader() for authentication and authorization.
|
|
38
|
+
* Network errors are logged and handled through the HandleHttpError utility.
|
|
39
|
+
*
|
|
40
|
+
* @throws Will throw an error if the HTTP request fails or returns a non-OK status
|
|
41
|
+
* @see CharacterRepository for local character caching
|
|
42
|
+
* @see GetRequestHeader for authentication details
|
|
43
|
+
* @see https://documentation.freeschema.com for character data structure
|
|
44
|
+
*/
|
|
3
45
|
export declare function CreateTheCharacter(characterData: TheCharacter): Promise<Returner>;
|
|
@@ -1,2 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concept creation API module for the Concept Connection System.
|
|
3
|
+
* This module provides functionality to create new concepts in the CCS database,
|
|
4
|
+
* which are the fundamental building blocks of the knowledge graph system.
|
|
5
|
+
* Concepts represent individual ideas, entities, or nodes in the connection network.
|
|
6
|
+
*
|
|
7
|
+
* @module Api/Create/CreateTheConceptApi
|
|
8
|
+
* @see https://documentation.freeschema.com for concept structure and API reference
|
|
9
|
+
*/
|
|
1
10
|
import { Concept } from "../../DataStructures/Concept";
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new concept in the Concept Connection System database.
|
|
13
|
+
* This function sends a POST request to the CCS API to persist a new concept.
|
|
14
|
+
* Concepts are the core data entities in CCS, representing nodes in the knowledge
|
|
15
|
+
* graph that can be connected to other concepts through relationships.
|
|
16
|
+
*
|
|
17
|
+
* @param conceptData - The concept data object to be created. Can be any valid concept
|
|
18
|
+
* structure that conforms to the API requirements
|
|
19
|
+
* @returns A promise that resolves to a Concept object containing the created concept
|
|
20
|
+
* with its assigned ID and all properties. Returns a default concept if
|
|
21
|
+
* the operation fails.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const newConcept = {
|
|
26
|
+
* userId: 123,
|
|
27
|
+
* characterId: 456,
|
|
28
|
+
* typeId: 1,
|
|
29
|
+
* composition: [],
|
|
30
|
+
* // ... other concept properties
|
|
31
|
+
* };
|
|
32
|
+
* const createdConcept = await CreateTheConceptApi(newConcept);
|
|
33
|
+
* console.log(`Concept created with ID: ${createdConcept.id}`);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* This function follows a fail-safe pattern by initializing the result with a
|
|
38
|
+
* default concept using CreateDefaultConcept(). This ensures that a valid concept
|
|
39
|
+
* structure is always returned, even if the API call fails.
|
|
40
|
+
*
|
|
41
|
+
* The function uses GetRequestHeader() to include necessary authentication tokens
|
|
42
|
+
* and headers in the request. All HTTP errors are handled through the HandleHttpError
|
|
43
|
+
* utility and logged to the console with descriptive messages.
|
|
44
|
+
*
|
|
45
|
+
* @throws Will throw an error if the HTTP request fails or returns a non-OK status,
|
|
46
|
+
* after logging the error details
|
|
47
|
+
* @see CreateDefaultConcept for the default concept initialization
|
|
48
|
+
* @see GetRequestHeader for authentication details
|
|
49
|
+
* @see HandleHttpError for error handling
|
|
50
|
+
* @see https://documentation.freeschema.com for concept data model
|
|
51
|
+
*/
|
|
2
52
|
export declare function CreateTheConceptApi(conceptData: any): Promise<Concept>;
|
|
@@ -1,2 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection creation API module for the Concept Connection System.
|
|
3
|
+
* This module handles the creation of connections (edges) between concepts in the CCS
|
|
4
|
+
* knowledge graph. Connections define relationships and associations between concepts,
|
|
5
|
+
* forming the network structure that enables knowledge mapping and traversal.
|
|
6
|
+
*
|
|
7
|
+
* @module Api/Create/CreateTheConnectionApi
|
|
8
|
+
* @see https://documentation.freeschema.com for connection structure and relationship types
|
|
9
|
+
*/
|
|
1
10
|
import { Connection } from "../../DataStructures/Connection";
|
|
11
|
+
/**
|
|
12
|
+
* Creates one or more connections between concepts in the Concept Connection System.
|
|
13
|
+
* This function sends a batch of connection data to the CCS API to establish
|
|
14
|
+
* relationships between concepts. Connections are the edges in the knowledge graph
|
|
15
|
+
* that link concepts together, enabling navigation and semantic relationships.
|
|
16
|
+
*
|
|
17
|
+
* @param connectionData - An array of Connection objects to be created. Each connection
|
|
18
|
+
* defines a relationship between two concepts with directional
|
|
19
|
+
* and metadata properties
|
|
20
|
+
* @returns A promise that resolves to a Connection object. Note that the function
|
|
21
|
+
* returns a default connection instance initialized at the start, and the
|
|
22
|
+
* actual API response is processed but not returned in success cases
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const connections = [
|
|
27
|
+
* new Connection(userId, ofTheConceptId, toTheConceptId, typeId, ...),
|
|
28
|
+
* new Connection(userId, anotherConceptId, targetConceptId, typeId, ...)
|
|
29
|
+
* ];
|
|
30
|
+
* await CreateTheConnectionApi(connections);
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* This function supports batch connection creation by accepting an array of
|
|
35
|
+
* Connection objects. The API processes all connections in a single request,
|
|
36
|
+
* which is more efficient than creating connections individually.
|
|
37
|
+
*
|
|
38
|
+
* The function has an asymmetric return pattern:
|
|
39
|
+
* - On success: Returns the default connection instance created at function start
|
|
40
|
+
* - On error: Logs the error and handles it through HandleHttpError
|
|
41
|
+
*
|
|
42
|
+
* The connection data is serialized to JSON and sent with authentication headers
|
|
43
|
+
* obtained from GetRequestHeader(). All network and HTTP errors are logged to
|
|
44
|
+
* the console with descriptive prefixes for debugging.
|
|
45
|
+
*
|
|
46
|
+
* @throws Will throw an error if the HTTP request fails, after logging error details
|
|
47
|
+
* and processing through HandleHttpError
|
|
48
|
+
* @see Connection for the connection data structure
|
|
49
|
+
* @see GetRequestHeader for authentication details
|
|
50
|
+
* @see HandleHttpError for error handling
|
|
51
|
+
* @see https://documentation.freeschema.com for connection types and semantics
|
|
52
|
+
*/
|
|
2
53
|
export declare function CreateTheConnectionApi(connectionData: Connection[]): Promise<Connection>;
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text data creation API module for the Concept Connection System.
|
|
3
|
+
* This module provides functionality to create and persist text data entries in the
|
|
4
|
+
* CCS database. Text data represents the textual content associated with concepts,
|
|
5
|
+
* enabling rich descriptions, annotations, and semantic information storage.
|
|
6
|
+
*
|
|
7
|
+
* @module Api/Create/CreateTheTextData
|
|
8
|
+
* @see https://documentation.freeschema.com for text data structure and usage
|
|
9
|
+
*/
|
|
1
10
|
import { TheTexts } from "../../DataStructures/TheTexts";
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new text data entry in the Concept Connection System database.
|
|
13
|
+
* This function sends a POST request to persist text content that can be associated
|
|
14
|
+
* with concepts, providing descriptive or explanatory information. Text data is a
|
|
15
|
+
* fundamental component for enriching concepts with human-readable content.
|
|
16
|
+
*
|
|
17
|
+
* @param textData - The TheTexts object containing the text content and metadata
|
|
18
|
+
* to be persisted in the database
|
|
19
|
+
* @returns A promise that resolves to a TheTexts object containing the created
|
|
20
|
+
* text data with its assigned ID and all associated properties
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const newText = new TheTexts(
|
|
25
|
+
* userId,
|
|
26
|
+
* characterId,
|
|
27
|
+
* conceptId,
|
|
28
|
+
* "Sample text content",
|
|
29
|
+
* languageId,
|
|
30
|
+
* typeId
|
|
31
|
+
* );
|
|
32
|
+
* const createdText = await CreateTextData(newText);
|
|
33
|
+
* console.log(`Text data created with ID: ${createdText.id}`);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* This function is essential for adding textual descriptions to concepts in the
|
|
38
|
+
* knowledge graph. Text data can include:
|
|
39
|
+
* - Concept descriptions and definitions
|
|
40
|
+
* - Annotations and notes
|
|
41
|
+
* - Multi-language translations
|
|
42
|
+
* - Rich content and documentation
|
|
43
|
+
*
|
|
44
|
+
* The function uses GetRequestHeader() to include authentication credentials
|
|
45
|
+
* and necessary headers for the API request. The created text data is returned
|
|
46
|
+
* with its server-assigned ID, enabling immediate reference and updates.
|
|
47
|
+
*
|
|
48
|
+
* All HTTP errors are processed through HandleHttpError and logged with
|
|
49
|
+
* descriptive error messages. Errors are propagated to the caller after logging.
|
|
50
|
+
*
|
|
51
|
+
* @throws Will throw an error if the HTTP request fails or returns a non-OK status,
|
|
52
|
+
* after logging the error details to the console
|
|
53
|
+
* @see TheTexts for the text data structure
|
|
54
|
+
* @see GetRequestHeader for authentication details
|
|
55
|
+
* @see HandleHttpError for error handling
|
|
56
|
+
* @see https://documentation.freeschema.com for text data model and language support
|
|
57
|
+
*/
|
|
2
58
|
export declare function CreateTextData(textData: TheTexts): Promise<TheTexts>;
|
|
@@ -1 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend concept deletion API module for the Concept Connection System.
|
|
3
|
+
*
|
|
4
|
+
* This module provides functionality to permanently delete concepts from the backend database.
|
|
5
|
+
* It handles authenticated API requests to remove concept records using the trash/delete endpoint.
|
|
6
|
+
*
|
|
7
|
+
* @module Api/Delete/DeleteConceptInBackend
|
|
8
|
+
* @see https://documentation.freeschema.com for API reference
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Permanently deletes a concept from the backend database using the trash endpoint.
|
|
12
|
+
*
|
|
13
|
+
* This function sends an authenticated POST request to remove a concept by its ID. It's used
|
|
14
|
+
* when a concept needs to be completely removed from the system rather than just marked as deleted.
|
|
15
|
+
* The operation requires authentication and will throw errors if the deletion fails.
|
|
16
|
+
*
|
|
17
|
+
* @param id - The unique identifier of the concept to delete
|
|
18
|
+
* @param token - Bearer authentication token for authorizing the deletion request
|
|
19
|
+
*
|
|
20
|
+
* @returns A promise that resolves when the concept is successfully deleted, or rejects with an error
|
|
21
|
+
*
|
|
22
|
+
* @throws Will throw an error if the HTTP request fails or returns a non-OK status
|
|
23
|
+
* @throws Will re-throw any caught errors after logging them to the console
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Delete a concept with authentication
|
|
28
|
+
* try {
|
|
29
|
+
* await TrashTheConcept(12345, 'your-auth-token-here');
|
|
30
|
+
* console.log('Concept deleted successfully');
|
|
31
|
+
* } catch (error) {
|
|
32
|
+
* console.error('Failed to delete concept:', error);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* This function uses FormData to send the concept ID in the request body. The deletion is permanent
|
|
38
|
+
* and cannot be undone. All errors are logged to the console before being re-thrown to allow
|
|
39
|
+
* proper error handling by the caller.
|
|
40
|
+
*
|
|
41
|
+
* @see DeleteTheConcept for an alternative deletion method
|
|
42
|
+
* @see BaseUrl.DeleteConceptUrl for the API endpoint configuration
|
|
43
|
+
*/
|
|
1
44
|
export declare function TrashTheConcept(id: number, token: string): Promise<void>;
|
|
@@ -1 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bulk connection deletion API module for the Concept Connection System.
|
|
3
|
+
*
|
|
4
|
+
* This module provides functionality to delete multiple connections between concepts in a single API call.
|
|
5
|
+
* It optimizes performance by allowing batch deletion operations rather than individual deletions,
|
|
6
|
+
* making it ideal for cleanup operations and managing multiple relationships at once.
|
|
7
|
+
*
|
|
8
|
+
* @module Api/DeleteConnectionApiBulk
|
|
9
|
+
* @see https://documentation.freeschema.com for API reference
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Deletes multiple connections between concepts in a single bulk operation.
|
|
13
|
+
*
|
|
14
|
+
* This function sends an authenticated POST request to delete multiple connection records
|
|
15
|
+
* identified by their IDs. It's particularly useful for cleanup operations, removing outdated
|
|
16
|
+
* relationships, or managing connections in bulk rather than one at a time. The function
|
|
17
|
+
* returns a boolean indicating success or failure of the bulk deletion.
|
|
18
|
+
*
|
|
19
|
+
* @param ids - Array of connection IDs to delete in bulk
|
|
20
|
+
*
|
|
21
|
+
* @returns A promise that resolves to `true` if all connections were successfully deleted,
|
|
22
|
+
* `false` if the deletion failed or encountered errors
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Delete multiple connections at once
|
|
27
|
+
* const connectionIds = [101, 102, 103, 104];
|
|
28
|
+
* const success = await DeleteTheConnectionBulkApi(connectionIds);
|
|
29
|
+
*
|
|
30
|
+
* if (success) {
|
|
31
|
+
* console.log('All connections deleted successfully');
|
|
32
|
+
* } else {
|
|
33
|
+
* console.log('Bulk deletion failed');
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Clean up all connections for a specific concept
|
|
40
|
+
* const obsoleteConnections = [45, 67, 89];
|
|
41
|
+
* const result = await DeleteTheConnectionBulkApi(obsoleteConnections);
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This function uses authenticated headers retrieved from GetRequestHeaderWithAuthorization().
|
|
46
|
+
* The connection IDs are sent as a JSON array in the request body. Unlike individual deletion
|
|
47
|
+
* methods, this function does not throw errors but returns false on failure, making it safer
|
|
48
|
+
* for batch operations where partial failures should be handled gracefully.
|
|
49
|
+
*
|
|
50
|
+
* The function logs all errors to the console for debugging purposes but does not re-throw them,
|
|
51
|
+
* allowing the calling code to continue execution even if the bulk deletion fails.
|
|
52
|
+
*
|
|
53
|
+
* @see DeleteTheConnection for single connection deletion
|
|
54
|
+
* @see BaseUrl.DeleteTheConnectionBulkUrl for the API endpoint configuration
|
|
55
|
+
*/
|
|
1
56
|
export default function DeleteTheConnectionBulkApi(ids: number[]): Promise<boolean>;
|
|
@@ -1 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concept deletion API module for the Concept Connection System.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the primary interface for deleting individual concept records from the system.
|
|
5
|
+
* It supports both authenticated and unauthenticated deletion requests, making it flexible for
|
|
6
|
+
* different security contexts. The module handles API communication, error management, and
|
|
7
|
+
* returns deletion status to the caller.
|
|
8
|
+
*
|
|
9
|
+
* @module Api/DeleteTheConcept
|
|
10
|
+
* @see https://documentation.freeschema.com for API reference
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Deletes a single concept from the system by its ID.
|
|
14
|
+
*
|
|
15
|
+
* This is the primary function for removing individual concepts from the CCS database. It supports
|
|
16
|
+
* optional authentication via a bearer token and handles both authenticated and unauthenticated
|
|
17
|
+
* deletion scenarios. The function returns a boolean indicating success or failure, and throws
|
|
18
|
+
* errors for critical failures that should halt execution.
|
|
19
|
+
*
|
|
20
|
+
* @param id - The unique identifier of the concept to delete
|
|
21
|
+
* @param token - Optional bearer authentication token. Defaults to empty string for unauthenticated requests
|
|
22
|
+
*
|
|
23
|
+
* @returns A promise that resolves to `true` if the concept was successfully deleted,
|
|
24
|
+
* `false` if the deletion failed
|
|
25
|
+
*
|
|
26
|
+
* @throws Will throw an error if the HTTP request fails with a non-OK status
|
|
27
|
+
* @throws Will re-throw any caught errors after logging them to the console
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Delete a concept with authentication
|
|
32
|
+
* try {
|
|
33
|
+
* const success = await DeleteTheConcept(12345, 'your-auth-token');
|
|
34
|
+
* if (success) {
|
|
35
|
+
* console.log('Concept deleted successfully');
|
|
36
|
+
* }
|
|
37
|
+
* } catch (error) {
|
|
38
|
+
* console.error('Critical deletion error:', error);
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // Delete a concept without authentication (using API key)
|
|
45
|
+
* const result = await DeleteTheConcept(67890);
|
|
46
|
+
* if (result) {
|
|
47
|
+
* console.log('Public concept removed');
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* The function uses FormData to send the concept ID along with a hardcoded "nodeserver" API key.
|
|
53
|
+
* When a token is provided, it switches to authenticated headers using GetRequestHeaderWithAuthorization.
|
|
54
|
+
* Note that the headers parameter is currently commented out in the fetch call, which may affect
|
|
55
|
+
* authentication behavior.
|
|
56
|
+
*
|
|
57
|
+
* Error handling follows a dual approach: errors are logged to console for debugging and then
|
|
58
|
+
* re-thrown to allow the caller to handle critical failures. The function returns the success
|
|
59
|
+
* status from the API response JSON.
|
|
60
|
+
*
|
|
61
|
+
* @see TrashTheConcept for backend-specific concept deletion
|
|
62
|
+
* @see BaseUrl.DeleteConceptUrl for the API endpoint configuration
|
|
63
|
+
* @see GetRequestHeaderWithAuthorization for authentication header construction
|
|
64
|
+
*/
|
|
1
65
|
export default function DeleteTheConcept(id: number, token?: string): Promise<boolean>;
|
|
@@ -1 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection deletion API module for the Concept Connection System.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the primary interface for deleting individual connection records between
|
|
5
|
+
* concepts in the system. Connections represent relationships, links, or associations between
|
|
6
|
+
* different concepts. This module supports both authenticated and unauthenticated deletion
|
|
7
|
+
* requests and handles all aspects of API communication and error management.
|
|
8
|
+
*
|
|
9
|
+
* @module Api/DeleteTheConnection
|
|
10
|
+
* @see https://documentation.freeschema.com for API reference
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Deletes a single connection between concepts by its ID.
|
|
14
|
+
*
|
|
15
|
+
* This is the primary function for removing individual connections (relationships) between concepts
|
|
16
|
+
* in the CCS database. Connections represent links, associations, or relationships between different
|
|
17
|
+
* concept nodes. The function supports optional authentication and returns a boolean indicating
|
|
18
|
+
* whether the deletion was successful.
|
|
19
|
+
*
|
|
20
|
+
* @param id - The unique identifier of the connection to delete
|
|
21
|
+
* @param token - Optional bearer authentication token. Defaults to empty string for unauthenticated requests
|
|
22
|
+
*
|
|
23
|
+
* @returns A promise that resolves to `true` if the connection was successfully deleted,
|
|
24
|
+
* `false` if the deletion failed or encountered errors
|
|
25
|
+
*
|
|
26
|
+
* @throws Will re-throw any caught errors after logging them to the console
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* // Delete a connection with authentication
|
|
31
|
+
* try {
|
|
32
|
+
* const success = await DeleteTheConnection(456, 'your-auth-token');
|
|
33
|
+
* if (success) {
|
|
34
|
+
* console.log('Connection removed successfully');
|
|
35
|
+
* } else {
|
|
36
|
+
* console.log('Failed to remove connection');
|
|
37
|
+
* }
|
|
38
|
+
* } catch (error) {
|
|
39
|
+
* console.error('Critical error during deletion:', error);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* // Delete a connection without authentication
|
|
46
|
+
* const removed = await DeleteTheConnection(789);
|
|
47
|
+
* if (removed) {
|
|
48
|
+
* console.log('Connection deleted');
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // Remove multiple connections sequentially
|
|
55
|
+
* const connectionIds = [101, 102, 103];
|
|
56
|
+
* for (const connId of connectionIds) {
|
|
57
|
+
* await DeleteTheConnection(connId, authToken);
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* The function uses FormData to send the connection ID along with a hardcoded "nodeserver" API key.
|
|
63
|
+
* When a token is provided, authenticated headers are prepared using GetRequestHeaderWithAuthorization,
|
|
64
|
+
* though the headers are currently commented out in the fetch call.
|
|
65
|
+
*
|
|
66
|
+
* The fetch request includes `redirect: "follow"` to handle any server-side redirects automatically.
|
|
67
|
+
* Error handling logs failures to the console before re-throwing, allowing both debugging and
|
|
68
|
+
* proper error propagation to calling code.
|
|
69
|
+
*
|
|
70
|
+
* Unlike concept deletion, connection deletion typically has fewer cascade effects since connections
|
|
71
|
+
* are edges in the concept graph rather than nodes themselves.
|
|
72
|
+
*
|
|
73
|
+
* @see DeleteTheConnectionBulkApi for bulk connection deletion
|
|
74
|
+
* @see BaseUrl.DeleteTheConnectionUrl for the API endpoint configuration
|
|
75
|
+
* @see GetRequestHeaderWithAuthorization for authentication header construction
|
|
76
|
+
*/
|
|
1
77
|
export default function DeleteTheConnection(id: number, token?: string): Promise<boolean>;
|
|
@@ -1 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for fetching AI-related concept data from the remote server.
|
|
3
|
+
* This module retrieves AI-generated or AI-specific concepts and adds them to the local concept store.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/GetAiData
|
|
6
|
+
* @see https://documentation.freeschema.com for more information on the Concept Connection System
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Fetches all AI-related concept data from the remote server and populates the local concept store.
|
|
10
|
+
* This function retrieves AI-generated concepts, AI metadata, or AI-specific data structures
|
|
11
|
+
* from the backend and adds them to the ConceptsData singleton for use throughout the application.
|
|
12
|
+
*
|
|
13
|
+
* The function uses authorized headers to ensure secure access to AI data endpoints.
|
|
14
|
+
* All retrieved concepts are automatically added to the local in-memory concept store.
|
|
15
|
+
*
|
|
16
|
+
* @returns A promise that resolves when all AI data has been fetched and stored locally
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Fetch and populate AI data
|
|
21
|
+
* await GetAiData();
|
|
22
|
+
*
|
|
23
|
+
* // AI concepts are now available in ConceptsData
|
|
24
|
+
* const aiConcepts = ConceptsData.GetAllConcepts();
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This function requires proper authentication headers via GetRequestHeaderWithAuthorization.
|
|
29
|
+
* Errors are logged to the console with the prefix 'Ai Error Message' and are re-thrown
|
|
30
|
+
* to allow calling code to handle failures appropriately.
|
|
31
|
+
*
|
|
32
|
+
* @throws Will throw an error if the network request fails or if the server returns an error response
|
|
33
|
+
*
|
|
34
|
+
* @see ConceptsData.AddConcept for how concepts are stored locally
|
|
35
|
+
* @see GetRequestHeaderWithAuthorization for authentication details
|
|
36
|
+
*/
|
|
1
37
|
export declare function GetAiData(): Promise<void>;
|
|
@@ -1 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for retrieving all concepts belonging to a specific user.
|
|
3
|
+
* This module fetches user-specific concept data from the remote server and populates the local concept store.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/GetAllConcepts
|
|
6
|
+
* @see https://documentation.freeschema.com for more information on the Concept Connection System
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves all concepts created by or associated with a specific user from the remote server.
|
|
10
|
+
* This function fetches all concepts belonging to the specified user ID and adds them to the
|
|
11
|
+
* local ConceptsData store for use throughout the application.
|
|
12
|
+
*
|
|
13
|
+
* Concepts represent individual units of knowledge or data in the Concept Connection System.
|
|
14
|
+
* Each user can create and manage their own set of concepts, which can then be connected
|
|
15
|
+
* to form a knowledge graph.
|
|
16
|
+
*
|
|
17
|
+
* @param userId - The unique identifier of the user whose concepts should be retrieved
|
|
18
|
+
*
|
|
19
|
+
* @returns A promise that resolves when all user concepts have been fetched and stored locally
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Fetch all concepts for user with ID 123
|
|
24
|
+
* await GetAllUserConcepts(123);
|
|
25
|
+
*
|
|
26
|
+
* // User concepts are now available in ConceptsData
|
|
27
|
+
* const userConcepts = ConceptsData.GetAllConcepts();
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Note: The current implementation has an inverted logic check where it processes results
|
|
32
|
+
* when response.ok is false. This may be intentional for specific server configurations
|
|
33
|
+
* or may need review.
|
|
34
|
+
*
|
|
35
|
+
* Errors are logged with the prefix 'GetAllUserConcepts error' and are re-thrown to allow
|
|
36
|
+
* calling code to handle failures appropriately.
|
|
37
|
+
*
|
|
38
|
+
* @throws Will throw an error if the network request fails or if the server returns an error response
|
|
39
|
+
*
|
|
40
|
+
* @see ConceptsData.AddConcept for how concepts are stored locally
|
|
41
|
+
* @see GetRequestHeader for request header configuration
|
|
42
|
+
*/
|
|
1
43
|
export declare function GetAllUserConcepts(userId: number): Promise<void>;
|
|
@@ -1 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for retrieving concepts filtered by type and user.
|
|
3
|
+
* This module fetches concepts of a specific type for a given user from the remote server
|
|
4
|
+
* and populates the local concept store.
|
|
5
|
+
*
|
|
6
|
+
* @module Api/GetAllConceptsByType
|
|
7
|
+
* @see https://documentation.freeschema.com for more information on the Concept Connection System
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all concepts of a specific type belonging to a user from the remote server.
|
|
11
|
+
* This function allows filtering concepts by their type (e.g., "person", "place", "thing")
|
|
12
|
+
* and user ownership, enabling targeted retrieval of specific concept categories.
|
|
13
|
+
*
|
|
14
|
+
* In the Concept Connection System, concepts can be categorized by type to organize
|
|
15
|
+
* different kinds of knowledge. This function fetches only concepts matching the specified
|
|
16
|
+
* type for the given user, which is useful for displaying categorized views or performing
|
|
17
|
+
* type-specific operations.
|
|
18
|
+
*
|
|
19
|
+
* @param type - The type category of concepts to retrieve (e.g., "person", "organization", "idea")
|
|
20
|
+
* @param userId - The unique identifier of the user whose concepts should be retrieved
|
|
21
|
+
*
|
|
22
|
+
* @returns A promise that resolves when all matching concepts have been fetched and stored locally
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Fetch all "person" type concepts for user 123
|
|
27
|
+
* await GetAllConceptsByType("person", 123);
|
|
28
|
+
*
|
|
29
|
+
* // Fetch all "organization" type concepts for user 456
|
|
30
|
+
* await GetAllConceptsByType("organization", 456);
|
|
31
|
+
*
|
|
32
|
+
* // Retrieved concepts are now available in ConceptsData
|
|
33
|
+
* const concepts = ConceptsData.GetAllConcepts();
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* The function uses URLSearchParams to properly encode the request body parameters.
|
|
38
|
+
* Errors are logged with the prefix 'GetAllConceptsByType error' and are re-thrown
|
|
39
|
+
* to allow calling code to handle failures appropriately.
|
|
40
|
+
*
|
|
41
|
+
* @throws Will throw an error if the network request fails or if the server returns an error response
|
|
42
|
+
*
|
|
43
|
+
* @see ConceptsData.AddConcept for how concepts are stored locally
|
|
44
|
+
* @see GetRequestHeader for request header configuration
|
|
45
|
+
*/
|
|
1
46
|
export declare function GetAllConceptsByType(type: string, userId: number): Promise<void>;
|
|
@@ -1 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for retrieving all connections belonging to a specific user.
|
|
3
|
+
* This module fetches user-specific connection data from the remote server and populates
|
|
4
|
+
* the local connection store, including both the main storage and the connection dictionary.
|
|
5
|
+
*
|
|
6
|
+
* @module Api/GetAllConnections
|
|
7
|
+
* @see https://documentation.freeschema.com for more information on the Concept Connection System
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all connections created by or associated with a specific user from the remote server.
|
|
11
|
+
* This function fetches all connections belonging to the specified user ID and adds them to both
|
|
12
|
+
* the main ConnectionData store and the connection dictionary for efficient lookup.
|
|
13
|
+
*
|
|
14
|
+
* Connections represent relationships between concepts in the Concept Connection System.
|
|
15
|
+
* Each connection links two or more concepts together with specific relationship metadata.
|
|
16
|
+
* This function ensures that all user-created connections are available locally for
|
|
17
|
+
* graph traversal and relationship analysis.
|
|
18
|
+
*
|
|
19
|
+
* @param userId - The unique identifier of the user whose connections should be retrieved
|
|
20
|
+
*
|
|
21
|
+
* @returns A promise that resolves when all user connections have been fetched and stored locally
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Fetch all connections for user with ID 123
|
|
26
|
+
* await GetAllUserConnections(123);
|
|
27
|
+
*
|
|
28
|
+
* // User connections are now available in ConnectionData
|
|
29
|
+
* const userConnections = ConnectionData.GetAllConnections();
|
|
30
|
+
*
|
|
31
|
+
* // Connections are also indexed in the dictionary for fast lookup
|
|
32
|
+
* const connection = ConnectionData.GetConnectionFromDictionary(connectionId);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* This function performs dual storage operations for each connection:
|
|
37
|
+
* 1. AddConnection - Adds to the main connection collection
|
|
38
|
+
* 2. AddToDictionary - Indexes in a dictionary for O(1) lookup by connection ID
|
|
39
|
+
*
|
|
40
|
+
* Errors are logged with the prefix 'Get all user Connections error' and are re-thrown
|
|
41
|
+
* to allow calling code to handle failures appropriately.
|
|
42
|
+
*
|
|
43
|
+
* @throws Will throw an error if the network request fails or if the server returns an error response
|
|
44
|
+
*
|
|
45
|
+
* @see ConnectionData.AddConnection for how connections are stored
|
|
46
|
+
* @see ConnectionData.AddToDictionary for connection indexing details
|
|
47
|
+
* @see GetRequestHeader for request header configuration
|
|
48
|
+
*/
|
|
1
49
|
export declare function GetAllUserConnections(userId: number): Promise<void>;
|