mftsccs-node 0.0.57 → 0.0.59

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.
Files changed (182) hide show
  1. package/README.md +1148 -11
  2. package/dist/bundle.js +1 -1
  3. package/dist/types/Api/Create/CreateTheCharacter.d.ts +42 -0
  4. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +50 -0
  5. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +51 -0
  6. package/dist/types/Api/Create/CreateTheTextData.d.ts +56 -0
  7. package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +43 -0
  8. package/dist/types/Api/DeleteConnectionApiBulk.d.ts +55 -0
  9. package/dist/types/Api/DeleteTheConcept.d.ts +64 -0
  10. package/dist/types/Api/DeleteTheConnection.d.ts +76 -0
  11. package/dist/types/Api/GetAiData.d.ts +36 -0
  12. package/dist/types/Api/GetAllConcepts.d.ts +42 -0
  13. package/dist/types/Api/GetAllConceptsByType.d.ts +45 -0
  14. package/dist/types/Api/GetAllConnections.d.ts +48 -0
  15. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +79 -0
  16. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +90 -0
  17. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +52 -0
  18. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +61 -0
  19. package/dist/types/Api/GetAllPrefetchConnections.d.ts +51 -0
  20. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +31 -0
  21. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +39 -0
  22. package/dist/types/Api/GetConcept.d.ts +47 -0
  23. package/dist/types/Api/GetConceptBulk.d.ts +68 -0
  24. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +75 -0
  25. package/dist/types/Api/GetConceptByCharacterValue.d.ts +47 -0
  26. package/dist/types/Api/GetConnection.d.ts +49 -0
  27. package/dist/types/Api/GetConnectionBulk.d.ts +46 -0
  28. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +50 -0
  29. package/dist/types/Api/GetConnectionToTheConcept.d.ts +56 -0
  30. package/dist/types/Api/GetReservedConnectionIds.d.ts +36 -0
  31. package/dist/types/Api/GetReservedIds.d.ts +37 -0
  32. package/dist/types/Api/Login.d.ts +38 -0
  33. package/dist/types/Api/MakeTheNameInBackend.d.ts +39 -0
  34. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +40 -0
  35. package/dist/types/Api/RecursiveSearch.d.ts +43 -0
  36. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +46 -0
  37. package/dist/types/Api/Search/Search.d.ts +67 -0
  38. package/dist/types/Api/Search/SearchInternalApi.d.ts +69 -0
  39. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +90 -0
  40. package/dist/types/Api/Search/SearchWithLinker.d.ts +97 -0
  41. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +39 -0
  42. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +47 -0
  43. package/dist/types/Api/Session/CreateSession.d.ts +45 -0
  44. package/dist/types/Api/Session/CreateSessionVisit.d.ts +43 -0
  45. package/dist/types/Api/Signin.d.ts +48 -0
  46. package/dist/types/Api/Signup.d.ts +44 -0
  47. package/dist/types/Api/View/ViewInternalDataApi.d.ts +50 -0
  48. package/dist/types/Constants/ApiConstants.d.ts +226 -0
  49. package/dist/types/Constants/FormatConstants.d.ts +81 -0
  50. package/dist/types/DataStructures/BaseUrl.d.ts +210 -0
  51. package/dist/types/DataStructures/BinaryCharacterTree.d.ts +211 -0
  52. package/dist/types/DataStructures/BinaryTree.d.ts +139 -0
  53. package/dist/types/DataStructures/BinaryTypeTree.d.ts +196 -0
  54. package/dist/types/DataStructures/CharacterRepository.d.ts +109 -0
  55. package/dist/types/DataStructures/Composition/Composition.d.ts +103 -0
  56. package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +104 -0
  57. package/dist/types/DataStructures/Composition/CompositionNode.d.ts +202 -0
  58. package/dist/types/DataStructures/Concept.d.ts +110 -0
  59. package/dist/types/DataStructures/ConceptData.d.ts +292 -0
  60. package/dist/types/DataStructures/ConceptsToDraw.d.ts +168 -0
  61. package/dist/types/DataStructures/Connection.d.ts +76 -0
  62. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +115 -0
  63. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +169 -0
  64. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +82 -0
  65. package/dist/types/DataStructures/ConnectionData.d.ts +191 -0
  66. package/dist/types/DataStructures/Count/CountInfo.d.ts +73 -0
  67. package/dist/types/DataStructures/FilterSearch.d.ts +84 -0
  68. package/dist/types/DataStructures/IdentifierFlags.d.ts +34 -0
  69. package/dist/types/DataStructures/Local/LConcept.d.ts +105 -0
  70. package/dist/types/DataStructures/Local/LConnection.d.ts +83 -0
  71. package/dist/types/DataStructures/Local/LNode.d.ts +190 -0
  72. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +133 -0
  73. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +135 -0
  74. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +147 -0
  75. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +100 -0
  76. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +109 -0
  77. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +89 -0
  78. package/dist/types/DataStructures/PatcherStructure.d.ts +86 -0
  79. package/dist/types/DataStructures/ReferentInfo.d.ts +68 -0
  80. package/dist/types/DataStructures/ReservedIds.d.ts +101 -0
  81. package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +184 -22
  82. package/dist/types/DataStructures/Responses/StandardResponses.d.ts +65 -0
  83. package/dist/types/DataStructures/Returner.d.ts +59 -0
  84. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +165 -0
  85. package/dist/types/DataStructures/Search/SearchStructure.d.ts +69 -0
  86. package/dist/types/DataStructures/SearchQuery.d.ts +130 -0
  87. package/dist/types/DataStructures/Security/TokenStorage.d.ts +48 -0
  88. package/dist/types/DataStructures/Session/SessionData.d.ts +118 -0
  89. package/dist/types/DataStructures/SettingData.d.ts +32 -0
  90. package/dist/types/DataStructures/Settings.d.ts +27 -0
  91. package/dist/types/DataStructures/SigninModel.d.ts +50 -0
  92. package/dist/types/DataStructures/SignupModel.d.ts +50 -0
  93. package/dist/types/DataStructures/SyncData.d.ts +206 -0
  94. package/dist/types/DataStructures/TheCharacter.d.ts +87 -0
  95. package/dist/types/DataStructures/TheTexts.d.ts +92 -0
  96. package/dist/types/DataStructures/Transaction/Transaction.d.ts +294 -4
  97. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +117 -0
  98. package/dist/types/DataStructures/User/UserNode.d.ts +130 -0
  99. package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
  100. package/dist/types/Database/NoIndexDb.d.ts +169 -0
  101. package/dist/types/Database/indexdblocal.d.ts +42 -0
  102. package/dist/types/Database/indexeddb.d.ts +43 -0
  103. package/dist/types/Drawing/ConceptDraw.d.ts +28 -0
  104. package/dist/types/Drawing/ConceptEvents.d.ts +46 -0
  105. package/dist/types/Helpers/CheckIfExists.d.ts +159 -0
  106. package/dist/types/Helpers/RemoveFromArray.d.ts +66 -0
  107. package/dist/types/Helpers/UniqueInsert.d.ts +28 -0
  108. package/dist/types/Services/CheckForConnectionDeletion.d.ts +190 -0
  109. package/dist/types/Services/Common/DecodeCountInfo.d.ts +54 -0
  110. package/dist/types/Services/Common/ErrorPosting.d.ts +49 -0
  111. package/dist/types/Services/Common/RegexFunction.d.ts +28 -0
  112. package/dist/types/Services/Composition/BuildComposition.d.ts +37 -0
  113. package/dist/types/Services/Composition/CompositionCache.d.ts +89 -0
  114. package/dist/types/Services/Composition/CreateCompositionCache.d.ts +43 -0
  115. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +83 -0
  116. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +38 -0
  117. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +42 -0
  118. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +206 -0
  119. package/dist/types/Services/CreateDefaultConcept.d.ts +114 -0
  120. package/dist/types/Services/CreateTheComposition.d.ts +101 -0
  121. package/dist/types/Services/CreateTheConcept.d.ts +179 -0
  122. package/dist/types/Services/CreateTheConnection.d.ts +59 -0
  123. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +127 -0
  124. package/dist/types/Services/CreateTypeTreeFromData.d.ts +43 -0
  125. package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +52 -5
  126. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +57 -9
  127. package/dist/types/Services/DeleteConcept.d.ts +136 -0
  128. package/dist/types/Services/DeleteConnection.d.ts +194 -0
  129. package/dist/types/Services/FindConeceptsFromConnection.d.ts +179 -0
  130. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +157 -0
  131. package/dist/types/Services/GenerateHexNumber.d.ts +64 -0
  132. package/dist/types/Services/GetComposition.d.ts +331 -0
  133. package/dist/types/Services/GetCompositionBulk.d.ts +251 -3
  134. package/dist/types/Services/GetCompositionList.d.ts +130 -0
  135. package/dist/types/Services/GetConceptByCharacter.d.ts +84 -0
  136. package/dist/types/Services/GetConnections.d.ts +72 -0
  137. package/dist/types/Services/GetDataFromIndexDb.d.ts +79 -0
  138. package/dist/types/Services/GetLink.d.ts +104 -0
  139. package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +99 -0
  140. package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +57 -0
  141. package/dist/types/Services/GetRelation.d.ts +162 -0
  142. package/dist/types/Services/GetTheConcept.d.ts +71 -0
  143. package/dist/types/Services/GetTheReferent.d.ts +74 -0
  144. package/dist/types/Services/InitializeSystem.d.ts +119 -0
  145. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +48 -0
  146. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +49 -0
  147. package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +54 -0
  148. package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +60 -0
  149. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +70 -0
  150. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +58 -0
  151. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +56 -0
  152. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +103 -0
  153. package/dist/types/Services/Local/GetCompositionLocal.d.ts +96 -0
  154. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +57 -0
  155. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +71 -0
  156. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +89 -0
  157. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +71 -0
  158. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +101 -0
  159. package/dist/types/Services/MakeTheCharacter.d.ts +74 -0
  160. package/dist/types/Services/MakeTheCharacterData.d.ts +65 -0
  161. package/dist/types/Services/MakeTheInstanceConcept.d.ts +75 -0
  162. package/dist/types/Services/MakeTheName.d.ts +81 -0
  163. package/dist/types/Services/MakeTheTimestamp.d.ts +68 -0
  164. package/dist/types/Services/MakeTheTypeConcept.d.ts +68 -0
  165. package/dist/types/Services/Mqtt/publishMessage.d.ts +27 -0
  166. package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
  167. package/dist/types/Services/PatchComposition.d.ts +105 -0
  168. package/dist/types/Services/Search/DataIdFormat.d.ts +96 -24
  169. package/dist/types/Services/Search/FormatData.d.ts +92 -17
  170. package/dist/types/Services/Search/JustIdFormat.d.ts +91 -16
  171. package/dist/types/Services/Search/NewFormat.d.ts +4 -0
  172. package/dist/types/Services/Search/SearchLinkInternal.d.ts +28 -0
  173. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +58 -0
  174. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +92 -24
  175. package/dist/types/Services/Search/orderingConnections.d.ts +34 -0
  176. package/dist/types/Services/SplitStrings.d.ts +50 -0
  177. package/dist/types/Services/UpdateComposition.d.ts +123 -0
  178. package/dist/types/Services/User/UserTranslation.d.ts +102 -0
  179. package/dist/types/Services/View/ViewInternalData.d.ts +32 -0
  180. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +140 -5
  181. package/dist/types/app.d.ts +72 -1
  182. package/package.json +1 -1
