genosdb 0.15.4 → 0.16.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 +2 -2
- package/dist/sm-acls.min.js +1 -1
- package/dist/sm-acls.min.js.gz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ A lightweight, decentralized graph database designed for modern web applications
|
|
|
39
39
|
|
|
40
40
|
## How it works
|
|
41
41
|
|
|
42
|
-
GenosDB runs **entirely in your browser** — there is no central database server. The Security Manager signs every operation with your key, nodes are stored locally in OPFS, and changes replicate **peer-to-peer over WebRTC
|
|
42
|
+
GenosDB runs **entirely in your browser** — there is no central database server. The Security Manager signs every operation with your key, nodes are stored locally in OPFS, and changes replicate **peer-to-peer over WebRTC** through [GenosRTC](https://github.com/estebanrfp/gdb/blob/main/docs/genosrtc-api-reference.md), GenosDB's own networking layer. Nostr relays only help peers discover each other — they never see your data.
|
|
43
43
|
|
|
44
44
|
```ascii
|
|
45
45
|
Nostr Relays
|
|
@@ -53,7 +53,7 @@ Browser + GenosDB
|
|
|
53
53
|
│
|
|
54
54
|
├─► Graph Store (OPFS) (stores nodes)
|
|
55
55
|
│ │
|
|
56
|
-
│ ├─► Other Peers (WebRTC sync)
|
|
56
|
+
│ ├─► Other Peers (GenosRTC / WebRTC sync)
|
|
57
57
|
│ │
|
|
58
58
|
│ └─► BroadcastChannel (cross-tab)
|
|
59
59
|
│
|
package/dist/sm-acls.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=async(D,T)=>{if(!T)return null;let F="owner",H="collaborators",P=()=>{let h=D.sm.getActiveEthAddress();if(!h)throw Error("❌ [SM-ACLs] Active user session required.");return h},V=(h)=>Error(`❌ [SM-ACLs] Only the owner can ${h}.`),
|
|
1
|
+
var _=async(D,T)=>{if(!T)return null;let F="owner",H="collaborators",P=()=>{let h=D.sm.getActiveEthAddress();if(!h)throw Error("❌ [SM-ACLs] Active user session required.");return h},V=(h)=>Error(`❌ [SM-ACLs] Only the owner can ${h}.`),Z=async(h,k)=>{let x=[];for(let z of h){let{signer:G,type:J,id:X}=z;if(!G||!X){x.push(z);continue}let Q=k.get(X),{[F]:K,[H]:Y={}}=Q?.value||{};if(J==="upsert"||J==="put"){if(!Q||K===void 0||G===K||Y[G]==="write"||Y[G]==="delete")x.push(z);continue}if(J==="remove"){if(!Q||K===void 0||G===K||Y[G]==="delete")x.push(z);continue}x.push(z)}return x};return D.use(Z),{async set(h,k){let x=P(),{result:z}=await D.get(k);if(z){let{[F]:G,[H]:J={}}=z.value;if(x!==G&&J[x]!=="write")throw Error(`\uD83D\uDEE1️ [SM-ACLs] Write denied for node ${k}.`);let{[F]:X,[H]:Q,...K}=h;return D.put({...z.value,...K},k)}return D.put({...h,[F]:x,[H]:{}},k)},async grant(h,k,x){let z=P();if(!["read","write","delete"].includes(x))throw Error("\uD83D\uDEE1️ [SM-ACLs] Permission must be 'read', 'write' or 'delete'.");let{result:G}=await D.get(h);if(!G)throw Error(`❌ [SM-ACLs] Node ${h} not found.`);if(G.value[F]!==z)throw V("grant permissions");let J={...G.value[H]??{},[k]:x};await D.put({...G.value,[H]:J},h)},async revoke(h,k){let x=P(),{result:z}=await D.get(h);if(!z)throw Error(`❌ [SM-ACLs] Node ${h} not found.`);if(z.value[F]!==x)throw V("revoke permissions");let{[k]:G,...J}=z.value[H]??{};await D.put({...z.value,[H]:J},h)},async delete(h){let k=P(),{result:x}=await D.get(h);if(!x)return;if(x.value[F]!==k&&x.value[H]?.[k]!=="delete")throw V("delete this node");await D.remove(h)},async getPermissions(h){let{result:k}=await D.get(h);if(!k||k.value[F]===void 0)return null;return{owner:k.value[F],collaborators:k.value[H]??{}}}}};async function f(D,T){try{let F=await _(D,T);if(F)try{Object.defineProperty(D.sm,"acls",{value:F,writable:!0,enumerable:!1,configurable:!0})}catch(H){throw Error("❌ [SM-ACLs] Cannot attach ACL module to gdb.sm. Ensure gdb.sm is extensible.")}}catch(F){throw F}}export{f as start,_ as createAclModule};
|
package/dist/sm-acls.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genosdb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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",
|