mftsccs-node 0.0.57 → 0.0.59
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,14 +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
|
+
*/
|
|
1
7
|
import { LConcept } from "./LConcept";
|
|
2
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
|
+
*/
|
|
3
16
|
export declare class LocalSyncData {
|
|
17
|
+
/**
|
|
18
|
+
* Static array storing concepts pending synchronization.
|
|
19
|
+
* @type {LConcept[]}
|
|
20
|
+
* @static
|
|
21
|
+
*/
|
|
4
22
|
static conceptsSyncArray: LConcept[];
|
|
23
|
+
/**
|
|
24
|
+
* Static array storing connections pending synchronization.
|
|
25
|
+
* @type {LConnection[]}
|
|
26
|
+
* @static
|
|
27
|
+
*/
|
|
5
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
|
+
*/
|
|
6
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
|
+
*/
|
|
7
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
|
+
*/
|
|
8
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
|
+
*/
|
|
9
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
|
+
*/
|
|
10
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
|
+
*/
|
|
11
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
|
+
*/
|
|
12
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
|
+
*/
|
|
13
102
|
static syncDataLocalDb(): Promise<string>;
|
|
14
103
|
}
|
|
@@ -1,8 +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
|
+
*/
|
|
1
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
|
+
*/
|
|
2
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
|
+
*/
|
|
3
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
|
+
*/
|
|
4
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
|
+
*/
|
|
5
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
|
+
*/
|
|
6
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
|
+
*/
|
|
7
93
|
patchObject: any;
|
|
8
94
|
}
|
|
@@ -1,7 +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
|
+
*/
|
|
1
29
|
export declare class ReferentInfo {
|
|
30
|
+
/**
|
|
31
|
+
* Unique identifier for the concept data.
|
|
32
|
+
*/
|
|
2
33
|
conceptDataId: number;
|
|
34
|
+
/**
|
|
35
|
+
* User ID associated with the concept data.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Tracks ownership of the concept entity.
|
|
39
|
+
*/
|
|
3
40
|
conceptDataUserId: number;
|
|
41
|
+
/**
|
|
42
|
+
* Unique identifier for the character data.
|
|
43
|
+
*/
|
|
4
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
|
+
*/
|
|
5
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
|
+
*/
|
|
6
74
|
constructor(conceptDataId: number, conceptDataUserId: number, characterDataId: number, characterDataUserId: number);
|
|
7
75
|
}
|
|
@@ -1,10 +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
|
+
*/
|
|
1
24
|
export declare class ReservedIds {
|
|
25
|
+
/** Pool of reserved concept IDs */
|
|
2
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
|
+
*/
|
|
3
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
|
+
*/
|
|
4
57
|
static AddId(id: number): void;
|
|
5
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
|
+
*/
|
|
6
77
|
export declare class ReservedConnectionIds {
|
|
78
|
+
/** Pool of reserved connection IDs */
|
|
7
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
|
+
*/
|
|
8
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
|
+
*/
|
|
9
110
|
static AddId(id: number): void;
|
|
10
111
|
}
|
|
@@ -1,74 +1,236 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* @fileoverview Defines the FreeSchemaResponse class for standardized error and response handling.
|
|
3
|
+
* @module DataStructures/Responses/ErrorResponse
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Standardized response class for FreeSchema API operations.
|
|
7
|
+
* This class provides a consistent response structure across all API operations,
|
|
8
|
+
* eliminating the need to manually handle HTTP response codes. It supports method
|
|
9
|
+
* chaining through fluent setters and provides accessors for all response properties.
|
|
10
|
+
*
|
|
11
|
+
* @class FreeSchemaResponse
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Create a success response
|
|
16
|
+
* const response = new FreeSchemaResponse(
|
|
17
|
+
* "Data retrieved successfully",
|
|
18
|
+
* true,
|
|
19
|
+
* 200,
|
|
20
|
+
* { users: [...] }
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Create an error response with chaining
|
|
27
|
+
* const errorResponse = new FreeSchemaResponse("", false, 500, null)
|
|
28
|
+
* .setMessage("Internal server error")
|
|
29
|
+
* .setUrl("https://api.example.com/users");
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Accessing response data
|
|
35
|
+
* if (response.getOk()) {
|
|
36
|
+
* const data = response.getData();
|
|
37
|
+
* console.log(response.getMessage());
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
4
40
|
*/
|
|
5
41
|
export declare class FreeSchemaResponse {
|
|
42
|
+
/**
|
|
43
|
+
* Human-readable message describing the result of the operation.
|
|
44
|
+
* @private
|
|
45
|
+
* @type {string}
|
|
46
|
+
*/
|
|
6
47
|
private message;
|
|
48
|
+
/**
|
|
49
|
+
* HTTP status code representing the result of the operation.
|
|
50
|
+
* Standard codes include: 200 (OK), 401 (Unauthorized), 500 (Internal Server Error), etc.
|
|
51
|
+
* @private
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
7
54
|
private status;
|
|
55
|
+
/**
|
|
56
|
+
* The response data payload.
|
|
57
|
+
* Can contain any type of data depending on the operation performed.
|
|
58
|
+
* @private
|
|
59
|
+
* @type {any}
|
|
60
|
+
*/
|
|
8
61
|
private data;
|
|
62
|
+
/**
|
|
63
|
+
* Boolean flag indicating operation success (true) or failure (false).
|
|
64
|
+
* @private
|
|
65
|
+
* @type {boolean}
|
|
66
|
+
*/
|
|
9
67
|
private ok;
|
|
68
|
+
/**
|
|
69
|
+
* The URL that originated the response or error.
|
|
70
|
+
* Defaults to the base API URL.
|
|
71
|
+
* @private
|
|
72
|
+
* @type {string}
|
|
73
|
+
*/
|
|
10
74
|
private url;
|
|
11
75
|
/**
|
|
76
|
+
* Creates a new FreeSchemaResponse instance.
|
|
12
77
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
78
|
+
* @constructor
|
|
79
|
+
* @param {string} message - Human-readable message describing the result of the operation
|
|
80
|
+
* @param {boolean} ok - Status flag indicating success (true) or failure (false)
|
|
81
|
+
* @param {number} status - Standard HTTP status code (e.g., 200 for OK, 500 for internal error)
|
|
82
|
+
* @param {any} data - The response data payload, can be any type
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const response = new FreeSchemaResponse(
|
|
87
|
+
* "User created successfully",
|
|
88
|
+
* true,
|
|
89
|
+
* 201,
|
|
90
|
+
* { id: 123, username: "johndoe" }
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
17
93
|
*/
|
|
18
94
|
constructor(message: string, ok: boolean, status: number, data: any);
|
|
19
95
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
96
|
+
* Retrieves the response message.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
* @returns {string} The human-readable message describing the operation result
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const message = response.getMessage();
|
|
104
|
+
* console.log(message); // "User created successfully"
|
|
105
|
+
* ```
|
|
22
106
|
*/
|
|
23
107
|
getMessage(): string;
|
|
24
108
|
/**
|
|
109
|
+
* Sets the response message. Supports method chaining.
|
|
25
110
|
*
|
|
26
|
-
* @
|
|
27
|
-
* @
|
|
111
|
+
* @public
|
|
112
|
+
* @param {string} message - The message to set in the FreeSchemaResponse
|
|
113
|
+
* @returns {FreeSchemaResponse} The current instance for method chaining
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* response.setMessage("Operation completed successfully")
|
|
118
|
+
* .setStatus(200);
|
|
119
|
+
* ```
|
|
28
120
|
*/
|
|
29
121
|
setMessage(message: string): FreeSchemaResponse;
|
|
30
122
|
/**
|
|
123
|
+
* Retrieves the HTTP status code.
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
* @returns {number} The HTTP status code
|
|
31
127
|
*
|
|
32
|
-
* @
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const statusCode = response.getStatus();
|
|
131
|
+
* if (statusCode === 200) {
|
|
132
|
+
* // Handle success
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
33
135
|
*/
|
|
34
136
|
getStatus(): number;
|
|
35
137
|
/**
|
|
138
|
+
* Sets the HTTP status code. Supports method chaining.
|
|
139
|
+
*
|
|
140
|
+
* @public
|
|
141
|
+
* @param {number} status - Standard HTTP status code (200 OK, 401 Unauthorized, 500 Internal Server Error, etc.)
|
|
142
|
+
* @returns {FreeSchemaResponse} The current instance for method chaining
|
|
36
143
|
*
|
|
37
|
-
* @
|
|
38
|
-
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* response.setStatus(404)
|
|
147
|
+
* .setMessage("Resource not found");
|
|
148
|
+
* ```
|
|
39
149
|
*/
|
|
40
150
|
setStatus(status: number): FreeSchemaResponse;
|
|
41
151
|
/**
|
|
152
|
+
* Retrieves the response data payload.
|
|
42
153
|
*
|
|
43
|
-
* @
|
|
154
|
+
* @public
|
|
155
|
+
* @returns {any} The data associated with the response
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const data = response.getData();
|
|
160
|
+
* console.log(data.users);
|
|
161
|
+
* ```
|
|
44
162
|
*/
|
|
45
163
|
getData(): any;
|
|
46
164
|
/**
|
|
165
|
+
* Sets the response data payload. Supports method chaining.
|
|
166
|
+
*
|
|
167
|
+
* @public
|
|
168
|
+
* @param {any} data - The data to include in the response (can be of any type)
|
|
169
|
+
* @returns {FreeSchemaResponse} The current instance for method chaining
|
|
47
170
|
*
|
|
48
|
-
* @
|
|
49
|
-
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* response.setData({ users: [...], total: 100 })
|
|
174
|
+
* .setOk(true);
|
|
175
|
+
* ```
|
|
50
176
|
*/
|
|
51
177
|
setData(data: any): FreeSchemaResponse;
|
|
52
178
|
/**
|
|
179
|
+
* Retrieves the success status flag.
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
* @returns {boolean} True if the operation was successful, false otherwise
|
|
53
183
|
*
|
|
54
|
-
* @
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* if (response.getOk()) {
|
|
187
|
+
* // Process successful response
|
|
188
|
+
* } else {
|
|
189
|
+
* // Handle error
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
55
192
|
*/
|
|
56
193
|
getOk(): boolean;
|
|
57
194
|
/**
|
|
195
|
+
* Sets the success status flag. Supports method chaining.
|
|
58
196
|
*
|
|
59
|
-
* @
|
|
60
|
-
* @
|
|
197
|
+
* @public
|
|
198
|
+
* @param {boolean} ok - True if the operation was successful, false if it failed
|
|
199
|
+
* @returns {FreeSchemaResponse} The current instance for method chaining
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* response.setOk(false)
|
|
204
|
+
* .setStatus(500)
|
|
205
|
+
* .setMessage("Internal server error");
|
|
206
|
+
* ```
|
|
61
207
|
*/
|
|
62
208
|
setOk(ok: boolean): FreeSchemaResponse;
|
|
63
209
|
/**
|
|
210
|
+
* Retrieves the URL associated with this response.
|
|
211
|
+
*
|
|
212
|
+
* @public
|
|
213
|
+
* @returns {string} The URL from which the response originated
|
|
64
214
|
*
|
|
65
|
-
* @
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const url = response.getUrl();
|
|
218
|
+
* console.log(url); // "https://api.example.com/users"
|
|
219
|
+
* ```
|
|
66
220
|
*/
|
|
67
221
|
getUrl(): string;
|
|
68
222
|
/**
|
|
223
|
+
* Sets the URL associated with this response. Supports method chaining.
|
|
224
|
+
*
|
|
225
|
+
* @public
|
|
226
|
+
* @param {string} url - The URL from which the response or error originates
|
|
227
|
+
* @returns {FreeSchemaResponse} The current instance for method chaining
|
|
69
228
|
*
|
|
70
|
-
* @
|
|
71
|
-
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* response.setUrl("https://api.example.com/users/123")
|
|
232
|
+
* .setStatus(404);
|
|
233
|
+
* ```
|
|
72
234
|
*/
|
|
73
235
|
setUrl(url: string): FreeSchemaResponse;
|
|
74
236
|
}
|