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.
- package/README.md +1148 -11
- package/dist/bundle.js +1 -0
- package/dist/types/Api/Create/CreateTheCharacter.d.ts +45 -0
- package/dist/types/Api/Create/CreateTheConceptApi.d.ts +52 -0
- package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +53 -0
- package/dist/types/Api/Create/CreateTheTextData.d.ts +58 -0
- package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +44 -0
- package/dist/types/Api/DeleteConnectionApiBulk.d.ts +56 -0
- package/dist/types/Api/DeleteTheConcept.d.ts +65 -0
- package/dist/types/Api/DeleteTheConnection.d.ts +77 -0
- package/dist/types/Api/GetAiData.d.ts +37 -0
- package/dist/types/Api/GetAllConcepts.d.ts +43 -0
- package/dist/types/Api/GetAllConceptsByType.d.ts +46 -0
- package/dist/types/Api/GetAllConnections.d.ts +49 -0
- package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +82 -0
- package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +93 -0
- package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +54 -0
- package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +63 -0
- package/dist/types/Api/GetAllPrefetchConnections.d.ts +52 -0
- package/dist/types/Api/GetCharacterDataByCharacter.d.ts +33 -0
- package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +41 -0
- package/dist/types/Api/GetConcept.d.ts +49 -0
- package/dist/types/Api/GetConceptBulk.d.ts +71 -0
- package/dist/types/Api/GetConceptByCharacterAndType.d.ts +78 -0
- package/dist/types/Api/GetConceptByCharacterValue.d.ts +49 -0
- package/dist/types/Api/GetConnection.d.ts +51 -0
- package/dist/types/Api/GetConnectionBulk.d.ts +48 -0
- package/dist/types/Api/GetConnectionOfTheConcept.d.ts +52 -0
- package/dist/types/Api/GetConnectionToTheConcept.d.ts +58 -0
- package/dist/types/Api/GetReservedConnectionIds.d.ts +37 -0
- package/dist/types/Api/GetReservedIds.d.ts +38 -0
- package/dist/types/Api/Login.d.ts +39 -0
- package/dist/types/Api/MakeTheNameInBackend.d.ts +40 -0
- package/dist/types/Api/MakeTheTypeConceptApi.d.ts +42 -0
- package/dist/types/Api/RecursiveSearch.d.ts +44 -0
- package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +48 -0
- package/dist/types/Api/Search/Search.d.ts +68 -0
- package/dist/types/Api/Search/SearchInternalApi.d.ts +71 -0
- package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +92 -0
- package/dist/types/Api/Search/SearchWithLinker.d.ts +99 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +41 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +49 -0
- package/dist/types/Api/Session/CreateSession.d.ts +47 -0
- package/dist/types/Api/Session/CreateSessionVisit.d.ts +44 -0
- package/dist/types/Api/Signin.d.ts +51 -0
- package/dist/types/Api/Signup.d.ts +47 -0
- package/dist/types/Api/View/ViewInternalDataApi.d.ts +51 -0
- package/dist/types/Constants/ApiConstants.d.ts +249 -0
- package/dist/types/Constants/FormatConstants.d.ts +87 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +262 -0
- package/dist/types/DataStructures/BinaryCharacterTree.d.ts +227 -0
- package/dist/types/DataStructures/BinaryTree.d.ts +151 -0
- package/dist/types/DataStructures/BinaryTypeTree.d.ts +211 -0
- package/dist/types/DataStructures/CharacterRepository.d.ts +117 -0
- package/dist/types/DataStructures/Composition/Composition.d.ts +117 -0
- package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +114 -0
- package/dist/types/DataStructures/Composition/CompositionNode.d.ts +223 -0
- package/dist/types/DataStructures/Concept.d.ts +139 -0
- package/dist/types/DataStructures/ConceptData.d.ts +317 -0
- package/dist/types/DataStructures/ConceptsToDraw.d.ts +179 -0
- package/dist/types/DataStructures/Connection.d.ts +103 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +126 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +193 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +95 -0
- package/dist/types/DataStructures/ConnectionData.d.ts +209 -0
- package/dist/types/DataStructures/Count/CountInfo.d.ts +79 -0
- package/dist/types/DataStructures/FilterSearch.d.ts +93 -0
- package/dist/types/DataStructures/IdentifierFlags.d.ts +45 -0
- package/dist/types/DataStructures/Local/LConcept.d.ts +126 -0
- package/dist/types/DataStructures/Local/LConnection.d.ts +101 -0
- package/dist/types/DataStructures/Local/LNode.d.ts +217 -0
- package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +145 -0
- package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +147 -0
- package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +160 -0
- package/dist/types/DataStructures/Local/LocalConceptData.d.ts +114 -0
- package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +125 -0
- package/dist/types/DataStructures/Local/LocalSyncData.d.ts +103 -0
- package/dist/types/DataStructures/Node.d.ts +29 -0
- package/dist/types/DataStructures/PatcherStructure.d.ts +94 -0
- package/dist/types/DataStructures/ReferentInfo.d.ts +75 -0
- package/dist/types/DataStructures/ReservedIds.d.ts +111 -0
- package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +236 -0
- package/dist/types/DataStructures/Responses/StandardResponses.d.ts +71 -0
- package/dist/types/DataStructures/Returner.d.ts +66 -0
- package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +187 -0
- package/dist/types/DataStructures/Search/SearchStructure.d.ts +78 -0
- package/dist/types/DataStructures/SearchQuery.d.ts +146 -0
- package/dist/types/DataStructures/Security/TokenStorage.d.ts +51 -0
- package/dist/types/DataStructures/Session/SessionData.d.ts +131 -0
- package/dist/types/DataStructures/SettingData.d.ts +37 -0
- package/dist/types/DataStructures/Settings.d.ts +31 -0
- package/dist/types/DataStructures/SigninModel.d.ts +54 -0
- package/dist/types/DataStructures/SignupModel.d.ts +54 -0
- package/dist/types/DataStructures/SyncData.d.ts +232 -0
- package/dist/types/DataStructures/TheCharacter.d.ts +100 -0
- package/dist/types/DataStructures/TheTexts.d.ts +106 -0
- package/dist/types/DataStructures/Transaction/Transaction.d.ts +320 -0
- package/dist/types/DataStructures/User/UserBinaryTree.d.ts +132 -0
- package/dist/types/DataStructures/User/UserNode.d.ts +150 -0
- package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
- package/dist/types/Database/NoIndexDb.d.ts +178 -0
- package/dist/types/Database/indexdblocal.d.ts +45 -0
- package/dist/types/Database/indexeddb.d.ts +46 -0
- package/dist/types/Drawing/ConceptDraw.d.ts +29 -0
- package/dist/types/Drawing/ConceptEvents.d.ts +47 -0
- package/dist/types/Helpers/CheckIfExists.d.ts +169 -0
- package/dist/types/Helpers/RemoveFromArray.d.ts +72 -0
- package/dist/types/Helpers/UniqueInsert.d.ts +29 -0
- package/dist/types/Services/CheckForConnectionDeletion.d.ts +193 -0
- package/dist/types/Services/Common/DecodeCountInfo.d.ts +57 -0
- package/dist/types/Services/Common/ErrorPosting.d.ts +51 -0
- package/dist/types/Services/Common/RegexFunction.d.ts +29 -0
- package/dist/types/Services/Composition/BuildComposition.d.ts +40 -0
- package/dist/types/Services/Composition/CompositionCache.d.ts +93 -0
- package/dist/types/Services/Composition/CreateCompositionCache.d.ts +46 -0
- package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +5 -0
- package/dist/types/Services/Conversion/ConvertConcepts.d.ts +90 -0
- package/dist/types/Services/CreateBinaryTreeFromData.d.ts +39 -0
- package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +43 -0
- package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +211 -0
- package/dist/types/Services/CreateDefaultConcept.d.ts +117 -0
- package/dist/types/Services/CreateTheComposition.d.ts +103 -0
- package/dist/types/Services/CreateTheConcept.d.ts +184 -0
- package/dist/types/Services/CreateTheConnection.d.ts +61 -0
- package/dist/types/Services/CreateTheConnectionGeneral.d.ts +132 -0
- package/dist/types/Services/CreateTypeTreeFromData.d.ts +44 -0
- package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +60 -0
- package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +64 -0
- package/dist/types/Services/DeleteConcept.d.ts +137 -0
- package/dist/types/Services/DeleteConnection.d.ts +196 -0
- package/dist/types/Services/FindConeceptsFromConnection.d.ts +181 -0
- package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +159 -0
- package/dist/types/Services/GenerateHexNumber.d.ts +65 -0
- package/dist/types/Services/GetAccessIdOfUser.d.ts +0 -0
- package/dist/types/Services/GetComposition.d.ts +342 -0
- package/dist/types/Services/GetCompositionBulk.d.ts +259 -0
- package/dist/types/Services/GetCompositionList.d.ts +132 -0
- package/dist/types/Services/GetConceptByCharacter.d.ts +87 -0
- package/dist/types/Services/GetConnections.d.ts +74 -0
- package/dist/types/Services/GetDataFromIndexDb.d.ts +81 -0
- package/dist/types/Services/GetLink.d.ts +107 -0
- package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +102 -0
- package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +59 -0
- package/dist/types/Services/GetRelation.d.ts +167 -0
- package/dist/types/Services/GetTheConcept.d.ts +73 -0
- package/dist/types/Services/GetTheReferent.d.ts +76 -0
- package/dist/types/Services/InitializeSystem.d.ts +121 -0
- package/dist/types/Services/Local/CreateConnectionListFromDatat.d.ts +0 -0
- package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +50 -0
- package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +50 -0
- package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +55 -0
- package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +61 -0
- package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +72 -0
- package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +60 -0
- package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +58 -0
- package/dist/types/Services/Local/GetCompositionListLocal.d.ts +105 -0
- package/dist/types/Services/Local/GetCompositionLocal.d.ts +98 -0
- package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +58 -0
- package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +73 -0
- package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +91 -0
- package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +73 -0
- package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +103 -0
- package/dist/types/Services/MakeTheCharacter.d.ts +76 -0
- package/dist/types/Services/MakeTheCharacterData.d.ts +67 -0
- package/dist/types/Services/MakeTheConcept.d.ts +2 -0
- package/dist/types/Services/MakeTheInstanceConcept.d.ts +78 -0
- package/dist/types/Services/MakeTheLocalConcept.d.ts +0 -0
- package/dist/types/Services/MakeTheName.d.ts +83 -0
- package/dist/types/Services/MakeTheTimestamp.d.ts +70 -0
- package/dist/types/Services/MakeTheTypeConcept.d.ts +71 -0
- package/dist/types/Services/Mqtt/publishMessage.d.ts +28 -0
- package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
- package/dist/types/Services/PatchComposition.d.ts +107 -0
- package/dist/types/Services/Search/DataIdFormat.d.ts +104 -0
- package/dist/types/Services/Search/FormatData.d.ts +101 -0
- package/dist/types/Services/Search/JustIdFormat.d.ts +98 -0
- package/dist/types/Services/Search/SearchLinkInternal.d.ts +30 -0
- package/dist/types/Services/Search/SearchLinkMultiple.d.ts +61 -0
- package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +101 -0
- package/dist/types/Services/Search/orderingConnections.d.ts +36 -0
- package/dist/types/Services/Security/GetRequestHeader.d.ts +10 -0
- package/dist/types/Services/SplitStrings.d.ts +51 -0
- package/dist/types/Services/UpdateComposition.d.ts +125 -0
- package/dist/types/Services/User/UserTranslation.d.ts +108 -0
- package/dist/types/Services/View/ViewInternalData.d.ts +33 -0
- package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +159 -0
- package/dist/types/app.d.ts +162 -0
- package/package.json +1 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview ConnectionData module for managing connection storage and retrieval in CCS-JS.
|
|
3
|
+
* This module provides centralized management of connections using binary tree indexing
|
|
4
|
+
* for efficient ID-based and type-based lookups.
|
|
5
|
+
* @module DataStructures/ConnectionData
|
|
6
|
+
*/
|
|
7
|
+
import { Connection } from "./Connection";
|
|
8
|
+
/**
|
|
9
|
+
* Central repository for managing all connections in the CCS system.
|
|
10
|
+
* Provides binary tree indexing for efficient connection retrieval by ID and type.
|
|
11
|
+
* Maintains both in-memory (tree structures) and persistent (IndexedDB) storage.
|
|
12
|
+
*
|
|
13
|
+
* @class ConnectionData
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Add a connection to the system
|
|
17
|
+
* ConnectionData.AddConnection(myConnection);
|
|
18
|
+
*
|
|
19
|
+
* // Retrieve a connection by ID
|
|
20
|
+
* const connection = await ConnectionData.GetConnection(123);
|
|
21
|
+
*
|
|
22
|
+
* // Get connections of a composition type
|
|
23
|
+
* const connections = await ConnectionData.GetConnectionsOfCompositionLocal(10);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* This class uses static methods and properties, functioning as a singleton data store.
|
|
28
|
+
* It coordinates ID-based and type-based indexing for optimized query performance.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ConnectionData {
|
|
31
|
+
/** Name identifier for this data structure */
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new ConnectionData instance.
|
|
35
|
+
* @remarks This is rarely instantiated as the class primarily uses static methods.
|
|
36
|
+
*/
|
|
37
|
+
constructor();
|
|
38
|
+
/** Legacy array storage for connections (deprecated in favor of tree structures) */
|
|
39
|
+
static connectionArray: Connection[];
|
|
40
|
+
/** Dictionary-style storage for quick connection lookups by ID */
|
|
41
|
+
static connectionDictionary: Connection[];
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a connection already exists in the connections array.
|
|
44
|
+
*
|
|
45
|
+
* @param {Connection} connection - The connection to check for existence
|
|
46
|
+
* @returns {boolean} True if the connection exists, false otherwise
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const exists = ConnectionData.CheckContains(myConnection);
|
|
51
|
+
* if (!exists) {
|
|
52
|
+
* // Add the connection
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
static CheckContains(connection: Connection): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Adds a connection to persistent storage (IndexedDB) only.
|
|
59
|
+
* Does not update in-memory tree structures.
|
|
60
|
+
*
|
|
61
|
+
* @param {Connection} connection - The connection to store persistently
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* ConnectionData.AddConnectionToStorage(myConnection);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
static AddConnectionToStorage(connection: Connection): void;
|
|
69
|
+
/**
|
|
70
|
+
* Adds a connection to both persistent storage and all in-memory tree indexes.
|
|
71
|
+
* This is the primary method for adding connections to the system.
|
|
72
|
+
*
|
|
73
|
+
* @param {Connection} connection - The connection to add
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const newConnection = new Connection(...);
|
|
78
|
+
* ConnectionData.AddConnection(newConnection);
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* Updates two tree structures:
|
|
83
|
+
* - ConnectionBinaryTree (ID-based lookup)
|
|
84
|
+
* - ConnectionTypeTree (type-based lookup)
|
|
85
|
+
* Skips temporary connections (isTemp = true)
|
|
86
|
+
*/
|
|
87
|
+
static AddConnection(connection: Connection): void;
|
|
88
|
+
/**
|
|
89
|
+
* Adds a connection to in-memory tree structures only, without persisting to storage.
|
|
90
|
+
* Useful for temporary connections or when storage is handled separately.
|
|
91
|
+
*
|
|
92
|
+
* @param {Connection} connection - The connection to add to memory
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* ConnectionData.AddConnectionToMemory(temporaryConnection);
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* Updates tree structures without touching IndexedDB.
|
|
101
|
+
* Skips temporary connections (isTemp = true)
|
|
102
|
+
*/
|
|
103
|
+
static AddConnectionToMemory(connection: Connection): void;
|
|
104
|
+
/**
|
|
105
|
+
* Adds a connection to the dictionary for quick ID-based lookups.
|
|
106
|
+
*
|
|
107
|
+
* @param {Connection} connection - The connection to add to dictionary
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* ConnectionData.AddToDictionary(myConnection);
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
static AddToDictionary(connection: Connection): void;
|
|
115
|
+
/**
|
|
116
|
+
* Removes a connection from all storage locations (memory trees and persistent storage).
|
|
117
|
+
*
|
|
118
|
+
* @param {Connection} connection - The connection to remove
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* ConnectionData.RemoveConnection(obsoleteConnection);
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @remarks
|
|
126
|
+
* Removes from:
|
|
127
|
+
* - IndexedDB persistent storage
|
|
128
|
+
* - ConnectionBinaryTree (ID index)
|
|
129
|
+
* - ConnectionTypeTree (type index)
|
|
130
|
+
* Only processes connections with valid IDs (id != 0)
|
|
131
|
+
*/
|
|
132
|
+
static RemoveConnection(connection: Connection): void;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the root node of the connection binary tree.
|
|
135
|
+
* Used for direct tree traversal or debugging.
|
|
136
|
+
*
|
|
137
|
+
* @returns {Node | null} The root node of the connection tree
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const tree = ConnectionData.GetConnectionTree();
|
|
142
|
+
* if (tree) {
|
|
143
|
+
* console.log("Tree root:", tree.key);
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
static GetConnectionTree(): import("./ConnectionBinaryTree/ConnectionNode").ConnectionNode | null;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the root node of the connection type tree.
|
|
150
|
+
* Used for direct tree traversal or debugging.
|
|
151
|
+
*
|
|
152
|
+
* @returns {Node | null} The root node of the connection type tree
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const tree = ConnectionData.GetConnectionTypeTree();
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
static GetConnectionTypeTree(): import("./ConnectionBinaryTree/ConnectionNode").ConnectionNode | null;
|
|
160
|
+
/**
|
|
161
|
+
* Retrieves a connection by its ID from the binary tree index.
|
|
162
|
+
*
|
|
163
|
+
* @param {number} id - The connection ID to retrieve
|
|
164
|
+
* @returns {Promise<Connection>} The connection if found, or a default connection if not found
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* const connection = await ConnectionData.GetConnection(123);
|
|
169
|
+
* if (connection.id !== 0) {
|
|
170
|
+
* console.log("Found connection:", connection.ofTheConceptId, "->", connection.toTheConceptId);
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @remarks
|
|
175
|
+
* Returns a default connection (id = 0) if the connection is not found.
|
|
176
|
+
* Uses ConnectionBinaryTree for O(log n) lookup performance.
|
|
177
|
+
*/
|
|
178
|
+
static GetConnection(id: number): Promise<Connection>;
|
|
179
|
+
/**
|
|
180
|
+
* Retrieves all connections of a specific composition type ID from the type tree.
|
|
181
|
+
* Includes the main connection and all its variants.
|
|
182
|
+
*
|
|
183
|
+
* @param {number} id - The type ID to filter by
|
|
184
|
+
* @returns {Promise<Connection[]>} Array of connections with the specified type
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* const connections = await ConnectionData.GetConnectionsOfCompositionLocal(10);
|
|
189
|
+
* console.log(`Found ${connections.length} connections of type 10`);
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* Uses ConnectionTypeTree to retrieve the main connection and all variant connections.
|
|
194
|
+
* Returns an empty array if no connections are found for the type.
|
|
195
|
+
*/
|
|
196
|
+
static GetConnectionsOfCompositionLocal(id: number): Promise<Connection[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Returns the name identifier of this data structure instance.
|
|
199
|
+
*
|
|
200
|
+
* @returns {string} The name "Connection Array"
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* const connectionData = new ConnectionData();
|
|
205
|
+
* console.log(connectionData.getName()); // "Connection Array"
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
getName(): string;
|
|
209
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the CountInfo class for storing connection count information.
|
|
3
|
+
* @module DataStructures/Count/CountInfo
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents information about connection counts for a concept.
|
|
7
|
+
* This class stores the count of connections of a specific type
|
|
8
|
+
* associated with a particular concept, useful for analytics and statistics.
|
|
9
|
+
*
|
|
10
|
+
* @class CountInfo
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const countInfo = new CountInfo();
|
|
15
|
+
* countInfo.conceptId = 123;
|
|
16
|
+
* countInfo.connectionTypeId = 456;
|
|
17
|
+
* countInfo.connectionType = "likes";
|
|
18
|
+
* countInfo.count = 42;
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Tracking follower counts
|
|
24
|
+
* const followerCount = new CountInfo();
|
|
25
|
+
* followerCount.conceptId = 100; // User ID
|
|
26
|
+
* followerCount.connectionType = "followers";
|
|
27
|
+
* followerCount.count = 1523;
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Multiple connection counts for a post
|
|
33
|
+
* const likesCount = new CountInfo();
|
|
34
|
+
* likesCount.conceptId = 200; // Post ID
|
|
35
|
+
* likesCount.connectionType = "likes";
|
|
36
|
+
* likesCount.count = 350;
|
|
37
|
+
*
|
|
38
|
+
* const commentsCount = new CountInfo();
|
|
39
|
+
* commentsCount.conceptId = 200; // Same Post ID
|
|
40
|
+
* commentsCount.connectionType = "comments";
|
|
41
|
+
* commentsCount.count = 45;
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare class CountInfo {
|
|
45
|
+
/**
|
|
46
|
+
* The ID of the concept for which connections are being counted.
|
|
47
|
+
* Identifies the entity whose connections are being tracked.
|
|
48
|
+
*
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @default 0
|
|
51
|
+
*/
|
|
52
|
+
conceptId: number;
|
|
53
|
+
/**
|
|
54
|
+
* The ID of the connection type being counted.
|
|
55
|
+
* Identifies which type of connection this count represents.
|
|
56
|
+
*
|
|
57
|
+
* @type {number}
|
|
58
|
+
* @default 0
|
|
59
|
+
*/
|
|
60
|
+
connectionTypeId: number;
|
|
61
|
+
/**
|
|
62
|
+
* The string name/description of the connection type.
|
|
63
|
+
* Human-readable identifier for the type of connection being counted.
|
|
64
|
+
*
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @default ""
|
|
67
|
+
*
|
|
68
|
+
* @example "likes", "follows", "comments", "shares"
|
|
69
|
+
*/
|
|
70
|
+
connectionType: string;
|
|
71
|
+
/**
|
|
72
|
+
* The number of connections of this type.
|
|
73
|
+
* The actual count value representing how many connections exist.
|
|
74
|
+
*
|
|
75
|
+
* @type {number}
|
|
76
|
+
* @default 0
|
|
77
|
+
*/
|
|
78
|
+
count: number;
|
|
79
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the FilterSearch class for creating filter criteria in search queries.
|
|
3
|
+
* @module DataStructures/FilterSearch
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a single filter criterion for search operations.
|
|
7
|
+
* This class encapsulates the conditions for filtering search results based on
|
|
8
|
+
* specific fields, values, and logical operators.
|
|
9
|
+
*
|
|
10
|
+
* @class FilterSearch
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const filter = new FilterSearch();
|
|
15
|
+
* filter.type = "age";
|
|
16
|
+
* filter.search = "25";
|
|
17
|
+
* filter.logicoperator = ">=";
|
|
18
|
+
* filter.index = 0;
|
|
19
|
+
* filter.composition = true;
|
|
20
|
+
* filter.name = "age_filter";
|
|
21
|
+
* filter.operateon = "value";
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // String equality filter
|
|
27
|
+
* const nameFilter = new FilterSearch();
|
|
28
|
+
* nameFilter.type = "name";
|
|
29
|
+
* nameFilter.search = "John";
|
|
30
|
+
* nameFilter.logicoperator = "=";
|
|
31
|
+
* nameFilter.operateon = "text";
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class FilterSearch {
|
|
35
|
+
/**
|
|
36
|
+
* The type or field name to filter on.
|
|
37
|
+
* Specifies which property of the entity should be evaluated by this filter.
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @default ""
|
|
41
|
+
*/
|
|
42
|
+
type: string;
|
|
43
|
+
/**
|
|
44
|
+
* The search value or term to filter against.
|
|
45
|
+
* The value that will be compared with the specified field using the logic operator.
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @default ""
|
|
49
|
+
*/
|
|
50
|
+
search: string;
|
|
51
|
+
/**
|
|
52
|
+
* The logical operator for comparison.
|
|
53
|
+
* Determines how the search value is compared with the field value.
|
|
54
|
+
* Common operators include: "=", "!=", ">", "<", ">=", "<=", "LIKE", "IN".
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @default "="
|
|
58
|
+
*/
|
|
59
|
+
logicoperator: string;
|
|
60
|
+
/**
|
|
61
|
+
* The index or position of this filter in a filter array.
|
|
62
|
+
* Used for ordering and referencing filters in complex filter combinations.
|
|
63
|
+
*
|
|
64
|
+
* @type {number}
|
|
65
|
+
* @default 0
|
|
66
|
+
*/
|
|
67
|
+
index: number;
|
|
68
|
+
/**
|
|
69
|
+
* Flag indicating whether this filter applies to compositions.
|
|
70
|
+
* When true, the filter is evaluated within a composition context.
|
|
71
|
+
*
|
|
72
|
+
* @type {boolean}
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
composition: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* A descriptive name for this filter.
|
|
78
|
+
* Useful for identifying and debugging filter operations.
|
|
79
|
+
*
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @default ""
|
|
82
|
+
*/
|
|
83
|
+
name: string;
|
|
84
|
+
/**
|
|
85
|
+
* The operand type or target field for the filter operation.
|
|
86
|
+
* Specifies what kind of data or field the filter operates on
|
|
87
|
+
* (e.g., "value", "text", "date", "id").
|
|
88
|
+
*
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @default ""
|
|
91
|
+
*/
|
|
92
|
+
operateon: string;
|
|
93
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview IdentifierFlags module for tracking data loading states in CCS-JS.
|
|
3
|
+
* This module provides centralized flags for synchronizing data loading across different storage structures.
|
|
4
|
+
* @module DataStructures/IdentifierFlags
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Centralized flags for tracking the loading state of various data structures.
|
|
8
|
+
* Used for synchronization when loading initial data from backend or local storage.
|
|
9
|
+
*
|
|
10
|
+
* @class IdentifierFlags
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Check if data is loaded
|
|
14
|
+
* if (IdentifierFlags.isDataLoaded) {
|
|
15
|
+
* console.log("Concept data ready");
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* // Set flag when loading completes
|
|
19
|
+
* IdentifierFlags.isDataLoaded = true;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* All properties are static flags (booleans) used across the application
|
|
24
|
+
* to coordinate asynchronous data loading operations.
|
|
25
|
+
*/
|
|
26
|
+
export declare class IdentifierFlags {
|
|
27
|
+
/** Flag indicating if the type tree has been loaded from backend */
|
|
28
|
+
static isTypeLoaded: boolean;
|
|
29
|
+
/** Flag indicating if the character tree has been loaded from backend */
|
|
30
|
+
static isCharacterLoaded: boolean;
|
|
31
|
+
/** Flag indicating if the main concept data has been loaded from backend */
|
|
32
|
+
static isDataLoaded: boolean;
|
|
33
|
+
/** Flag indicating if local concept data has been loaded from IndexedDB */
|
|
34
|
+
static isLocalDataLoaded: boolean;
|
|
35
|
+
/** Flag indicating if local character tree has been loaded from IndexedDB */
|
|
36
|
+
static isLocalCharacterLoaded: boolean;
|
|
37
|
+
/** Flag indicating if local type tree has been loaded from IndexedDB */
|
|
38
|
+
static isLocalTypeLoaded: boolean;
|
|
39
|
+
/** Flag indicating if connection data has been loaded from backend */
|
|
40
|
+
static isConnectionLoaded: boolean;
|
|
41
|
+
/** Flag indicating if connection type tree has been loaded from backend */
|
|
42
|
+
static isConnectionTypeLoaded: boolean;
|
|
43
|
+
/** Flag indicating if local connection data has been loaded from IndexedDB */
|
|
44
|
+
static isLocalConnectionLoaded: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Local Concept data structure for the Concept Connection System.
|
|
3
|
+
* This module defines the LConcept class which represents a local concept entity
|
|
4
|
+
* with various identifiers, timestamps, and metadata properties.
|
|
5
|
+
* @module DataStructures/Local/LConcept
|
|
6
|
+
*/
|
|
7
|
+
import { Concept } from "../Concept";
|
|
8
|
+
/**
|
|
9
|
+
* Represents a Local Concept in the Concept Connection System.
|
|
10
|
+
* A local concept is a data structure that stores concept information locally
|
|
11
|
+
* before or instead of synchronizing with a remote server.
|
|
12
|
+
*
|
|
13
|
+
* @class LConcept
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare class LConcept {
|
|
17
|
+
/**
|
|
18
|
+
* Unique identifier for the concept.
|
|
19
|
+
* @type {number}
|
|
20
|
+
*/
|
|
21
|
+
id: number;
|
|
22
|
+
/**
|
|
23
|
+
* Ghost identifier for tracking purposes.
|
|
24
|
+
* @type {number}
|
|
25
|
+
*/
|
|
26
|
+
ghostId: number;
|
|
27
|
+
/**
|
|
28
|
+
* Identifier of the user who owns this concept.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
userId: number;
|
|
32
|
+
/**
|
|
33
|
+
* Type identifier that classifies this concept.
|
|
34
|
+
* @type {number}
|
|
35
|
+
*/
|
|
36
|
+
typeId: number;
|
|
37
|
+
/**
|
|
38
|
+
* Category identifier for grouping concepts.
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
categoryId: number;
|
|
42
|
+
/**
|
|
43
|
+
* Access control identifier determining permissions.
|
|
44
|
+
* @type {number}
|
|
45
|
+
*/
|
|
46
|
+
accessId: number;
|
|
47
|
+
/**
|
|
48
|
+
* The character or text value representing this concept.
|
|
49
|
+
* @type {string}
|
|
50
|
+
*/
|
|
51
|
+
characterValue: string;
|
|
52
|
+
/**
|
|
53
|
+
* Character representation of the type.
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
typeCharacter: string;
|
|
57
|
+
/**
|
|
58
|
+
* Timestamp when this concept was created or entered.
|
|
59
|
+
* @type {Date | string}
|
|
60
|
+
*/
|
|
61
|
+
entryTimeStamp: Date | string;
|
|
62
|
+
/**
|
|
63
|
+
* Identifier for the referent data.
|
|
64
|
+
* @type {number}
|
|
65
|
+
*/
|
|
66
|
+
referentId: number;
|
|
67
|
+
/**
|
|
68
|
+
* Timestamp when this concept was last updated.
|
|
69
|
+
* @type {Date | string}
|
|
70
|
+
*/
|
|
71
|
+
updatedTimeStamp: Date | string;
|
|
72
|
+
/**
|
|
73
|
+
* Reference to the type concept (can be LConcept or Concept).
|
|
74
|
+
* @type {LConcept | null | void | Concept}
|
|
75
|
+
*/
|
|
76
|
+
type: LConcept | null | void | Concept;
|
|
77
|
+
/**
|
|
78
|
+
* Indicates whether this concept is newly created.
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
*/
|
|
81
|
+
isNew: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether this concept is a composition.
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
isComposition: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Indicates whether this concept is temporary.
|
|
90
|
+
* @type {boolean}
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
isTemp: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Application identifier for multi-application support.
|
|
96
|
+
* @type {number}
|
|
97
|
+
* @default 999
|
|
98
|
+
*/
|
|
99
|
+
applicationId: number;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a new LConcept instance.
|
|
102
|
+
*
|
|
103
|
+
* @constructor
|
|
104
|
+
* @param {number} id - Unique identifier for the concept
|
|
105
|
+
* @param {number} userId - Identifier of the user who owns this concept
|
|
106
|
+
* @param {number} typeId - Type identifier that classifies this concept
|
|
107
|
+
* @param {number} categoryId - Category identifier for grouping concepts
|
|
108
|
+
* @param {number} accessId - Access control identifier
|
|
109
|
+
* @param {string} characterValue - The character or text value of this concept
|
|
110
|
+
* @param {string} typeCharacter - Character representation of the type
|
|
111
|
+
* @param {boolean} [isNew=false] - Whether this concept is newly created
|
|
112
|
+
* @param {Date | string} entryTimeStamp - Creation timestamp
|
|
113
|
+
* @param {Date | string} updatedTimeStamp - Last update timestamp
|
|
114
|
+
* @param {number} referentId - Identifier for the referent data
|
|
115
|
+
* @param {number} [applicationId=999] - Application identifier
|
|
116
|
+
*/
|
|
117
|
+
constructor(id: number, userId: number, typeId: number, categoryId: number, accessId: number, characterValue: string, typeCharacter: string, isNew: boolean | undefined, entryTimeStamp: Date | string, updatedTimeStamp: Date | string, referentId: number, applicationId?: number);
|
|
118
|
+
/**
|
|
119
|
+
* Logs the type identifier of this concept to the console.
|
|
120
|
+
* Used primarily for debugging purposes.
|
|
121
|
+
*
|
|
122
|
+
* @method getType
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
getType(): void;
|
|
126
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Local Connection data structure for the Concept Connection System.
|
|
3
|
+
* This module defines the LConnection class which represents a connection between
|
|
4
|
+
* concepts in the local storage system.
|
|
5
|
+
* @module DataStructures/Local/LConnection
|
|
6
|
+
*/
|
|
7
|
+
import { LConcept } from "./LConcept";
|
|
8
|
+
/**
|
|
9
|
+
* Represents a Local Connection between concepts in the Concept Connection System.
|
|
10
|
+
* A local connection links two concepts and stores metadata about that relationship.
|
|
11
|
+
*
|
|
12
|
+
* @class LConnection
|
|
13
|
+
* @export
|
|
14
|
+
*/
|
|
15
|
+
export declare class LConnection {
|
|
16
|
+
/**
|
|
17
|
+
* Unique identifier for the connection.
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
id: number;
|
|
21
|
+
/**
|
|
22
|
+
* Ghost identifier for tracking purposes.
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
ghostId: number;
|
|
26
|
+
/**
|
|
27
|
+
* Identifier of the source concept (from concept).
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
ofTheConceptId: number;
|
|
31
|
+
/**
|
|
32
|
+
* Identifier of the target concept (to concept).
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
toTheConceptId: number;
|
|
36
|
+
/**
|
|
37
|
+
* Timestamp when this connection was created or entered.
|
|
38
|
+
* @type {Date | string}
|
|
39
|
+
*/
|
|
40
|
+
entryTimeStamp: Date | string;
|
|
41
|
+
/**
|
|
42
|
+
* Date and time when this connection is terminated or expires.
|
|
43
|
+
* @type {Date}
|
|
44
|
+
*/
|
|
45
|
+
terminationDateTime: Date;
|
|
46
|
+
/**
|
|
47
|
+
* Access control identifier determining permissions.
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
accessId: number;
|
|
51
|
+
/**
|
|
52
|
+
* Type identifier that classifies this connection.
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
typeId: number;
|
|
56
|
+
/**
|
|
57
|
+
* Order identifier for sequencing connections.
|
|
58
|
+
* @type {number}
|
|
59
|
+
*/
|
|
60
|
+
orderId: number;
|
|
61
|
+
/**
|
|
62
|
+
* Character representation of the connection type.
|
|
63
|
+
* @type {string}
|
|
64
|
+
*/
|
|
65
|
+
typeCharacter: string;
|
|
66
|
+
/**
|
|
67
|
+
* Timestamp of the last local synchronization.
|
|
68
|
+
* @type {Date}
|
|
69
|
+
*/
|
|
70
|
+
localSyncTime: Date;
|
|
71
|
+
/**
|
|
72
|
+
* Indicates whether this connection is temporary.
|
|
73
|
+
* @type {boolean}
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
isTemp: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Application identifier for multi-application support.
|
|
79
|
+
* @type {number}
|
|
80
|
+
* @default 999
|
|
81
|
+
*/
|
|
82
|
+
applicationId: number;
|
|
83
|
+
/**
|
|
84
|
+
* Reference to the type concept for this connection.
|
|
85
|
+
* @type {LConcept}
|
|
86
|
+
*/
|
|
87
|
+
type: LConcept;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a new LConnection instance.
|
|
90
|
+
*
|
|
91
|
+
* @constructor
|
|
92
|
+
* @param {number} [id=0] - Unique identifier for the connection
|
|
93
|
+
* @param {number} ofTheConceptId - Identifier of the source concept
|
|
94
|
+
* @param {number} toTheConceptId - Identifier of the target concept
|
|
95
|
+
* @param {number} typeId - Type identifier that classifies this connection
|
|
96
|
+
* @param {number} orderId - Order identifier for sequencing
|
|
97
|
+
* @param {number} accessId - Access control identifier
|
|
98
|
+
* @param {number} [applicationId=999] - Application identifier
|
|
99
|
+
*/
|
|
100
|
+
constructor(id: number | undefined, ofTheConceptId: number, toTheConceptId: number, typeId: number, orderId: number, accessId: number, applicationId?: number);
|
|
101
|
+
}
|