@@ -1,2 +1,49 @@
1
+ /**
2
+ * Module for retrieving concepts by their character value string.
3
+ * Provides lookup functionality for concepts using their character identifier without type restrictions.
4
+ *
5
+ * @module Api/GetConceptByCharacterValue
6
+ * @see https://documentation.freeschema.com for character value system details
7
+ */
1
8
  import { Concept } from "../DataStructures/Concept";
9
+ /**
10
+ * Retrieves a concept by its character value string identifier.
11
+ * This function performs a type-agnostic lookup, returning the first concept matching the character value.
12
+ *
13
+ * @param characterValue - The character string identifier of the concept to retrieve
14
+ * @returns A promise that resolves to the Concept object, or a default concept if not found
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Fetch a concept by its character value
19
+ * const concept = await GetConceptByCharacterValue("username");
20
+ * if (concept.id > 0) {
21
+ * console.log(`Found concept with ID: ${concept.id}`);
22
+ * } else {
23
+ * console.log("Concept not found");
24
+ * }
25
+ * ```
26
+ *
27
+ * @remarks
28
+ * This function provides a simplified lookup mechanism:
29
+ *
30
+ * 1. Makes a direct API call with the character_value parameter
31
+ * 2. Does not check local cache before making the request
32
+ * 3. Automatically caches successful results in ConceptsData
33
+ * 4. Returns a default concept (id = 0) if not found or on error
34
+ *
35
+ * Key characteristics:
36
+ * - Uses form-urlencoded content type for the POST request
37
+ * - Only caches concepts with id > 0 (valid concepts)
38
+ * - Does not throw errors on HTTP failure, only logs them
39
+ * - Simpler than GetConceptByCharacterAndType as it doesn't consider type
40
+ *
41
+ * Use this when you know the character value uniquely identifies a concept,
42
+ * or when type information is not available or relevant.
43
+ *
44
+ * @see Concept for the structure of concept objects
45
+ * @see CreateDefaultConcept for default concept structure
46
+ * @see GetConceptByCharacterAndType for character+type lookup
47
+ * @see ConceptsData.AddConcept for caching mechanism
48
+ */
2
49
  export declare function GetConceptByCharacterValue(characterValue: string): Promise<Concept>;
@@ -1,2 +1,51 @@
1
+ /**
2
+ * Module for retrieving individual connections from the CCS system.
3
+ * Provides caching and optimized retrieval of Connection objects by their unique identifiers.
4
+ *
5
+ * @module Api/GetConnection
6
+ * @see https://documentation.freeschema.com for connection details
7
+ */
1
8
  import { Connection } from "../DataStructures/Connection";
9
+ /**
10
+ * Retrieves a connection by its unique ID with automatic caching.
11
+ * Connections represent relationships between concepts in the CCS system.
12
+ *
13
+ * @param id - The unique numeric identifier of the connection to retrieve
14
+ * @returns A promise that resolves to the Connection object
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Fetch a connection by ID
19
+ * const connection = await GetConnection(456);
20
+ * if (connection.id !== 0) {
21
+ * console.log(`Connection from ${connection.ofTheConceptId} to ${connection.toTheConceptId}`);
22
+ * }
23
+ * ```
24
+ *
25
+ * @remarks
26
+ * This function implements a two-tier retrieval strategy:
27
+ *
28
+ * 1. Local Cache Check: First attempts to retrieve the connection from
29
+ * ConnectionData cache using GetConnection().
30
+ *
31
+ * 2. API Fallback: If not found in cache (id = 0), makes an API request
32
+ * to fetch the connection from the server.
33
+ *
34
+ * 3. Automatic Caching: Successfully retrieved connections are cached in
35
+ * ConnectionData for future lookups.
36
+ *
37
+ * Key characteristics:
38
+ * - Uses form-urlencoded content type for POST request
39
+ * - Always returns a Connection object (default has id = 0 if not found)
40
+ * - Errors are logged but propagated to caller
41
+ * - Does not implement request deduplication (unlike GetConcept)
42
+ *
43
+ * Connections are fundamental to the CCS system, linking concepts together
44
+ * and forming the relationship graph that defines knowledge structure.
45
+ *
46
+ * @see Connection for the structure of connection objects
47
+ * @see ConnectionData.GetConnection for cache retrieval
48
+ * @see ConnectionData.AddConnection for caching mechanism
49
+ * @see GetConnectionBulk for retrieving multiple connections efficiently
50
+ */
2
51
  export declare function GetConnection(id: number): Promise<Connection>;
@@ -1,2 +1,48 @@
1
+ /**
2
+ * Module for bulk retrieval of connections from the CCS system.
3
+ * Provides optimized batch fetching of multiple connections in a single API request.
4
+ *
5
+ * @module Api/GetConnectionBulk
6
+ * @see https://documentation.freeschema.com for bulk connection operations
7
+ */
1
8
  import { Connection } from "../DataStructures/Connection";
9
+ /**
10
+ * Retrieves multiple connections in a single optimized API request.
11
+ * This function checks the local cache first and only fetches uncached connections from the API.
12
+ *
13
+ * @param connectionIds - Array of connection IDs to retrieve (defaults to empty array)
14
+ * @returns A promise that resolves to an array of Connection objects
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Fetch multiple connections at once
19
+ * const connections = await GetConnectionBulk([101, 102, 103, 104]);
20
+ * connections.forEach(conn => {
21
+ * console.log(`Connection ${conn.id}: ${conn.ofTheConceptId} -> ${conn.toTheConceptId}`);
22
+ * });
23
+ * ```
24
+ *
25
+ * @remarks
26
+ * Performance optimization strategy:
27
+ * 1. Checks ConnectionData cache for each requested connection ID
28
+ * 2. Immediately includes cached connections in results
29
+ * 3. Batches all uncached IDs into a single bulk API request
30
+ * 4. Caches all newly fetched connections for future use
31
+ * 5. Automatically fetches related concepts via FindConceptsFromConnections
32
+ * 6. Returns empty array if all connections are cached or if none requested
33
+ *
34
+ * This function provides significant performance benefits:
35
+ * - Reduces network overhead by batching API requests
36
+ * - Avoids redundant fetches through cache checking
37
+ * - Proactively loads related concepts to prevent N+1 query problems
38
+ *
39
+ * The automatic concept fetching ensures that when you have connections,
40
+ * you also have the concepts they connect, enabling immediate relationship
41
+ * traversal without additional API calls.
42
+ *
43
+ * @see Connection for the structure of connection objects
44
+ * @see ConnectionData.AddConnection for caching mechanism
45
+ * @see GetConnection for single connection retrieval
46
+ * @see FindConceptsFromConnections for automatic concept loading
47
+ */
2
48
  export declare function GetConnectionBulk(connectionIds?: number[]): Promise<Connection[]>;
@@ -1,2 +1,52 @@
1
+ /**
2
+ * Module for retrieving outgoing connections from a specific concept.
3
+ * Provides paginated access to connections where a concept is the source (ofTheConcept).
4
+ *
5
+ * @module Api/GetConnectionOfTheConcept
6
+ * @see https://documentation.freeschema.com for connection direction details
7
+ */
1
8
  import { Connection } from "../DataStructures/Connection";
9
+ /**
10
+ * Retrieves all connections originating from a specific concept with pagination support.
11
+ * Returns connections where the specified concept is the source (ofTheConcept).
12
+ *
13
+ * @param typeId - The type ID to filter connections by connection type
14
+ * @param ofTheConceptId - The ID of the source concept whose outgoing connections to retrieve
15
+ * @param userId - The user ID for access control and filtering
16
+ * @param inpage - Number of connections per page (default: 10)
17
+ * @param page - Page number for pagination, 1-indexed (default: 1)
18
+ * @returns A promise that resolves to an array of Connection objects
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // Get first 10 connections of type 5 from concept 100 for user 1
23
+ * const connections = await GetConnectionOfTheConcept(5, 100, 1);
24
+ * console.log(`Found ${connections.length} outgoing connections`);
25
+ *
26
+ * // Get second page with 20 connections per page
27
+ * const moreConnections = await GetConnectionOfTheConcept(5, 100, 1, 20, 2);
28
+ * ```
29
+ *
30
+ * @remarks
31
+ * Connection Direction:
32
+ * This function retrieves "outgoing" or "from" connections where the specified
33
+ * concept is the source. In the CCS graph model, these represent relationships
34
+ * initiated by or originating from the concept.
35
+ *
36
+ * Pagination:
37
+ * - Uses 1-based page numbering (page 1 is the first page)
38
+ * - Results are limited by the inpage parameter
39
+ * - Useful for large result sets to avoid loading all connections at once
40
+ *
41
+ * Filtering:
42
+ * - typeId filters connections by their type/relationship kind
43
+ * - userId enables user-specific visibility and access control
44
+ *
45
+ * The function does NOT automatically cache results in ConnectionData,
46
+ * unlike GetConnection or GetConnectionBulk. It returns the raw API response.
47
+ *
48
+ * @see Connection for the structure of connection objects
49
+ * @see GetConnectionToTheConcept for retrieving incoming connections
50
+ * @see GetConnectionBulk for bulk connection retrieval with caching
51
+ */
2
52
  export declare function GetConnectionOfTheConcept(typeId: number, ofTheConceptId: number, userId: number, inpage?: number, page?: number): Promise<Connection[]>;
@@ -1,2 +1,58 @@
1
+ /**
2
+ * Module for retrieving incoming connections to a specific concept.
3
+ * Provides paginated access to connections where a concept is the target (toTheConcept).
4
+ *
5
+ * @module Api/GetConnectionToTheConcept
6
+ * @see https://documentation.freeschema.com for connection direction details
7
+ */
1
8
  import { Connection } from "../DataStructures/Connection";
9
+ /**
10
+ * Retrieves all connections pointing to a specific concept with pagination support.
11
+ * Returns connections where the specified concept is the target (toTheConcept).
12
+ *
13
+ * @param typeId - The type ID to filter connections by connection type
14
+ * @param toTheConceptId - The ID of the target concept whose incoming connections to retrieve
15
+ * @param userId - The user ID for access control and filtering
16
+ * @param inpage - Number of connections per page (default: 10)
17
+ * @param page - Page number for pagination, 1-indexed (default: 1)
18
+ * @returns A promise that resolves to an array of Connection objects
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // Get first 10 connections of type 3 pointing to concept 200 for user 1
23
+ * const connections = await GetConnectionToTheConcept(3, 200, 1);
24
+ * console.log(`Found ${connections.length} incoming connections`);
25
+ *
26
+ * // Get second page with 20 connections per page
27
+ * const moreConnections = await GetConnectionToTheConcept(3, 200, 1, 20, 2);
28
+ * ```
29
+ *
30
+ * @remarks
31
+ * Connection Direction:
32
+ * This function retrieves "incoming" or "to" connections where the specified
33
+ * concept is the target. In the CCS graph model, these represent relationships
34
+ * directed toward or pointing to the concept.
35
+ *
36
+ * Use Cases:
37
+ * - Finding all concepts that reference a specific concept
38
+ * - Discovering backlinks or reverse relationships
39
+ * - Building bidirectional relationship navigation
40
+ * - Analyzing concept dependencies
41
+ *
42
+ * Pagination:
43
+ * - Uses 1-based page numbering (page 1 is the first page)
44
+ * - Results are limited by the inpage parameter
45
+ * - Useful for large result sets to avoid loading all connections at once
46
+ *
47
+ * Filtering:
48
+ * - typeId filters connections by their type/relationship kind
49
+ * - userId enables user-specific visibility and access control
50
+ *
51
+ * The function does NOT automatically cache results in ConnectionData,
52
+ * unlike GetConnection or GetConnectionBulk. It returns the raw API response.
53
+ *
54
+ * @see Connection for the structure of connection objects
55
+ * @see GetConnectionOfTheConcept for retrieving outgoing connections
56
+ * @see GetConnectionBulk for bulk connection retrieval with caching
57
+ */
2
58
  export declare function GetConnectionToTheConcept(typeId: number, toTheConceptId: number, userId: number, inpage?: number, page?: number): Promise<Connection[]>;
@@ -1 +1,37 @@
1
+ /**
2
+ * API module for fetching reserved connection IDs from the backend.
3
+ * Manages a pool of pre-allocated connection IDs to optimize performance when creating connections.
4
+ *
5
+ * @module Api/GetReservedConnectionIds
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ /**
9
+ * Fetches reserved connection IDs from the backend and stores them in the local pool.
10
+ * Uses a queue-based system to prevent simultaneous requests and maintains a minimum
11
+ * threshold of available IDs.
12
+ *
13
+ * This function is critical for maintaining a pool of pre-allocated connection IDs,
14
+ * which improves performance by avoiding the need to request IDs individually when
15
+ * creating new connections in the Concept Connection System.
16
+ *
17
+ * @returns A promise that resolves when the IDs are successfully fetched and stored
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Ensure reserved connection IDs are available
22
+ * await GetReservedConnectionIds();
23
+ *
24
+ * // Now IDs can be consumed from ReservedConnectionIds.connectionIds
25
+ * const id = ReservedConnectionIds.GetId();
26
+ * ```
27
+ *
28
+ * @remarks
29
+ * - Skips fetching if more than 10 IDs are already available
30
+ * - Uses a queue system to serialize requests and prevent concurrent fetches
31
+ * - Automatically refills the pool when it runs low
32
+ * - Errors are logged but the promise is rejected to allow proper error handling
33
+ *
34
+ * @see ReservedConnectionIds for the storage data structure
35
+ * @see GetReservedIds for fetching regular concept IDs
36
+ */
1
37
  export declare function GetReservedConnectionIds(): Promise<void>;
