mftsccs-node 0.2.7 → 0.2.9
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 -1
- package/dist/types/Api/Create/CreateTheCharacter.d.ts +42 -0
- package/dist/types/Api/Create/CreateTheConceptApi.d.ts +50 -0
- package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +51 -0
- package/dist/types/Api/Create/CreateTheTextData.d.ts +56 -0
- package/dist/types/Api/Delete/DeleteConceptInBackend.d.ts +43 -0
- package/dist/types/Api/DeleteConnectionApiBulk.d.ts +55 -0
- package/dist/types/Api/DeleteTheConcept.d.ts +64 -0
- package/dist/types/Api/DeleteTheConnection.d.ts +76 -0
- package/dist/types/Api/GetAiData.d.ts +36 -0
- package/dist/types/Api/GetAllConcepts.d.ts +42 -0
- package/dist/types/Api/GetAllConceptsByType.d.ts +45 -0
- package/dist/types/Api/GetAllConnections.d.ts +48 -0
- package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +79 -0
- package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +90 -0
- package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +52 -0
- package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +61 -0
- package/dist/types/Api/GetAllPrefetchConnections.d.ts +51 -0
- package/dist/types/Api/GetCharacterDataByCharacter.d.ts +31 -0
- package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +39 -0
- package/dist/types/Api/GetConcept.d.ts +47 -0
- package/dist/types/Api/GetConceptBulk.d.ts +68 -0
- package/dist/types/Api/GetConceptByCharacterAndType.d.ts +75 -0
- package/dist/types/Api/GetConceptByCharacterValue.d.ts +47 -0
- package/dist/types/Api/GetConnection.d.ts +49 -0
- package/dist/types/Api/GetConnectionBulk.d.ts +46 -0
- package/dist/types/Api/GetConnectionOfTheConcept.d.ts +50 -0
- package/dist/types/Api/GetConnectionToTheConcept.d.ts +56 -0
- package/dist/types/Api/GetReservedConnectionIds.d.ts +36 -0
- package/dist/types/Api/GetReservedIds.d.ts +37 -0
- package/dist/types/Api/Login.d.ts +38 -0
- package/dist/types/Api/MakeTheNameInBackend.d.ts +39 -0
- package/dist/types/Api/MakeTheTypeConceptApi.d.ts +40 -0
- package/dist/types/Api/RecursiveSearch.d.ts +43 -0
- package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +46 -0
- package/dist/types/Api/Search/Search.d.ts +67 -0
- package/dist/types/Api/Search/SearchInternalApi.d.ts +69 -0
- package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +90 -0
- package/dist/types/Api/Search/SearchWithLinker.d.ts +97 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +39 -0
- package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +47 -0
- package/dist/types/Api/Session/CreateSession.d.ts +45 -0
- package/dist/types/Api/Session/CreateSessionVisit.d.ts +43 -0
- package/dist/types/Api/Signin.d.ts +48 -0
- package/dist/types/Api/Signup.d.ts +44 -0
- package/dist/types/Api/View/ViewInternalDataApi.d.ts +50 -0
- package/dist/types/Constants/ApiConstants.d.ts +226 -0
- package/dist/types/Constants/FormatConstants.d.ts +81 -0
- package/dist/types/DataStructures/BaseUrl.d.ts +210 -0
- package/dist/types/DataStructures/BinaryCharacterTree.d.ts +211 -0
- package/dist/types/DataStructures/BinaryTree.d.ts +139 -0
- package/dist/types/DataStructures/BinaryTypeTree.d.ts +196 -0
- package/dist/types/DataStructures/CharacterRepository.d.ts +109 -0
- package/dist/types/DataStructures/Composition/Composition.d.ts +103 -0
- package/dist/types/DataStructures/Composition/CompositionBinaryTree.d.ts +104 -0
- package/dist/types/DataStructures/Composition/CompositionNode.d.ts +202 -0
- package/dist/types/DataStructures/Concept.d.ts +110 -0
- package/dist/types/DataStructures/ConceptData.d.ts +292 -0
- package/dist/types/DataStructures/ConceptsToDraw.d.ts +168 -0
- package/dist/types/DataStructures/Connection.d.ts +76 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +115 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +169 -0
- package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +82 -0
- package/dist/types/DataStructures/ConnectionData.d.ts +191 -0
- package/dist/types/DataStructures/Count/CountInfo.d.ts +73 -0
- package/dist/types/DataStructures/FilterSearch.d.ts +84 -0
- package/dist/types/DataStructures/IdentifierFlags.d.ts +34 -0
- package/dist/types/DataStructures/Local/LConcept.d.ts +105 -0
- package/dist/types/DataStructures/Local/LConnection.d.ts +83 -0
- package/dist/types/DataStructures/Local/LNode.d.ts +190 -0
- package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +133 -0
- package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +135 -0
- package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +147 -0
- package/dist/types/DataStructures/Local/LocalConceptData.d.ts +100 -0
- package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +109 -0
- package/dist/types/DataStructures/Local/LocalSyncData.d.ts +89 -0
- package/dist/types/DataStructures/PatcherStructure.d.ts +86 -0
- package/dist/types/DataStructures/ReferentInfo.d.ts +68 -0
- package/dist/types/DataStructures/ReservedIds.d.ts +101 -0
- package/dist/types/DataStructures/Responses/ErrorResponse.d.ts +184 -22
- package/dist/types/DataStructures/Responses/StandardResponses.d.ts +65 -0
- package/dist/types/DataStructures/Returner.d.ts +59 -0
- package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +165 -0
- package/dist/types/DataStructures/Search/SearchStructure.d.ts +69 -0
- package/dist/types/DataStructures/SearchQuery.d.ts +130 -0
- package/dist/types/DataStructures/Security/TokenStorage.d.ts +48 -0
- package/dist/types/DataStructures/Session/SessionData.d.ts +118 -0
- package/dist/types/DataStructures/SettingData.d.ts +32 -0
- package/dist/types/DataStructures/Settings.d.ts +27 -0
- package/dist/types/DataStructures/SigninModel.d.ts +50 -0
- package/dist/types/DataStructures/SignupModel.d.ts +50 -0
- package/dist/types/DataStructures/SyncData.d.ts +206 -0
- package/dist/types/DataStructures/TheCharacter.d.ts +87 -0
- package/dist/types/DataStructures/TheTexts.d.ts +92 -0
- package/dist/types/DataStructures/Transaction/Transaction.d.ts +294 -4
- package/dist/types/DataStructures/User/UserBinaryTree.d.ts +117 -0
- package/dist/types/DataStructures/User/UserNode.d.ts +130 -0
- package/dist/types/Database/GetConceptFromIndexDb.d.ts +9 -0
- package/dist/types/Database/NoIndexDb.d.ts +169 -0
- package/dist/types/Database/indexdblocal.d.ts +42 -0
- package/dist/types/Database/indexeddb.d.ts +43 -0
- package/dist/types/Drawing/ConceptDraw.d.ts +28 -0
- package/dist/types/Drawing/ConceptEvents.d.ts +46 -0
- package/dist/types/Helpers/CheckIfExists.d.ts +159 -0
- package/dist/types/Helpers/RemoveFromArray.d.ts +66 -0
- package/dist/types/Helpers/UniqueInsert.d.ts +28 -0
- package/dist/types/Services/CheckForConnectionDeletion.d.ts +190 -0
- package/dist/types/Services/Common/DecodeCountInfo.d.ts +54 -0
- package/dist/types/Services/Common/ErrorPosting.d.ts +49 -0
- package/dist/types/Services/Common/RegexFunction.d.ts +28 -0
- package/dist/types/Services/Composition/BuildComposition.d.ts +37 -0
- package/dist/types/Services/Composition/CompositionCache.d.ts +89 -0
- package/dist/types/Services/Composition/CreateCompositionCache.d.ts +43 -0
- package/dist/types/Services/Conversion/ConvertConcepts.d.ts +83 -0
- package/dist/types/Services/CreateBinaryTreeFromData.d.ts +38 -0
- package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +42 -0
- package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +206 -0
- package/dist/types/Services/CreateDefaultConcept.d.ts +114 -0
- package/dist/types/Services/CreateTheComposition.d.ts +101 -0
- package/dist/types/Services/CreateTheConcept.d.ts +179 -0
- package/dist/types/Services/CreateTheConnection.d.ts +59 -0
- package/dist/types/Services/CreateTheConnectionGeneral.d.ts +127 -0
- package/dist/types/Services/CreateTypeTreeFromData.d.ts +43 -0
- package/dist/types/Services/Delete/DeleteConnectionByType.d.ts +52 -5
- package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +57 -9
- package/dist/types/Services/DeleteConcept.d.ts +136 -0
- package/dist/types/Services/DeleteConnection.d.ts +194 -0
- package/dist/types/Services/FindConeceptsFromConnection.d.ts +179 -0
- package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +157 -0
- package/dist/types/Services/GenerateHexNumber.d.ts +64 -0
- package/dist/types/Services/GetComposition.d.ts +331 -0
- package/dist/types/Services/GetCompositionBulk.d.ts +251 -3
- package/dist/types/Services/GetCompositionList.d.ts +130 -0
- package/dist/types/Services/GetConceptByCharacter.d.ts +84 -0
- package/dist/types/Services/GetConnections.d.ts +72 -0
- package/dist/types/Services/GetDataFromIndexDb.d.ts +79 -0
- package/dist/types/Services/GetLink.d.ts +104 -0
- package/dist/types/Services/GetLinkerConnectionFromConcept.d.ts +99 -0
- package/dist/types/Services/GetMaximumConnectionSyncTime.d.ts +57 -0
- package/dist/types/Services/GetRelation.d.ts +162 -0
- package/dist/types/Services/GetTheConcept.d.ts +71 -0
- package/dist/types/Services/GetTheReferent.d.ts +74 -0
- package/dist/types/Services/InitializeSystem.d.ts +119 -0
- package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +48 -0
- package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +49 -0
- package/dist/types/Services/Local/CreateLocalBinaryTypeTreeFromData.d.ts +54 -0
- package/dist/types/Services/Local/CreateLocalCharacterBinaryTree.d.ts +60 -0
- package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +70 -0
- package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +58 -0
- package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +56 -0
- package/dist/types/Services/Local/GetCompositionListLocal.d.ts +103 -0
- package/dist/types/Services/Local/GetCompositionLocal.d.ts +96 -0
- package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +57 -0
- package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +71 -0
- package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +89 -0
- package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +71 -0
- package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +101 -0
- package/dist/types/Services/MakeTheCharacter.d.ts +74 -0
- package/dist/types/Services/MakeTheCharacterData.d.ts +65 -0
- package/dist/types/Services/MakeTheInstanceConcept.d.ts +75 -0
- package/dist/types/Services/MakeTheName.d.ts +81 -0
- package/dist/types/Services/MakeTheTimestamp.d.ts +68 -0
- package/dist/types/Services/MakeTheTypeConcept.d.ts +68 -0
- package/dist/types/Services/Mqtt/publishMessage.d.ts +27 -0
- package/dist/types/Services/Mqtt/subscribeMessage.d.ts +23 -0
- package/dist/types/Services/PatchComposition.d.ts +105 -0
- package/dist/types/Services/Search/DataIdFormat.d.ts +96 -24
- package/dist/types/Services/Search/FormatData.d.ts +92 -17
- package/dist/types/Services/Search/JustIdFormat.d.ts +91 -16
- package/dist/types/Services/Search/NewFormat.d.ts +4 -0
- package/dist/types/Services/Search/SearchLinkInternal.d.ts +28 -0
- package/dist/types/Services/Search/SearchLinkMultiple.d.ts +58 -0
- package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +92 -24
- package/dist/types/Services/Search/orderingConnections.d.ts +34 -0
- package/dist/types/Services/SplitStrings.d.ts +50 -0
- package/dist/types/Services/UpdateComposition.d.ts +123 -0
- package/dist/types/Services/User/UserTranslation.d.ts +102 -0
- package/dist/types/Services/View/ViewInternalData.d.ts +32 -0
- package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +140 -5
- package/dist/types/app.d.ts +72 -1
- package/package.json +1 -1
|
@@ -1,13 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the SessionData class for storing session information.
|
|
3
|
+
* @module DataStructures/Session/SessionData
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents session information for a user's connection.
|
|
7
|
+
* This class stores comprehensive details about a user's session, including
|
|
8
|
+
* network information, server configuration, and user identification data.
|
|
9
|
+
* It captures both client and server-side information for session tracking and security purposes.
|
|
10
|
+
*
|
|
11
|
+
* @class SessionData
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const session = new SessionData();
|
|
16
|
+
* session.id = "abc123def456";
|
|
17
|
+
* session.userId = "12345";
|
|
18
|
+
* session.email = "user@example.com";
|
|
19
|
+
* session.remote_address = "192.168.1.100";
|
|
20
|
+
* session.http_user_agent = "Mozilla/5.0...";
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Populate session data from request
|
|
26
|
+
* const session = new SessionData();
|
|
27
|
+
* session.remote_address = request.connection.remoteAddress;
|
|
28
|
+
* session.server_port = process.env.PORT;
|
|
29
|
+
* session.server_name = request.hostname;
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
1
32
|
export declare class SessionData {
|
|
33
|
+
/**
|
|
34
|
+
* The unique session identifier.
|
|
35
|
+
* Used to track and identify individual sessions across requests.
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @default "0"
|
|
39
|
+
*/
|
|
2
40
|
id: string;
|
|
41
|
+
/**
|
|
42
|
+
* The remote IP address of the client.
|
|
43
|
+
* Identifies the network address from which the client is connecting.
|
|
44
|
+
*
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @default ""
|
|
47
|
+
*
|
|
48
|
+
* @example "192.168.1.100" or "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
|
|
49
|
+
*/
|
|
3
50
|
remote_address: string;
|
|
51
|
+
/**
|
|
52
|
+
* The port number on which the server is listening.
|
|
53
|
+
* Indicates which server port is handling the connection.
|
|
54
|
+
*
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @default ""
|
|
57
|
+
*
|
|
58
|
+
* @example "8080" or "443"
|
|
59
|
+
*/
|
|
4
60
|
server_port: string;
|
|
61
|
+
/**
|
|
62
|
+
* The server's IP address.
|
|
63
|
+
* Identifies the network address of the server handling the request.
|
|
64
|
+
*
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @default ""
|
|
67
|
+
*/
|
|
5
68
|
server_address: string;
|
|
69
|
+
/**
|
|
70
|
+
* The server's hostname or domain name.
|
|
71
|
+
* The fully qualified domain name or hostname of the server.
|
|
72
|
+
*
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @default ""
|
|
75
|
+
*
|
|
76
|
+
* @example "api.example.com" or "localhost"
|
|
77
|
+
*/
|
|
6
78
|
server_name: string;
|
|
79
|
+
/**
|
|
80
|
+
* Information about the server software.
|
|
81
|
+
* Identifies the server software and version handling the request.
|
|
82
|
+
*
|
|
83
|
+
* @type {string}
|
|
84
|
+
* @default ""
|
|
85
|
+
*
|
|
86
|
+
* @example "Apache/2.4.41" or "nginx/1.18.0"
|
|
87
|
+
*/
|
|
7
88
|
server_software: string;
|
|
89
|
+
/**
|
|
90
|
+
* The HTTP User-Agent header from the client.
|
|
91
|
+
* Contains information about the client's browser or application making the request.
|
|
92
|
+
*
|
|
93
|
+
* @type {string}
|
|
94
|
+
* @default ""
|
|
95
|
+
*
|
|
96
|
+
* @example "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36..."
|
|
97
|
+
*/
|
|
8
98
|
http_user_agent: string;
|
|
99
|
+
/**
|
|
100
|
+
* The self-referential identifier or URL.
|
|
101
|
+
* May contain a reference to the current script or endpoint.
|
|
102
|
+
*
|
|
103
|
+
* @type {string}
|
|
104
|
+
* @default ""
|
|
105
|
+
*/
|
|
9
106
|
self: string;
|
|
107
|
+
/**
|
|
108
|
+
* The client's port number.
|
|
109
|
+
* Indicates which port on the client side is being used for the connection.
|
|
110
|
+
*
|
|
111
|
+
* @type {string}
|
|
112
|
+
* @default ""
|
|
113
|
+
*/
|
|
10
114
|
port: string;
|
|
115
|
+
/**
|
|
116
|
+
* The user's unique identifier.
|
|
117
|
+
* Links the session to a specific user account.
|
|
118
|
+
*
|
|
119
|
+
* @type {string}
|
|
120
|
+
* @default ""
|
|
121
|
+
*/
|
|
11
122
|
userId: string;
|
|
123
|
+
/**
|
|
124
|
+
* The user's email address.
|
|
125
|
+
* Stores the authenticated user's email for session tracking.
|
|
126
|
+
*
|
|
127
|
+
* @type {string}
|
|
128
|
+
* @default ""
|
|
129
|
+
*/
|
|
12
130
|
email: string;
|
|
13
131
|
}
|
|
@@ -1,5 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SettingData module for managing persisted setting data in CCS-JS.
|
|
3
|
+
* This module defines the structure for storing user preferences and configuration.
|
|
4
|
+
* @module DataStructures/SettingData
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Represents persisted setting data for the application.
|
|
8
|
+
* Can be stored in local storage or IndexedDB for user preferences.
|
|
9
|
+
*
|
|
10
|
+
* @class SettingData
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Create settings with online sync enabled
|
|
14
|
+
* const settings = new SettingData(true);
|
|
15
|
+
*
|
|
16
|
+
* // Store settings
|
|
17
|
+
* localStorage.setItem('settings', JSON.stringify(settings));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
1
20
|
export declare class SettingData {
|
|
21
|
+
/** Unique identifier for the settings record */
|
|
2
22
|
id: number;
|
|
23
|
+
/** Controls whether online synchronization is enabled */
|
|
3
24
|
isOnlineSync: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new SettingData instance.
|
|
27
|
+
*
|
|
28
|
+
* @param {boolean} isOnlineSync - Whether to enable online synchronization
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const settings = new SettingData(true);
|
|
33
|
+
* console.log(settings.isOnlineSync); // true
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
4
36
|
constructor(isOnlineSync: boolean);
|
|
5
37
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Settings module for managing global application settings in CCS-JS.
|
|
3
|
+
* This module provides centralized configuration flags for application behavior.
|
|
4
|
+
* @module DataStructures/Settings
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Global application settings for CCS-JS.
|
|
8
|
+
* Controls application-wide behavior such as update status and synchronization mode.
|
|
9
|
+
*
|
|
10
|
+
* @class Settings
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Enable online sync
|
|
14
|
+
* Settings.isOnlineSync = true;
|
|
15
|
+
*
|
|
16
|
+
* // Check if system is updated
|
|
17
|
+
* if (Settings.isUpdated) {
|
|
18
|
+
* console.log("System is up to date");
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* All properties are static flags used across the application.
|
|
24
|
+
* These settings affect how data is synchronized and persisted.
|
|
25
|
+
*/
|
|
1
26
|
export declare class Settings {
|
|
27
|
+
/** Flag indicating if the system has been updated to the latest version */
|
|
2
28
|
static isUpdated: boolean;
|
|
29
|
+
/** Flag controlling whether changes are synchronized online immediately */
|
|
3
30
|
static isOnlineSync: boolean;
|
|
4
31
|
}
|
|
@@ -1,4 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the SigninModel interface for user authentication data.
|
|
3
|
+
* @module DataStructures/SigninModel
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the data required for user authentication/signin.
|
|
7
|
+
* This interface defines the structure for collecting user credentials
|
|
8
|
+
* during the login process.
|
|
9
|
+
*
|
|
10
|
+
* @interface SigninModel
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const signinData: SigninModel = {
|
|
15
|
+
* email: "user@example.com",
|
|
16
|
+
* password: "MySecurePassword123"
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Usage in an authentication function
|
|
23
|
+
* async function authenticateUser(credentials: SigninModel) {
|
|
24
|
+
* const user = await validateCredentials(credentials.email, credentials.password);
|
|
25
|
+
* if (user) {
|
|
26
|
+
* return generateAuthToken(user);
|
|
27
|
+
* }
|
|
28
|
+
* throw new Error("Invalid credentials");
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
1
32
|
export interface SigninModel {
|
|
33
|
+
/**
|
|
34
|
+
* The user's email address.
|
|
35
|
+
* Used to identify the user account attempting to sign in.
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
*
|
|
39
|
+
* @example "user@example.com"
|
|
40
|
+
*/
|
|
2
41
|
email: string;
|
|
42
|
+
/**
|
|
43
|
+
* The user's password for authentication.
|
|
44
|
+
* Will be verified against the stored hashed password.
|
|
45
|
+
*
|
|
46
|
+
* @type {string}
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* The password is transmitted securely and verified against
|
|
50
|
+
* the hashed version stored in the database. Never store or
|
|
51
|
+
* log passwords in plain text.
|
|
52
|
+
*/
|
|
3
53
|
password: string;
|
|
4
54
|
}
|
|
@@ -1,4 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the SignupModel interface for user registration data.
|
|
3
|
+
* @module DataStructures/SignupModel
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the data required for user registration/signup.
|
|
7
|
+
* This interface defines the structure for collecting user credentials
|
|
8
|
+
* during the account creation process.
|
|
9
|
+
*
|
|
10
|
+
* @interface SignupModel
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const signupData: SignupModel = {
|
|
15
|
+
* email: "newuser@example.com",
|
|
16
|
+
* password: "SecureP@ssw0rd123"
|
|
17
|
+
* };
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Usage in a signup function
|
|
23
|
+
* async function registerUser(userData: SignupModel) {
|
|
24
|
+
* // Validate and create user account
|
|
25
|
+
* const result = await createAccount(userData.email, userData.password);
|
|
26
|
+
* return result;
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
1
30
|
export interface SignupModel {
|
|
31
|
+
/**
|
|
32
|
+
* The user's email address.
|
|
33
|
+
* Used as the primary identifier for the user account.
|
|
34
|
+
* Should be unique and in valid email format.
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
*
|
|
38
|
+
* @example "user@example.com"
|
|
39
|
+
*/
|
|
2
40
|
email: string;
|
|
41
|
+
/**
|
|
42
|
+
* The user's password for account authentication.
|
|
43
|
+
* Should meet security requirements (e.g., minimum length, complexity).
|
|
44
|
+
* Will be hashed before storage for security purposes.
|
|
45
|
+
*
|
|
46
|
+
* @type {string}
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Passwords should be validated for strength before being accepted.
|
|
50
|
+
* Common requirements include minimum length, uppercase, lowercase,
|
|
51
|
+
* numbers, and special characters.
|
|
52
|
+
*/
|
|
3
53
|
password: string;
|
|
4
54
|
}
|
|
@@ -1,26 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SyncData module for managing synchronization of concepts and connections in CCS-JS.
|
|
3
|
+
* This module provides queuing and batch synchronization of local changes to the backend server,
|
|
4
|
+
* with support for transactional operations and rollback capabilities.
|
|
5
|
+
* @module DataStructures/SyncData
|
|
6
|
+
*/
|
|
1
7
|
import { Concept } from "./Concept";
|
|
2
8
|
import { Connection } from "./Connection";
|
|
3
9
|
import { InnerActions } from "./Transaction/Transaction";
|
|
10
|
+
/**
|
|
11
|
+
* Container for transactional sync data.
|
|
12
|
+
* Stores concepts and connections that are part of a transaction.
|
|
13
|
+
*/
|
|
4
14
|
type syncContainer = {
|
|
15
|
+
/** Unique transaction identifier */
|
|
5
16
|
id: string;
|
|
17
|
+
/** Transaction data containing concepts and connections */
|
|
6
18
|
data: InnerActions;
|
|
19
|
+
/** ISO timestamp of when the transaction was created */
|
|
7
20
|
createdDate: string;
|
|
8
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Manages synchronization of concepts and connections between local storage and backend.
|
|
24
|
+
* Provides queuing, batch processing, and transaction support for data synchronization.
|
|
25
|
+
*
|
|
26
|
+
* @class SyncData
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Add items to sync queue
|
|
30
|
+
* SyncData.AddConcept(myConcept);
|
|
31
|
+
* SyncData.AddConnection(myConnection);
|
|
32
|
+
*
|
|
33
|
+
* // Sync to backend
|
|
34
|
+
* await SyncData.SyncDataOnline();
|
|
35
|
+
*
|
|
36
|
+
* // Transaction support
|
|
37
|
+
* await SyncData.initializeTransaction("txn-123");
|
|
38
|
+
* await SyncData.markTransactionActions("txn-123", actions);
|
|
39
|
+
* await SyncData.SyncDataOnline("txn-123");
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* This class provides both immediate and batched synchronization modes.
|
|
44
|
+
* Transactions are automatically cleaned up after 7 days (604800000 ms).
|
|
45
|
+
*/
|
|
9
46
|
export declare class SyncData {
|
|
47
|
+
/** Queue of concepts waiting to be synchronized to backend */
|
|
10
48
|
static conceptsSyncArray: Concept[];
|
|
49
|
+
/** Queue of connections waiting to be synchronized to backend */
|
|
11
50
|
static connectionSyncArray: Connection[];
|
|
51
|
+
/** Collection of transactional sync operations */
|
|
12
52
|
static transactionCollections: syncContainer[];
|
|
53
|
+
/**
|
|
54
|
+
* Checks if a concept already exists in the sync queue.
|
|
55
|
+
*
|
|
56
|
+
* @param {Concept} concept - The concept to check
|
|
57
|
+
* @returns {boolean} True if the concept is in the sync queue, false otherwise
|
|
58
|
+
*
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
13
61
|
static CheckContains(concept: Concept): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Removes all sync data related to a specific concept ID.
|
|
64
|
+
* Removes the concept and any connections that reference it.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} id - The concept ID to remove from sync queues
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* SyncData.SyncDataDelete(123);
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* Also removes connections where the concept appears as ofTheConceptId, toTheConceptId, or typeId.
|
|
75
|
+
*/
|
|
14
76
|
static SyncDataDelete(id: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* Checks if a connection already exists in the sync queue.
|
|
79
|
+
*
|
|
80
|
+
* @param {Connection} connection - The connection to check
|
|
81
|
+
* @returns {boolean} True if the connection is in the sync queue, false otherwise
|
|
82
|
+
*
|
|
83
|
+
* @private
|
|
84
|
+
*/
|
|
15
85
|
static CheckContainsConnection(connection: Connection): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Adds a concept to the synchronization queue.
|
|
88
|
+
*
|
|
89
|
+
* @param {Concept} concept - The concept to add to sync queue
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* SyncData.AddConcept(myConcept);
|
|
94
|
+
* // Later...
|
|
95
|
+
* await SyncData.SyncDataOnline();
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
16
98
|
static AddConcept(concept: Concept): void;
|
|
99
|
+
/**
|
|
100
|
+
* Removes a concept from the synchronization queue.
|
|
101
|
+
*
|
|
102
|
+
* @param {Concept} concept - The concept to remove from sync queue
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* SyncData.RemoveConcept(myConcept);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
17
109
|
static RemoveConcept(concept: Concept): void;
|
|
110
|
+
/**
|
|
111
|
+
* Adds a connection to the synchronization queue.
|
|
112
|
+
*
|
|
113
|
+
* @param {Connection} connection - The connection to add to sync queue
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* SyncData.AddConnection(myConnection);
|
|
118
|
+
* // Later...
|
|
119
|
+
* await SyncData.SyncDataOnline();
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
18
122
|
static AddConnection(connection: Connection): void;
|
|
123
|
+
/**
|
|
124
|
+
* Removes a connection from the synchronization queue.
|
|
125
|
+
*
|
|
126
|
+
* @param {Connection} connection - The connection to remove from sync queue
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* SyncData.RemoveConnection(myConnection);
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
19
133
|
static RemoveConnection(connection: Connection): void;
|
|
134
|
+
/**
|
|
135
|
+
* Synchronizes queued data to the backend server.
|
|
136
|
+
* Can sync either a specific transaction or all queued data.
|
|
137
|
+
*
|
|
138
|
+
* @param {string} [transactionId] - Optional transaction ID to sync specific transaction
|
|
139
|
+
* @returns {Promise<string>} Returns "done" when synchronization completes
|
|
140
|
+
* @throws {Error} If synchronization fails
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* // Sync all queued data
|
|
145
|
+
* await SyncData.SyncDataOnline();
|
|
146
|
+
*
|
|
147
|
+
* // Sync specific transaction
|
|
148
|
+
* await SyncData.SyncDataOnline("txn-123");
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* @remarks
|
|
152
|
+
* - If transactionId is provided, only that transaction is synced and removed from collection
|
|
153
|
+
* - Otherwise, all queued concepts and connections are synced
|
|
154
|
+
* - Automatically cleans up transactions older than 7 days (604800000 ms)
|
|
155
|
+
* - Adds data to permanent storage before sending to backend
|
|
156
|
+
*/
|
|
20
157
|
static SyncDataOnline(transactionId?: string): Promise<"done" | undefined>;
|
|
158
|
+
/**
|
|
159
|
+
* Initializes a new transaction container for tracking related changes.
|
|
160
|
+
*
|
|
161
|
+
* @param {string} transactionId - Unique identifier for the transaction
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* await SyncData.initializeTransaction("txn-123");
|
|
166
|
+
* // Make changes...
|
|
167
|
+
* await SyncData.markTransactionActions("txn-123", actions);
|
|
168
|
+
* await SyncData.SyncDataOnline("txn-123");
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @remarks
|
|
172
|
+
* Does nothing if a transaction with the same ID already exists.
|
|
173
|
+
* Creates an empty container with the current timestamp.
|
|
174
|
+
*/
|
|
21
175
|
static initializeTransaction(transactionId: string): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Marks specific actions as part of a transaction.
|
|
178
|
+
* Removes these actions from the general sync queues to prevent duplication.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} transactionId - The transaction ID
|
|
181
|
+
* @param {InnerActions} actions - The concepts and connections to mark as part of transaction
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const actions = {
|
|
186
|
+
* concepts: [concept1, concept2],
|
|
187
|
+
* connections: [connection1, connection2]
|
|
188
|
+
* };
|
|
189
|
+
* await SyncData.markTransactionActions("txn-123", actions);
|
|
190
|
+
* ```
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* - Updates the transaction container with the actions
|
|
194
|
+
* - Removes marked items from conceptsSyncArray and connectionSyncArray
|
|
195
|
+
* - Matches items by both id and ghostId to handle temporary IDs
|
|
196
|
+
*/
|
|
22
197
|
static markTransactionActions(transactionId: string, actions: InnerActions): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Rolls back a transaction by removing it from the transaction collection.
|
|
200
|
+
*
|
|
201
|
+
* @param {string} transactionId - The transaction ID to rollback
|
|
202
|
+
* @param {InnerActions} actions - The actions to rollback (currently unused)
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* await SyncData.rollbackTransaction("txn-123", actions);
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* @remarks
|
|
210
|
+
* Currently only removes the transaction from collection if it doesn't already exist.
|
|
211
|
+
* The logic may need review as it checks for existence before removal.
|
|
212
|
+
*/
|
|
23
213
|
static rollbackTransaction(transactionId: string, actions: InnerActions): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Synchronizes queued data to local IndexedDB storage only (not to backend).
|
|
216
|
+
*
|
|
217
|
+
* @returns {Promise<string>} Returns "done" when local sync completes
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* await SyncData.syncDataLocalDb();
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
* @remarks
|
|
225
|
+
* - Stores concepts to "localconcept" database
|
|
226
|
+
* - Stores connections to "localconnection" database
|
|
227
|
+
* - Clears the sync queues after storing
|
|
228
|
+
* - Used for offline persistence without backend sync
|
|
229
|
+
*/
|
|
24
230
|
static syncDataLocalDb(): Promise<string>;
|
|
25
231
|
}
|
|
26
232
|
export {};
|
|
@@ -1,13 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Character data structure for the CCS-JS system.
|
|
3
|
+
* @module DataStructures/TheCharacter
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a character entity in the system with associated user, security, access, and session information.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* TheCharacter class encapsulates character data along with comprehensive metadata including
|
|
10
|
+
* user ownership, security credentials, access control, and session tracking. Each character
|
|
11
|
+
* maintains references to multiple user contexts for fine-grained authorization control.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const character = new TheCharacter(
|
|
16
|
+
* 1001, // userId
|
|
17
|
+
* "A", // data
|
|
18
|
+
* 5001, // securityId
|
|
19
|
+
* 1001, // securityUserId
|
|
20
|
+
* 6001, // accessId
|
|
21
|
+
* 1001, // accessUserId
|
|
22
|
+
* 7001, // sessionId
|
|
23
|
+
* 1001, // sessionUserId
|
|
24
|
+
* "2025-10-30T12:00:00Z", // entryTimestamp
|
|
25
|
+
* true // isNew
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
1
29
|
export declare class TheCharacter {
|
|
30
|
+
/**
|
|
31
|
+
* Unique identifier for the character.
|
|
32
|
+
* @defaultValue 0
|
|
33
|
+
*/
|
|
2
34
|
id: number;
|
|
35
|
+
/**
|
|
36
|
+
* ID of the user who owns this character.
|
|
37
|
+
*/
|
|
3
38
|
userId: number;
|
|
39
|
+
/**
|
|
40
|
+
* The actual character data (typically a single character string).
|
|
41
|
+
*/
|
|
4
42
|
data: string;
|
|
43
|
+
/**
|
|
44
|
+
* Security level or security context identifier for this character.
|
|
45
|
+
*/
|
|
5
46
|
securityId: number;
|
|
47
|
+
/**
|
|
48
|
+
* User ID associated with the security context.
|
|
49
|
+
*/
|
|
6
50
|
securityUserId: number;
|
|
51
|
+
/**
|
|
52
|
+
* Access control identifier for this character.
|
|
53
|
+
*/
|
|
7
54
|
accessId: number;
|
|
55
|
+
/**
|
|
56
|
+
* User ID associated with the access control.
|
|
57
|
+
*/
|
|
8
58
|
accessUserId: number;
|
|
59
|
+
/**
|
|
60
|
+
* Session identifier tracking when this character was accessed.
|
|
61
|
+
*/
|
|
9
62
|
sessionId: number;
|
|
63
|
+
/**
|
|
64
|
+
* User ID associated with the session.
|
|
65
|
+
*/
|
|
10
66
|
sessionUserId: number;
|
|
67
|
+
/**
|
|
68
|
+
* Flag indicating whether this is a newly created character.
|
|
69
|
+
* @defaultValue false
|
|
70
|
+
*/
|
|
11
71
|
isNew: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new TheCharacter instance.
|
|
74
|
+
*
|
|
75
|
+
* @param userId - The ID of the user who owns this character
|
|
76
|
+
* @param data - The character data (will be converted to string)
|
|
77
|
+
* @param securityId - Security level or context identifier
|
|
78
|
+
* @param securityUserId - User ID for the security context
|
|
79
|
+
* @param accessId - Access control identifier
|
|
80
|
+
* @param accessUserId - User ID for access control
|
|
81
|
+
* @param sessionId - Session tracking identifier
|
|
82
|
+
* @param sessionUserId - User ID for the session
|
|
83
|
+
* @param entryTimestamp - Timestamp when the character was created/entered (currently unused in initialization)
|
|
84
|
+
* @param isNew - Whether this is a newly created character
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The data parameter is explicitly converted to a string using template literals.
|
|
88
|
+
* The entryTimestamp parameter is accepted but not currently stored in the instance.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const char = new TheCharacter(
|
|
93
|
+
* 1, "X", 100, 1, 200, 1, 300, 1, "2025-10-30", true
|
|
94
|
+
* );
|
|
95
|
+
* console.log(char.data); // "X"
|
|
96
|
+
* console.log(char.isNew); // true
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
12
99
|
constructor(userId: number, data: string, securityId: number, securityUserId: number, accessId: number, accessUserId: number, sessionId: number, sessionUserId: number, entryTimestamp: string, isNew: boolean);
|
|
13
100
|
}
|