mftsccs-node 0.2.24 → 0.2.25

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.
Files changed (34) hide show
  1. package/README.md +41 -29
  2. package/dist/bundle.js +1 -1
  3. package/dist/bundle.mjs +1 -0
  4. package/dist/types/Api/Create/CreateTheConnectionApi.d.ts +4 -9
  5. package/dist/types/Api/GetAllConcepts.d.ts +0 -4
  6. package/dist/types/Api/GetAllLinkerConnectionsFromTheConcept.d.ts +1 -1
  7. package/dist/types/Api/GetAllLinkerConnectionsToTheConcept.d.ts +1 -1
  8. package/dist/types/Api/GetAllPrefetchConnections.d.ts +0 -3
  9. package/dist/types/Api/RecursiveSearch.d.ts +1 -1
  10. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +6 -5
  11. package/dist/types/Api/Search/Search.d.ts +4 -3
  12. package/dist/types/Api/Search/SearchInternalApi.d.ts +5 -4
  13. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +4 -4
  14. package/dist/types/Api/Search/SearchWithLinker.d.ts +5 -4
  15. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +3 -2
  16. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +3 -2
  17. package/dist/types/Api/View/ViewInternalDataApi.d.ts +3 -4
  18. package/dist/types/DataStructures/ConceptData.d.ts +14 -5
  19. package/dist/types/DataStructures/ReservedIds.d.ts +1 -0
  20. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +1 -0
  21. package/dist/types/Database/NoIndexDb.d.ts +32 -36
  22. package/dist/types/Services/Common/DecodeCountInfo.d.ts +4 -3
  23. package/dist/types/Services/Common/ErrorPosting.d.ts +5 -7
  24. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +4 -3
  25. package/dist/types/Services/CreateTheComposition.d.ts +2 -2
  26. package/dist/types/Services/CreateTheConnection.d.ts +9 -4
  27. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +4 -4
  28. package/dist/types/Services/GetDataFromIndexDb.d.ts +8 -8
  29. package/dist/types/Services/Http/HttpClient.service.d.ts +7 -0
  30. package/dist/types/Services/MakeTheTimestamp.d.ts +2 -2
  31. package/dist/types/Services/PatchComposition.d.ts +10 -15
  32. package/dist/types/Services/UpdateComposition.d.ts +1 -1
  33. package/dist/types/app.d.ts +19 -22
  34. package/package.json +12 -1
@@ -20,8 +20,8 @@ import { Concept } from "../DataStructures/Concept";
20
20
  * @param ofConcept - The source concept from which the connection originates
21
21
  * @param MainConcept - The main composition concept that contains both concepts and their connection
22
22
  * @param toConcept - The target concept to which the connection points
23
- * @returns The connection object between the two concepts within the composition context,
24
- * or undefined if no such connection exists
23
+ * @returns The connections between the two concepts within the composition context,
24
+ * or an empty array if no such connection exists
25
25
  *
26
26
  * @example
27
27
  * ```typescript
@@ -33,8 +33,8 @@ import { Concept } from "../DataStructures/Concept";
33
33
  * const profileConcept: Concept = { id: 456, type: "profile", ... };
34
34
  * const compositionConcept: Concept = { id: 789, type: "composition", ... };
35
35
  *
36
- * const connection = PatchComposition(userConcept, compositionConcept, profileConcept);
37
- * // Returns the connection object linking user to profile within the composition
36
+ * const connections = await PatchComposition(userConcept, compositionConcept, profileConcept);
37
+ * // Returns the connections linking user to profile within the composition
38
38
  * ```
39
39
  *
40
40
  * @example
@@ -44,13 +44,13 @@ import { Concept } from "../DataStructures/Concept";
44
44
  * const addressConcept = await GetTheConcept(456);
45
45
  * const mainComposition = await GetTheConcept(789);
46
46
  *
