mftsccs-node 0.2.23 → 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 (41) 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/GetConnections/GetConnectionsBetweenApi.d.ts +8 -0
  10. package/dist/types/Api/GetReservedConnectionIds.d.ts +1 -1
  11. package/dist/types/Api/RecursiveSearch.d.ts +1 -1
  12. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +6 -5
  13. package/dist/types/Api/Search/Search.d.ts +4 -3
  14. package/dist/types/Api/Search/SearchInternalApi.d.ts +5 -4
  15. package/dist/types/Api/Search/SearchLinkMultipleApi.d.ts +4 -4
  16. package/dist/types/Api/Search/SearchWithLinker.d.ts +5 -4
  17. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +3 -2
  18. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryDirect.d.ts +3 -2
  19. package/dist/types/Api/View/ViewInternalDataApi.d.ts +3 -4
  20. package/dist/types/DataStructures/BaseUrl.d.ts +5 -0
  21. package/dist/types/DataStructures/ConceptData.d.ts +14 -5
  22. package/dist/types/DataStructures/FetchConnection.d.ts +21 -0
  23. package/dist/types/DataStructures/ReservedIds.d.ts +11 -16
  24. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +1 -0
  25. package/dist/types/DataStructures/Transaction/Transaction.d.ts +23 -0
  26. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +1 -119
  27. package/dist/types/DataStructures/User/UserNode.d.ts +4 -146
  28. package/dist/types/Database/NoIndexDb.d.ts +32 -36
  29. package/dist/types/Services/Common/DecodeCountInfo.d.ts +4 -3
  30. package/dist/types/Services/Common/ErrorPosting.d.ts +5 -7
  31. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +4 -3
  32. package/dist/types/Services/CreateTheComposition.d.ts +2 -2
  33. package/dist/types/Services/CreateTheConnection.d.ts +9 -4
  34. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +4 -4
  35. package/dist/types/Services/GetDataFromIndexDb.d.ts +8 -8
  36. package/dist/types/Services/Http/HttpClient.service.d.ts +7 -0
  37. package/dist/types/Services/MakeTheTimestamp.d.ts +2 -2
  38. package/dist/types/Services/PatchComposition.d.ts +10 -15
  39. package/dist/types/Services/UpdateComposition.d.ts +1 -1
  40. package/dist/types/app.d.ts +21 -21
  41. package/package.json +12 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **mftsccs-node** - Full Pack of Concept and Connection System
4
4
 