@@ -1 +1,38 @@
1
+ /**
2
+ * API module for fetching reserved concept IDs from the backend.
3
+ * Manages a pool of pre-allocated concept IDs to optimize performance when creating new concepts.
4
+ *
5
+ * @module Api/GetReservedIds
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ /**
9
+ * Fetches reserved concept IDs from the backend and stores them in the local pool.
10
+ * Uses a queue-based system to prevent simultaneous requests and maintains a minimum
11
+ * threshold of available IDs.
12
+ *
13
+ * This function is essential for maintaining a pool of pre-allocated concept IDs,
14
+ * which significantly improves performance by avoiding the need to request IDs
15
+ * individually when creating new concepts in the Concept Connection System.
16
+ *
17
+ * @returns A promise that resolves when the IDs are successfully fetched and stored
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Ensure reserved concept IDs are available
22
+ * await GetReservedIds();
23
+ *
24
+ * // Now IDs can be consumed from ReservedIds.ids
25
+ * const id = ReservedIds.GetId();
26
+ * ```
27
+ *
28
+ * @remarks
29
+ * - Skips fetching if more than 10 IDs are already available
30
+ * - Uses a queue system to serialize requests and prevent concurrent fetches
31
+ * - Automatically refills the pool when it runs low during concept creation
32
+ * - Errors are logged with the endpoint URL for debugging purposes
33
+ * - The promise is rejected on error to allow proper error handling
34
+ *
35
+ * @see ReservedIds for the storage data structure
36
+ * @see GetReservedConnectionIds for fetching connection IDs
37
+ */
1
38
  export declare function GetReservedIds(): Promise<void>;
@@ -1 +1,39 @@
1
+ /**
2
+ * API module for user authentication and login functionality.
3
+ * Handles user login by validating credentials against the backend and storing the access token.
4
+ *
5
+ * @module Api/Login
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ /**
9
+ * Authenticates a user with the backend using email and password credentials.
10
+ * Upon successful authentication, stores the bearer access token for subsequent API requests.
11
+ *
12
+ * This function is used for logging existing users into the Concept Connection System,
13
+ * enabling them to perform authenticated operations such as creating and modifying concepts.
14
+ *
15
+ * @param email - The user's email address used for authentication
16
+ * @param password - The user's password for authentication
17
+ * @returns A promise that resolves to the login response containing user data and token, or undefined on error
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Login an existing user
22
+ * const result = await LoginToBackend('user@example.com', 'securePassword123');
23
+ * if (result) {
24
+ * console.log('Login successful:', result.data);
25
+ * // Token is automatically stored in TokenStorage.BearerAccessToken
26
+ * }
27
+ * ```
28
+ *
29
+ * @remarks
30
+ * - The bearer access token is automatically stored in TokenStorage.BearerAccessToken upon successful login
31
+ * - HTTP errors are handled through HandleHttpError for consistent error reporting
32
+ * - The function returns undefined if the response is not OK
33
+ * - Errors are logged to console and re-thrown for caller handling
34
+ *
35
+ * @see Signin for an alternative login implementation
36
+ * @see Signup for user registration
37
+ * @see TokenStorage for token management
38
+ */
1
39
  export declare function LoginToBackend(email: string, password: string): Promise<any>;
@@ -1 +1,40 @@
1
+ /**
2
+ * API module for creating named concept entries in the backend.
3
+ * Registers concept names (referents) with their associated type information in the system.
4
+ *
5
+ * @module Api/MakeTheNameInBackend
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ /**
9
+ * Creates a named concept entry in the backend by associating a referent (name) with a concept ID.
10
+ * This function registers the human-readable name for a concept along with its type classification.
11
+ *
12
+ * In the Concept Connection System, concepts are identified by numeric IDs, but they also need
13
+ * human-readable names (referents). This function establishes that association in the backend.
14
+ *
15
+ * @param newConceptId - The unique identifier of the concept being named
16
+ * @param referent - The human-readable name or label for the concept
17
+ * @param typeId - The type category ID that classifies this concept
18
+ * @param typeUserId - The user ID associated with the type
19
+ * @returns A promise that resolves when the name is successfully registered
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Create a named concept for "John Doe" as a person type
24
+ * await MakeTheNameInBackend(
25
+ * 12345, // newConceptId
26
+ * 'John Doe', // referent
27
+ * 999, // typeId for 'person'
28
+ * 1 // typeUserId
29
+ * );
30
+ * ```
31
+ *
32
+ * @remarks
33
+ * - This function does not return a value on success, only throws on error
34
+ * - HTTP errors are handled through HandleHttpError
35
+ * - Requires authentication via GetRequestHeader
36
+ * - Errors are logged and re-thrown for caller handling
37
+ *
38
+ * @see MakeTheTypeConceptApi for creating type concepts
39
+ */
1
40
  export declare function MakeTheNameInBackend(newConceptId: number, referent: string, typeId: number, typeUserId: number): Promise<void>;