47
- * const existingConnection = PatchComposition(
47
+ * const existingConnections = await PatchComposition(
48
48
  * userConcept,
49
49
  * mainComposition,
50
50
  * addressConcept
51
51
  * );
52
52
  *
53
- * if (existingConnection) {
53
+ * if (existingConnections.length > 0) {
54
54
  * console.log("Connection already exists");
55
55
  * } else {
56
56
  * console.log("No connection found, can create new one");
@@ -64,9 +64,9 @@ import { Concept } from "../DataStructures/Concept";
64
64
  * const toConcept = await GetTheConcept(222);
65
65
  * const composition = await GetTheConcept(333);
66
66
  *
67
- * const connection = PatchComposition(fromConcept, composition, toConcept);
68
- * if (connection) {
69
- * await DeleteConnectionById(connection.id);
67
+ * const connections = await PatchComposition(fromConcept, composition, toConcept);
68
+ * if (connections.length > 0) {
69
+ * await DeleteConnectionById(connections[0].id);
70
70
  * }
71
71
  * ```
72
72
  *
@@ -83,11 +83,6 @@ import { Concept } from "../DataStructures/Concept";
83
83
  * - This prevents retrieving connections from other compositions that might link the same concepts
84
84
  * - Provides composition-scoped connection lookup
85
85
  *
86
- * **Return Value:**
87
- * - The function calls an API method but doesn't explicitly handle the return
88
- * - The connection variable is assigned but not returned in the current implementation
89
- * - This may be an incomplete implementation that needs a return statement
90
- *
91
86
  * **Use Cases:**
92
87
  * - Verifying if a connection exists before creating a new one
93
88
  * - Finding the connection ID for deletion operations
@@ -104,4 +99,4 @@ import { Concept } from "../DataStructures/Concept";
104
99
  * @see {@link Connection} for the connection data structure
105
100
  * @see {@link UpdateComposition} for composition update operations
106
101
  */
107
- export default function PatchComposition(ofConcept: Concept, MainConcept: Concept, toConcept: Concept): void;
102
+ export default function PatchComposition(ofConcept: Concept, MainConcept: Concept, toConcept: Concept): Promise<import("../app").Connection[]>;
@@ -118,7 +118,7 @@ import { PatcherStructure } from '../DataStructures/PatcherStructure';
118
118
  * @see {@link CreateTheCompositionWithCache} for creating nested compositions
119
119
  * @see {@link GetTheConcept} for concept retrieval
120
120
  * @see {@link MakeTheInstanceConcept} for creating new concept instances
121
- * @see {@link createTheConnection} for creating connections between concepts
121
+ * @see {@link CreateTheConnectionGeneral} for creating connections between concepts
122
122
  * @see {@link DeleteConnectionById} for connection deletion
123
123
  * @see {@link SyncData.SyncDataOnline} for backend synchronization
124
124
  */
@@ -7,26 +7,23 @@
7
7
  * @see {@link https://documentation.freeschema.com} for detailed documentation
8
8
  */
9
9
  export { init, updateAccessToken };
10
- export { getOAuthToken, refreshOAuthToken, OAuthResponse } from './Services/oauth/CallOauth.service';
11
- export { requestWithRetry, postWithRetry, getWithRetry, putWithRetry, deleteWithRetry, patchWithRetry, HttpResponse, TokenRefreshError } from './Services/Http/HttpClient.service';
10
+ export { getOAuthToken, refreshOAuthToken } from './Services/oauth/CallOauth.service';
11
+ export type { OAuthResponse } from './Services/oauth/CallOauth.service';
12
+ export { requestWithRetry, postWithRetry, getWithRetry, putWithRetry, deleteWithRetry, patchWithRetry, fetchWithRetry, HttpResponse, TokenRefreshError } from './Services/Http/HttpClient.service';
12
13
  export { SplitStrings } from './Services/SplitStrings';
13
14
  export { GetRequestHeader, GetRequestHeaderWithAuthorization } from './Services/Security/GetRequestHeader';
14
15
  export { GetCompositionList, GetCompositionListWithId } from './Services/GetCompositionList';
15
- export { GetCompositionListLocal, GetCompositionListLocalWithId } from './Services/Local/GetCompositionListLocal';
16
16
  export { GetAllConnectionsOfComposition } from './Api/GetAllConnectionsOfComposition';
17
17
  export { GetComposition, GetCompositionWithId, recursiveFetch, GetCompositionWithAllIds } from './Services/GetComposition';
18
- export { GetCompositionLocal, GetCompositionLocalWithId } from './Services/Local/GetCompositionLocal';
19
18
  export { default as CreateComposition } from './Services/CreateTheComposition';
20
- export { CreateTheCompositionLocal } from './Services/Local/CreateTheCompositionLocal';
21
19
  export { CreateConnectionBetweenTwoConcepts, CreateConnectionBetweenTwoConceptsGeneral } from './Services/CreateConnectionBetweenTwoConcepts';
22
20
  export { default as GetTheConcept } from './Services/GetTheConcept';
23
21
  export { default as MakeTheInstanceConcept } from './Services/MakeTheInstanceConcept';
24
- export { MakeTheInstanceConceptLocal } from './Services/Local/MakeTheInstanceConceptLocal';
25
22
  export { storeToDatabase, getFromDatabaseWithType, getFromDatabaseWithTypeOld } from './Database/NoIndexDb';
26
- export { createTheConnection as CreateTheConnection } from './Services/CreateTheConnection';
27
23
  export { default as GetConceptByCharacter } from './Services/GetConceptByCharacter';
28
24
  export { GetLink, GetLinkRaw } from './Services/GetLink';
29
25
  export { CreateDefaultConcept } from './Services/CreateDefaultConcept';
26
+ export { CreateDefaultLConcept } from './Services/Local/CreateDefaultLConcept';
30
27
  export { MakeTheTypeConcept } from './Services/MakeTheTypeConcept';
31
28
  export { MakeTheTypeConceptApi } from './Api/MakeTheTypeConceptApi';
32
29
  export { GetLinkerConnectionFromConcepts, GetLinkerConnectionToConcepts } from './Services/GetLinkerConnectionFromConcept';
@@ -54,12 +51,9 @@ export {} from './Api/GetConceptByCharacterAndType';
54
51
  export { GetRelation, GetRelationRaw } from './Services/GetRelation';
55
52
  export { recursiveFetchNew } from './Services/Composition/BuildComposition';
56
53
  export { CreateTheCompositionWithCache } from './Services/Composition/CreateCompositionCache';
57
- export { CreateDefaultLConcept } from './Services/Local/CreateDefaultLConcept';
58
54
  export { CreateTheConnectionGeneral, CreateConnection } from './Services/CreateTheConnectionGeneral';
59
- export { CreateTheConnectionLocal } from './Services/Local/CreateTheConnectionLocal';
60
55
  export { GetUserGhostId, AddGhostConcept, GetUserGhostConnectionId, AddGhostConnection } from './Services/User/UserTranslation';
61
56
  export { SearchLinkMultipleAll, FormatFromConnections } from './Services/Search/SearchLinkMultiple';
62
- export { UpdateCompositionLocal } from './Services/Local/UpdateCompositionLocal';
63
57
  export { GetCompositionFromConnectionsWithDataIdInObject } from './Services/GetCompositionBulk';
64
58
  export { ViewInternalData } from './Services/View/ViewInternalData';
65
59
  export { convertFromLConceptToConcept } from './Services/Conversion/ConvertConcepts';
@@ -80,9 +74,9 @@ export { ConceptsData } from './DataStructures/ConceptData';
80
74
  export { ConnectionData } from './DataStructures/ConnectionData';
81
75
  export { BinaryTree } from './DataStructures/BinaryTree';
82
76
  export { SearchQuery } from './DataStructures/SearchQuery';
83
- export { SignupModel } from './DataStructures/SignupModel';
84
- export { SigninModel } from './DataStructures/SigninModel';
85
- export { FreeschemaResponse } from './DataStructures/Responses/StandardResponses';
77
+ export type { SignupModel } from './DataStructures/SignupModel';
78
+ export type { SigninModel } from './DataStructures/SigninModel';
79
+ export type { FreeschemaResponse } from './DataStructures/Responses/StandardResponses';
86
80
  export { PatcherStructure } from './DataStructures/PatcherStructure';
87
81
  export { SessionData } from './DataStructures/Session/SessionData';
88
82
  export { Composition } from './DataStructures/Composition/Composition';
@@ -100,11 +94,13 @@ export { SchemaQueryListener } from './WrapperFunctions/SchemaQueryObservable';
100
94
  export { FreeschemaQuery } from './DataStructures/Search/FreeschemaQuery';
101
95
  export { GiveConnection, GetAllTheConnectionsByTypeAndOfTheConcept } from './Services/Delete/GetAllConnectionByType';
102
96
  export { GetConnectionsBetweenApi } from './Api/GetConnections/GetConnectionsBetweenApi';
103
- export { FetchConnection, FetchConnectionQuery, buildFetchConnection } from './DataStructures/FetchConnection';
97
+ export { buildFetchConnection } from './DataStructures/FetchConnection';
98
+ export type { FetchConnection, FetchConnectionQuery } from './DataStructures/FetchConnection';
104
99
  export { DATAID, NORMAL, JUSTDATA, ALLID, DATAIDDATE, RAW, LISTNORMAL, DATAV2 } from './Constants/FormatConstants';
105
100
  export { AccessControlService } from './Services/AccessControl/AccessControlService';
106
101
  export { PermissionSet } from './Services/AccessControl/PermissionSet';
107
- export { Transaction, InnerActions } from './DataStructures/Transaction/Transaction';
102
+ export { Transaction } from './DataStructures/Transaction/Transaction';
103
+ export type { InnerActions } from './DataStructures/Transaction/Transaction';
108
104
  export { ReservedIds, ReservedConnectionIds } from './DataStructures/ReservedIds';
109
105
  /**
110
106
  * Updates the bearer access token used for authenticating API requests to the backend.
@@ -129,11 +125,11 @@ declare function updateAccessToken(accessToken?: string): void;
129
125
  *
130
126
  * 1. Sets up base URLs for the main API and AI services
131
127
  * 2. Stores the authentication token for API requests (or obtains one via OAuth)
132
- * 3. Initializes the system (database setup)
128
+ * 3. Initializes the system and process-local compatibility store
133
129
  * 4. Creates binary trees from concept data for efficient querying (by ID, character, and type)
134
- * 5. Creates local binary trees for offline/local concept management
135
- * 6. Loads connection data from IndexedDB into memory
136
- * 7. Loads local connection data for offline operations
130
+ * 5. Creates local binary trees for compatibility with frontend-origin APIs
131
+ * 6. Loads connection data from process-local storage into memory
132
+ * 7. Loads local connection data from process-local storage
137
133
  *
138
134
  * All data loading operations run in parallel for optimal performance. The IdentifierFlags
139
135
  * are updated as each operation completes to indicate which data structures are ready for use.
@@ -194,8 +190,9 @@ declare function updateAccessToken(accessToken?: string): void;
194
190
  * ```
195
191
  *
196
192
  * @remarks
197
- * The initialization process is asynchronous but does not return a Promise. Instead,
198
- * it uses IdentifierFlags to signal when different components are ready:
193
+ * The initialization process returns a Promise that resolves after OAuth setup,
194
+ * system initialization, and all cache hydration tasks complete. IdentifierFlags
195
+ * are also updated for consumers that poll readiness:
199
196
  * - `isDataLoaded`, `isCharacterLoaded`, `isTypeLoaded` - Remote concept data ready
200
197
  * - `isLocalDataLoaded`, `isLocalTypeLoaded`, `isLocalCharacterLoaded` - Local concept data ready
201
198
  * - `isConnectionLoaded`, `isConnectionTypeLoaded` - Remote connection data ready
@@ -207,4 +204,4 @@ declare function updateAccessToken(accessToken?: string): void;
207
204
  * @see CreateBinaryTreeFromData for concept tree creation
208
205
  * @see https://documentation.freeschema.com/#installation for setup guide
209
206
  */
210
- declare function init(url?: string, nodeUrl?: string, applicationName?: string, config?: CCSConfig): void;
207
+ declare function init(url?: string, nodeUrl?: string, applicationName?: string, config?: CCSConfig): Promise<void>;
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "mftsccs-node",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "environment": "production",
5
5
  "description": "Full Pack of concept and connection system",
6
6
  "main": "dist/bundle.js",
7
+ "module": "dist/bundle.mjs",
7
8
  "types": "dist/types/app.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/app.d.ts",
12
+ "import": "./dist/bundle.mjs",
13
+ "require": "./dist/bundle.js",
14
+ "default": "./dist/bundle.js"
15
+ },
16
+ "./dist/*": "./dist/*",
17
+ "./package.json": "./package.json"
18
+ },
8
19
  "files": [
9
20
  "dist",
10
21
  "LICENSE",