5
- A powerful TypeScript library for building knowledge graphs and managing complex relationships between concepts. CCS-JS provides a complete solution for creating, querying, and managing concepts and connections with support for offline-first architecture, transactions, and flexible schema querying.
5
+ A powerful TypeScript library for building knowledge graphs and managing complex relationships between concepts. CCS-JS provides a complete solution for creating, querying, and managing concepts and connections with support for transactions, runtime caching, and flexible schema querying.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/mftsccs-node.svg)](https://www.npmjs.com/package/mftsccs-node)
8
8
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
@@ -106,7 +106,7 @@ A **Composition** is a hierarchical structure of related concepts and connection
106
106
 
107
107
  ## ✨ Key Features
108
108
 
109
- - 🔄 **Offline-First Architecture**: Local IndexedDB storage with backend synchronization
109
+ - 🔄 **Runtime Caching**: In-memory compatibility store and backend synchronization helpers
110
110
  - 🔐 **Security & Access Control**: Fine-grained permissions per concept/connection
111
111
  - 🌳 **Binary Tree Indexing**: O(log n) lookups by ID, character, and type
112
112
  - 📦 **Transactions**: ACID-like operations with rollback support
@@ -149,8 +149,8 @@ updateAccessToken('new-access-token');
149
149
 
150
150
  **Important**:
151
151
  - Call `init()` once at application startup
152
- - System loads data from IndexedDB asynchronously
153
- - Check `IdentifierFlags` to ensure data is loaded before queries
152
+ - `init()` returns a Promise; await it before making API calls that depend on auth or hydrated caches
153
+ - `IdentifierFlags` are also updated for callers that poll readiness
154
154
 
155
155
  ```typescript
156
156
  import { IdentifierFlags } from 'mftsccs-node';
@@ -912,31 +912,9 @@ const retrieved = await GetComposition(composition.id);
912
912
  console.log(retrieved); // Full nested structure
913
913
  ```
914
914
 
915
- ### Local Storage (Offline Support)
915
+ ### Local Compatibility APIs
916
916
 
917
- Work with local concepts for offline functionality:
918
-
919
- ```typescript
920
- import {
921
- CreateTheConceptLocal,
922
- GetCompositionLocal,
923
- MakeTheInstanceConceptLocal
924
- } from 'mftsccs-node';
925
-
926
- // Create local concept (survives offline)
927
- const localConcept = await MakeTheInstanceConceptLocal(
928
- "note",
929
- "Offline note",
930
- 1,
931
- 4
932
- );
933
-
934
- // Retrieve from local storage
935
- const composition = await GetCompositionLocal(
936
- localConcept.id,
937
- localConcept.userId
938
- );
939
- ```
917
+ Frontend-origin local/offline helpers are not exported by the Node package. Server consumers should use the backend-backed concept, connection, and composition APIs instead of local concept creation helpers.
940
918
 
941
919
  ### Bulk Operations
942
920
 
@@ -1041,7 +1019,7 @@ ccs-js/
1041
1019
  │ ├── Api/ # Backend API integration (45 files)
1042
1020
  │ ├── Services/ # Business logic layer (73+ files)
1043
1021
  │ ├── DataStructures/ # Core data models (70+ files)
1044
- │ ├── Database/ # IndexedDB persistence (4 files)
1022
+ │ ├── Database/ # Node in-memory compatibility storage (4 files)
1045
1023
  │ ├── Constants/ # Configuration (2 files)
1046
1024
  │ ├── Helpers/ # Utility functions (3 files)
1047
1025
  │ ├── Drawing/ # UI visualization (2 files)
@@ -1121,6 +1099,40 @@ const documents = await FreeschemaQueryApi(query, "token");
1121
1099
 
1122
1100
  ---
1123
1101
 
1102
+ ## Local Package Testing
1103
+
1104
+ You can call `SchemaQueryListener` from this repository without creating another project.
1105
+
1106
+ 1. Copy `scripts/.env.example` to `scripts/.env` and set `CCS_BASE_URL`, `CCS_ACCESS_TOKEN`, and optionally `CCS_SCHEMA_QUERY_FILE`.
1107
+ 2. Edit `scripts/schema-query.example.json` or create another query JSON file.
1108
+ 3. Run:
1109
+
1110
+ ```bash
1111
+ npm run schemaquery:test
1112
+ ```
1113
+
1114
+ To reuse an already-built `dist/bundle.js`, run:
1115
+
1116
+ ```bash
1117
+ npm run schemaquery:test:built -- --query scripts/schema-query.example.json
1118
+ ```
1119
+
1120
+ You can override values from the command line:
1121
+
1122
+ ```bash
1123
+ npm run schemaquery:test -- --query scripts/schema-query.example.json --base-url https://your-api-url.com --token your-token --type YourTypeName --format DATAID
1124
+ ```
1125
+
1126
+ The runner prints the full `SchemaQueryListener` result as JSON, including the top-level `count`.
1127
+
1128
+ If the backend returns an error, inspect the raw API response:
1129
+
1130
+ ```bash
1131
+ npm run schemaquery:test:built -- --query scripts/schema-query.example.json --raw
1132
+ ```
1133
+
1134
+ ---
1135
+
1124
1136
  ## 🤝 Contributing
1125
1137
 
1126
1138
  Contributions are welcome! Please follow these steps: