genosdb 0.10.4 โ†’ 0.10.5

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
@@ -14,9 +14,7 @@ A lightweight, decentralized graph database designed for modern web applications
14
14
  [![](https://data.jsdelivr.com/v1/package/npm/genosdb/badge)](https://www.jsdelivr.com/package/npm/genosdb)
15
15
  [![Tests](https://github.com/estebanrfp/gdb/actions/workflows/test.yml/badge.svg)](https://estebanrfp.github.io/gdb/tests/html/test-results.html)
16
16
 
17
- ![Project Status](https://img.shields.io/badge/state-development-green)
18
-
19
- <!-- [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/estebanrfp/gdb&build=dist) -->
17
+ ![Project Status](https://img.shields.io/badge/status-stable--beta-blue)
20
18
 
21
19
  ![NPM Unpacked Size (with version)](https://img.shields.io/npm/unpacked-size/genosdb/latest)
22
20
 
@@ -24,11 +22,6 @@ A lightweight, decentralized graph database designed for modern web applications
24
22
 
25
23
  [![Liberapay receiving](https://img.shields.io/liberapay/receives/estebanrfp.svg?logo=liberapay)](https://liberapay.com/estebanrfp/donate)
26
24
 
27
-
28
- > โœ… GenosDB uses network access by design for real-time P2P synchronization ๐Ÿ‘‰ { rtc: true }
29
-
30
- > โš ๏ธ Migration Guide: The class-based API `new GDB()` has been removed. Please migrate to the async factory function. See the guide: [MIGRATION.md](./MIGRATION.md)
31
-
32
25
  <!-- ### Nostr.band Followers
33
26
 
34
27
  ![Nostr.band Followers](https://img.shields.io/nostr-band/followers/npub18c556t7n8xa3df2q82rwxejfglw5przds7sqvefylzjh8tjne28qld0we7) -->
@@ -42,18 +35,15 @@ A lightweight, decentralized graph database designed for modern web applications
42
35
  - **High-Performance Engine & Efficient Storage:** Utilizes OPFS for fast, local-first storage. The engine is optimized for extreme write loads, capable of processing tens of thousands of operations per second without blocking the main UI thread.
43
36
  - **Powerful & Flexible Queries:** Supports standard CRUD operations for nodes and relationships, plus advanced, multi-hop recursive graph traversals to discover deep connections.
44
37
  - **Real-time Synchronization:**
45
- - **Between Devices (P2P):** Employs an intelligent hybrid system (via GenosRTC) that combines real-time delta updates with a full-state fallback to ensure data consistency across all peers.
38
+ - **Between Devices (P2P):** Employs an intelligent hybrid system (via GenosRTC) that combines real-time delta updates with a full-state fallback to ensure data consistency across all peers. This feature is enabled by initializing the database with the `{ rtc: true }` option.
46
39
  - **Between Tabs:** Uses BroadcastChannel for instant, local synchronization.
47
40
  - **Optimized Data Handling:** Efficiently serializes data with MessagePack and compresses it with Pako to reduce storage footprint and network payload.
48
41
  - **Extensible & Modular:** The core is lightweight, but its capabilities can be easily extended with external modules for features like advanced indexing (e.g., Radix Tree).
49
42
 
50
- ## Warning
51
-
52
- GenosDB is in active beta and soon will deliver its first stable release, v1.0.0. See the [Project Status](#project-status) section for the latest updates.
53
-
54
43
  ## Project Status
55
44
 
56
- - **Phase**: Beta
45
+ - **Phase**: Stable Beta
46
+ - **Current Focus**: The project has completed its major feature development and has entered a hardening phase. Our current focus is on rigorous testing, performance tuning, and solidifying API stability for the first stable release.
57
47
  - **Completed Features**:
58
48
  - Basic queries.
59
49
  - Advanced queries.
@@ -67,10 +57,10 @@ GenosDB is in active beta and soon will deliver its first stable release, v1.0.0
67
57
  GenosDB overcomes the limitations of naive P2P sync with an intelligent, dual-mode engine. It automatically exchanges tiny, compressed Deltas between active peers using a sliding-window Oplog for blazing-fast, low-latency updates. For peers that are too far out of sync, it seamlessly switches to a robust Full-State Fallback, guaranteeing absolute data consistency for everyone, no matter how long they've been offline.
68
58
  - **Access Control Lists (ACLs):** Optional submodule for fine-grained, node-level permissions, allowing owners to grant/revoke specific permissions ('read', 'write', 'delete') to other users per node, complementing the existing RBAC system.
69
59
 
70
- - **Pending Features**:
71
- - No major features are currently pending. The project has entered a hardening phase with a focus on rigorous testing and stability improvements.
60
+ ### ๐Ÿงช API Status: Stable Beta
72
61
 
73
- > โš ๏ธ The API is under active development and may change without notice. Use fixed versions and check the [CHANGELOG](CHANGELOG.md) before upgrading.
62
+ > The GenosDB API is currently in a stable beta. We are actively adding features and improving stability.
63
+ > We recommend checking the [CHANGELOG](https://github.com/estebanrfp/gdb/blob/main/CHANGELOG.md) as we continue to refine the API for its first stable release.
74
64
 
75
65
  ### โœ… **Role Based Access Control (RBAC)**
76
66
 
@@ -87,17 +77,9 @@ GenosDB is in active beta and soon will deliver its first stable release, v1.0.0
87
77
  - Secure storage of roles in internal graph
88
78
  - [Security Manager (SM Architecture)](https://github.com/estebanrfp/gdb/blob/main/docs/sm-architecture.md)
89
79
 
90
- > **Important Notice**: This project has progressed from its active development phase and is now in the beta stage. While it is functional and stable in controlled environments, it is recommended to evaluate its suitability for production based on the specific needs of your environment. For more details, please refer to the [Project Status](#project-status)
91
-
92
- ## โš ๏ธ Reliability Notice
93
-
94
- This is a distributed database (P2P + CRDT); therefore:
95
- โ€ข In extreme conditions (network failures, partial synchronization, or unconventional usage), unexpected behavior may occur.
96
- โ€ข Any reported issues will be prioritized and resolved in upcoming patch versions.
97
-
98
- The project has achieved the expected stability goals (such as conflict resolution, synchronization, and distributed storage), without intending to ignore the limitations inherent to distributed technologies (P2P + CRDT).
80
+ ## A Note on P2P System Reliability
99
81
 
100
- GenosDB has been rigorously tested with our common usage examples in such environments, demonstrating greater stability than many other well-known distributed databases.
82
+ GenosDB operates in a real-world P2P environment, which exposes the system to network uncertainties by design. Our engineering focus is on mitigating these uncertainties within our software through robust conflict resolution (CRDTs) and synchronization logic. While we cannot control external network conditions, our commitment is to the continuous research and development required to ensure the highest possible resilience of the GenosDB engine.
101
83
 
102
84
  ---
103
85
 
@@ -141,14 +123,14 @@ Weโ€™ve created a collection of interactive examples to help you understand how
141
123
  ๐Ÿ‘‰ [Explore /docs/Examples](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-examples.md)
142
124
 
143
125
  ## Roadmap & Whitepaper
144
- - ๐Ÿงญ [ROADMAP.md](./ROADMAP.md) (Planned features and milestones)
145
- - ๐Ÿ“„ [WHITEPAPER.md](./WHITEPAPER.md) (Architecture and design paper)
146
- - ๐Ÿ“œ [PHILOSOPHY.md](./PHILOSOPHY.md) (Project philosophy, founder history, and coreprinciples)
147
- - ๐Ÿ  [README.md](./README.md) (Project overview, installation, and docs)
148
- - ๐Ÿงพ [CHANGELOG.md](./CHANGELOG.md) (Release notes and version history)
149
- - ๐Ÿค [CONTRIBUTING.md](./CONTRIBUTING.md) (How to contribute examples and guidelines)
150
- - ๐Ÿ”€ [MIGRATION.md](./MIGRATION.md) (Migrate from "new GDB()" to "await gdb(..)")
151
- - ๐Ÿ›ก๏ธ [SECURITY.md](./SECURITY.md) (Security policy and vulnerability reporting)
126
+ - ๐Ÿงญ [ROADMAP.md](https://github.com/estebanrfp/gdb/blob/main/ROADMAP.md) (Planned features and milestones)
127
+ - ๐Ÿ“„ [WHITEPAPER.md](https://github.com/estebanrfp/gdb/blob/main/WHITEPAPER.md) (Architecture and design paper)
128
+ - ๐Ÿ“œ [PHILOSOPHY.md](https://github.com/estebanrfp/gdb/blob/main/PHILOSOPHY.md) (Project philosophy, founder history, and coreprinciples)
129
+ - ๐Ÿ  [README.md](https://github.com/estebanrfp/gdb/blob/main/README.md) (Project overview, installation, and docs)
130
+ - ๐Ÿงพ [CHANGELOG.md](https://github.com/estebanrfp/gdb/blob/main/CHANGELOG.md) (Release notes and version history)
131
+ - ๐Ÿค [CONTRIBUTING.md](https://github.com/estebanrfp/gdb/blob/main/CONTRIBUTING.md) (How to contribute examples and guidelines)
132
+ - ๐Ÿ”€ [MIGRATION.md](https://github.com/estebanrfp/gdb/blob/main/MIGRATION.md) (Migrate from "new GDB()" to "await gdb(..)")
133
+ - ๐Ÿ›ก๏ธ [SECURITY.md](https://github.com/estebanrfp/gdb/blob/main/SECURITY.md) (Security policy and vulnerability reporting)
152
134
 
153
135
  ---
154
136
 
@@ -207,7 +189,7 @@ This graphical view is especially useful for new contributors or anyone looking
207
189
 
208
190
  ## Contributing
209
191
 
210
- We welcome contributions to improve this project! Please read our [Contribution Guidelines](CONTRIBUTING.md) for details on how to get started.
192
+ We welcome contributions to improve this project! Please read our [Contribution Guidelines](https://github.com/estebanrfp/gdb/blob/main/CONTRIBUTING.md) for details on how to get started.
211
193
 
212
194
 
213
195
  ## Community
@@ -220,13 +202,13 @@ We value community contributions and discussions! Here's how you can get involve
220
202
 
221
203
  Feel free to ask questions, share ideas, or just say hello! ๐Ÿ‘‹
222
204
 
223
- For more details on contributing, check out our [Contributing Guidelines](CONTRIBUTING.md).
205
+ For more details on contributing, check out our [Contributing Guidelines](https://github.com/estebanrfp/gdb/blob/main/CONTRIBUTING.md).
224
206
 
225
207
  ## Licenses
226
208
 
227
- This project includes third-party dependencies with their respective licenses. For detailed information, see the [Licenses page](THIRD_PARTY_LICENSES.md).
209
+ This project includes third-party dependencies with their respective licenses. For detailed information, see the [Licenses page](https://github.com/estebanrfp/gdb/blob/main/THIRD_PARTY_LICENSES.md).
228
210
 
229
- The source code of this project is licensed under the [MIT License](https://opensource.org/licenses/MIT). For more information, see the [LICENSE](LICENSE) file.
211
+ The source code of this project is licensed under the [MIT License](https://opensource.org/licenses/MIT). For more information, see the [LICENSE](https://github.com/estebanrfp/gdb/blob/main/LICENSE) file.
230
212
 
231
213
  ## Maintenance
232
214
 
@@ -1 +1 @@
1
- async function D(){for(let m of z)try{const{results:f}=await q.map({query:m.if});if(f.length===0)continue;for(let h of f){const P=h.id.split(":")[1];if(!m.offsetTimestamp||h.timestamp.physical<=Date.now()-m.offsetTimestamp)await F(m.then,P)}}catch(f){console.error("\u274C GOVERNANCE ERROR: Failed to process rule.",{rule:m,error:f.message})}}async function F(m,f){if(m.assignRole){const h=m.assignRole,P=`user:${f}`,{result:B}=await q.get(P),k=B.value.role;if(k==="superadmin")return;if(k!==h)await q.sm.executeWithPermission("assignRole"),await q.sm.assignRole(f,h)}}var G=function(){console.log("\u2705 GOVERNANCE ENGINE: Activated. Starting periodic checks."),V=setInterval(D,4000),j=!0},H=function(){if(!j)return;clearInterval(V),V=null,j=!1,console.log("\uD83D\uDED1 GOVERNANCE ENGINE: Deactivated. Pausing checks.")};function J(m,f={}){if(!m||!f.governanceRules)return console.error("\u274C GOVERNANCE: Initialization failed: gdb instance and rules are required.");q=m,z=f.governanceRules,m.sm.setGovernanceStateChangeCallback(async(h)=>{if(h.isActive&&h.activeAddress&&f.superAdmins.includes(h.activeAddress))await q.sm.executeWithPermission("assignRole"),G();else H()})}var q=null,z=[],V=null,j=!1;export{J as start};
1
+ var T,w=[],j,h=!1,y=async()=>{for(let k of w)try{const{results:q=[]}=await T.map({query:k.if});if(!q.length)continue;await Promise.all(q.map(async({id:V,timestamp:P})=>{const[,f]=V.split(":");if(!k.offsetTimestamp||P.physical<=Date.now()-k.offsetTimestamp)await z(k.then,f)}))}catch(q){console.error("\u274C GOVERNANCE ERROR: Failed to process rule.",{rule:k,error:q.message})}},z=async(k,q)=>{if(!k.assignRole)return;const{result:V}=await T.get(`user:${q}`),P=V?.value?.role;if(!P||P==="superadmin"||P===k.assignRole)return;await T.sm.executeWithPermission("assignRole"),await T.sm.assignRole(q,k.assignRole)},B=()=>{if(h)return;console.log("\u2705 GOVERNANCE ENGINE: Activated. Starting periodic checks."),j=setInterval(y,4000),h=!0},D=()=>{if(!h)return;clearInterval(j),j=null,h=!1,console.log("\uD83D\uDED1 GOVERNANCE ENGINE: Deactivated. Pausing checks.")},G=(k,{governanceRules:q,superAdmins:V}={})=>{if(!k||!q)return console.error("\u274C GOVERNANCE: Initialization failed: gdb instance and rules are required.");T=k,w=q,k.sm.setGovernanceStateChangeCallback(async({isActive:P,activeAddress:f})=>{if(P&&f&&V.includes(f))await T.sm.executeWithPermission("assignRole"),B();else D()})};export{G as start};
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genosdb",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "description": "GenosDB (GDB): distributed graph database in real-time, peer-to-peer, scalable storage - efficient querying of complex relationships.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -44,17 +44,17 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@msgpack/msgpack": "3.1.2",
47
- "@vitest/ui": "3.2.4",
48
47
  "ethers": "6.15.0",
49
- "jsdom": "26.1.0",
50
- "pako": "2.1.0",
51
- "vitest": "3.2.4"
48
+ "pako": "2.1.0"
52
49
  },
53
50
  "devDependencies": {
51
+ "@vitest/ui": "3.2.4",
54
52
  "eslint": "9.32.0",
55
53
  "eslint-config-standard": "17.1.0",
56
54
  "eslint-plugin-import": "2.32.0",
57
55
  "eslint-plugin-n": "17.21.3",
58
- "eslint-plugin-promise": "7.2.1"
56
+ "eslint-plugin-promise": "7.2.1",
57
+ "jsdom": "26.1.0",
58
+ "vitest": "3.2.4"
59
59
  }
60
60
  }