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,236 @@
|
|
|
1
|
+
/**
|
|
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
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class FreeSchemaResponse {
|
|
42
|
+
/**
|
|
43
|
+
* Human-readable message describing the result of the operation.
|
|
44
|
+
* @private
|
|
45
|
+
* @type {string}
|
|
46
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
61
|
+
private data;
|
|
62
|
+
/**
|
|
63
|
+
* Boolean flag indicating operation success (true) or failure (false).
|
|
64
|
+
* @private
|
|
65
|
+
* @type {boolean}
|
|
66
|
+
*/
|
|
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
|
+
*/
|
|
74
|
+
private url;
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new FreeSchemaResponse instance.
|
|
77
|
+
*
|
|
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
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
constructor(message: string, ok: boolean, status: number, data: any);
|
|
95
|
+
/**
|
|
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
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
getMessage(): string;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the response message. Supports method chaining.
|
|
110
|
+
*
|
|
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
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
setMessage(message: string): FreeSchemaResponse;
|
|
122
|
+
/**
|
|
123
|
+
* Retrieves the HTTP status code.
|
|
124
|
+
*
|
|
125
|
+
* @public
|
|
126
|
+
* @returns {number} The HTTP status code
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const statusCode = response.getStatus();
|
|
131
|
+
* if (statusCode === 200) {
|
|
132
|
+
* // Handle success
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
getStatus(): number;
|
|
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
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* response.setStatus(404)
|
|
147
|
+
* .setMessage("Resource not found");
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
setStatus(status: number): FreeSchemaResponse;
|
|
151
|
+
/**
|
|
152
|
+
* Retrieves the response data payload.
|
|
153
|
+
*
|
|
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
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
getData(): any;
|
|
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
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* response.setData({ users: [...], total: 100 })
|
|
174
|
+
* .setOk(true);
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
setData(data: any): FreeSchemaResponse;
|
|
178
|
+
/**
|
|
179
|
+
* Retrieves the success status flag.
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
* @returns {boolean} True if the operation was successful, false otherwise
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* if (response.getOk()) {
|
|
187
|
+
* // Process successful response
|
|
188
|
+
* } else {
|
|
189
|
+
* // Handle error
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
getOk(): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the success status flag. Supports method chaining.
|
|
196
|
+
*
|
|
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
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
setOk(ok: boolean): FreeSchemaResponse;
|
|
209
|
+
/**
|
|
210
|
+
* Retrieves the URL associated with this response.
|
|
211
|
+
*
|
|
212
|
+
* @public
|
|
213
|
+
* @returns {string} The URL from which the response originated
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* const url = response.getUrl();
|
|
218
|
+
* console.log(url); // "https://api.example.com/users"
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
getUrl(): string;
|
|
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
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* response.setUrl("https://api.example.com/users/123")
|
|
232
|
+
* .setStatus(404);
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
setUrl(url: string): FreeSchemaResponse;
|
|
236
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the FreeschemaResponse interface for standardized API responses.
|
|
3
|
+
* @module DataStructures/Responses/StandardResponses
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a standardized response structure for Freeschema API operations.
|
|
7
|
+
* This interface provides a consistent format for all API responses, including
|
|
8
|
+
* success and error cases, making it easier to handle responses uniformly across the application.
|
|
9
|
+
*
|
|
10
|
+
* @interface FreeschemaResponse
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const response: FreeschemaResponse = {
|
|
15
|
+
* message: "User created successfully",
|
|
16
|
+
* status: true,
|
|
17
|
+
* statusCode: 201,
|
|
18
|
+
* data: { id: 123, name: "John Doe" }
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Error response example
|
|
25
|
+
* const errorResponse: FreeschemaResponse = {
|
|
26
|
+
* message: "User not found",
|
|
27
|
+
* status: false,
|
|
28
|
+
* statusCode: 404,
|
|
29
|
+
* data: null
|
|
30
|
+
* };
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export interface FreeschemaResponse {
|
|
34
|
+
/**
|
|
35
|
+
* A human-readable message describing the result of the operation.
|
|
36
|
+
* Provides context about the success or failure of the request.
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
*/
|
|
40
|
+
message: string;
|
|
41
|
+
/**
|
|
42
|
+
* A boolean flag indicating whether the operation was successful.
|
|
43
|
+
* True indicates success, false indicates failure.
|
|
44
|
+
*
|
|
45
|
+
* @type {boolean}
|
|
46
|
+
*/
|
|
47
|
+
status: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The HTTP status code representing the result of the operation.
|
|
50
|
+
* Standard HTTP status codes are used (e.g., 200 for success, 404 for not found, 500 for server error).
|
|
51
|
+
*
|
|
52
|
+
* @type {number}
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* 200 - OK
|
|
56
|
+
* 201 - Created
|
|
57
|
+
* 400 - Bad Request
|
|
58
|
+
* 401 - Unauthorized
|
|
59
|
+
* 404 - Not Found
|
|
60
|
+
* 500 - Internal Server Error
|
|
61
|
+
*/
|
|
62
|
+
statusCode: number;
|
|
63
|
+
/**
|
|
64
|
+
* The response data payload.
|
|
65
|
+
* Can contain any type of data depending on the operation performed.
|
|
66
|
+
* May be null or undefined for operations that don't return data.
|
|
67
|
+
*
|
|
68
|
+
* @type {any}
|
|
69
|
+
*/
|
|
70
|
+
data: any;
|
|
71
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Returner data structure for tracking referent relationships in the CCS-JS system.
|
|
3
|
+
* @module DataStructures/Returner
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a returner entity that establishes a relationship between a user and a referent.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* The Returner class is a lightweight data structure that links entities through referent
|
|
10
|
+
* relationships. It tracks which user owns a particular referent reference and whether
|
|
11
|
+
* the relationship is newly created. This is commonly used in bidirectional relationship
|
|
12
|
+
* tracking within the concept composition system.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const returner = new Returner(
|
|
17
|
+
* 1001, // id
|
|
18
|
+
* 2001, // userId
|
|
19
|
+
* 3001, // referentId
|
|
20
|
+
* true // isNew
|
|
21
|
+
* );
|
|
22
|
+
* console.log(returner.referentId); // 3001
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class Returner {
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier for this returner entity.
|
|
28
|
+
*/
|
|
29
|
+
id: number;
|
|
30
|
+
/**
|
|
31
|
+
* ID of the user who owns this returner relationship.
|
|
32
|
+
*/
|
|
33
|
+
userId: number;
|
|
34
|
+
/**
|
|
35
|
+
* ID of the referent being referenced by this returner.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The referentId typically points to another entity in the system,
|
|
39
|
+
* establishing a directional relationship.
|
|
40
|
+
*/
|
|
41
|
+
referentId: number;
|
|
42
|
+
/**
|
|
43
|
+
* Flag indicating whether this returner relationship is newly created.
|
|
44
|
+
*/
|
|
45
|
+
isNew: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new Returner instance.
|
|
48
|
+
*
|
|
49
|
+
* @param id - Unique identifier for this returner
|
|
50
|
+
* @param userId - ID of the user who owns this relationship
|
|
51
|
+
* @param referentId - ID of the entity being referenced
|
|
52
|
+
* @param isNew - Whether this is a newly created relationship
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* // Create a returner linking user 100 to referent 500
|
|
57
|
+
* const returner = new Returner(1, 100, 500, false);
|
|
58
|
+
*
|
|
59
|
+
* // Check the relationship
|
|
60
|
+
* if (!returner.isNew) {
|
|
61
|
+
* console.log(`Existing relationship to referent ${returner.referentId}`);
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
constructor(id: number, userId: number, referentId: number, isNew: boolean);
|
|
66
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the FreeschemaQuery class for complex, flexible query construction.
|
|
3
|
+
* @module DataStructures/Search/FreeschemaQuery
|
|
4
|
+
*/
|
|
5
|
+
import { Concept } from "../Concept";
|
|
6
|
+
import { FilterSearch } from "../FilterSearch";
|
|
7
|
+
/**
|
|
8
|
+
* Represents a flexible, schema-free query structure for complex data retrieval operations.
|
|
9
|
+
* This class supports nested queries, filtering, ordering, and various output formats.
|
|
10
|
+
* It is designed to handle advanced querying scenarios with multiple concepts and connections.
|
|
11
|
+
*
|
|
12
|
+
* @class FreeschemaQuery
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const query = new FreeschemaQuery();
|
|
17
|
+
* query.type = "User";
|
|
18
|
+
* query.inpage = 20;
|
|
19
|
+
* query.page = 1;
|
|
20
|
+
* query.order = "ASC";
|
|
21
|
+
* query.filters = [filterSearch1, filterSearch2];
|
|
22
|
+
* query.filterLogic = "AND";
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Nested query example
|
|
28
|
+
* const parentQuery = new FreeschemaQuery();
|
|
29
|
+
* const childQuery = new FreeschemaQuery();
|
|
30
|
+
* childQuery.type = "Comment";
|
|
31
|
+
* parentQuery.freeschemaQueries = [childQuery];
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class FreeschemaQuery {
|
|
35
|
+
/**
|
|
36
|
+
* The type of entity to query (e.g., "User", "Post", "Comment").
|
|
37
|
+
* Determines the primary data structure being queried.
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @default ""
|
|
41
|
+
*/
|
|
42
|
+
type: string;
|
|
43
|
+
/**
|
|
44
|
+
* The number of results to return per page (page size).
|
|
45
|
+
* Controls pagination by limiting results in the response.
|
|
46
|
+
*
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @default 10
|
|
49
|
+
*/
|
|
50
|
+
inpage: number;
|
|
51
|
+
/**
|
|
52
|
+
* The page number to retrieve (1-indexed).
|
|
53
|
+
* Used with inpage for paginating through large result sets.
|
|
54
|
+
*
|
|
55
|
+
* @type {number}
|
|
56
|
+
* @default 1
|
|
57
|
+
*/
|
|
58
|
+
page: number;
|
|
59
|
+
/**
|
|
60
|
+
* Array of Concept objects to include in the query.
|
|
61
|
+
* Contains the actual concept instances used for filtering or joining.
|
|
62
|
+
*
|
|
63
|
+
* @type {Concept[]}
|
|
64
|
+
* @default []
|
|
65
|
+
*/
|
|
66
|
+
concepts: Concept[];
|
|
67
|
+
/**
|
|
68
|
+
* Array of concept IDs to filter by.
|
|
69
|
+
* Alternative to using full Concept objects when only IDs are needed.
|
|
70
|
+
*
|
|
71
|
+
* @type {number[]}
|
|
72
|
+
* @default []
|
|
73
|
+
*/
|
|
74
|
+
conceptIds: number[];
|
|
75
|
+
/**
|
|
76
|
+
* Array of field selectors to include in the query results.
|
|
77
|
+
* Specifies which properties should be returned in the response.
|
|
78
|
+
*
|
|
79
|
+
* @type {string[]}
|
|
80
|
+
* @default []
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* query.selectors = ["id", "name", "email"];
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
selectors: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Array of nested FreeschemaQuery objects for complex hierarchical queries.
|
|
90
|
+
* Enables querying related data structures in a single operation.
|
|
91
|
+
*
|
|
92
|
+
* @type {FreeschemaQuery[]}
|
|
93
|
+
* @default []
|
|
94
|
+
*/
|
|
95
|
+
freeschemaQueries: FreeschemaQuery[];
|
|
96
|
+
/**
|
|
97
|
+
* Array of FilterSearch objects to apply to the query.
|
|
98
|
+
* Each filter defines specific criteria for narrowing results.
|
|
99
|
+
*
|
|
100
|
+
* @type {FilterSearch[]}
|
|
101
|
+
* @default []
|
|
102
|
+
*/
|
|
103
|
+
filters: FilterSearch[];
|
|
104
|
+
/**
|
|
105
|
+
* The logical operator to combine multiple filters.
|
|
106
|
+
* Typically "AND" or "OR" to determine how filters are applied together.
|
|
107
|
+
*
|
|
108
|
+
* @type {string}
|
|
109
|
+
* @default ""
|
|
110
|
+
*/
|
|
111
|
+
filterLogic: string;
|
|
112
|
+
/**
|
|
113
|
+
* The type of connection to query when dealing with relationships.
|
|
114
|
+
* Specifies the connection type when traversing between concepts.
|
|
115
|
+
*
|
|
116
|
+
* @type {string}
|
|
117
|
+
* @default ""
|
|
118
|
+
*/
|
|
119
|
+
typeConnection: string;
|
|
120
|
+
/**
|
|
121
|
+
* The sort order for query results.
|
|
122
|
+
* Determines whether results are sorted in ascending or descending order.
|
|
123
|
+
*
|
|
124
|
+
* @type {string}
|
|
125
|
+
* @default "DESC"
|
|
126
|
+
*/
|
|
127
|
+
order: string;
|
|
128
|
+
/**
|
|
129
|
+
* The output format for query results.
|
|
130
|
+
* Determines the structure and presentation of returned data.
|
|
131
|
+
*
|
|
132
|
+
* @type {number}
|
|
133
|
+
* @default NORMAL
|
|
134
|
+
*
|
|
135
|
+
* @see {@link FormatConstants.NORMAL}
|
|
136
|
+
* @see {@link FormatConstants.ALLID}
|
|
137
|
+
*/
|
|
138
|
+
outputFormat: number;
|
|
139
|
+
/**
|
|
140
|
+
* A descriptive name for this query.
|
|
141
|
+
* Useful for identifying or debugging complex nested queries.
|
|
142
|
+
*
|
|
143
|
+
* @type {string}
|
|
144
|
+
* @default ""
|
|
145
|
+
*/
|
|
146
|
+
name: string;
|
|
147
|
+
/**
|
|
148
|
+
* Flag indicating whether to reverse the query direction.
|
|
149
|
+
* When true, traverses relationships in the opposite direction.
|
|
150
|
+
*
|
|
151
|
+
* @type {boolean}
|
|
152
|
+
* @default false
|
|
153
|
+
*/
|
|
154
|
+
reverse: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Flag indicating whether to apply a limit to the query results.
|
|
157
|
+
* When true, enforces the page size limit strictly.
|
|
158
|
+
*
|
|
159
|
+
* @type {boolean}
|
|
160
|
+
* @default false
|
|
161
|
+
*/
|
|
162
|
+
limit: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Filter criteria applied to ancestor nodes in hierarchical queries.
|
|
165
|
+
* Used for filtering based on parent or ancestor relationships.
|
|
166
|
+
*
|
|
167
|
+
* @type {string}
|
|
168
|
+
* @default ""
|
|
169
|
+
*/
|
|
170
|
+
filterAncestor: string;
|
|
171
|
+
/**
|
|
172
|
+
* Flag indicating whether to include this query in parent filter operations.
|
|
173
|
+
* When true, the query results are considered in parent-level filtering.
|
|
174
|
+
*
|
|
175
|
+
* @type {boolean}
|
|
176
|
+
* @default false
|
|
177
|
+
*/
|
|
178
|
+
includeInFilter: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Flag indicating whether to use legacy connection type behavior.
|
|
181
|
+
* Maintains backward compatibility with older connection type systems.
|
|
182
|
+
*
|
|
183
|
+
* @type {boolean}
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
isOldConnectionType: boolean;
|
|
187
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Defines the SearchStructure class for configuring search operations.
|
|
3
|
+
* @module DataStructures/Search/SearchStructure
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a search structure configuration for querying data.
|
|
7
|
+
* This class encapsulates all parameters needed to perform a search operation,
|
|
8
|
+
* including filtering, pagination, and composition settings.
|
|
9
|
+
*
|
|
10
|
+
* @class SearchStructure
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const search = new SearchStructure();
|
|
15
|
+
* search.type = "concept";
|
|
16
|
+
* search.search = "user profile";
|
|
17
|
+
* search.page = 1;
|
|
18
|
+
* search.inpage = 20;
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class SearchStructure {
|
|
22
|
+
/**
|
|
23
|
+
* The type of entity to search for (e.g., "concept", "connection").
|
|
24
|
+
* Determines which data structure will be queried.
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @default ""
|
|
28
|
+
*/
|
|
29
|
+
type: string;
|
|
30
|
+
/**
|
|
31
|
+
* The search term or query string to match against.
|
|
32
|
+
* This is the primary search criteria used for filtering results.
|
|
33
|
+
*
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @default ""
|
|
36
|
+
*/
|
|
37
|
+
search: string;
|
|
38
|
+
/**
|
|
39
|
+
* The composition identifier or filter for searching within compositions.
|
|
40
|
+
* Used to narrow search results to specific composition contexts.
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @default ""
|
|
44
|
+
*/
|
|
45
|
+
composition: string;
|
|
46
|
+
/**
|
|
47
|
+
* Internal composition identifier for nested or hierarchical composition searches.
|
|
48
|
+
* Allows for more granular filtering within composition structures.
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @default ""
|
|
52
|
+
*/
|
|
53
|
+
internalComposition: string;
|
|
54
|
+
/**
|
|
55
|
+
* The user ID associated with the search operation.
|
|
56
|
+
* Used for access control and filtering results based on user permissions.
|
|
57
|
+
*
|
|
58
|
+
* @type {number}
|
|
59
|
+
* @default 999
|
|
60
|
+
*/
|
|
61
|
+
userId: number;
|
|
62
|
+
/**
|
|
63
|
+
* The number of results to display per page (page size).
|
|
64
|
+
* Controls pagination by limiting the number of results returned.
|
|
65
|
+
*
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @default 10
|
|
68
|
+
*/
|
|
69
|
+
inpage: number;
|
|
70
|
+
/**
|
|
71
|
+
* The page number to retrieve (1-indexed).
|
|
72
|
+
* Used in conjunction with inpage for pagination of search results.
|
|
73
|
+
*
|
|
74
|
+
* @type {number}
|
|
75
|
+
* @default 1
|
|
76
|
+
*/
|
|
77
|
+
page: number;
|
|
78
|
+
}
|