mftsccs-browser 2.1.239-dev → 2.1.240-dev

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 (272) hide show
  1. package/dist/main.bundle.js +404 -95
  2. package/dist/main.bundle.js.map +1 -1
  3. package/dist/serviceWorker.bundle.js +398 -94
  4. package/dist/serviceWorker.bundle.js.map +1 -1
  5. package/dist/types/AccessTracker/accessTracker.d.ts +67 -0
  6. package/dist/types/Anomaly/anomaly.d.ts +103 -0
  7. package/dist/types/Api/Create/CreateTheCharacter.d.ts +24 -0
  8. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +20 -0
  9. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +18 -0
  10. package/dist/types/Api/Create/CreateTheGhostConceptApi.d.ts +28 -0
  11. package/dist/types/Api/Create/CreateTheGhostConnectionApi.d.ts +18 -0
  12. package/dist/types/Api/Create/CreateTheTextData.d.ts +18 -0
  13. package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +14 -0
  14. package/dist/types/Api/Delete/DeleteUserInBackend.d.ts +19 -0
  15. package/dist/types/Api/DeleteConnectionBulkApi.d.ts +20 -0
  16. package/dist/types/Api/DeleteTheConcept.d.ts +20 -0
  17. package/dist/types/Api/DeleteTheConnection.d.ts +20 -0
  18. package/dist/types/Api/GetAiData.d.ts +10 -0
  19. package/dist/types/Api/GetAllConceptsByType.d.ts +12 -0
  20. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +23 -0
  21. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +23 -0
  22. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +12 -0
  23. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +12 -0
  24. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +12 -0
  25. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +13 -0
  26. package/dist/types/Api/GetConcept.d.ts +6 -0
  27. package/dist/types/Api/GetConceptBulk.d.ts +20 -0
  28. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +15 -0
  29. package/dist/types/Api/GetConceptByCharacterValue.d.ts +12 -0
  30. package/dist/types/Api/GetConnection.d.ts +15 -0
  31. package/dist/types/Api/GetConnectionBulk.d.ts +7 -0
  32. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +15 -0
  33. package/dist/types/Api/GetConnectionToTheConcept.d.ts +17 -0
  34. package/dist/types/Api/GetConnections/GetConnectionsBetweenApi.d.ts +40 -0
  35. package/dist/types/Api/GetConnections/GetConnectionsByTypeApi.d.ts +15 -0
  36. package/dist/types/Api/GetInstanceConceptByCharacterType.d.ts +9 -0
  37. package/dist/types/Api/GetReservedConnectionIds.d.ts +10 -0
  38. package/dist/types/Api/GetReservedIds.d.ts +10 -0
  39. package/dist/types/Api/Images/GetImages.d.ts +15 -0
  40. package/dist/types/Api/Local/GetLocalConceptByCharacterValue.d.ts +13 -0
  41. package/dist/types/Api/Login.d.ts +78 -0
  42. package/dist/types/Api/MakeTheNameInBackend.d.ts +14 -0
  43. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +9 -0
  44. package/dist/types/Api/Prototype/Selector.d.ts +26 -0
  45. package/dist/types/Api/RecursiveSearch.d.ts +67 -0
  46. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +18 -0
  47. package/dist/types/Api/Search/Search.d.ts +73 -0
  48. package/dist/types/Api/Search/SearchInternalApi.d.ts +28 -0
  49. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +15 -0
  50. package/dist/types/Api/Search/SearchWithLinker.d.ts +16 -0
  51. package/dist/types/Api/Search/SearchWithTypeAndLinker.d.ts +14 -0
  52. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +12 -0
  53. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +13 -0
  54. package/dist/types/Api/SearchConcept/GetTypeConceptByBulk.d.ts +15 -0
  55. package/dist/types/Api/Session/CreateSession.d.ts +16 -0
  56. package/dist/types/Api/Session/CreateSessionVisit.d.ts +12 -0
  57. package/dist/types/Api/Signin.d.ts +24 -0
  58. package/dist/types/Api/Signup.d.ts +61 -0
  59. package/dist/types/Api/Translate/TranslateLocalToReal.d.ts +12 -0
  60. package/dist/types/Api/View/ViewInternalDataApi.d.ts +15 -0
  61. package/dist/types/Constants/AccessConstants.d.ts +3 -0
  62. package/dist/types/Constants/ApiConstants.d.ts +23 -0
  63. package/dist/types/Constants/FormatConstants.d.ts +8 -0
  64. package/dist/types/Constants/ckeditorCSS.d.ts +1 -0
  65. package/dist/types/Constants/general.const.d.ts +6 -0
  66. package/dist/types/Constants/page.const.d.ts +5 -0
  67. package/dist/types/DataStructures/BaseUrl.d.ts +94 -0
  68. package/dist/types/DataStructures/BinaryCharacterTree.d.ts +16 -0
  69. package/dist/types/DataStructures/BinaryTree.d.ts +77 -0
  70. package/dist/types/DataStructures/BinaryTypeTree.d.ts +17 -0
  71. package/dist/types/DataStructures/CharacterRepository.d.ts +8 -0
  72. package/dist/types/DataStructures/Composition/Composition.d.ts +14 -0
  73. package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +10 -0
  74. package/dist/types/DataStructures/Composition/CompositionNode.d.ts +21 -0
  75. package/dist/types/DataStructures/Concept.d.ts +25 -0
  76. package/dist/types/DataStructures/ConceptData.d.ts +30 -0
  77. package/dist/types/DataStructures/ConceptsToDraw.d.ts +11 -0
  78. package/dist/types/DataStructures/Connection.d.ts +23 -0
  79. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +81 -0
  80. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +27 -0
  81. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionOfNode.d.ts +10 -0
  82. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionOfTheTree.d.ts +24 -0
  83. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeNode.d.ts +10 -0
  84. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +20 -0
  85. package/dist/types/DataStructures/ConnectionBinaryTree/NodePrimitive.d.ts +15 -0
  86. package/dist/types/DataStructures/ConnectionByType/GetConnectionByType.d.ts +4 -0
  87. package/dist/types/DataStructures/ConnectionData.d.ts +26 -0
  88. package/dist/types/DataStructures/Count/CountInfo.d.ts +6 -0
  89. package/dist/types/DataStructures/FetchConnection.d.ts +64 -0
  90. package/dist/types/DataStructures/FilterSearch.d.ts +9 -0
  91. package/dist/types/DataStructures/IdentifierFlags.d.ts +11 -0
  92. package/dist/types/DataStructures/Local/LConcept.d.ts +23 -0
  93. package/dist/types/DataStructures/Local/LConnection.d.ts +18 -0
  94. package/dist/types/DataStructures/Local/LNode.d.ts +29 -0
  95. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +13 -0
  96. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +13 -0
  97. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +13 -0
  98. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +21 -0
  99. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +20 -0
  100. package/dist/types/DataStructures/Local/LocalGhostIdTree.d.ts +11 -0
  101. package/dist/types/DataStructures/Local/LocalId.d.ts +19 -0
  102. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +33 -0
  103. package/dist/types/DataStructures/Node.d.ts +30 -0
  104. package/dist/types/DataStructures/PatcherStructure.d.ts +8 -0
  105. package/dist/types/DataStructures/Prototype/Prototype.d.ts +19 -0
  106. package/dist/types/DataStructures/Prototype/PrototypeOption.d.ts +4 -0
  107. package/dist/types/DataStructures/Prototype/QuerySelector.d.ts +4 -0
  108. package/dist/types/DataStructures/ReservedIds.d.ts +10 -0
  109. package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +74 -0
  110. package/dist/types/DataStructures/Responses/StandardResponses.d.ts +6 -0
  111. package/dist/types/DataStructures/Returner.d.ts +7 -0
  112. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +25 -0
  113. package/dist/types/DataStructures/Search/SearchStructure.d.ts +10 -0
  114. package/dist/types/DataStructures/SearchQuery.d.ts +17 -0
  115. package/dist/types/DataStructures/Security/SecureStorage.d.ts +14 -0
  116. package/dist/types/DataStructures/Security/TokenStorage.d.ts +24 -0
  117. package/dist/types/DataStructures/Session/SessionData.d.ts +13 -0
  118. package/dist/types/DataStructures/SettingData.d.ts +5 -0
  119. package/dist/types/DataStructures/Settings.d.ts +4 -0
  120. package/dist/types/DataStructures/SigninModel.d.ts +4 -0
  121. package/dist/types/DataStructures/SignupModel.d.ts +4 -0
  122. package/dist/types/DataStructures/SyncData.d.ts +14 -0
  123. package/dist/types/DataStructures/TheCharacter.d.ts +13 -0
  124. package/dist/types/DataStructures/TheTexts.d.ts +14 -0
  125. package/dist/types/DataStructures/TypeLibrary.d.ts +19 -0
  126. package/dist/types/DataStructures/TypeNode.d.ts +18 -0
  127. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +13 -0
  128. package/dist/types/DataStructures/User/UserNode.d.ts +18 -0
  129. package/dist/types/DataStructures/WidgetCache/WidgetCache.d.ts +10 -0
  130. package/dist/types/DataStructures/WidgetCache/WidgetDetails.d.ts +9 -0
  131. package/dist/types/DataStructures/WidgetCache/WidgetNode.d.ts +18 -0
  132. package/dist/types/DataStructures/environments/environments.d.ts +48 -0
  133. package/dist/types/Database/CacheDatabase.d.ts +57 -0
  134. package/dist/types/Database/IndexUpdate.d.ts +47 -0
  135. package/dist/types/Database/NoIndexDb.d.ts +9 -0
  136. package/dist/types/Database/indexdblocal.d.ts +43 -0
  137. package/dist/types/Database/indexeddb.d.ts +58 -0
  138. package/dist/types/Helpers/CheckIfExists.d.ts +9 -0
  139. package/dist/types/Helpers/RemoveFromArray.d.ts +5 -0
  140. package/dist/types/Helpers/UniqueInsert.d.ts +1 -0
  141. package/dist/types/Middleware/ApplicationMonitor.d.ts +14 -0
  142. package/dist/types/Middleware/logger.service.d.ts +144 -0
  143. package/dist/types/ServiceWorker/actions/connectionActions.d.ts +2 -0
  144. package/dist/types/ServiceWorker/actions/createActions.d.ts +2 -0
  145. package/dist/types/ServiceWorker/actions/deleteActions.d.ts +2 -0
  146. package/dist/types/ServiceWorker/actions/getActions.d.ts +2 -0
  147. package/dist/types/ServiceWorker/actions/index.d.ts +15 -0
  148. package/dist/types/ServiceWorker/actions/searchActions.d.ts +2 -0
  149. package/dist/types/ServiceWorker/actions/syncActions.d.ts +2 -0
  150. package/dist/types/ServiceWorker/actions/updateActions.d.ts +2 -0
  151. package/dist/types/ServiceWorker/index.d.ts +11 -0
  152. package/dist/types/Services/CacheClear.d.ts +7 -0
  153. package/dist/types/Services/CheckForConnectionDeletion.d.ts +3 -0
  154. package/dist/types/Services/Common/DecodeCountInfo.d.ts +3 -0
  155. package/dist/types/Services/Common/DelayFunction.d.ts +7 -0
  156. package/dist/types/Services/Common/ErrorPosting.d.ts +10 -0
  157. package/dist/types/Services/Common/MergeArrays.d.ts +7 -0
  158. package/dist/types/Services/Common/RegexFunction.d.ts +1 -0
  159. package/dist/types/Services/Common/RemoveAllChild.d.ts +1 -0
  160. package/dist/types/Services/Composition/BuildComposition.d.ts +3 -0
  161. package/dist/types/Services/Composition/CompositionCache.d.ts +4 -0
  162. package/dist/types/Services/Composition/CreateCompositionCache.d.ts +3 -0
  163. package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +5 -0
  164. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +5 -0
  165. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +5 -0
  166. package/dist/types/Services/CreateConnection/CreateConnectionEntity.d.ts +2 -0
  167. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +5 -0
  168. package/dist/types/Services/CreateDefaultConcept.d.ts +3 -0
  169. package/dist/types/Services/CreateTheComposition.d.ts +1 -0
  170. package/dist/types/Services/CreateTheConcept.d.ts +122 -0
  171. package/dist/types/Services/CreateTheConnection.d.ts +63 -0
  172. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +2 -0
  173. package/dist/types/Services/DeleteConcept.d.ts +2 -0
  174. package/dist/types/Services/DeleteConnection.d.ts +2 -0
  175. package/dist/types/Services/DeleteConnectionByType.d.ts +22 -0
  176. package/dist/types/Services/FindConeceptsFromConnection.d.ts +6 -0
  177. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +1 -0
  178. package/dist/types/Services/GetComposition.d.ts +205 -0
  179. package/dist/types/Services/GetCompositionBulk.d.ts +100 -0
  180. package/dist/types/Services/GetCompositionList.d.ts +7 -0
  181. package/dist/types/Services/GetConceptByCharacter.d.ts +2 -0
  182. package/dist/types/Services/GetConnectionBetweenTwoConceptsLinker.d.ts +11 -0
  183. package/dist/types/Services/GetConnections.d.ts +1 -0
  184. package/dist/types/Services/GetDataFromIndexDb.d.ts +2 -0
  185. package/dist/types/Services/GetLink.d.ts +3 -0
  186. package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +3 -0
  187. package/dist/types/Services/GetRelation.d.ts +3 -0
  188. package/dist/types/Services/GetTheConcept.d.ts +96 -0
  189. package/dist/types/Services/InitializeSystem.d.ts +2 -0
  190. package/dist/types/Services/Local/ConvertFromLConceptToConcept.d.ts +41 -0
  191. package/dist/types/Services/Local/ConvertFromLConnectionToConnection.d.ts +47 -0
  192. package/dist/types/Services/Local/CreateConnectionBetweenTwoConceptsLocal.d.ts +44 -0
  193. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +46 -0
  194. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +34 -0
  195. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +104 -0
  196. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +84 -0
  197. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +140 -0
  198. package/dist/types/Services/Local/DeleteConceptLocal.d.ts +47 -0
  199. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +37 -0
  200. package/dist/types/Services/Local/GetCompositionLocal.d.ts +97 -0
  201. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +56 -0
  202. package/dist/types/Services/Local/GetConnectionOfTheConceptLocal.d.ts +19 -0
  203. package/dist/types/Services/Local/GetRelationLocal.d.ts +21 -0
  204. package/dist/types/Services/Local/GetTheConceptLocal.d.ts +63 -0
  205. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +22 -0
  206. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +164 -0
  207. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +36 -0
  208. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +42 -0
  209. package/dist/types/Services/Logs/LogEvent.d.ts +1 -0
  210. package/dist/types/Services/Mail.d.ts +41 -0
  211. package/dist/types/Services/MakeTheCharacter.d.ts +2 -0
  212. package/dist/types/Services/MakeTheCharacterData.d.ts +2 -0
  213. package/dist/types/Services/MakeTheConcept.d.ts +2 -0
  214. package/dist/types/Services/MakeTheInstanceConcept.d.ts +15 -0
  215. package/dist/types/Services/MakeTheTimestamp.d.ts +1 -0
  216. package/dist/types/Services/MakeTheTypeConcept.d.ts +1 -0
  217. package/dist/types/Services/Mqtt/publishMessage.d.ts +1 -0
  218. package/dist/types/Services/Search/DataIdFormat.d.ts +32 -0
  219. package/dist/types/Services/Search/FormatData.d.ts +36 -0
  220. package/dist/types/Services/Search/JustIdFormat.d.ts +23 -0
  221. package/dist/types/Services/Search/NewFormat.d.ts +4 -0
  222. package/dist/types/Services/Search/SearchLinkInternal.d.ts +3 -0
  223. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +55 -0
  224. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +82 -0
  225. package/dist/types/Services/Search/orderingConnections.d.ts +2 -0
  226. package/dist/types/Services/Security/GetRequestHeader.d.ts +6 -0
  227. package/dist/types/Services/SplitStrings.d.ts +1 -0
  228. package/dist/types/Services/Transaction/LocalTransaction.d.ts +117 -0
  229. package/dist/types/Services/UpdateComposition.d.ts +2 -0
  230. package/dist/types/Services/Upload.d.ts +111 -0
  231. package/dist/types/Services/User/UserFromLocalStorage.d.ts +10 -0
  232. package/dist/types/Services/User/UserTranslation.d.ts +3 -0
  233. package/dist/types/Services/View/ViewInternalData.d.ts +1 -0
  234. package/dist/types/Services/assets/GetImageService.d.ts +14 -0
  235. package/dist/types/Services/automated/automated-concept-connection.d.ts +7 -0
  236. package/dist/types/Services/cacheService.d.ts +1 -0
  237. package/dist/types/Validator/constant.d.ts +3 -0
  238. package/dist/types/Validator/interface.d.ts +19 -0
  239. package/dist/types/Validator/utils.d.ts +7 -0
  240. package/dist/types/Validator/validator.d.ts +37 -0
  241. package/dist/types/Visualize/ConceptCircle.d.ts +35 -0
  242. package/dist/types/Visualize/ConceptCircleList.d.ts +9 -0
  243. package/dist/types/Visualize/ConnectionLine.d.ts +21 -0
  244. package/dist/types/Visualize/ConnectionLineList.d.ts +6 -0
  245. package/dist/types/Visualize/drawExistingConcepts.d.ts +8 -0
  246. package/dist/types/Visualize/helper.d.ts +15 -0
  247. package/dist/types/Widgets/BaseObserver.d.ts +25 -0
  248. package/dist/types/Widgets/BaseWidget.d.ts +37 -0
  249. package/dist/types/Widgets/BuilderSpeceficFunctions.d.ts +11 -0
  250. package/dist/types/Widgets/BuilderStatefulWidget.d.ts +392 -0
  251. package/dist/types/Widgets/CacheWidget.service.d.ts +77 -0
  252. package/dist/types/Widgets/NormalizeStyles.service.d.ts +10 -0
  253. package/dist/types/Widgets/RenderPage.service.d.ts +17 -0
  254. package/dist/types/Widgets/RenderWidgetLibrary.service.d.ts +22 -0
  255. package/dist/types/Widgets/RenderWidgetService.d.ts +187 -0
  256. package/dist/types/Widgets/StatefulWidget.d.ts +167 -0
  257. package/dist/types/Widgets/WidgetBuild.d.ts +45 -0
  258. package/dist/types/Widgets/WidgetCacheManager.d.ts +108 -0
  259. package/dist/types/Widgets/WidgetTree.d.ts +61 -0
  260. package/dist/types/WrapperFunctions/DepenedencyObserver.d.ts +95 -0
  261. package/dist/types/WrapperFunctions/GetCompositionListObservable.d.ts +51 -0
  262. package/dist/types/WrapperFunctions/GetCompositionObservable.d.ts +35 -0
  263. package/dist/types/WrapperFunctions/GetLinkListObservable.d.ts +57 -0
  264. package/dist/types/WrapperFunctions/GetLinkObservable.d.ts +50 -0
  265. package/dist/types/WrapperFunctions/QueryCacheManager.d.ts +107 -0
  266. package/dist/types/WrapperFunctions/RecursiveSearchObservable.d.ts +55 -0
  267. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +60 -0
  268. package/dist/types/WrapperFunctions/SearchLinkMultipleAllObservable.d.ts +36 -0
  269. package/dist/types/app.d.ts +381 -0
  270. package/dist/types/prototype/prototype.service.d.ts +25 -0
  271. package/dist/types/service-worker.d.ts +1 -0
  272. package/package.json +1 -1