@@ -1,2 +1,42 @@
1
+ /**
2
+ * API module for creating and retrieving type concepts.
3
+ * Type concepts define the categories and classifications used in the Concept Connection System.
4
+ *
5
+ * @module Api/MakeTheTypeConceptApi
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
1
8
  import { Concept } from "../DataStructures/Concept";
9
+ /**
10
+ * Retrieves or creates a type concept based on a string identifier.
11
+ * Type concepts are special concepts that define categories for other concepts in the system.
12
+ *
13
+ * This function first attempts to find an existing type concept locally, then queries the backend
14
+ * if not found. If the concept doesn't exist in the backend, it creates a new type concept.
15
+ * The function uses caching to prevent duplicate requests for the same type.
16
+ *
17
+ * @param type - The string identifier for the type concept (e.g., "the_person", "the_location")
18
+ * @param userId - The user ID associated with the request
19
+ * @returns A promise that resolves to the Concept object representing the type
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Get or create a "person" type concept
24
+ * const personType = await MakeTheTypeConceptApi('the_person', 123);
25
+ * console.log('Person type ID:', personType.id);
26
+ *
27
+ * // Use the type concept when creating new concepts
28
+ * const newPerson = await CreateConcept('John Doe', personType.id);
29
+ * ```
30
+ *
31
+ * @remarks
32
+ * - Uses local caching to prevent duplicate simultaneous requests
33
+ * - First searches for existing concept via GetConceptByCharacterAndCategory
34
+ * - Creates new type concept in backend if not found or if typeId is 4 (unknown type)
35
+ * - Automatically adds the retrieved concept to ConceptsData for local access
36
+ * - Cache entries are cleaned up after the fetch completes
37
+ * - Returns a default concept with id=0 if errors occur
38
+ *
39
+ * @see GetConceptByCharacterAndCategory for local concept searching
40
+ * @see MakeTheNameInBackend for creating named concepts
41
+ */
2
42
  export declare function MakeTheTypeConceptApi(type: string, userId: number): Promise<Concept>;
@@ -1 +1,44 @@
1
+ /**
2
+ * API module for performing recursive searches through concept compositions.
3
+ * Enables complex queries that traverse concept relationships and compositions.
4
+ *
5
+ * @module Api/RecursiveSearch
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ /**
9
+ * Performs a recursive search through concept compositions using specified filters.
10
+ * This function searches through the network of concepts, following composition relationships
11
+ * and filtering by linker types and text content.
12
+ *
13
+ * Recursive search is a powerful feature of the Concept Connection System that allows
14
+ * navigation through complex concept hierarchies. It can find all concepts within a composition,
15
+ * filtered by specific relationship types (linkers) and text search terms.
16
+ *
17
+ * @param composition - The composition ID to search within (0 for global search)
18
+ * @param listLinkers - Array of linker type strings to filter connections (e.g., ['is_a', 'has_property'])
19
+ * @param textSearch - Text string to search for within concept names/properties
20
+ * @returns A promise that resolves to an array of concepts matching the search criteria
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Search for all concepts within composition 100 that have 'is_a' relationships
25
+ * const results = await RecursiveSearchApi(100, ['is_a']);
26
+ *
27
+ * // Search for concepts containing "person" in composition 200
28
+ * const personResults = await RecursiveSearchApi(200, [], 'person');
29
+ *
30
+ * // Combined search with linkers and text
31
+ * const filtered = await RecursiveSearchApi(300, ['has_property', 'located_at'], 'building');
32
+ * ```
33
+ *
34
+ * @remarks
35
+ * - Returns an empty array if the search fails or no results are found
36
+ * - The function retrieves both internal and external connections
37
+ * - Results are processed through GetCompositionFromConnectionsWithDataId to build full concept objects
38
+ * - HTTP errors are handled through HandleHttpError
39
+ * - Errors are logged and re-thrown for caller handling
40
+ *
41
+ * @see SearchQuery for the query data structure
42
+ * @see GetCompositionFromConnectionsWithDataId for result processing
43
+ */
1
44
  export declare function RecursiveSearchApi(composition?: number, listLinkers?: string[], textSearch?: string): Promise<any[]>;
