mftsccs-node 0.0.78-dev → 0.0.80-dev

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 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 transactions, runtime caching, 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
- - 🔄 **Runtime Caching**: In-memory compatibility store and backend synchronization helpers
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
@@ -125,12 +125,22 @@ Initialize the CCS system before performing any operations:
125
125
 
126
126
  ```typescript
127
127
  import { init, updateAccessToken } from 'mftsccs-node';
128
+ import { CCSConfig } from 'mftsccs-node';
129
+
130
+ // Access control is disabled by default (all access allowed).
131
+ // Enable it explicitly via CCSConfig when needed.
132
+ const config = new CCSConfig({
133
+ accessToken: 'your-bearer-access-token',
134
+ enableAccessControl: true,
135
+ accessControlBaseUrl: 'https://access.example.com/api/access-control'
136
+ });
128
137
 
129
- // Initialize with backend URLs and auth token
138
+ // Initialize with backend URLs and config
130
139
  init(
131
140
  'https://api.freeschema.com', // Base API URL
132
- 'https://ai.freeschema.com', // AI service URL
133
- 'your-bearer-access-token' // Authentication token
141
+ '', // Optional Node URL
142
+ 'MyApp', // Application name
143
+ config
134
144
  );
135
145
 
136
146
  // Update token later if needed
@@ -139,8 +149,8 @@ updateAccessToken('new-access-token');
139
149
 
140
150
  **Important**:
141
151
  - Call `init()` once at application startup
142
- - `init()` returns a Promise; await it before making API calls that depend on auth or hydrated caches
143
- - `IdentifierFlags` are also updated for callers that poll readiness
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
144
154
 
145
155
  ```typescript
146
156
  import { IdentifierFlags } from 'mftsccs-node';
@@ -902,9 +912,9 @@ const retrieved = await GetComposition(composition.id);
902
912
  console.log(retrieved); // Full nested structure
903
913
  ```
904
914
 
905
- ### Local Compatibility APIs
906
-
907
- 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.
915
+ ### Local Compatibility APIs
916
+
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.
908
918
 
909
919
  ### Bulk Operations
910
920
 
@@ -1009,7 +1019,7 @@ ccs-js/
1009
1019
  │ ├── Api/ # Backend API integration (45 files)
1010
1020
  │ ├── Services/ # Business logic layer (73+ files)
1011
1021
  │ ├── DataStructures/ # Core data models (70+ files)
1012
- │ ├── Database/ # Node in-memory compatibility storage (4 files)
1022
+ │ ├── Database/ # Node in-memory compatibility storage (4 files)
1013
1023
  │ ├── Constants/ # Configuration (2 files)
1014
1024
  │ ├── Helpers/ # Utility functions (3 files)
1015
1025
  │ ├── Drawing/ # UI visualization (2 files)
@@ -1087,45 +1097,45 @@ const query = {
1087
1097
  const documents = await FreeschemaQueryApi(query, "token");
1088
1098
  ```
1089
1099
 
1090
- ---
1091
-
1092
- ## Local Package Testing
1093
-
1094
- You can call `SchemaQueryListener` from this repository without creating another project.
1095
-
1096
- 1. Copy `scripts/.env.example` to `scripts/.env` and set `CCS_BASE_URL`, `CCS_ACCESS_TOKEN`, and optionally `CCS_SCHEMA_QUERY_FILE`.
1097
- 2. Edit `scripts/schema-query.example.json` or create another query JSON file.
1098
- 3. Run:
1099
-
1100
- ```bash
1101
- npm run schemaquery:test
1102
- ```
1103
-
1104
- To reuse an already-built `dist/bundle.js`, run:
1105
-
1106
- ```bash
1107
- npm run schemaquery:test:built -- --query scripts/schema-query.example.json
1108
- ```
1109
-
1110
- You can override values from the command line:
1111
-
1112
- ```bash
1113
- npm run schemaquery:test -- --query scripts/schema-query.example.json --base-url https://your-api-url.com --token your-token --type YourTypeName --format DATAID
1114
- ```
1115
-
1116
- The runner prints the full `SchemaQueryListener` result as JSON, including the top-level `count`.
1117
-
1118
- If the backend returns an error, inspect the raw API response:
1119
-
1120
- ```bash
1121
- npm run schemaquery:test:built -- --query scripts/schema-query.example.json --raw
1122
- ```
1123
-
1124
- ---
1125
-
1126
- ## 🤝 Contributing
1127
-
1128
- Contributions are welcome! Please follow these steps:
1100
+ ---
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
+
1136
+ ## 🤝 Contributing
1137
+
1138
+ Contributions are welcome! Please follow these steps:
1129
1139
 
1130
1140
  1. Fork the repository
1131
1141
  2. Create a feature branch (`git checkout -b feature/amazing-feature`)