@@ -0,0 +1,140 @@
1
+ import { Concept, InnerActions } from "../../app";
2
+ /**
3
+ * Creates a connection in local storage (IndexedDB) without syncing to the backend.
4
+ *
5
+ * This is the primary function for creating offline-first connections. The connection is stored
6
+ * locally in IndexedDB and memory, but NOT immediately sent to the backend. Sync happens
7
+ * later via LocalSyncData.SyncDataOnline().
8
+ *
9
+ * **Virtual ID System:**
10
+ * - Generates a negative ID (e.g., -67890) to indicate local/virtual status
11
+ * - id and ghostId are initially equal and both negative
12
+ * - After backend sync: id becomes positive (real backend ID)
13
+ * - ghostId remains negative (preserves original local ID)
14
+ * - Mapping is stored in backend and LocalGhostIdTree
15
+ *
16
+ * **Connection Types:**
17
+ * - **Internal Connections**: orderId < 3 (within a composition)
18
+ * - typeId is typically the composition ID
19
+ * - **External Connections**: orderId >= 999 (between different entities)
20
+ * - typeId is a type concept ID
21
+ * - typeString provides human-readable type name
22
+ *
23
+ * **Self-Connection Prevention:**
24
+ * If ofTheConceptId equals toTheConceptId, returns an empty connection (prevents loops).
25
+ *
26
+ * @param ofTheConceptId - Source concept ID (FROM). The connection originates here.
27
+ * Can be negative (local) or positive (server) ID.
28
+ * @param toTheConceptId - Target concept ID (TO). The connection points here.
29
+ * Can be negative (local) or positive (server) ID.
30
+ * @param typeId - The type classification for this connection.
31
+ * - For internal connections: composition ID
32
+ * - For external connections: type concept ID
33
+ * @param orderId - Order identifier for sorting multiple connections.
34
+ * - < 3: Internal connection
35
+ * - >= 999: External connection
36
+ * - Defaults to 1
37
+ * @param typeString - Human-readable type name (e.g., "the_person_email").
38
+ * Used primarily for external connections. Defaults to empty string.
39
+ * @param userId - The ID of the user creating this connection. Defaults to 999 (system).
40
+ * @param actions - Action tracking object that accumulates created concepts and connections.
41
+ * Used for batch operations and rollback. Defaults to empty arrays.
42
+ *
43
+ * @returns Promise resolving to the created Connection object with negative ID.
44
+ * Returns empty connection (all IDs = 0) if self-connection attempted.
45
+ *
46
+ * @example
47
+ * // Create internal connection (within composition)
48
+ * const internalConn = await CreateTheConnectionLocal(
49
+ * projectId, // -12345
50
+ * taskId, // -67890
51
+ * compositionId,// -11111
52
+ * 1, // orderId < 3 = internal
53
+ * "", // no typeString needed
54
+ * 101 // userId
55
+ * );
56
+ * console.log(internalConn.id); // -99999 (negative = local)
57
+ *
58
+ * @example
59
+ * // Create external connection (between entities)
60
+ * const externalConn = await CreateTheConnectionLocal(
61
+ * personId, // 123
62
+ * emailId, // 456
63
+ * emailTypeId, // 789
64
+ * 1000, // orderId >= 999 = external
65
+ * "the_person_email", // typeString for external
66
+ * 101
67
+ * );
68
+ *
69
+ * @example
70
+ * // Track actions for batch operations
71
+ * const actions = { concepts: [], connections: [] };
72
+ * await CreateTheConnectionLocal(id1, id2, typeId, 1, "", 101, actions);
73
+ * await CreateTheConnectionLocal(id2, id3, typeId, 1, "", 101, actions);
74
+ * console.log(actions.connections.length); // 2
75
+ * // All created connections tracked for potential rollback
76
+ *
77
+ * @example
78
+ * // Self-connection prevention
79
+ * const selfConn = await CreateTheConnectionLocal(123, 123, 5, 1);
80
+ * console.log(selfConn.id); // 0 (empty connection, prevented)
81
+ *
82
+ * @throws Logs errors and re-throws for handling by caller
83
+ *
84
+ * @see {@link CreateConnection} for simplified connection creation with concepts
85
+ * @see {@link LocalSyncData} for syncing local connections to backend
86
+ * @see {@link createTheConnection} for creating server-synced connections directly
87
+ */
88
+ export declare function CreateTheConnectionLocal(ofTheConceptId: number, toTheConceptId: number, typeId: number, orderId?: number, typeString?: string, userId?: number, actions?: InnerActions): Promise<any>;
89
+ /**
90
+ * Simplified connection creator that accepts concepts and a type string.
91
+ *
92
+ * This is a convenience wrapper around CreateTheConnectionLocal that:
93
+ * 1. Accepts Concept objects instead of IDs
94
+ * 2. Creates the connection type concept if it doesn't exist
95
+ * 3. Extracts necessary IDs automatically
96
+ * 4. Sets appropriate defaults for local connections
97
+ *
98
+ * **Advantages:**
99
+ * - More intuitive API (pass concepts, not IDs)
100
+ * - Automatic type concept creation/retrieval
101
+ * - Less boilerplate code
102
+ * - Type-safe with TypeScript
103
+ *
104
+ * **Process:**
105
+ * 1. Creates/retrieves type concept from connectionTypeString
106
+ * 2. Extracts userId from source concept
107
+ * 3. Calls CreateTheConnectionLocal with extracted IDs
108
+ * 4. Returns the created connection
109
+ *
110
+ * @param ofTheConcept - The source Concept object (FROM)
111
+ * @param toTheConcept - The target Concept object (TO)
112
+ * @param connectionTypeString - Type name as string (e.g., "the_person_email").
113
+ * A type concept will be created if it doesn't exist.
114
+ * @param actions - Action tracking object for batch operations. Defaults to empty arrays.
115
+ *
116
+ * @returns Promise resolving to the created Connection object
117
+ *
118
+ * @example
119
+ * // Simple usage with concepts
120
+ * const person = await CreateTheConceptLocal('Alice', 'the_person', 101, 1, 1, 2);
121
+ * const email = await CreateTheConceptLocal('alice@example.com', 'the_email', 101, 1, 2, 2);
122
+ *
123
+ * const connection = await CreateConnection(person, email, 'the_person_email');
124
+ * // Connection created with:
125
+ * // - ofTheConceptId: person.id
126
+ * // - toTheConceptId: email.id
127
+ * // - typeId: auto-generated from 'the_person_email'
128
+ * // - orderId: 1000 (external connection)
129
+ *
130
+ * @example
131
+ * // With action tracking
132
+ * const actions = { concepts: [], connections: [] };
133
+ * const conn1 = await CreateConnection(concept1, concept2, 'links_to', actions);
134
+ * const conn2 = await CreateConnection(concept2, concept3, 'links_to', actions);
135
+ * console.log(actions.connections.length); // 2
136
+ *
137
+ * @see {@link CreateTheConnectionLocal} for the underlying implementation
138
+ * @see {@link MakeTheTypeConceptLocal} for type concept creation
139
+ */
140
+ export declare function CreateConnection(ofTheConcept: Concept, toTheConcept: Concept, connectionTypeString: string, actions?: InnerActions): Promise<any>;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Deletes a concept from local storage (IndexedDB).
3
+ *
4
+ * This function removes a concept from LocalConceptsData, effectively deleting it
5
+ * from the local IndexedDB cache. This is a local-only delete - it does NOT sync
6
+ * the deletion to the backend.
7
+ *
8
+ * **Important Notes:**
9
+ * - Only deletes from local storage (IndexedDB)
10
+ * - Does NOT delete from backend server
11
+ * - Does NOT automatically delete related connections
12
+ * - For full deletion including backend, use DeleteConceptById
13
+ * - Works with both negative (local) and positive (synced) IDs
14
+ *
15
+ * **Use Cases:**
16
+ * - Cleaning up local draft concepts
17
+ * - Removing concepts before they're synced
18
+ * - Local cache management
19
+ * - Testing and development
20
+ *
21
+ * **Process:**
22
+ * 1. Fetches the concept via GetTheConceptLocal
23
+ * 2. Removes it from LocalConceptsData
24
+ * 3. Updates IndexedDB
25
+ *
26
+ * @param id - The concept ID to delete (negative for local, positive for synced)
27
+ *
28
+ * @returns Promise that resolves when deletion is complete
29
+ *
30
+ * @example
31
+ * // Delete a local concept
32
+ * await DeleteConceptLocal(-12345);
33
+ * console.log("Local concept deleted");
34
+ *
35
+ * @example
36
+ * // Delete after checking existence
37
+ * const concept = await GetTheConceptLocal(-67890);
38
+ * if (concept.id !== 0) {
39
+ * await DeleteConceptLocal(concept.id);
40
+ * console.log("Deleted:", concept.characterValue);
41
+ * }
42
+ *
43
+ * @see {@link DeleteConceptById} for full deletion including backend
44
+ * @see {@link GetTheConceptLocal} for retrieving concepts before deletion
45
+ * @see {@link LocalConceptsData.RemoveConcept} for the underlying removal operation
46
+ */
47
+ export declare function DeleteConceptLocal(id: number): Promise<any>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Retrieves all compositions of a specific type from local storage.
3
+ *
4
+ * **Process Flow**:
5
+ * 1. Finds the type concept by compositionName (e.g., "the_project")
6
+ * 2. Queries all concepts with that typeId belonging to the user
7
+ * 3. Fetches full composition for each concept
8
+ * 4. Returns array of complete compositions
9
+ *
10
+ * @param compositionName - The type name of compositions to retrieve (e.g., "the_project", "the_person")
11
+ * @param userId - User ID to filter compositions by ownership
12
+ * @returns Array of composition objects (empty array if type not found)
13
+ * @throws Error if lookup or composition fetching fails
14
+ *
15
+ * @example
16
+ * // Get all local projects for a user
17
+ * const projects = await GetCompositionListLocal("the_project", 101);
18
+ * // Returns: [{id: -1, data: {...}}, {id: -2, data: {...}}]
19
+ */
20
+ export declare function GetCompositionListLocal(compositionName: string, userId: number): Promise<any>;
21
+ /**
22
+ * Retrieves all compositions of a specific type with DATAID format (includes concept ID).
23
+ *
24
+ * Same as GetCompositionListLocal but returns compositions in data-id wrapper format,
25
+ * which includes both the composition data and its concept ID for easier reference.
26
+ *
27
+ * @param compositionName - The type name of compositions to retrieve
28
+ * @param userId - User ID to filter compositions by ownership
29
+ * @returns Array of composition objects in {id, data} format
30
+ * @throws Error if lookup or composition fetching fails
31
+ *
32
+ * @example
33
+ * // Get all local projects with IDs
34
+ * const projects = await GetCompositionListLocalWithId("the_project", 101);
35
+ * // Returns: [{id: -1, data: {the_name: "Project A"}}, {id: -2, data: {...}}]
36
+ */
37
+ export declare function GetCompositionListLocalWithId(compositionName: string, userId: number): Promise<any>;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Retrieves a complete composition structure from local storage (IndexedDB).
3
+ *
4
+ * This function fetches a composition using local-only data, building a hierarchical
5
+ * structure from local connections and concepts. If the concept has been synced to the
6
+ * backend, it can automatically fall back to fetching from the server.
7
+ *
8
+ * **Process:**
9
+ * 1. Fetches all local connections for the composition
10
+ * 2. Identifies all connected concept IDs
11
+ * 3. Retrieves the main concept from LocalConceptsData
12
+ * 4. If concept not found locally, checks if it's been synced (TranslateLocalToReal)
13
+ * 5. Falls back to server GetComposition if concept is synced
14
+ * 6. Recursively builds composition tree from local data
15
+ * 7. Organizes output by concept type
16
+ *
17
+ * **Local vs Server:**
18
+ * - Prioritizes local data (IndexedDB)
19
+ * - Automatic fallback to server if concept synced
20
+ * - Uses LocalConnectionData for connections
21
+ * - Uses LocalConceptsData for concepts
22
+ *
23
+ * **Output Format (JUSTDATA):**
24
+ * Returns an object keyed by the main concept's type:
25
+ * ```
26
+ * {
27
+ * "Person": {
28
+ * name: "Alice",
29
+ * email: {...},
30
+ * projects: {...}
31
+ * }
32
+ * }
33
+ * ```
34
+ *
35
+ * @param id - The concept ID (can be negative for local or positive for synced)
36
+ *
37
+ * @returns Promise resolving to composition data organized by concept type
38
+ *
39
+ * @example
40
+ * // Get local composition
41
+ * const localComp = await GetCompositionLocal(-12345);
42
+ * console.log(localComp["Project"]);
43
+ * // Returns all data connected to this local project
44
+ *
45
+ * @example
46
+ * // Get synced concept (automatically falls back to server)
47
+ * const syncedComp = await GetCompositionLocal(-67890);
48
+ * // If concept synced to server, fetches from there
49
+ *
50
+ * @throws Re-throws errors for handling by caller
51
+ *
52
+ * @see {@link GetCompositionLocalWithId} for composition with ID and data wrapper
53
+ * @see {@link GetComposition} for server-only composition retrieval
54
+ * @see {@link recursiveFetchLocal} for the recursive building logic
55
+ */
56
+ export declare function GetCompositionLocal(id: number): Promise<any>;
57
+ /**
58
+ * Retrieves a local composition with ID and data wrapper (DATAID format).
59
+ *
60
+ * This is a variant of GetCompositionLocal that returns the composition data
61
+ * wrapped in an object that includes both the data and the concept ID. This format
62
+ * is useful for tracking which concept the data belongs to.
63
+ *
64
+ * **Output Format (DATAID):**
65
+ * ```
66
+ * {
67
+ * data: {
68
+ * "Person": {
69
+ * name: "Alice",
70
+ * email: {...}
71
+ * }
72
+ * },
73
+ * id: 12345
74
+ * }
75
+ * ```
76
+ *
77
+ * **Differences from GetCompositionLocal:**
78
+ * - Returns { data, id } wrapper object
79
+ * - Same local data retrieval process
80
+ * - Same recursive building logic
81
+ * - No automatic server fallback
82
+ *
83
+ * @param id - The concept ID (negative for local, positive for synced)
84
+ *
85
+ * @returns Promise resolving to object with { data, id } structure
86
+ *
87
+ * @example
88
+ * const result = await GetCompositionLocalWithId(-12345);
89
+ * console.log(result.id); // -12345
90
+ * console.log(result.data.Project); // Composition data
91
+ *
92
+ * @throws Re-throws errors for handling by caller
93
+ *
94
+ * @see {@link GetCompositionLocal} for standard format without ID wrapper
95
+ * @see {@link GetCompositionWithId} for server version
96
+ */
97
+ export declare function GetCompositionLocalWithId(id: number): Promise<any>;
@@ -0,0 +1,56 @@
1
+ import { Concept } from "../../app";
2
+ /**
3
+ * Retrieves a local concept by character value with typeId=51 (standard type).
4
+ *
5
+ * Simple lookup in LocalConceptsData for concepts matching the character value
6
+ * and having typeId of 51.
7
+ *
8
+ * @param characterValue - The character value to search for
9
+ * @returns Concept matching the character and type, or empty concept if not found
10
+ */
11
+ export default function GetConceptByCharacterLocal(characterValue: string): Promise<Concept>;
12
+ /**
13
+ * Retrieves a local concept by character value, handling hierarchical type names.
14
+ *
15
+ * **Complex Logic**: For compound names (e.g., "the_person_email"):
16
+ * 1. Splits string by underscore
17
+ * 2. Recursively processes first part to get category ID
18
+ * 3. Searches using character value and derived category
19
+ * 4. Falls back to simple character search for single words
20
+ *
21
+ * **Special Case**: Returns concept with id=1 for character value "the".
22
+ *
23
+ * @param character - The character value to find (e.g., "the_status", "the_person_email")
24
+ * @returns Concept associated with the character value
25
+ *
26
+ * @example
27
+ * const concept = await GetConceptByCharacterAndCategoryLocal("the_person_email");
28
+ * // Splits into "the_person" (category) and searches with that context
29
+ */
30
+ export declare function GetConceptByCharacterAndCategoryLocal(character: string): Promise<any>;
31
+ /**
32
+ * Retrieves a concept by character value and category ID from local memory.
33
+ *
34
+ * Direct lookup in LocalConceptsData without server fallback.
35
+ *
36
+ * @param value - The character value to search for
37
+ * @param categoryId - The category ID to filter by
38
+ * @returns Concept matching the character and category, or empty concept if not found
39
+ */
40
+ export declare function GetConceptByCategoryAndCharacterLocalMemory(value: string, categoryId: number): Promise<Concept>;
41
+ /**
42
+ * Retrieves a concept by character value with automatic server fallback.
43
+ *
44
+ * **Complex Logic**:
45
+ * 1. First checks LocalConceptsData for existing concept
46
+ * 2. If not found (id==0 or null), fetches from server via GetLocalConceptByCharacterValue
47
+ * 3. After server fetch, rechecks LocalConceptsData (now populated)
48
+ * 4. Returns the concept or throws error
49
+ *
50
+ * Use this when you need guaranteed concept retrieval with server sync.
51
+ *
52
+ * @param characterValue - The character value to search for
53
+ * @returns Concept from local storage, fetching from server if needed
54
+ * @throws Error if server fetch fails
55
+ */
56
+ export declare function GetConceptByCharacterLocalFull(characterValue: string): Promise<Concept>;
@@ -0,0 +1,19 @@
1
+ import { Connection } from "../../app";
2
+ /**
3
+ * Retrieves all connections originating from a specific concept with a given type.
4
+ *
5
+ * Searches local storage (IndexedDB) for connections where:
6
+ * - ofTheConceptId matches the provided concept ID
7
+ * - typeId matches the provided type
8
+ *
9
+ * @param ofTheConcept - The source concept ID (connections originating from this concept)
10
+ * @param typeId - The connection type ID to filter by
11
+ * @param userId - User ID (currently not used in filtering)
12
+ * @returns Array of Connection objects matching the criteria (empty array if none found)
13
+ * @throws Error if local storage query fails
14
+ *
15
+ * @example
16
+ * // Get all "has_property" connections from a person concept
17
+ * const connections = await GetConnectionOfTheConceptLocal(personId, 42, userId);
18
+ */
19
+ export declare function GetConnectionOfTheConceptLocal(ofTheConcept: number, typeId: number, userId: number): Promise<Connection[]>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Retrieves all related compositions from local storage by relation name.
3
+ *
4
+ * **Process Flow (Complex Logic)**:
5
+ * 1. Converts relation string to type concept (e.g., "the_email" → type concept)
6
+ * 2. Finds all connections from source concept with that relation type
7
+ * 3. For each connection, retrieves the target composition
8
+ * 4. Returns array of all related compositions
9
+ *
10
+ * @param id - The source concept ID to get relations from
11
+ * @param relation - The relation name (e.g., "the_email", "the_address")
12
+ * @param userId - User ID for permissions
13
+ * @returns Array of composition objects representing related entities
14
+ * @throws Error if relation lookup or composition retrieval fails
15
+ *
16
+ * @example
17
+ * // Get all email addresses related to a person
18
+ * const emails = await GetRelationLocal(personId, "the_email", userId);
19
+ * // Returns: [emailComposition1, emailComposition2, ...]
20
+ */
21
+ export declare function GetRelationLocal(id: number, relation: string, userId: number): Promise<any>;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Retrieves a concept by ID with support for both local (virtual) and server concepts.
3
+ *
4
+ * This is the primary function for fetching concepts in offline/local mode. It intelligently
5
+ * handles three types of concept IDs and retrieves from appropriate sources:
6
+ *
7
+ * **ID Types Handled:**
8
+ * 1. **Negative IDs (Virtual/Local)**: Concepts created locally not yet synced
9
+ * - Stored in LocalConceptsData (IndexedDB)
10
+ * - Return negative IDs
11
+ *
12
+ * 2. **Synced Virtual IDs**: Originally local concepts now synced to backend
13
+ * - Looked up via LocalGhostIdTree (maps negative to positive IDs)
14
+ * - Returns positive (real) ID with ghostId reference
15
+ *
16
+ * 3. **Positive IDs (Server)**: Real backend concepts
17
+ * - Fetched via GetTheConcept from backend
18
+ * - Converted to LConcept format
19
+ * - May have undefined ghostId
20
+ *
21
+ * **Retrieval Strategy:**
22
+ * - If id < 0: Check LocalConceptsData → Check LocalGhostIdTree
23
+ * - If id >= 0: Fetch from backend → Convert to LConcept
24
+ * - Routes through service worker if enabled
25
+ * - Returns default empty concept if not found
26
+ *
27
+ * **Ghost ID System:**
28
+ * - ghostId: Original negative ID (preserved after sync)
29
+ * - id: Current ID (negative if local, positive if synced)
30
+ * - LocalGhostIdTree maintains the mapping
31
+ *
32
+ * @param id - The concept ID to retrieve. Can be:
33
+ * - Negative (e.g., -12345) for local-only concepts
34
+ * - Positive (e.g., 789) for server concepts
35
+ *
36
+ * @returns Promise resolving to a Concept object in LConcept format.
37
+ * Returns default concept (id=0) if not found.
38
+ *
39
+ * @example
40
+ * // Get a local concept (negative ID)
41
+ * const localConcept = await GetTheConceptLocal(-12345);
42
+ * console.log(localConcept.id); // -12345
43
+ * console.log(localConcept.characterValue); // "Draft Note"
44
+ *
45
+ * @example
46
+ * // Get a synced concept (originally local, now on server)
47
+ * const syncedConcept = await GetTheConceptLocal(-12345);
48
+ * console.log(syncedConcept.id); // 789 (now positive, synced)
49
+ * console.log(syncedConcept.ghostId); // -12345 (original ID preserved)
50
+ *
51
+ * @example
52
+ * // Get a server concept
53
+ * const serverConcept = await GetTheConceptLocal(456);
54
+ * console.log(serverConcept.id); // 456
55
+ * // Converted to LConcept format for consistency
56
+ *
57
+ * @throws Logs errors but returns default concept instead of throwing
58
+ *
59
+ * @see {@link CreateTheConceptLocal} for creating local concepts
60
+ * @see {@link GetTheConcept} for fetching server concepts only
61
+ * @see {@link convertFromConceptToLConcept} for format conversion
62
+ */
63
+ export declare function GetTheConceptLocal(id: number): Promise<any>;
@@ -0,0 +1,22 @@
1
+ import { InnerActions } from "../../app";
2
+ /**
3
+ * Gets or creates a local concept - implements get-or-create pattern.
4
+ *
5
+ * Checks LocalConceptsData for existing concept matching referent and typeId.
6
+ * If found, returns existing concept. If not found, creates new local concept.
7
+ *
8
+ * **Special Case**: If typeCharacter is "the", sets categoryId to 1 (system category).
9
+ *
10
+ * @param referent - The character value/name of the concept
11
+ * @param typeCharacter - Type name string (e.g., "the_name")
12
+ * @param userId - User ID creating the concept
13
+ * @param categoryId - Category classification ID
14
+ * @param typeId - Type classification ID
15
+ * @param actions - Action tracking for batch operations
16
+ * @returns Existing or newly created Concept
17
+ *
18
+ * @example
19
+ * const concept = await MakeTheConceptLocal("Active", "the_status", 101, 1, 5);
20
+ * // Returns existing "Active" status or creates new one
21
+ */
22
+ export default function MakeTheConceptLocal(referent: string, typeCharacter: string, userId: number, categoryId: number, typeId: number, actions?: InnerActions): Promise<any>;
@@ -0,0 +1,164 @@
1
+ import { InnerActions } from "../../Constants/general.const";
2
+ /**
3
+ * Creates or retrieves an instance concept locally - the core building block of the concept-connection system.
4
+ *
5
+ * This is THE fundamental function for creating concepts in local storage. It implements an intelligent
6
+ * get-or-create pattern that checks for existing concepts before creating new ones, preventing duplicates
7
+ * while supporting both unique instances and composition concepts.
8
+ *
9
+ * **Core Behaviors:**
10
+ * 1. **Composition Mode (composition=true)**: Always creates a new concept
11
+ * - Used for containers/objects that need unique instances
12
+ * - Marks concept with isComposition flag
13
+ * - Example: Each "Project" is unique, even with same name
14
+ *
15
+ * 2. **Instance Mode (composition=false)**: Get-or-create pattern
16
+ * - Checks if concept with same type and value exists
17
+ * - Returns existing if found (deduplication)
18
+ * - Creates new only if not found
19
+ * - Example: "Published" status concept reused across items
20
+ *
21
+ * 3. **Long Text Handling**: Values >255 characters always create new
22
+ * - Prevents expensive lookups on large text
23
+ * - Each long text gets unique concept
24
+ *
25
+ * **Type String Processing:**
26
+ * - **Best Practice**: Always pass type with "the_" prefix (e.g., "the_name", "the_email")
27
+ * - Auto-correction: If missing, "the_" is automatically added internally
28
+ * - "name" → "the_name" (auto-corrected)
29
+ * - "email" → "the_email" (auto-corrected)
30
+ * - "the_status" → "the_status" (already correct)
31
+ * - Creates type concept if it doesn't exist
32
+ * - **Recommendation**: Use explicit "the_" prefix for code clarity and consistency
33
+ *
34
+ * **Sync and Storage:**
35
+ * - Adds concept to LocalSyncData queue for backend sync
36
+ * - Stores in LocalConceptsData (IndexedDB)
37
+ * - Tracks in actions parameter for batch operations
38
+ * - Assigns negative ID (virtual/local)
39
+ *
40
+ * **Process Flow:**
41
+ * 1. Normalizes type string (adds "the_" prefix)
42
+ * 2. Creates/retrieves type concept via MakeTheTypeConceptLocal
43
+ * 3. If composition=true: Creates new concept immediately
44
+ * 4. If referent length >255: Creates new concept
45
+ * 5. If regular instance: Checks for existing by type+value
46
+ * 6. Returns existing or creates new
47
+ * 7. Attaches type information
48
+ * 8. Adds to sync queue
49
+ *
50
+ * @param type - The type/key of the concept. **Should follow the format "the_xyz"**.
51
+ * Represents what kind of data this is.
52
+ * Examples: "the_name", "the_email", "the_status", "the_first_name"
53
+ *
54
+ * **Note**: If you pass without "the_" prefix (e.g., "name"), the code will
55
+ * automatically add it internally (becomes "the_name"). However, best practice
56
+ * is to always include the "the_" prefix for clarity and consistency.
57
+ *
58
+ * @param referent - The actual value/content of the concept.
59
+ * The human-readable data (e.g., "Alice", "alice@example.com", "Active").
60
+ * Can be empty string for composition concepts.
61
+ *
62
+ * @param composition - Boolean flag determining creation behavior.
63
+ * - true: Always creates new concept (unique instances)
64
+ * - false: Get-or-create pattern (reuses existing)
65
+ * Defaults to false.
66
+ *
67
+ * @param userId - The ID of the user creating this concept. Used for ownership and permissions.
68
+ *
69
+ * @param accessId - Access control level. Typically 4 (default internal access).
70
+ * Controls who can view/modify this concept.
71
+ *
72
+ * @param sessionInformationId - Session identifier for tracking. Defaults to 999 (system).
73
+ * Used for audit logging and session management.
74
+ *
75
+ * @param referentId - Optional reference to another concept ID.
76
+ * Used when this concept is an instance of or refers to another concept.
77
+ * Defaults to 0 (no reference).
78
+ *
79
+ * @param actions - Action tracking object that accumulates all created concepts and connections.
80
+ * Used for batch operations, rollback, and sync management.
81
+ * Structure: { concepts: Concept[], connections: Connection[] }
82
+ *
83
+ * @returns Promise resolving to the created or retrieved Concept object with:
84
+ * - Negative ID if newly created locally
85
+ * - Attached type information (concept.type)
86
+ * - All standard concept properties
87
+ *
88
+ * @example
89
+ * // Create a reusable status concept (get-or-create)
90
+ * const status = await MakeTheInstanceConceptLocal(
91
+ * "the_status", // type (with "the_" prefix - best practice)
92
+ * "Active", // value
93
+ * false, // not composition - will reuse if exists
94
+ * 101, // userId
95
+ * 4, // accessId
96
+ * 999, // sessionId
97
+ * 0 // no referent
98
+ * );
99
+ * // First call creates, subsequent calls return same concept
100
+ *
101
+ * @example
102
+ * // Create a composition concept (always new)
103
+ * const project = await MakeTheInstanceConceptLocal(
104
+ * "the_project", // type (with "the_" prefix)
105
+ * "Project Alpha", // value
106
+ * true, // composition - always creates new
107
+ * 101,
108
+ * 4,
109
+ * 999,
110
+ * 0
111
+ * );
112
+ * // Each project is unique, even with same name
113
+ * console.log(project.isComposition); // true
114
+ *
115
+ * @example
116
+ * // Type prefix is added automatically if missing (but prefer explicit)
117
+ * const email = await MakeTheInstanceConceptLocal(
118
+ * "email", // Missing "the_" - will become "the_email" internally
119
+ * "alice@example.com",
120
+ * false,
121
+ * 101, 4
122
+ * );
123
+ * console.log(email.typeCharacter); // "the_email" (auto-prefixed)
124
+ *
125
+ * // RECOMMENDED: Always include "the_" prefix explicitly
126
+ * const emailBetter = await MakeTheInstanceConceptLocal(
127
+ * "the_email", // Explicit prefix - clearer and more consistent
128
+ * "bob@example.com",
129
+ * false,
130
+ * 101, 4
131
+ * );
132
+ *
133
+ * @example
134
+ * // Long text always creates new concept
135
+ * const longDescription = "Lorem ipsum...".repeat(100); // >255 chars
136
+ * const concept = await MakeTheInstanceConceptLocal(
137
+ * "the_description", // type with "the_" prefix
138
+ * longDescription,
139
+ * false, // Even with false, creates new due to length
140
+ * 101, 4
141
+ * );
142
+ *
143
+ * @example
144
+ * // Track actions for batch operations
145
+ * const actions = { concepts: [], connections: [] };
146
+ * await MakeTheInstanceConceptLocal("the_name", "Alice", false, 101, 4, 999, 0, actions);
147
+ * await MakeTheInstanceConceptLocal("the_email", "alice@ex.com", false, 101, 4, 999, 0, actions);
148
+ * console.log(actions.concepts.length); // 2 (plus any type concepts created)
149
+ *
150
+ * @example
151
+ * // Deduplication in action
152
+ * const status1 = await MakeTheInstanceConceptLocal("the_status", "Published", false, 101, 4);
153
+ * const status2 = await MakeTheInstanceConceptLocal("the_status", "Published", false, 101, 4);
154
+ * console.log(status1.id === status2.id); // true - same concept reused
155
+ *
156
+ * @throws Logs errors and re-throws for handling by caller.
157
+ * Common issues: Type concept creation failures, IndexedDB errors.
158
+ *
159
+ * @see {@link CreateTheConceptLocal} for the underlying creation function
160
+ * @see {@link MakeTheTypeConceptLocal} for type concept creation/retrieval
161
+ * @see {@link LocalConceptsData.GetConceptByCharacterAndTypeLocal} for existence check
162
+ * @see {@link LocalSyncData.AddConcept} for sync queue management
163
+ */
164
+ export declare function MakeTheInstanceConceptLocal(type: string, referent: string, composition: boolean | undefined, userId: number, accessId: number, sessionInformationId?: number, referentId?: number, actions?: InnerActions): Promise<any>;