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.
Files changed (188) hide show
  1. package/README.md +1148 -11
  2. package/dist/bundle.js +1 -0
  3. package/dist/types/Api/Create/CreateTheCharacter.d.ts +45 -0
  4. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +52 -0
  5. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +53 -0
  6. package/dist/types/Api/Create/CreateTheTextData.d.ts +58 -0
  7. package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +44 -0
  8. package/dist/types/Api/DeleteConnectionApiBulk.d.ts +56 -0
  9. package/dist/types/Api/DeleteTheConcept.d.ts +65 -0
  10. package/dist/types/Api/DeleteTheConnection.d.ts +77 -0
  11. package/dist/types/Api/GetAiData.d.ts +37 -0
  12. package/dist/types/Api/GetAllConcepts.d.ts +43 -0
  13. package/dist/types/Api/GetAllConceptsByType.d.ts +46 -0
  14. package/dist/types/Api/GetAllConnections.d.ts +49 -0
  15. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +82 -0
  16. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +93 -0
  17. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +54 -0
  18. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +63 -0
  19. package/dist/types/Api/GetAllPrefetchConnections.d.ts +52 -0
  20. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +33 -0
  21. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +41 -0
  22. package/dist/types/Api/GetConcept.d.ts +49 -0
  23. package/dist/types/Api/GetConceptBulk.d.ts +71 -0
  24. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +78 -0
  25. package/dist/types/Api/GetConceptByCharacterValue.d.ts +49 -0
  26. package/dist/types/Api/GetConnection.d.ts +51 -0
  27. package/dist/types/Api/GetConnectionBulk.d.ts +48 -0
  28. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +52 -0
  29. package/dist/types/Api/GetConnectionToTheConcept.d.ts +58 -0
  30. package/dist/types/Api/GetReservedConnectionIds.d.ts +37 -0
  31. package/dist/types/Api/GetReservedIds.d.ts +38 -0
  32. package/dist/types/Api/Login.d.ts +39 -0
  33. package/dist/types/Api/MakeTheNameInBackend.d.ts +40 -0
  34. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +42 -0
  35. package/dist/types/Api/RecursiveSearch.d.ts +44 -0
  36. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +48 -0
  37. package/dist/types/Api/Search/Search.d.ts +68 -0
  38. package/dist/types/Api/Search/SearchInternalApi.d.ts +71 -0
  39. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +92 -0
  40. package/dist/types/Api/Search/SearchWithLinker.d.ts +99 -0
  41. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +41 -0
  42. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +49 -0
  43. package/dist/types/Api/Session/CreateSession.d.ts +47 -0
  44. package/dist/types/Api/Session/CreateSessionVisit.d.ts +44 -0
  45. package/dist/types/Api/Signin.d.ts +51 -0
  46. package/dist/types/Api/Signup.d.ts +47 -0
  47. package/dist/types/Api/View/ViewInternalDataApi.d.ts +51 -0
  48. package/dist/types/Constants/ApiConstants.d.ts +249 -0
  49. package/dist/types/Constants/FormatConstants.d.ts +87 -0
  50. package/dist/types/DataStructures/BaseUrl.d.ts +262 -0
  51. package/dist/types/DataStructures/BinaryCharacterTree.d.ts +227 -0
  52. package/dist/types/DataStructures/BinaryTree.d.ts +151 -0
  53. package/dist/types/DataStructures/BinaryTypeTree.d.ts +211 -0
  54. package/dist/types/DataStructures/CharacterRepository.d.ts +117 -0
  55. package/dist/types/DataStructures/Composition/Composition.d.ts +117 -0
  56. package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +114 -0
  57. package/dist/types/DataStructures/Composition/CompositionNode.d.ts +223 -0
  58. package/dist/types/DataStructures/Concept.d.ts +139 -0
  59. package/dist/types/DataStructures/ConceptData.d.ts +317 -0
  60. package/dist/types/DataStructures/ConceptsToDraw.d.ts +179 -0
  61. package/dist/types/DataStructures/Connection.d.ts +103 -0
  62. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +126 -0
  63. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +193 -0
  64. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +95 -0
  65. package/dist/types/DataStructures/ConnectionData.d.ts +209 -0
  66. package/dist/types/DataStructures/Count/CountInfo.d.ts +79 -0
  67. package/dist/types/DataStructures/FilterSearch.d.ts +93 -0
  68. package/dist/types/DataStructures/IdentifierFlags.d.ts +45 -0
  69. package/dist/types/DataStructures/Local/LConcept.d.ts +126 -0
  70. package/dist/types/DataStructures/Local/LConnection.d.ts +101 -0
  71. package/dist/types/DataStructures/Local/LNode.d.ts +217 -0
  72. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +145 -0
  73. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +147 -0
  74. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +160 -0
  75. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +114 -0
  76. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +125 -0
  77. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +103 -0
  78. package/dist/types/DataStructures/Node.d.ts +29 -0
  79. package/dist/types/DataStructures/PatcherStructure.d.ts +94 -0
  80. package/dist/types/DataStructures/ReferentInfo.d.ts +75 -0
  81. package/dist/types/DataStructures/ReservedIds.d.ts +111 -0
  82. package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +236 -0
  83. package/dist/types/DataStructures/Responses/StandardResponses.d.ts +71 -0
  84. package/dist/types/DataStructures/Returner.d.ts +66 -0
  85. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +187 -0
  86. package/dist/types/DataStructures/Search/SearchStructure.d.ts +78 -0
  87. package/dist/types/DataStructures/SearchQuery.d.ts +146 -0
  88. package/dist/types/DataStructures/Security/TokenStorage.d.ts +51 -0
  89. package/dist/types/DataStructures/Session/SessionData.d.ts +131 -0
  90. package/dist/types/DataStructures/SettingData.d.ts +37 -0
  91. package/dist/types/DataStructures/Settings.d.ts +31 -0
  92. package/dist/types/DataStructures/SigninModel.d.ts +54 -0
  93. package/dist/types/DataStructures/SignupModel.d.ts +54 -0
  94. package/dist/types/DataStructures/SyncData.d.ts +232 -0
  95. package/dist/types/DataStructures/TheCharacter.d.ts +100 -0
  96. package/dist/types/DataStructures/TheTexts.d.ts +106 -0
  97. package/dist/types/DataStructures/Transaction/Transaction.d.ts +320 -0
  98. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +132 -0
  99. package/dist/types/DataStructures/User/UserNode.d.ts +150 -0
  100. package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
  101. package/dist/types/Database/NoIndexDb.d.ts +178 -0
  102. package/dist/types/Database/indexdblocal.d.ts +45 -0
  103. package/dist/types/Database/indexeddb.d.ts +46 -0
  104. package/dist/types/Drawing/ConceptDraw.d.ts +29 -0
  105. package/dist/types/Drawing/ConceptEvents.d.ts +47 -0
  106. package/dist/types/Helpers/CheckIfExists.d.ts +169 -0
  107. package/dist/types/Helpers/RemoveFromArray.d.ts +72 -0
  108. package/dist/types/Helpers/UniqueInsert.d.ts +29 -0
  109. package/dist/types/Services/CheckForConnectionDeletion.d.ts +193 -0
  110. package/dist/types/Services/Common/DecodeCountInfo.d.ts +57 -0
  111. package/dist/types/Services/Common/ErrorPosting.d.ts +51 -0
  112. package/dist/types/Services/Common/RegexFunction.d.ts +29 -0
  113. package/dist/types/Services/Composition/BuildComposition.d.ts +40 -0
  114. package/dist/types/Services/Composition/CompositionCache.d.ts +93 -0
  115. package/dist/types/Services/Composition/CreateCompositionCache.d.ts +46 -0
  116. package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +5 -0
  117. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +90 -0
  118. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +39 -0
  119. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +43 -0
  120. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +211 -0
  121. package/dist/types/Services/CreateDefaultConcept.d.ts +117 -0
  122. package/dist/types/Services/CreateTheComposition.d.ts +103 -0
  123. package/dist/types/Services/CreateTheConcept.d.ts +184 -0
  124. package/dist/types/Services/CreateTheConnection.d.ts +61 -0
  125. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +132 -0
  126. package/dist/types/Services/CreateTypeTreeFromData.d.ts +44 -0
  127. package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +60 -0
  128. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +64 -0
  129. package/dist/types/Services/DeleteConcept.d.ts +137 -0
  130. package/dist/types/Services/DeleteConnection.d.ts +196 -0
  131. package/dist/types/Services/FindConeceptsFromConnection.d.ts +181 -0
  132. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +159 -0
  133. package/dist/types/Services/GenerateHexNumber.d.ts +65 -0
  134. package/dist/types/Services/GetAccessIdOfUser.d.ts +0 -0
  135. package/dist/types/Services/GetComposition.d.ts +342 -0
  136. package/dist/types/Services/GetCompositionBulk.d.ts +259 -0
  137. package/dist/types/Services/GetCompositionList.d.ts +132 -0
  138. package/dist/types/Services/GetConceptByCharacter.d.ts +87 -0
  139. package/dist/types/Services/GetConnections.d.ts +74 -0
  140. package/dist/types/Services/GetDataFromIndexDb.d.ts +81 -0
  141. package/dist/types/Services/GetLink.d.ts +107 -0
  142. package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +102 -0
  143. package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +59 -0
  144. package/dist/types/Services/GetRelation.d.ts +167 -0
  145. package/dist/types/Services/GetTheConcept.d.ts +73 -0
  146. package/dist/types/Services/GetTheReferent.d.ts +76 -0
  147. package/dist/types/Services/InitializeSystem.d.ts +121 -0
  148. package/dist/types/Services/Local/CreateConnectionListFromDatat.d.ts +0 -0
  149. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +50 -0
  150. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +50 -0
  151. package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +55 -0
  152. package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +61 -0
  153. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +72 -0
  154. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +60 -0
  155. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +58 -0
  156. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +105 -0
  157. package/dist/types/Services/Local/GetCompositionLocal.d.ts +98 -0
  158. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +58 -0
  159. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +73 -0
  160. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +91 -0
  161. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +73 -0
  162. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +103 -0
  163. package/dist/types/Services/MakeTheCharacter.d.ts +76 -0
  164. package/dist/types/Services/MakeTheCharacterData.d.ts +67 -0
  165. package/dist/types/Services/MakeTheConcept.d.ts +2 -0
  166. package/dist/types/Services/MakeTheInstanceConcept.d.ts +78 -0
  167. package/dist/types/Services/MakeTheLocalConcept.d.ts +0 -0
  168. package/dist/types/Services/MakeTheName.d.ts +83 -0
  169. package/dist/types/Services/MakeTheTimestamp.d.ts +70 -0
  170. package/dist/types/Services/MakeTheTypeConcept.d.ts +71 -0
  171. package/dist/types/Services/Mqtt/publishMessage.d.ts +28 -0
  172. package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
  173. package/dist/types/Services/PatchComposition.d.ts +107 -0
  174. package/dist/types/Services/Search/DataIdFormat.d.ts +104 -0
  175. package/dist/types/Services/Search/FormatData.d.ts +101 -0
  176. package/dist/types/Services/Search/JustIdFormat.d.ts +98 -0
  177. package/dist/types/Services/Search/SearchLinkInternal.d.ts +30 -0
  178. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +61 -0
  179. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +101 -0
  180. package/dist/types/Services/Search/orderingConnections.d.ts +36 -0
  181. package/dist/types/Services/Security/GetRequestHeader.d.ts +10 -0
  182. package/dist/types/Services/SplitStrings.d.ts +51 -0
  183. package/dist/types/Services/UpdateComposition.d.ts +125 -0
  184. package/dist/types/Services/User/UserTranslation.d.ts +108 -0
  185. package/dist/types/Services/View/ViewInternalData.d.ts +33 -0
  186. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +159 -0
  187. package/dist/types/app.d.ts +162 -0
  188. package/package.json +1 -1
