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,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
+ */
37
+ export declare function GetReservedConnectionIds(): Promise<void>;
@@ -0,0 +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
+ */
38
+ export declare function GetReservedIds(): Promise<void>;
@@ -0,0 +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
+ */
39
+ export declare function LoginToBackend(email: string, password: string): Promise<any>;
@@ -0,0 +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
+ */
40
+ export declare function MakeTheNameInBackend(newConceptId: number, referent: string, typeId: number, typeUserId: number): Promise<void>;
@@ -0,0 +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
+ */
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
+ */
42
+ export declare function MakeTheTypeConceptApi(type: string, userId: number): Promise<Concept>;
@@ -0,0 +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
+ */
44
+ export declare function RecursiveSearchApi(composition?: number, listLinkers?: string[], textSearch?: string): Promise<any[]>;
@@ -0,0 +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
+ */
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
+ */
48
+ export declare function FreeschemaQueryApi(query: FreeschemaQuery, token?: string): Promise<any>;
@@ -0,0 +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
+ */
68
+ export declare function SearchAllConcepts(type: string, search: string, composition: string, token: string, inpage?: number, page?: number): Promise<any>;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Internal Search API module for querying concepts within nested compositions.
3
+ * This module provides specialized search functionality for searching concepts that exist
4
+ * within internal (nested) compositions, enabling hierarchical concept retrieval in the
5
+ * Concept Connection System.
6
+ *
7
+ * @module Api/Search/SearchInternalApi
8
+ * @see https://documentation.freeschema.com for internal composition structure and search patterns
9
+ */
10
+ import { SearchStructure } from "../../app";
11
+ /**
12
+ * Searches for concepts within internal (nested) compositions with authentication.
13
+ * This function enables searching for concepts that are part of internal compositions,
14
+ * which are compositions nested within other compositions. It performs a GET request
15
+ * with query parameters to search both the parent composition and internal composition.
16
+ *
17
+ * @param search - SearchStructure object containing all search parameters including composition, internal composition, type, search text, and pagination
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 from the internal composition, or empty array on error
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Search for concepts in an internal composition
24
+ * const searchParams: SearchStructure = {
25
+ * composition: "parent-composition-123",
26
+ * internalComposition: "nested-composition-456",
27
+ * type: "Task",
28
+ * search: "urgent",
29
+ * inpage: 15,
30
+ * page: 1
31
+ * };
32
+ * const results = await SearchInternalApi(searchParams, "auth-token-789");
33
+ * console.log(`Found ${results.length} urgent tasks in nested composition`);
34
+ * ```
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * // Search in a deeply nested composition structure
39
+ * const searchParams: SearchStructure = {
40
+ * composition: "organization",
41
+ * internalComposition: "department.team.projects",
42
+ * type: "Project",
43
+ * search: "active",
44
+ * inpage: 10,
45
+ * page: 1
46
+ * };
47
+ * const activeProjects = await SearchInternalApi(searchParams, authToken);
48
+ * ```
49
+ *
50
+ * @remarks
51
+ * This function is specifically designed for hierarchical concept structures where
52
+ * compositions can contain other compositions. It's particularly useful for:
53
+ * - Searching within organizational hierarchies
54
+ * - Querying nested data structures
55
+ * - Accessing concepts in private or protected sub-compositions
56
+ * - Filtering results within specific composition contexts
57
+ *
58
+ * Error handling:
59
+ * - HTTP errors are logged with status and handled via HandleHttpError
60
+ * - Network errors are caught, logged, and re-thrown
61
+ * - Returns empty array on HTTP errors to prevent null reference issues
62
+ *
63
+ * Query construction:
64
+ * - All parameters are URL-encoded as query strings
65
+ * - The URL pattern: ?composition=X&search=Y&internalComposition=Z&type=T&inpage=N&page=P
66
+ * - Uses authenticated CCS endpoint for secure access
67
+ *
68
+ * @see SearchAllConcepts for searching in top-level compositions
69
+ * @see FreeschemaQueryApi for complex nested queries
70
+ */
71
+ export declare function SearchInternalApi(search: SearchStructure, token?: string): Promise<any>;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Search Link Multiple API module for executing batch searches across multiple queries.
3
+ * This module provides functionality to search for concepts using multiple search queries
4
+ * in a single API call, optimizing performance for applications that need to retrieve
5
+ * related or linked concepts efficiently.
6
+ *
7
+ * @module Api/Search/SearchLinkMultipleApi
8
+ * @see https://documentation.freeschema.com for batch search patterns and optimization techniques
9
+ */
10
+ import { SearchQuery } from '../../DataStructures/SearchQuery';
11
+ /**
12
+ * Executes multiple search queries in a single API call to retrieve linked concepts.
13
+ * This function sends an array of SearchQuery objects to the backend, which processes
14
+ * all queries and returns the combined results. This is significantly more efficient
15
+ * than making individual API calls for each query, especially when searching for
16
+ * related or linked concepts.
17
+ *
18
+ * @param searchQuery - Array of SearchQuery objects, each containing search parameters for a specific query
19
+ * @param token - Optional authentication token for authorized access (defaults to empty string for public queries)
20
+ * @returns Promise resolving to an array of search results (one result set per query), or empty array on error
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Search for multiple related concepts simultaneously
25
+ * const queries: SearchQuery[] = [
26
+ * {
27
+ * type: "Person",
28
+ * search: "John",
29
+ * composition: "users",
30
+ * inpage: 10,
31
+ * page: 1
32
+ * },
33
+ * {
34
+ * type: "Organization",
35
+ * search: "Company",
36
+ * composition: "organizations",
37
+ * inpage: 5,
38
+ * page: 1
39
+ * },
40
+ * {
41
+ * type: "Document",
42
+ * search: "contract",
43
+ * composition: "documents",
44
+ * inpage: 20,
45
+ * page: 1
46
+ * }
47
+ * ];
48
+ * const results = await SearchLinkMultipleApi(queries, "auth-token-123");
49
+ * console.log(`Retrieved ${results.length} result sets`);
50
+ * ```
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * // Search for a person and their associated data in one call
55
+ * const linkedQueries: SearchQuery[] = [
56
+ * { type: "Person", search: "Alice", composition: "main", inpage: 1, page: 1 },
57
+ * { type: "Post", search: "Alice", composition: "social", inpage: 10, page: 1 },
58
+ * { type: "Comment", search: "Alice", composition: "social", inpage: 10, page: 1 }
59
+ * ];
60
+ * const [person, posts, comments] = await SearchLinkMultipleApi(linkedQueries, token);
61
+ * ```
62
+ *
63
+ * @remarks
64
+ * This function is optimized for scenarios where you need to:
65
+ * - Retrieve multiple related concepts in a single request
66
+ * - Reduce network round-trips and improve performance
67
+ * - Maintain consistency across related queries (all executed at the same time)
68
+ * - Search for linked or connected concepts efficiently
69
+ *
70
+ * Performance benefits:
71
+ * - Single HTTP connection instead of multiple
72
+ * - Reduced network latency
73
+ * - Server-side query optimization
74
+ * - Atomic execution of all queries
75
+ *
76
+ * Error handling:
77
+ * - HTTP errors are logged with status and handled via HandleHttpError
78
+ * - Network errors are caught, logged, and re-thrown
79
+ * - Returns empty array on HTTP errors to prevent null reference issues
80
+ * - If any query fails, the entire operation returns an empty array
81
+ *
82
+ * Query execution:
83
+ * - All queries are executed server-side
84
+ * - Results maintain the same order as input queries
85
+ * - Each query can have different pagination settings
86
+ * - Each query is independent but executed atomically
87
+ *
88
+ * @see SearchWithLinker for alternative batch search with linker functionality
89
+ * @see SearchAllConcepts for single concept searches
90
+ * @see FreeschemaQueryApi for complex queries
91
+ */
92
+ export declare function SearchLinkMultipleApi(searchQuery: SearchQuery[], token?: string): Promise<any>;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Search With Linker API module for executing linked searches across related concepts.
3
+ * This module provides functionality to search for concepts with automatic link resolution,
4
+ * enabling efficient retrieval of connected concepts and their relationships in the
5
+ * Concept Connection System. The linker functionality automatically resolves and includes
6
+ * related concepts based on defined relationships.
7
+ *
8
+ * @module Api/Search/SearchWithLinker
9
+ * @see https://documentation.freeschema.com for linker patterns and relationship traversal
10
+ */
11
+ import { SearchQuery } from '../../DataStructures/SearchQuery';
12
+ /**
13
+ * Executes multiple search queries with automatic link resolution and relationship traversal.
14
+ * This function searches for concepts while automatically resolving and including linked
15
+ * concepts based on defined relationships. The linker functionality intelligently follows
16
+ * concept connections, providing a complete view of related data in a single API call.
17
+ *
18
+ * @param searchQuery - Array of SearchQuery objects defining search criteria and relationship paths to follow
19
+ * @param token - Optional authentication token for authorized access (defaults to empty string for public queries)
20
+ * @returns Promise resolving to an array of search results with linked concepts resolved, or empty array on error
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Search for a person and automatically include their related concepts
25
+ * const queries: SearchQuery[] = [
26
+ * {
27
+ * type: "Person",
28
+ * search: "John Doe",
29
+ * composition: "users",
30
+ * inpage: 1,
31
+ * page: 1
32
+ * }
33
+ * ];
34
+ * // The linker will automatically include related organizations, posts, etc.
35
+ * const results = await SearchWithLinker(queries, "auth-token-123");
36
+ * console.log("Person with all linked data:", results);
37
+ * ```
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // Search for multiple concepts with link resolution
42
+ * const queries: SearchQuery[] = [
43
+ * {
44
+ * type: "Project",
45
+ * search: "Alpha",
46
+ * composition: "projects",
47
+ * inpage: 5,
48
+ * page: 1
49
+ * },
50
+ * {
51
+ * type: "Team",
52
+ * search: "Engineering",
53
+ * composition: "teams",
54
+ * inpage: 5,
55
+ * page: 1
56
+ * }
57
+ * ];
58
+ * // Results will include projects with linked tasks, team members, etc.
59
+ * const linkedResults = await SearchWithLinker(queries, token);
60
+ * ```
61
+ *
62
+ * @remarks
63
+ * The SearchWithLinker function differs from SearchLinkMultipleApi by automatically
64
+ * resolving concept relationships and including linked concepts in the results.
65
+ * This is particularly useful for:
66
+ * - Retrieving complete object graphs in one call
67
+ * - Following relationship chains automatically
68
+ * - Reducing the need for multiple follow-up queries
69
+ * - Building comprehensive views of related data
70
+ *
71
+ * Link resolution behavior:
72
+ * - Automatically follows defined relationships between concepts
73
+ * - Includes linked concepts in the response
74
+ * - Respects composition boundaries and access controls
75
+ * - Optimizes server-side to prevent N+1 query problems
76
+ *
77
+ * Performance considerations:
78
+ * - More comprehensive than simple searches but single round-trip
79
+ * - Server-side optimization for relationship traversal
80
+ * - May return larger payloads due to included linked concepts
81
+ * - Ideal for reducing client-side data fetching complexity
82
+ *
83
+ * Error handling:
84
+ * - HTTP errors are logged with status and handled via HandleHttpError
85
+ * - Network errors are caught, logged, and re-thrown
86
+ * - Returns empty array on HTTP errors to maintain consistent error handling
87
+ * - Link resolution errors are handled gracefully server-side
88
+ *
89
+ * Use cases:
90
+ * - Building detailed profile views with all related data
91
+ * - Dashboard displays requiring multiple related entities
92
+ * - Report generation needing complete relationship graphs
93
+ * - Mobile applications minimizing network requests
94
+ *
95
+ * @see SearchLinkMultipleApi for batch searches without automatic link resolution
96
+ * @see SearchAllConcepts for simple single-concept searches
97
+ * @see FreeschemaQueryApi for custom relationship queries
98
+ */
99
+ export declare function SearchWithLinker(searchQuery: SearchQuery[], token?: string): Promise<any>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * API module for searching concepts by their character value and category.
3
+ * Retrieves concepts from the backend based on their character representation.
4
+ *
5
+ * @module Api/SearchConcept/GetConceptByCharacterAndCategoryApi
6
+ * @see https://documentation.freeschema.com for reference
7
+ */
8
+ import { Concept } from "../../DataStructures/Concept";
9
+ /**
10
+ * Retrieves a concept from the backend by its character value.
11
+ * The character value is a string representation that uniquely identifies a concept.
12
+ *
13
+ * This function queries the backend for a concept matching the provided character value,
14
+ * automatically determining the appropriate category. Retrieved concepts are added to
15
+ * the local ConceptsData cache for faster subsequent access.
16
+ *
17
+ * @param characterValue - The character string identifying the concept (e.g., "the_person", "john_doe")
18
+ * @returns A promise that resolves to the matching Concept object, or a default concept if not found
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * // Find a concept by its character value
23
+ * const concept = await GetConceptByCharacterAndCategoryApi('the_person');
24
+ * if (concept.id !== 0) {
25
+ * console.log('Found concept:', concept.characterValue);
26
+ * } else {
27
+ * console.log('Concept not found');
28
+ * }
29
+ * ```
30
+ *
31
+ * @remarks
32
+ * - Returns a default concept (id=0) if the concept is not found or an error occurs
33
+ * - Automatically caches the retrieved concept in ConceptsData
34
+ * - HTTP errors are handled through HandleHttpError but do not throw
35
+ * - Errors are logged to console and re-thrown for caller handling
36
+ *
37
+ * @see GetConceptByCharacterAndCategoryDirectApi for searching with explicit category
38
+ * @see CreateDefaultConcept for the default concept structure
39
+ * @see ConceptsData for the local concept cache
40
+ */
41
+ export declare function GetConceptByCharacterAndCategoryApi(characterValue: string): Promise<Concept>;