genosdb 0.14.0 → 0.15.0

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
@@ -1,6 +1,6 @@
1
1
  # GenosDB (GDB) – Decentralized P2P Graph Database
2
2
 
3
- A lightweight, decentralized graph database designed for modern web applications, offering real-time peer-to-peer synchronization, SM ([Security Manager](https://github.com/estebanrfp/gdb/blob/main/docs/sm-architecture.md)) Provides WebAuthn-based authentication, role-based access control (RBAC), Access Control Lists ([ACLs](https://github.com/estebanrfp/gdb/blob/main/docs/sm-acls-module.md)), rule-based role promotion ([Governance](https://github.com/estebanrfp/gdb/blob/main/docs/governance.md)), and efficient local storage utilizing OPFS.
3
+ A lightweight, decentralized graph database designed for modern web applications, offering real-time peer-to-peer synchronization, SM ([Security Manager](https://github.com/estebanrfp/gdb/blob/main/docs/sm-architecture.md)) Provides WebAuthn-based authentication, role-based access control (RBAC), Access Control Lists ([ACLs](https://github.com/estebanrfp/gdb/blob/main/docs/sm-acls-module.md)), rule-based role promotion & demotion ([Governance](https://github.com/estebanrfp/gdb/blob/main/docs/governance.md)), and efficient local storage utilizing OPFS.
4
4
 
5
5
  ![GenosDB](https://i.imgur.com/7Xqrht1.png)
6
6
 
@@ -64,7 +64,7 @@ A lightweight, decentralized graph database designed for modern web applications
64
64
  - **Intelligent Hybrid Synchronization:**
65
65
  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.
66
66
  - **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.
67
- - **Governance (Role Promotion):** Optional engine that promotes users between roles from declarative rules whose conditions are native GenosDB queries, with each promotion signed by an online superadmin. ([Governance](https://github.com/estebanrfp/gdb/blob/main/docs/governance.md))
67
+ - **Governance (Role Promotion & Demotion):** Optional engine that resolves each user's role from declarative rules (native GenosDB queries) using **last-match-wins** — a merit ladder where climbing overrides lower tiers and losing the condition auto-demotes, each change signed by an online superadmin. ([Governance](https://github.com/estebanrfp/gdb/blob/main/docs/governance.md))
68
68
 
69
69
  ### 🧪 API Status: Stable Beta
70
70
 
@@ -1 +1 @@
1
- var F=null,J=[],K=[],B=null,L=(f)=>!!f&&K.some((j)=>j&&j.toLowerCase()===f.toLowerCase()),P=async()=>{for(let f of J)try{let{results:j=[]}=await F.map({query:f.if});for(let q of j){if(!q.id.startsWith("user:"))continue;let D=q.id.slice(5);if(L(D))continue;if(f.offsetTimestamp&&(q.timestamp?.physical??0)>Date.now()-f.offsetTimestamp)continue;let{assignRole:z,expiresIn:H,expiresAt:M}=f.then??{};if(!z||q.value?.role===z)continue;let N=M??(H!=null?Date.now()+H:null);await F.sm.assignRole(D,z,N)}}catch(j){}},Q=()=>{if(B)return;B=setInterval(P,4000)},U=()=>{if(!B)return;clearInterval(B),B=null},V=(f,{governanceRules:j,superAdmins:q}={})=>{if(!f||!j)return;F=f,J=j,K=q||[],f.sm.setGovernanceStateChangeCallback(({isActive:D,activeAddress:z})=>{if(D&&z&&L(z))Q();else U()})};export{V as start};
1
+ var D=null,F=[],H=[],B=null,J=(q)=>!!q&&H.some((f)=>f&&f.toLowerCase()===q.toLowerCase()),K=async()=>{let q=new Map;for(let f of F){let x=f.then?.assignRole;if(!x)continue;let z=[];try{({results:z=[]}=await D.map({query:f.if}))}catch(j){continue}for(let j of z){if(!j.id.startsWith("user:"))continue;if(J(j.id.slice(5)))continue;if(f.offsetTimestamp&&(j.timestamp?.physical??0)>Date.now()-f.offsetTimestamp)continue;q.set(j.id,{role:x,current:j.value?.role})}}for(let[f,{role:x,current:z}]of q){if(z===x)continue;let j=f.slice(5);try{await D.sm.assignRole(j,x)}catch(N){}}},L=()=>{if(B)return;B=setInterval(K,4000)},M=()=>{if(!B)return;clearInterval(B),B=null},P=(q,{governanceRules:f,superAdmins:x}={})=>{if(!q||!f)return;D=q,F=f,H=x||[],q.sm.setGovernanceStateChangeCallback(({isActive:z,activeAddress:j})=>{if(z&&j&&J(j))L();else M()})};export{P as start};
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genosdb",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
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",