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,114 @@
1
+ /**
2
+ * @fileoverview Local Concepts Data management for the Concept Connection System.
3
+ * This module provides static methods for managing local concept data, including
4
+ * adding, retrieving, and querying concepts from local binary trees and memory.
5
+ * @module DataStructures/Local/LocalConceptData
6
+ */
7
+ import { LConcept } from "./../Local/LConcept";
8
+ /**
9
+ * Manages local concept data storage and retrieval.
10
+ * Provides static methods for managing concepts in memory and across multiple
11
+ * binary tree structures for efficient querying.
12
+ *
13
+ * @class LocalConceptsData
14
+ * @export
15
+ */
16
+ export declare class LocalConceptsData {
17
+ /**
18
+ * Name identifier for this data structure.
19
+ * @type {string}
20
+ */
21
+ name: string;
22
+ /**
23
+ * Creates a new LocalConceptsData instance.
24
+ *
25
+ * @constructor
26
+ */
27
+ constructor();
28
+ /**
29
+ * Static array storing all local concepts in memory.
30
+ * @type {LConcept[]}
31
+ * @static
32
+ */
33
+ static localconceptsArray: LConcept[];
34
+ /**
35
+ * Adds a concept to the local storage system.
36
+ * Stores the concept in the database and adds it to all relevant binary trees.
37
+ *
38
+ * @static
39
+ * @method AddConcept
40
+ * @param {LConcept} concept - The concept to add
41
+ * @returns {void}
42
+ */
43
+ static AddConcept(concept: LConcept): void;
44
+ /**
45
+ * Adds a concept to memory only (without database storage).
46
+ * Updates all relevant binary trees for fast lookups.
47
+ *
48
+ * @static
49
+ * @method AddConceptToMemory
50
+ * @param {LConcept} concept - The concept to add to memory
51
+ * @returns {void}
52
+ */
53
+ static AddConceptToMemory(concept: LConcept): void;
54
+ /**
55
+ * Retrieves a concept by its ID from the local binary tree.
56
+ *
57
+ * @static
58
+ * @async
59
+ * @method GetConcept
60
+ * @param {number} id - The ID of the concept to retrieve
61
+ * @returns {Promise<LConcept>} The concept if found, otherwise a default concept
62
+ */
63
+ static GetConcept(id: number): Promise<LConcept>;
64
+ /**
65
+ * Retrieves a concept by its character value.
66
+ *
67
+ * @static
68
+ * @async
69
+ * @method GetConceptByCharacter
70
+ * @param {string} characterValue - The character value to search for
71
+ * @returns {Promise<LConcept>} The concept if found, otherwise a default concept
72
+ */
73
+ static GetConceptByCharacter(characterValue: string): Promise<LConcept>;
74
+ /**
75
+ * Retrieves a concept by both character value and type ID.
76
+ * Useful for finding specific concepts when multiple concepts share the same character value.
77
+ *
78
+ * @static
79
+ * @async
80
+ * @method GetConceptByCharacterAndTypeLocal
81
+ * @param {string} character_value - The character value to search for
82
+ * @param {number} typeId - The type ID to match
83
+ * @returns {Promise<LConcept>} The concept if found, otherwise a default concept
84
+ */
85
+ static GetConceptByCharacterAndTypeLocal(character_value: string, typeId: number): Promise<LConcept>;
86
+ /**
87
+ * Retrieves all concepts of a specific type.
88
+ *
89
+ * @static
90
+ * @method GetConceptsByTypeId
91
+ * @param {number} typeId - The type ID to filter by
92
+ * @returns {LConcept[]} Array of concepts with the specified type
93
+ */
94
+ static GetConceptsByTypeId(typeId: number): LConcept[];
95
+ /**
96
+ * Retrieves concepts filtered by both type ID and user ID.
97
+ * Useful for multi-user environments.
98
+ *
99
+ * @static
100
+ * @async
101
+ * @method GetConceptsByTypeIdAndUser
102
+ * @param {number} typeId - The type ID to filter by
103
+ * @param {number} userId - The user ID to filter by
104
+ * @returns {Promise<LConcept[]>} Array of concepts matching both criteria
105
+ */
106
+ static GetConceptsByTypeIdAndUser(typeId: number, userId: number): Promise<LConcept[]>;
107
+ /**
108
+ * Gets the name of this data structure.
109
+ *
110
+ * @method getName
111
+ * @returns {string} The name identifier
112
+ */
113
+ getName(): string;
114
+ }
@@ -0,0 +1,125 @@
1
+ /**
2
+ * @fileoverview Local Connection Data management for the Concept Connection System.
3
+ * This module provides static methods for managing local connection data, including
4
+ * adding, removing, and retrieving connections from memory and database storage.
5
+ * @module DataStructures/Local/LocalConnectionData
6
+ */
7
+ import { LConnection } from "./LConnection";
8
+ /**
9
+ * Manages local connection data storage and retrieval.
10
+ * Provides static methods for managing connections in memory and database,
11
+ * with support for querying connections by composition and waiting for data loads.
12
+ *
13
+ * @class LocalConnectionData
14
+ * @export
15
+ */
16
+ export declare class LocalConnectionData {
17
+ /**
18
+ * Name identifier for this data structure.
19
+ * @type {string}
20
+ */
21
+ name: string;
22
+ /**
23
+ * Creates a new LocalConnectionData instance.
24
+ *
25
+ * @constructor
26
+ */
27
+ constructor();
28
+ /**
29
+ * Static array storing all local connections in memory.
30
+ * @type {LConnection[]}
31
+ * @static
32
+ */
33
+ static connectionArray: LConnection[];
34
+ /**
35
+ * Static dictionary/map for fast connection lookups by ID.
36
+ * @type {LConnection[]}
37
+ * @static
38
+ */
39
+ static connectionDictionary: LConnection[];
40
+ /**
41
+ * Checks if a connection already exists in the array.
42
+ *
43
+ * @static
44
+ * @method CheckContains
45
+ * @param {LConnection} connection - The connection to check
46
+ * @returns {boolean} True if the connection exists, false otherwise
47
+ */
48
+ static CheckContains(connection: LConnection): boolean;
49
+ /**
50
+ * Adds a connection to the local storage system.
51
+ * If the connection already exists, it is removed and re-added.
52
+ * Stores non-temporary connections with valid IDs to the database.
53
+ *
54
+ * @static
55
+ * @method AddConnection
56
+ * @param {LConnection} connection - The connection to add
57
+ * @returns {void}
58
+ */
59
+ static AddConnection(connection: LConnection): void;
60
+ /**
61
+ * Adds a connection to the fast lookup dictionary.
62
+ *
63
+ * @static
64
+ * @method AddToDictionary
65
+ * @param {LConnection} connection - The connection to add to dictionary
66
+ * @returns {void}
67
+ */
68
+ static AddToDictionary(connection: LConnection): void;
69
+ /**
70
+ * Removes a connection from the local storage system.
71
+ * Removes from both the array and the database (if it has a valid ID).
72
+ *
73
+ * @static
74
+ * @method RemoveConnection
75
+ * @param {LConnection} connection - The connection to remove
76
+ * @returns {void}
77
+ */
78
+ static RemoveConnection(connection: LConnection): void;
79
+ /**
80
+ * Retrieves a connection by its ID.
81
+ *
82
+ * @static
83
+ * @method GetConnection
84
+ * @param {number} id - The ID of the connection to retrieve
85
+ * @returns {LConnection | null} The connection if found, null otherwise
86
+ */
87
+ static GetConnection(id: number): LConnection | null;
88
+ /**
89
+ * Waits for the local connection data to finish loading.
90
+ * Uses a polling mechanism to check the loading flag.
91
+ *
92
+ * @static
93
+ * @async
94
+ * @method waitForDataToLoad
95
+ * @returns {Promise<string>} Resolves with "done" when loaded, rejects after 25 seconds
96
+ */
97
+ static waitForDataToLoad(): Promise<unknown>;
98
+ /**
99
+ * Polling function that checks if connection data has finished loading.
100
+ *
101
+ * @static
102
+ * @method checkFlag
103
+ * @param {Function} resolve - The promise resolve function
104
+ * @returns {*} Resolves immediately if loaded, otherwise schedules next check
105
+ */
106
+ static checkFlag(resolve: any): any;
107
+ /**
108
+ * Retrieves all connections of a specific composition (by type ID).
109
+ * Waits for data to load if necessary.
110
+ *
111
+ * @static
112
+ * @async
113
+ * @method GetConnectionsOfCompositionLocal
114
+ * @param {number} id - The composition type ID to filter by
115
+ * @returns {Promise<LConnection[]>} Array of connections with the specified type
116
+ */
117
+ static GetConnectionsOfCompositionLocal(id: number): Promise<LConnection[]>;
118
+ /**
119
+ * Gets the name of this data structure.
120
+ *
121
+ * @method getName
122
+ * @returns {string} The name identifier
123
+ */
124
+ getName(): string;
125
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @fileoverview Local Synchronization Data management for the Concept Connection System.
3
+ * This module manages temporary storage of concepts and connections that need to be
4
+ * synchronized with the local database periodically.
5
+ * @module DataStructures/Local/LocalSyncData
6
+ */
7
+ import { LConcept } from "./LConcept";
8
+ import { LConnection } from "./LConnection";
9
+ /**
10
+ * Manages synchronization data for local concepts and connections.
11
+ * Provides static methods for staging data before batch synchronization to the local database.
12
+ *
13
+ * @class LocalSyncData
14
+ * @export
15
+ */
16
+ export declare class LocalSyncData {
17
+ /**
18
+ * Static array storing concepts pending synchronization.
19
+ * @type {LConcept[]}
20
+ * @static
21
+ */
22
+ static conceptsSyncArray: LConcept[];
23
+ /**
24
+ * Static array storing connections pending synchronization.
25
+ * @type {LConnection[]}
26
+ * @static
27
+ */
28
+ static connectionSyncArray: LConnection[];
29
+ /**
30
+ * Checks if a concept already exists in the sync array.
31
+ *
32
+ * @static
33
+ * @method CheckContains
34
+ * @param {LConcept} concept - The concept to check
35
+ * @returns {boolean} True if the concept exists, false otherwise
36
+ */
37
+ static CheckContains(concept: LConcept): boolean;
38
+ /**
39
+ * Removes related concepts and connections from sync arrays when a concept is deleted.
40
+ * Removes the concept itself and any connections that reference it.
41
+ *
42
+ * @static
43
+ * @method SyncDataDelete
44
+ * @param {number} id - The ID of the concept being deleted
45
+ * @returns {void}
46
+ */
47
+ static SyncDataDelete(id: number): void;
48
+ /**
49
+ * Checks if a connection already exists in the sync array.
50
+ *
51
+ * @static
52
+ * @method CheckContainsConnection
53
+ * @param {LConnection} connection - The connection to check
54
+ * @returns {boolean} True if the connection exists, false otherwise
55
+ */
56
+ static CheckContainsConnection(connection: LConnection): boolean;
57
+ /**
58
+ * Adds a concept to the sync array for later batch synchronization.
59
+ *
60
+ * @static
61
+ * @method AddConcept
62
+ * @param {LConcept} concept - The concept to add
63
+ * @returns {void}
64
+ */
65
+ static AddConcept(concept: LConcept): void;
66
+ /**
67
+ * Removes a concept from the sync array.
68
+ *
69
+ * @static
70
+ * @method RemoveConcept
71
+ * @param {LConcept} concept - The concept to remove
72
+ * @returns {void}
73
+ */
74
+ static RemoveConcept(concept: LConcept): void;
75
+ /**
76
+ * Adds a connection to the sync array for later batch synchronization.
77
+ *
78
+ * @static
79
+ * @method AddConnection
80
+ * @param {LConnection} connection - The connection to add
81
+ * @returns {void}
82
+ */
83
+ static AddConnection(connection: LConnection): void;
84
+ /**
85
+ * Removes a connection from the sync array.
86
+ *
87
+ * @static
88
+ * @method RemoveConnection
89
+ * @param {LConnection} connection - The connection to remove
90
+ * @returns {void}
91
+ */
92
+ static RemoveConnection(connection: LConnection): void;
93
+ /**
94
+ * Synchronizes all pending concepts and connections to the local database.
95
+ * Clears the sync arrays after successful synchronization.
96
+ *
97
+ * @static
98
+ * @async
99
+ * @method syncDataLocalDb
100
+ * @returns {Promise<string>} Returns "done" when synchronization is complete
101
+ */
102
+ static syncDataLocalDb(): Promise<string>;
103
+ }
@@ -0,0 +1,29 @@
1
+ import { Concept } from "./Concept";
2
+ export declare class Node {
3
+ key: any;
4
+ value: Concept;
5
+ leftNode: Node | null;
6
+ rightNode: Node | null;
7
+ currentNode: Node | null;
8
+ variants: Node[];
9
+ height: number;
10
+ constructor(key: any, value: Concept, leftNode: Node | null, rightNode: Node | null);
11
+ addCurrentNode(passedNode: Node, node: Node | null): Node;
12
+ addCurrentNodeType(passedNode: Node, node: Node | null): Node;
13
+ addNode(passedNode: Node, node: Node | null, height: number): Node | null;
14
+ addCharacterNode(passedNode: Node, node: Node | null, height: number): Node | null;
15
+ addTypeNode(passedNode: Node, node: Node | null, height: number): Node | null;
16
+ rightRotate(y: Node | null): Node | null;
17
+ leftRotate(x: Node | null): Node | null;
18
+ getHeight(node: Node | null): number;
19
+ getBalanceFactor(N: Node | null): number;
20
+ getFromNode(id: number, node: Node | null): Node | null;
21
+ getCharacterFromNode(value: string, node: Node | null): Node | null;
22
+ getCharacterFromNodeUpdated(value: string, node: Node | null): Node | null;
23
+ getFromNodeWithCharacterAndType(value: string, typeId: number, node: Node | null): Node | null;
24
+ getFromNodeWithCharacterAndCategory(value: string, categoryId: number, node: Node | null): Node | null;
25
+ removeNode(passedNode: Node | null, id: number): Node | null;
26
+ removeNodeWithVariants(passedNode: Node | null, typeIdentifier: any, conceptId: number): Node | null;
27
+ countNodeBelow(root: Node | null): number;
28
+ inOrderSuccessor(root: Node): Node;
29
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @fileoverview Defines the PatcherStructure class for patching/updating compositions.
3
+ * @module DataStructures/PatcherStructure
4
+ */
5
+ /**
6
+ * Represents a structure for patching or updating composition data.
7
+ * This class encapsulates all necessary information for performing partial updates
8
+ * on compositions, including identification, permissions, and the actual patch data.
9
+ *
10
+ * @class PatcherStructure
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const patcher = new PatcherStructure();
15
+ * patcher.compositionId = 123;
16
+ * patcher.userId = 1;
17
+ * patcher.sessionId = 456;
18
+ * patcher.accessId = 4;
19
+ * patcher.ofTheCompositionId = 789;
20
+ * patcher.patchObject = { name: "Updated Name", description: "New description" };
21
+ * ```
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Patching a user profile composition
26
+ * const profilePatcher = new PatcherStructure();
27
+ * profilePatcher.compositionId = 100;
28
+ * profilePatcher.userId = 25;
29
+ * profilePatcher.patchObject = {
30
+ * email: "newemail@example.com",
31
+ * bio: "Updated bio"
32
+ * };
33
+ * ```
34
+ */
35
+ export declare class PatcherStructure {
36
+ /**
37
+ * The ID of the composition to be patched.
38
+ * Identifies which composition will receive the update.
39
+ *
40
+ * @type {number}
41
+ * @default 0
42
+ */
43
+ compositionId: number;
44
+ /**
45
+ * The ID of the user performing the patch operation.
46
+ * Used for access control and audit purposes.
47
+ *
48
+ * @type {number}
49
+ * @default 999
50
+ */
51
+ userId: number;
52
+ /**
53
+ * The session ID associated with the patch operation.
54
+ * Links the patch to a specific user session for tracking.
55
+ *
56
+ * @type {number}
57
+ * @default 999
58
+ */
59
+ sessionId: number;
60
+ /**
61
+ * The access level ID for the patch operation.
62
+ * Determines what level of access is required to perform this patch.
63
+ *
64
+ * @type {number}
65
+ * @default 4
66
+ */
67
+ accessId: number;
68
+ /**
69
+ * The ID of the parent or related composition.
70
+ * Used when patching within a composition hierarchy or relationship.
71
+ *
72
+ * @type {number}
73
+ * @default 0
74
+ */
75
+ ofTheCompositionId: number;
76
+ /**
77
+ * The object containing the patch data.
78
+ * Contains key-value pairs representing the fields to update and their new values.
79
+ * Can be any structure depending on the composition being patched.
80
+ *
81
+ * @type {any}
82
+ * @default {}
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * patchObject = {
87
+ * name: "New Name",
88
+ * age: 30,
89
+ * tags: ["tag1", "tag2"]
90
+ * }
91
+ * ```
92
+ */
93
+ patchObject: any;
94
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @fileoverview Referent information data structure for the CCS-JS system.
3
+ * @module DataStructures/ReferentInfo
4
+ */
5
+ /**
6
+ * Represents referent information that links concept data with character data.
7
+ *
8
+ * @remarks
9
+ * ReferentInfo serves as a bridge between concept entities and character entities in the
10
+ * system. It maintains both the data IDs and the associated user IDs for each entity,
11
+ * enabling cross-referencing and ownership tracking across different data types. This is
12
+ * particularly useful for establishing semantic relationships between abstract concepts
13
+ * and their concrete character representations.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const referentInfo = new ReferentInfo(
18
+ * 1001, // conceptDataId
19
+ * 2001, // conceptDataUserId
20
+ * 3001, // characterDataId
21
+ * 2001 // characterDataUserId
22
+ * );
23
+ *
24
+ * // Use for linking concept to character
25
+ * console.log(`Concept ${referentInfo.conceptDataId} ` +
26
+ * `maps to Character ${referentInfo.characterDataId}`);
27
+ * ```
28
+ */
29
+ export declare class ReferentInfo {
30
+ /**
31
+ * Unique identifier for the concept data.
32
+ */
33
+ conceptDataId: number;
34
+ /**
35
+ * User ID associated with the concept data.
36
+ *
37
+ * @remarks
38
+ * Tracks ownership of the concept entity.
39
+ */
40
+ conceptDataUserId: number;
41
+ /**
42
+ * Unique identifier for the character data.
43
+ */
44
+ characterDataId: number;
45
+ /**
46
+ * User ID associated with the character data.
47
+ *
48
+ * @remarks
49
+ * Tracks ownership of the character entity. May differ from conceptDataUserId
50
+ * when characters are shared across users.
51
+ */
52
+ characterDataUserId: number;
53
+ /**
54
+ * Creates a new ReferentInfo instance.
55
+ *
56
+ * @param conceptDataId - The ID of the concept data
57
+ * @param conceptDataUserId - The user ID who owns the concept data
58
+ * @param characterDataId - The ID of the character data
59
+ * @param characterDataUserId - The user ID who owns the character data
60
+ *
61
+ * @remarks
62
+ * Both concept and character entities maintain their own user ownership,
63
+ * allowing for flexible sharing and access control scenarios.
64
+ *
65
+ * @example
66
+ * ```typescript
67
+ * // Create a referent linking concept 100 to character 200
68
+ * const ref = new ReferentInfo(100, 1, 200, 1);
69
+ *
70
+ * // Verify the mapping
71
+ * console.log(`Concept: ${ref.conceptDataId} -> Character: ${ref.characterDataId}`);
72
+ * ```
73
+ */
74
+ constructor(conceptDataId: number, conceptDataUserId: number, characterDataId: number, characterDataUserId: number);
75
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * @fileoverview ReservedIds module for managing pre-allocated concept and connection IDs.
3
+ * This module provides a pool of reserved IDs to avoid database round-trips during bulk operations.
4
+ * @module DataStructures/ReservedIds
5
+ */
6
+ /**
7
+ * Manages a pool of pre-allocated concept IDs from the backend.
8
+ * Automatically refills the pool when it gets low to ensure smooth operation.
9
+ *
10
+ * @class ReservedIds
11
+ * @example
12
+ * ```typescript
13
+ * // Get a reserved ID for a new concept
14
+ * const newId = await ReservedIds.getId();
15
+ *
16
+ * // Add an ID to the pool
17
+ * ReservedIds.AddId(123);
18
+ * ```
19
+ *
20
+ * @remarks
21
+ * Maintains a pool of at least 10 IDs. When the pool has fewer than 10 IDs,
22
+ * it automatically requests more from the backend.
23
+ */
24
+ export declare class ReservedIds {
25
+ /** Pool of reserved concept IDs */
26
+ static ids: number[];
27
+ /**
28
+ * Gets the next available reserved ID from the pool.
29
+ * Automatically refills the pool if it has fewer than 10 IDs.
30
+ *
31
+ * @returns {Promise<number>} A unique reserved concept ID
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const id = await ReservedIds.getId();
36
+ * const concept = new Concept(id, ...);
37
+ * ```
38
+ *
39
+ * @remarks
40
+ * Uses FIFO (first in, first out) to retrieve IDs.
41
+ * Triggers a backend call to GetReservedIds when pool is low.
42
+ */
43
+ static getId(): Promise<number>;
44
+ /**
45
+ * Adds an ID to the reserved IDs pool.
46
+ *
47
+ * @param {number} id - The ID to add to the pool
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * ReservedIds.AddId(123);
52
+ * ```
53
+ *
54
+ * @remarks
55
+ * Prevents duplicate IDs from being added to the pool.
56
+ */
57
+ static AddId(id: number): void;
58
+ }
59
+ /**
60
+ * Manages a pool of pre-allocated connection IDs from the backend.
61
+ * Automatically refills the pool when it gets low to ensure smooth operation.
62
+ *
63
+ * @class ReservedConnectionIds
64
+ * @example
65
+ * ```typescript
66
+ * // Get a reserved ID for a new connection
67
+ * const newId = await ReservedConnectionIds.getId();
68
+ *
69
+ * // Add an ID to the pool
70
+ * ReservedConnectionIds.AddId(456);
71
+ * ```
72
+ *
73
+ * @remarks
74
+ * Maintains a pool of at least 10 IDs. When the pool has fewer than 10 IDs,
75
+ * it automatically requests more from the backend.
76
+ */
77
+ export declare class ReservedConnectionIds {
78
+ /** Pool of reserved connection IDs */
79
+ static connectionIds: number[];
80
+ /**
81
+ * Gets the next available reserved connection ID from the pool.
82
+ * Automatically refills the pool if it has fewer than 10 IDs.
83
+ *
84
+ * @returns {Promise<number>} A unique reserved connection ID
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const id = await ReservedConnectionIds.getId();
89
+ * const connection = new Connection(id, ...);
90
+ * ```
91
+ *
92
+ * @remarks
93
+ * Uses FIFO (first in, first out) to retrieve IDs.
94
+ * Triggers a backend call to GetReservedConnectionIds when pool is low.
95
+ */
96
+ static getId(): Promise<number>;
97
+ /**
98
+ * Adds an ID to the reserved connection IDs pool.
99
+ *
100
+ * @param {number} id - The ID to add to the pool
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * ReservedConnectionIds.AddId(456);
105
+ * ```
106
+ *
107
+ * @remarks
108
+ * Prevents duplicate IDs from being added to the pool.
109
+ */
110
+ static AddId(id: number): void;
111
+ }