@@ -0,0 +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
+ */
44
+ export declare function TrashTheConcept(id: number, token: string): Promise<void>;
@@ -0,0 +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
+ */
56
+ export default function DeleteTheConnectionBulkApi(ids: number[]): Promise<boolean>;
@@ -0,0 +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
+ */
65
+ export default function DeleteTheConcept(id: number, token?: string): Promise<boolean>;
@@ -0,0 +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
+ */
77
+ export default function DeleteTheConnection(id: number, token?: string): Promise<boolean>;
@@ -0,0 +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
+ */
37
+ export declare function GetAiData(): Promise<void>;
@@ -0,0 +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
+ */
43
+ export declare function GetAllUserConcepts(userId: number): Promise<void>;
@@ -0,0 +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
+ */
46
+ export declare function GetAllConceptsByType(type: string, userId: number): Promise<void>;
@@ -0,0 +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
+ */
49
+ export declare function GetAllUserConnections(userId: number): Promise<void>;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * API module for retrieving connections associated with a specific composition.
3
+ * This module handles both local caching and remote fetching of composition connections,
4
+ * with automatic synchronization and deletion detection.
5
+ *
6
+ * @module Api/GetAllConnectionsOfComposition
7
+ * @see https://documentation.freeschema.com for more information on the Concept Connection System
8
+ */
9
+ import { Connection } from '../DataStructures/Connection';
10
+ /**
11
+ * Retrieves all connections associated with a specific composition, using local cache when available.
12
+ * This function implements a smart caching strategy: it first checks for locally stored connections,
13
+ * and if found, fetches fresh data from the server to detect any deletions or changes. If no local
14
+ * data exists, it directly fetches from the server.
15
+ *
16
+ * A composition represents a group or collection of related concepts and their connections.
17
+ * This function ensures that all connections within a composition are available and synchronized
18
+ * with the remote server.
19
+ *
20
+ * @param composition_id - The unique identifier of the composition whose connections should be retrieved
21
+ *
22
+ * @returns A promise that resolves to an array of Connection objects belonging to the composition
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Fetch all connections for composition 456
27
+ * const connections = await GetAllConnectionsOfComposition(456);
28
+ *
29
+ * // Process the connections
30
+ * connections.forEach(conn => {
31
+ * console.log(`Connection: ${conn.id} links concepts`);
32
+ * });
33
+ * ```
34
+ *
35
+ * @remarks
36
+ * This function implements a two-step synchronization process:
37
+ * 1. First fetch: Retrieves from local cache if available
38
+ * 2. Online fetch: Always fetches fresh data from server
39
+ * 3. Deletion check: Compares old and new data to detect removed connections
40
+ *
41
+ * This approach ensures data consistency while maintaining local performance benefits.
42
+ *
43
+ * @see GetAllConnectionsOfCompositionOnline for the underlying server fetch operation
44
+ * @see CheckForConnectionDeletion for how deleted connections are detected
45
+ * @see ConnectionData.GetConnectionsOfCompositionLocal for local cache access
46
+ */
47
+ export declare function GetAllConnectionsOfComposition(composition_id: number): Promise<Connection[]>;
48
+ /**
49
+ * Fetches connections for a specific composition directly from the remote server.
50
+ * This function bypasses local caching and always retrieves fresh data from the backend,
51
+ * making it suitable for ensuring data accuracy and detecting server-side changes.
52
+ *
53
+ * All retrieved connections are automatically added to the local ConnectionData store
54
+ * for subsequent use throughout the application.
55
+ *
56
+ * @param composition_id - The unique identifier of the composition whose connections should be fetched
57
+ *
58
+ * @returns A promise that resolves to an array of Connection objects retrieved from the server
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * // Fetch fresh connections directly from server
63
+ * const connections = await GetAllConnectionsOfCompositionOnline(456);
64
+ *
65
+ * // Compare with cached data
66
+ * const cachedConnections = await ConnectionData.GetConnectionsOfCompositionLocal(456);
67
+ * ```
68
+ *
69
+ * @remarks
70
+ * This is the underlying server communication function used by GetAllConnectionsOfComposition.
71
+ * It should generally not be called directly unless you specifically need to bypass caching
72
+ * and force a fresh server fetch.
73
+ *
74
+ * Each retrieved connection is added to ConnectionData, making it available for local queries
75
+ * and reducing the need for subsequent server requests.
76
+ *
77
+ * @throws Will throw an error if the network request fails or if the server returns an error response
78
+ *
79
+ * @see GetAllConnectionsOfComposition for the recommended high-level function with caching
80
+ * @see ConnectionData.AddConnection for how connections are stored locally
81
+ */
82
+ export declare function GetAllConnectionsOfCompositionOnline(composition_id: number): Promise<Connection[]>;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * API module for retrieving connections for multiple compositions in a single bulk operation.
3
+ * This module optimizes performance by fetching connections for multiple compositions at once,
4
+ * with automatic synchronization, deletion detection, and concept resolution.
5
+ *
6
+ * @module Api/GetAllConnectionsOfCompositionBulk
7
+ * @see https://documentation.freeschema.com for more information on the Concept Connection System
8
+ */
9
+ import { Connection } from '../DataStructures/Connection';
10
+ /**
11
+ * Retrieves connections for multiple compositions in a single bulk operation for improved performance.
12
+ * This function fetches connections for multiple composition IDs at once, checks for deletions by
13
+ * comparing with in-memory data, and automatically resolves all referenced concepts.
14
+ *
15
+ * Bulk operations are significantly more efficient than individual requests when working with
16
+ * multiple compositions, reducing network overhead and improving application responsiveness.
17
+ *
18
+ * @param composition_ids - Array of composition IDs whose connections should be retrieved. Defaults to empty array.
19
+ *
20
+ * @returns A promise that resolves to an array of Connection objects from all specified compositions
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Fetch connections for multiple compositions at once
25
+ * const compositionIds = [100, 200, 300];
26
+ * const connections = await GetAllConnectionsOfCompositionBulk(compositionIds);
27
+ *
28
+ * console.log(`Retrieved ${connections.length} connections`);
29
+ *
30
+ * // All referenced concepts are automatically fetched
31
+ * connections.forEach(conn => {
32
+ * console.log(`Connection ${conn.id} is ready with its concepts`);
33
+ * });
34
+ *
35
+ * // Handle empty array case
36
+ * const noConnections = await GetAllConnectionsOfCompositionBulk([]);
37
+ * console.log(noConnections); // Returns empty array
38
+ * ```
39
+ *
40
+ * @remarks
41
+ * This function performs several important operations:
42
+ * 1. Early return if composition_ids array is empty
43
+ * 2. Retrieves old connections from in-memory storage for comparison
44
+ * 3. Fetches fresh connections from server via bulk endpoint
45
+ * 4. Detects and handles deleted connections via CheckForConnectionDeletion
46
+ * 5. Automatically resolves all concepts referenced by the connections
47
+ *
48
+ * The automatic concept resolution ensures that all concepts referenced in the connections
49
+ * are available locally, preventing the need for additional lookups.
50
+ *
51
+ * @see GetAllConnectionsOfCompositionOnline for the underlying bulk server fetch
52
+ * @see FindConnectionsOfCompositionsBulkInMemory for in-memory lookup
53
+ * @see FindConceptsFromConnections for automatic concept resolution
54
+ * @see CheckForConnectionDeletion for deletion detection logic
55
+ */
56
+ export declare function GetAllConnectionsOfCompositionBulk(composition_ids?: number[]): Promise<Connection[]>;
57
+ /**
58
+ * Fetches connections for multiple compositions directly from the remote server in a single request.
59
+ * This function bypasses local caching and retrieves fresh data from the bulk endpoint,
60
+ * which is optimized for handling multiple composition IDs efficiently.
61
+ *
62
+ * All retrieved connections are automatically added to the local ConnectionData store
63
+ * for subsequent use throughout the application.
64
+ *
65
+ * @param composition_ids - Array of composition IDs to fetch connections for. Defaults to empty array.
66
+ *
67
+ * @returns A promise that resolves to an array of Connection objects retrieved from the server
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * // Fetch connections for multiple compositions from server
72
+ * const connections = await GetAllConnectionsOfCompositionOnline([100, 200, 300]);
73
+ *
74
+ * // Process the bulk results
75
+ * console.log(`Fetched ${connections.length} connections from server`);
76
+ * ```
77
+ *
78
+ * @remarks
79
+ * This is the underlying server communication function for bulk composition queries.
80
+ * It uses JSON serialization for the request body to send the array of composition IDs,
81
+ * and the server returns all connections for those compositions in a single response.
82
+ *
83
+ * The function handles both successful and error responses gracefully, logging appropriate
84
+ * error messages with the prefix 'Get all connections of composition bulk error message'.
85
+ *
86
+ * Each retrieved connection is added to ConnectionData, making it available for local queries.
87
+ *
88
+ * @throws Will throw an error if the network request fails or if the server returns an error response
89
+ *
90
+ * @see GetAllConnectionsOfCompositionBulk for the recommended high-level function
91
+ * @see ConnectionData.AddConnection for how connections are stored locally
92
+ */
93
+ export declare function GetAllConnectionsOfCompositionOnline(composition_ids?: number[]): Promise<Connection[]>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * API module for retrieving all linker connections originating from a specific concept.
3
+ * This module fetches outbound linker connections where the specified concept acts as the source,
4
+ * enabling navigation and analysis of concept relationships in the forward direction.
5
+ *
6
+ * @module Api/GetAllLinkerConnectionsFromTheConcept
7
+ * @see https://documentation.freeschema.com for more information on the Concept Connection System
8
+ */
9
+ import { Connection } from "../DataStructures/Connection";
10
+ /**
11
+ * Retrieves all linker connections that originate from a specific concept.
12
+ * This function fetches connections where the specified concept is the source (from-concept),
13
+ * allowing you to discover all concepts that this concept links to or relates with.
14
+ *
15
+ * Linker connections represent directed relationships in the concept graph, and this function
16
+ * specifically returns outbound connections where the given concept acts as the origin point.
17
+ * This is essential for graph traversal, relationship discovery, and understanding how a
18
+ * concept connects to other parts of the knowledge graph.
19
+ *
20
+ * @param conceptId - The unique identifier of the concept whose outbound linker connections should be retrieved
21
+ *
22
+ * @returns A promise that resolves to an array of Connection objects originating from the specified concept
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Get all connections from concept 789
27
+ * const outboundConnections = await GetAllLinkerConnectionsFromTheConcept(789);
28
+ *
29
+ * // Discover what this concept links to
30
+ * outboundConnections.forEach(connection => {
31
+ * console.log(`Concept 789 links to concept ${connection.toConceptId}`);
32
+ * });
33
+ *
34
+ * // Use for graph navigation
35
+ * async function traverseFromConcept(conceptId: number) {
36
+ * const connections = await GetAllLinkerConnectionsFromTheConcept(conceptId);
37
+ * return connections.map(conn => conn.toConceptId);
38
+ * }
39
+ * ```
40
+ *
41
+ * @remarks
42
+ * This function uses a GET request with the concept ID as a query parameter.
43
+ * Unlike some other API functions, it does not automatically add connections to ConnectionData,
44
+ * allowing the caller to decide how to handle the returned connections.
45
+ *
46
+ * The function returns an empty array if the request fails or if no connections are found.
47
+ * Errors are logged with the prefix 'Get all linker connection from the concepts error'.
48
+ *
49
+ * @throws Will throw an error if the network request fails or if the server returns an error response
50
+ *
51
+ * @see GetAllLinkerConnectionsToTheConcept for retrieving inbound connections to a concept
52
+ * @see Connection for the connection data structure
53
+ */
54
+ export declare function GetAllLinkerConnectionsFromTheConcept(conceptId: number): Promise<Connection[]>;