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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for searching concepts by character value with explicit category specification.
|
|
3
|
+
* Provides direct category-based concept retrieval with request caching.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/SearchConcept/GetConceptByCharacterAndCategoryDirect
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
import { Concept } from "./../../DataStructures/Concept";
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves a concept from the backend by its character value and specific category ID.
|
|
11
|
+
* This is a more precise search than GetConceptByCharacterAndCategoryApi as it requires
|
|
12
|
+
* an explicit category ID.
|
|
13
|
+
*
|
|
14
|
+
* The function uses request caching to prevent duplicate simultaneous requests for the
|
|
15
|
+
* same character-category combination. Retrieved concepts are automatically added to
|
|
16
|
+
* the local ConceptsData cache.
|
|
17
|
+
*
|
|
18
|
+
* @param characterValue - The character string identifying the concept (e.g., "john_doe", "building_a")
|
|
19
|
+
* @param category_id - The specific category ID to search within
|
|
20
|
+
* @returns A promise that resolves to the matching Concept object, or a default concept if not found
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Find a specific person concept in category 5
|
|
25
|
+
* const person = await GetConceptByCharacterAndCategoryDirectApi('john_doe', 5);
|
|
26
|
+
* if (person.id !== 0) {
|
|
27
|
+
* console.log('Found person:', person);
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* // Simultaneous calls for the same concept will use the same cached promise
|
|
31
|
+
* const promise1 = GetConceptByCharacterAndCategoryDirectApi('jane_doe', 5);
|
|
32
|
+
* const promise2 = GetConceptByCharacterAndCategoryDirectApi('jane_doe', 5);
|
|
33
|
+
* // Both will resolve to the same result without making duplicate API calls
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* - Uses local caching (conceptCache) to prevent duplicate simultaneous requests
|
|
38
|
+
* - Cache key is the concatenation of characterValue and category_id
|
|
39
|
+
* - Returns a default concept (id=0) if the concept is not found or an error occurs
|
|
40
|
+
* - Automatically caches the retrieved concept in ConceptsData for subsequent use
|
|
41
|
+
* - Cache entries are cleaned up in the finally block after fetch completes
|
|
42
|
+
* - HTTP errors are handled through HandleHttpError but do not throw
|
|
43
|
+
* - Errors are logged with full diagnostic information including the endpoint URL
|
|
44
|
+
*
|
|
45
|
+
* @see GetConceptByCharacterAndCategoryApi for searching without explicit category
|
|
46
|
+
* @see CreateDefaultConcept for the default concept structure
|
|
47
|
+
* @see ConceptsData for the local concept cache
|
|
48
|
+
*/
|
|
49
|
+
export declare function GetConceptByCharacterAndCategoryDirectApi(characterValue: string, category_id: number): Promise<Concept>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for creating user session records.
|
|
3
|
+
* Tracks user sessions for analytics and activity monitoring purposes.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/Session/CreateSession
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
import { SessionData } from "../../app";
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new session record in the backend for tracking user activity.
|
|
11
|
+
* Sessions are used to monitor user interactions, track analytics, and maintain
|
|
12
|
+
* activity logs within the Concept Connection System.
|
|
13
|
+
*
|
|
14
|
+
* This function initiates a new session with the provided session data, which
|
|
15
|
+
* typically includes user information, timestamps, and session metadata.
|
|
16
|
+
*
|
|
17
|
+
* @param sessionData - The session data object containing session initialization information
|
|
18
|
+
* @returns A promise that resolves to the created session response, or null if creation fails
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Create a new user session
|
|
23
|
+
* const sessionInfo: SessionData = {
|
|
24
|
+
* userId: 123,
|
|
25
|
+
* startTime: new Date().toISOString(),
|
|
26
|
+
* userAgent: navigator.userAgent
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* const session = await CreateSession(sessionInfo);
|
|
30
|
+
* if (session) {
|
|
31
|
+
* console.log('Session created:', session.sessionId);
|
|
32
|
+
* } else {
|
|
33
|
+
* console.log('Session creation failed');
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* - Returns null if the session creation fails
|
|
39
|
+
* - HTTP errors are handled through HandleHttpError
|
|
40
|
+
* - Requires authentication via GetRequestHeader
|
|
41
|
+
* - Error details are logged to console for debugging
|
|
42
|
+
* - Errors are re-thrown for caller handling
|
|
43
|
+
*
|
|
44
|
+
* @see CreateSessionVisit for tracking URL visits within a session
|
|
45
|
+
* @see SessionData for the session data structure
|
|
46
|
+
*/
|
|
47
|
+
export declare function CreateSession(sessionData: SessionData): Promise<any>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for tracking URL visits within user sessions.
|
|
3
|
+
* Records individual page/URL visits as part of session activity tracking.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/Session/CreateSessionVisit
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Records a URL visit within an existing session for activity tracking.
|
|
10
|
+
* This function creates a session visit record that tracks which URLs a user
|
|
11
|
+
* accesses during their session, useful for analytics and navigation tracking.
|
|
12
|
+
*
|
|
13
|
+
* Session visits help build a complete picture of user activity by recording
|
|
14
|
+
* each page or resource accessed during a session in the Concept Connection System.
|
|
15
|
+
*
|
|
16
|
+
* @param sessionId - The unique identifier of the session to associate this visit with
|
|
17
|
+
* @param url - The URL that was visited (page path or full URL)
|
|
18
|
+
* @returns A promise that resolves to the created visit response, or null if creation fails
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Track a page visit within a session
|
|
23
|
+
* const visit = await CreateSessionVisit(456, '/concepts/dashboard');
|
|
24
|
+
* if (visit) {
|
|
25
|
+
* console.log('Visit tracked:', visit);
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Track multiple visits in sequence
|
|
29
|
+
* await CreateSessionVisit(456, '/concepts/search');
|
|
30
|
+
* await CreateSessionVisit(456, '/concepts/create');
|
|
31
|
+
* await CreateSessionVisit(456, '/concepts/view/123');
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* - Returns null if the visit creation fails
|
|
36
|
+
* - HTTP errors are handled through HandleHttpError
|
|
37
|
+
* - Requires authentication via GetRequestHeader
|
|
38
|
+
* - Uses URL-encoded form data for the request body
|
|
39
|
+
* - Error details are logged to console for debugging
|
|
40
|
+
* - Errors are re-thrown for caller handling
|
|
41
|
+
*
|
|
42
|
+
* @see CreateSession for creating the initial session
|
|
43
|
+
*/
|
|
44
|
+
export declare function CreateSessionVisit(sessionId: number, url: string): Promise<any>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for user sign-in operations.
|
|
3
|
+
* Provides standardized authentication with structured response handling.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/Signin
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
import { FreeschemaResponse } from "../DataStructures/Responses/StandardResponses";
|
|
9
|
+
import { SigninModel } from "../DataStructures/SigninModel";
|
|
10
|
+
/**
|
|
11
|
+
* Authenticates a user and returns a standardized Freeschema response.
|
|
12
|
+
* This function provides a more structured authentication approach compared to LoginToBackend,
|
|
13
|
+
* returning a FreeschemaResponse object with consistent status and data fields.
|
|
14
|
+
*
|
|
15
|
+
* The signin process validates user credentials and returns authentication data including
|
|
16
|
+
* tokens and user information in a standardized response format.
|
|
17
|
+
*
|
|
18
|
+
* @param signinInfo - The signin model containing user credentials (email and password)
|
|
19
|
+
* @returns A promise that resolves to a FreeschemaResponse containing authentication data
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Sign in a user with standardized response
|
|
24
|
+
* const signinData: SigninModel = {
|
|
25
|
+
* email: 'user@example.com',
|
|
26
|
+
* password: 'securePassword123'
|
|
27
|
+
* };
|
|
28
|
+
*
|
|
29
|
+
* const response = await Signin(signinData);
|
|
30
|
+
* if (response.status && response.statusCode === 200) {
|
|
31
|
+
* console.log('Signin successful:', response.data);
|
|
32
|
+
* // Use response.data.token for subsequent API calls
|
|
33
|
+
* } else {
|
|
34
|
+
* console.error('Signin failed:', response.message);
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* - Returns a FreeschemaResponse with status, statusCode, message, and data fields
|
|
40
|
+
* - On success: status=true, statusCode=200, data contains authentication information
|
|
41
|
+
* - On failure: status=false, statusCode and message indicate the error
|
|
42
|
+
* - HTTP errors are handled through HandleHttpError
|
|
43
|
+
* - Errors are logged to console and re-thrown for caller handling
|
|
44
|
+
* - Uses JSON content-type for request body
|
|
45
|
+
*
|
|
46
|
+
* @see LoginToBackend for alternative login implementation
|
|
47
|
+
* @see Signup for user registration
|
|
48
|
+
* @see SigninModel for the signin data structure
|
|
49
|
+
* @see FreeschemaResponse for the response structure
|
|
50
|
+
*/
|
|
51
|
+
export default function Signin(signinInfo: SigninModel): Promise<FreeschemaResponse>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for user registration and signup operations.
|
|
3
|
+
* Handles new user account creation with standardized response handling.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/Signup
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
import { FreeschemaResponse } from "../DataStructures/Responses/StandardResponses";
|
|
9
|
+
import { SignupModel } from "../DataStructures/SignupModel";
|
|
10
|
+
/**
|
|
11
|
+
* Registers a new user account in the Concept Connection System.
|
|
12
|
+
* This function creates a new user with the provided signup information and returns
|
|
13
|
+
* a standardized response containing registration results.
|
|
14
|
+
*
|
|
15
|
+
* @param signupModel - The signup model containing user registration information (name, email, password, etc.)
|
|
16
|
+
* @returns A promise that resolves to a FreeschemaResponse indicating success or failure
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Register a new user
|
|
21
|
+
* const newUser: SignupModel = {
|
|
22
|
+
* name: 'John Doe',
|
|
23
|
+
* email: 'john@example.com',
|
|
24
|
+
* password: 'securePassword123'
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* const response = await Signup(newUser);
|
|
28
|
+
* if (response.status && response.statusCode === 200) {
|
|
29
|
+
* console.log('Signup successful:', response.data);
|
|
30
|
+
* } else {
|
|
31
|
+
* console.error('Signup failed:', response.message);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* - Returns a FreeschemaResponse with status, statusCode, message, and data fields
|
|
37
|
+
* - On success: status=true, statusCode=200, data contains user information
|
|
38
|
+
* - On failure: status=false with error details
|
|
39
|
+
* - HTTP errors are handled through HandleHttpError
|
|
40
|
+
* - Errors are logged to console and re-thrown for caller handling
|
|
41
|
+
*
|
|
42
|
+
* @see Signin for user authentication after signup
|
|
43
|
+
* @see LoginToBackend for alternative login
|
|
44
|
+
* @see SignupModel for the signup data structure
|
|
45
|
+
* @see FreeschemaResponse for the response structure
|
|
46
|
+
*/
|
|
47
|
+
export default function Signup(signupModel: SignupModel): Promise<FreeschemaResponse>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API module for viewing internal concept data and connections.
|
|
3
|
+
* Retrieves detailed internal structure including connections for specified concepts.
|
|
4
|
+
*
|
|
5
|
+
* @module Api/View/ViewInternalDataApi
|
|
6
|
+
* @see https://documentation.freeschema.com for reference
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves internal data and connections for a list of concept IDs.
|
|
10
|
+
* This function fetches the internal composition structure of concepts, including all
|
|
11
|
+
* sub-concepts and their interconnections, providing a complete view of concept internals.
|
|
12
|
+
*
|
|
13
|
+
* In the Concept Connection System, concepts can contain other concepts as part of their
|
|
14
|
+
* internal structure (composition). This function retrieves those internal concepts and
|
|
15
|
+
* the connections between them, returning a dictionary mapping concept IDs to their
|
|
16
|
+
* internal connection lists.
|
|
17
|
+
*
|
|
18
|
+
* @param ids - Array of concept IDs to retrieve internal data for
|
|
19
|
+
* @returns A promise that resolves to a dictionary mapping concept IDs to their internal connections,
|
|
20
|
+
* or an empty connection list if the request fails
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // View internal data for multiple concepts
|
|
25
|
+
* const conceptIds = [100, 101, 102];
|
|
26
|
+
* const internalData = await ViewInternalDataApi(conceptIds);
|
|
27
|
+
*
|
|
28
|
+
* // Access connections for a specific concept
|
|
29
|
+
* const concept100Connections = internalData[100];
|
|
30
|
+
* if (concept100Connections) {
|
|
31
|
+
* console.log('Concept 100 has', concept100Connections.length, 'internal connections');
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* // Process all internal structures
|
|
35
|
+
* for (const [conceptId, connections] of Object.entries(internalData)) {
|
|
36
|
+
* console.log(`Concept ${conceptId}:`, connections);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* - Returns an object where keys are concept IDs and values are arrays of Connection objects
|
|
42
|
+
* - Automatically fetches and caches all sub-concepts via GetConceptBulk
|
|
43
|
+
* - Returns an empty connection list on error
|
|
44
|
+
* - HTTP errors are handled through HandleHttpError but do not throw
|
|
45
|
+
* - Requires authentication via GetRequestHeader
|
|
46
|
+
* - Errors are logged to console and re-thrown for caller handling
|
|
47
|
+
*
|
|
48
|
+
* @see GetConceptBulk for bulk concept retrieval
|
|
49
|
+
* @see Connection for the connection data structure
|
|
50
|
+
*/
|
|
51
|
+
export declare function ViewInternalDataApi(ids: number[]): Promise<any>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Constants Module for Concept Connection System (CCS-JS)
|
|
3
|
+
*
|
|
4
|
+
* This module defines all API endpoint URLs and configuration for interacting with the FreeSchema backend.
|
|
5
|
+
* It provides centralized URL management and allows dynamic base URL configuration for different environments.
|
|
6
|
+
*
|
|
7
|
+
* @module Constants/ApiConstants
|
|
8
|
+
* @see https://documentation.freeschema.com for API reference
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Default configuration object for the API base URL.
|
|
12
|
+
* Points to the development environment of FreeSchema.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* console.log(config.BASE_URL); // "https://devboom.freeschema.com"
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const config: {
|
|
20
|
+
BASE_URL: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The current base URL for all API requests.
|
|
24
|
+
* This value is dynamically retrieved and can be changed using `changeBaseUrl()`.
|
|
25
|
+
*
|
|
26
|
+
* @see {@link getBaseUrl}
|
|
27
|
+
* @see {@link changeBaseUrl}
|
|
28
|
+
*/
|
|
29
|
+
export declare const BASE_URL: string;
|
|
30
|
+
/**
|
|
31
|
+
* API endpoint URL for retrieving a single concept by ID.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const response = await fetch(`${GetConceptUrl}?id=123`);
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see https://documentation.freeschema.com for API documentation
|
|
39
|
+
*/
|
|
40
|
+
export declare const GetConceptUrl: string;
|
|
41
|
+
/**
|
|
42
|
+
* API endpoint URL for retrieving multiple concepts in bulk.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const response = await fetch(GetConceptBulkUrl, {
|
|
47
|
+
* method: 'POST',
|
|
48
|
+
* body: JSON.stringify({ ids: [1, 2, 3] })
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const GetConceptBulkUrl: string;
|
|
53
|
+
/**
|
|
54
|
+
* API endpoint URL for retrieving all concepts belonging to a specific user.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const response = await fetch(`${GetAllConceptsOfUserUrl}?userId=456`);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare const GetAllConceptsOfUserUrl: string;
|
|
62
|
+
/**
|
|
63
|
+
* API endpoint URL for retrieving all connections belonging to a specific user.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const response = await fetch(`${GetAllConnectionsOfUserUrl}?userId=456`);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare const GetAllConnectionsOfUserUrl: string;
|
|
71
|
+
/**
|
|
72
|
+
* API endpoint URL for retrieving all connections within a composition.
|
|
73
|
+
* A composition is a grouping of related concepts and their connections.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const response = await fetch(`${GetAllConnectionsOfCompositionUrl}?compositionId=789`);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const GetAllConnectionsOfCompositionUrl: string;
|
|
81
|
+
/**
|
|
82
|
+
* API endpoint URL for retrieving connections of multiple compositions in bulk.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const response = await fetch(GetAllConnectionsOfCompositionBulkUrl, {
|
|
87
|
+
* method: 'POST',
|
|
88
|
+
* body: JSON.stringify({ compositionIds: [1, 2, 3] })
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const GetAllConnectionsOfCompositionBulkUrl: string;
|
|
93
|
+
/**
|
|
94
|
+
* API endpoint URL for retrieving a concept by its character value.
|
|
95
|
+
* Character value is the string representation/label of a concept.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const response = await fetch(`${GetConceptByCharacterValueUrl}?value=hello`);
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export declare const GetConceptByCharacterValueUrl: string;
|
|
103
|
+
/**
|
|
104
|
+
* API endpoint URL for retrieving a concept by both its character value and type.
|
|
105
|
+
* This provides more specific filtering when multiple concepts share the same character value.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const response = await fetch(`${GetConceptByCharacterAndTypeUrl}?value=hello&typeId=5`);
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare const GetConceptByCharacterAndTypeUrl: string;
|
|
113
|
+
/**
|
|
114
|
+
* API endpoint URL for retrieving character data by character string.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const response = await fetch(`${GetCharacterByCharacterUrl}?character=A`);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export declare const GetCharacterByCharacterUrl: string;
|
|
122
|
+
/**
|
|
123
|
+
* API endpoint URL for retrieving all concepts of a specific type.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const response = await fetch(`${GetAllConceptsByTypeUrl}?typeId=10`);
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare const GetAllConceptsByTypeUrl: string;
|
|
131
|
+
/**
|
|
132
|
+
* API endpoint URL for retrieving all connections associated with a specific concept.
|
|
133
|
+
* This includes both incoming and outgoing connections.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const response = await fetch(`${GetAllConnectionsOfConceptUrl}?conceptId=123`);
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare const GetAllConnectionsOfConceptUrl: string;
|
|
141
|
+
/**
|
|
142
|
+
* API endpoint URL for retrieving AI-ranked data.
|
|
143
|
+
* Can be overridden via the AI_URL environment variable.
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* The default query parameter `inpage=500` limits the number of results returned.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* const response = await fetch(GetAllAiData);
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
export declare const GetAllAiData: string;
|
|
154
|
+
/**
|
|
155
|
+
* API endpoint URL for retrieving reserved IDs from the system.
|
|
156
|
+
* Reserved IDs are pre-allocated concept IDs used for system-level concepts.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const response = await fetch(GetReservedIdUrl);
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @see https://documentation.freeschema.com for information about reserved IDs
|
|
164
|
+
*/
|
|
165
|
+
export declare const GetReservedIdUrl: string;
|
|
166
|
+
/**
|
|
167
|
+
* API endpoint URL for creating text data in the system.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* const response = await fetch(CreateTheTextDataUrl, {
|
|
172
|
+
* method: 'POST',
|
|
173
|
+
* body: JSON.stringify({ text: 'Hello World' })
|
|
174
|
+
* });
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare const CreateTheTextDataUrl: string;
|
|
178
|
+
/**
|
|
179
|
+
* API endpoint URL for creating character data in the system.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const response = await fetch(CreateTheCharacterDataUrl, {
|
|
184
|
+
* method: 'POST',
|
|
185
|
+
* body: JSON.stringify({ character: 'A' })
|
|
186
|
+
* });
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export declare const CreateTheCharacterDataUrl: string;
|
|
190
|
+
/**
|
|
191
|
+
* API endpoint URL for creating a new concept in the system.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* const response = await fetch(CreateTheConceptUrl, {
|
|
196
|
+
* method: 'POST',
|
|
197
|
+
* body: JSON.stringify({
|
|
198
|
+
* characterValue: 'example',
|
|
199
|
+
* typeId: 5,
|
|
200
|
+
* userId: 123
|
|
201
|
+
* })
|
|
202
|
+
* });
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
export declare const CreateTheConceptUrl: string;
|
|
206
|
+
/**
|
|
207
|
+
* API endpoint URL for creating a new connection between concepts.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const response = await fetch(CreateTheConnectionUrl, {
|
|
212
|
+
* method: 'POST',
|
|
213
|
+
* body: JSON.stringify({
|
|
214
|
+
* ofTheConceptId: 1,
|
|
215
|
+
* toTheConceptId: 2,
|
|
216
|
+
* typeId: 3
|
|
217
|
+
* })
|
|
218
|
+
* });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
export declare const CreateTheConnectionUrl: string;
|
|
222
|
+
/**
|
|
223
|
+
* Changes the base URL for all API endpoints.
|
|
224
|
+
* This is useful for switching between development, staging, and production environments.
|
|
225
|
+
*
|
|
226
|
+
* @param url - The new base URL to use for API requests
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```typescript
|
|
230
|
+
* changeBaseUrl('https://production.freeschema.com');
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @remarks
|
|
234
|
+
* This function modifies the global BaseUrl object, affecting all subsequent API calls.
|
|
235
|
+
* Make sure to call this before making any API requests if you need a custom URL.
|
|
236
|
+
*/
|
|
237
|
+
export declare function changeBaseUrl(url: string): void;
|
|
238
|
+
/**
|
|
239
|
+
* Retrieves the current base URL being used for API requests.
|
|
240
|
+
*
|
|
241
|
+
* @returns The current base URL string
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const currentUrl = getBaseUrl();
|
|
246
|
+
* console.log(currentUrl); // "https://devboom.freeschema.com"
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
export declare function getBaseUrl(): string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format Constants Module for Concept Connection System (CCS-JS)
|
|
3
|
+
*
|
|
4
|
+
* This module defines constants for different data format types used throughout the system.
|
|
5
|
+
* These format types determine how data structures (concepts, connections, etc.) are serialized
|
|
6
|
+
* and presented when retrieved from the API or displayed in the application.
|
|
7
|
+
*
|
|
8
|
+
* @module Constants/FormatConstants
|
|
9
|
+
* @see https://documentation.freeschema.com for format specifications
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Standard normal format for data representation.
|
|
13
|
+
* This format includes essential data fields without additional metadata.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { NORMAL } from './FormatConstants';
|
|
18
|
+
* const format = NORMAL; // 1
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const NORMAL = 1;
|
|
22
|
+
/**
|
|
23
|
+
* Data with ID format.
|
|
24
|
+
* This format includes the data along with its unique identifier.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { DATAID } from './FormatConstants';
|
|
29
|
+
* const format = DATAID; // 2
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const DATAID = 2;
|
|
33
|
+
/**
|
|
34
|
+
* Just data format without any metadata.
|
|
35
|
+
* This format returns only the core data fields, excluding IDs and timestamps.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { JUSTDATA } from './FormatConstants';
|
|
40
|
+
* const format = JUSTDATA; // 3
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const JUSTDATA = 3;
|
|
44
|
+
/**
|
|
45
|
+
* Data with ID and date format.
|
|
46
|
+
* This format includes the data, its ID, and associated timestamp information.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* import { DATAIDDATE } from './FormatConstants';
|
|
51
|
+
* const format = DATAIDDATE; // 4
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const DATAIDDATE = 4;
|
|
55
|
+
/**
|
|
56
|
+
* Raw data format.
|
|
57
|
+
* This format returns data in its raw form as stored in the database without any processing.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { RAW } from './FormatConstants';
|
|
62
|
+
* const format = RAW; // 5
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const RAW = 5;
|
|
66
|
+
/**
|
|
67
|
+
* All IDs format.
|
|
68
|
+
* This format includes all related IDs (concept IDs, type IDs, user IDs, etc.).
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* import { ALLID } from './FormatConstants';
|
|
73
|
+
* const format = ALLID; // 6
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare const ALLID = 6;
|
|
77
|
+
/**
|
|
78
|
+
* List normal format.
|
|
79
|
+
* This format is used for representing lists or arrays of data in standard format.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* import { LISTNORMAL } from './FormatConstants';
|
|
84
|
+
* const format = LISTNORMAL; // 7
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare const LISTNORMAL = 7;
|