@@ -1,2 +1,48 @@
1
+ /**
2
+ * Freeschema Query API module for executing flexible schema-based queries.
3
+ * This module provides functionality to query concepts using the Freeschema query language,
4
+ * which allows for dynamic and flexible data retrieval from the Concept Connection System.
5
+ *
6
+ * @module Api/Search/FreeschemaQueryApi
7
+ * @see https://documentation.freeschema.com for Freeschema query syntax and examples
8
+ */
1
9
  import { FreeschemaQuery } from "../../DataStructures/Search/FreeschemaQuery";
10
+ /**
11
+ * Executes a Freeschema query to retrieve concepts from the CCS backend.
12
+ * This function sends a POST request with a FreeschemaQuery object to perform
13
+ * flexible, schema-independent queries on the concept database. The Freeschema
14
+ * query language enables complex filtering, nested searches, and dynamic property
15
+ * access across different concept types.
16
+ *
17
+ * @param query - The FreeschemaQuery object containing query parameters, filters, and search criteria
18
+ * @param token - Optional authentication token for authorized access (defaults to empty string for public queries)
19
+ * @returns Promise resolving to an array of matching concepts, or empty array on error
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Search for concepts with specific properties
24
+ * const query: FreeschemaQuery = {
25
+ * type: "Person",
26
+ * filters: { age: { $gt: 18 } },
27
+ * limit: 10
28
+ * };
29
+ * const results = await FreeschemaQueryApi(query, "auth-token-123");
30
+ * console.log(`Found ${results.length} matching concepts`);
31
+ * ```
32
+ *
33
+ * @remarks
34
+ * This function handles both HTTP errors and internal exceptions gracefully:
35
+ * - HTTP errors are logged and handled via HandleHttpError
36
+ * - Internal errors are caught and reported via HandleInternalError
37
+ * - Returns empty array on any failure to prevent null reference errors
38
+ *
39
+ * The Freeschema query system is particularly useful for:
40
+ * - Cross-composition searches
41
+ * - Dynamic property filtering
42
+ * - Complex relationship traversal
43
+ * - Type-independent queries
44
+ *
45
+ * @see SearchAllConcepts for simpler search operations
46
+ * @see SearchWithLinker for linked concept searches
47
+ */
2
48
  export declare function FreeschemaQueryApi(query: FreeschemaQuery, token?: string): Promise<any>;
@@ -1 +1,68 @@
1
+ /**
2
+ * Search API module for querying concepts across compositions.
3
+ * This module provides the primary search functionality for the Concept Connection System,
4
+ * enabling users to search for concepts by type, name, and composition with pagination support.
5
+ *
6
+ * @module Api/Search/Search
7
+ * @see https://documentation.freeschema.com for search query patterns and best practices
8
+ */
9
+ /**
10
+ * Searches for concepts across specified compositions with pagination.
11
+ * This is the primary search function for retrieving concepts based on type,
12
+ * search text, and composition. It performs a GET request with URL-encoded
13
+ * parameters to find matching concepts in the CCS database.
14
+ *
15
+ * @param type - The concept type to search for (e.g., "Person", "Organization", "Document")
16
+ * @param search - The search text to match against concept names or properties
17
+ * @param composition - The composition ID or name to search within
18
+ * @param token - Authentication token for authorized access
19
+ * @param inpage - Number of results per page (defaults to 10)
20
+ * @param page - Page number for pagination, starting from 1 (defaults to 1)
21
+ * @returns Promise resolving to an array of matching concepts, or empty array on error
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Search for Person concepts in a specific composition
26
+ * const results = await SearchAllConcepts(
27
+ * "Person",
28
+ * "John",
29
+ * "my-composition-123",
30
+ * "auth-token-456",
31
+ * 20, // 20 results per page
32
+ * 1 // first page
33
+ * );
34
+ * console.log(`Found ${results.length} matching persons`);
35
+ * ```
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * // Search with default pagination
40
+ * const results = await SearchAllConcepts(
41
+ * "Document",
42
+ * "report",
43
+ * "documents-composition",
44
+ * authToken
45
+ * );
46
+ * // Returns first 10 results by default
47
+ * ```
48
+ *
49
+ * @remarks
50
+ * This function uses URL-encoded parameters for the GET request, which is ideal for
51
+ * simple search operations. For more complex queries, consider using FreeschemaQueryApi.
52
+ *
53
+ * Error handling:
54
+ * - HTTP errors are handled via HandleHttpError and logged
55
+ * - Network errors are caught, logged, and re-thrown
56
+ * - Returns empty array on HTTP errors, throws exception on network errors
57
+ *
58
+ * Pagination:
59
+ * - Results are paginated server-side
60
+ * - Use 'inpage' to control page size
61
+ * - Use 'page' to navigate through results
62
+ * - Page numbers start at 1, not 0
63
+ *
64
+ * @see FreeschemaQueryApi for complex queries
65
+ * @see SearchInternalApi for searching within internal compositions
66
+ * @see SearchWithLinker for linked concept searches
67
+ */
1
68
  export declare function SearchAllConcepts(type: string, search: string, composition: string, token: string, inpage?: number, page?: number): Promise<any>;