genosdb 0.8.4 → 0.8.6
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 +15 -3
- package/dist/audit.min.js +18 -0
- package/dist/audit.min.js.gz +0 -0
- package/dist/gdb.min.js +1 -1
- package/dist/gdb.min.js.gz +0 -0
- package/dist/index.js +1 -1
- package/dist/index.js.gz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ A lightweight, decentralized graph database designed for modern web applications
|
|
|
23
23
|
|
|
24
24
|
[](https://liberapay.com/estebanrfp/donate)
|
|
25
25
|
|
|
26
|
+
> ✅ GenosDB uses network access by design for real-time P2P synchronization (Socket.dev notice)
|
|
27
|
+
|
|
26
28
|
> ⚠️ 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)
|
|
27
29
|
|
|
28
30
|
<!-- ### Nostr.band Followers
|
|
@@ -118,9 +120,12 @@ import { gdb } from "genosdb"
|
|
|
118
120
|
|
|
119
121
|
## Documentation
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
- **Technical Docs**: Find API references and guides in [/docs](https://github.com/estebanrfp/gdb/blob/main/docs/index.md).
|
|
124
|
+
|
|
125
|
+
- **Introduction & Concepts**: Visit our [GitHub Wiki](https://github.com/estebanrfp/gdb/wiki) for an overview.
|
|
126
|
+
|
|
127
|
+
- **Tutorials**: Explore use cases on [Medium](https://medium.com/genosdb).
|
|
122
128
|
|
|
123
|
-
For community-driven content, detailed documentation, tutorials, and live examples, please visit our [GitHub Wiki](https://github.com/estebanrfp/gdb/wiki).
|
|
124
129
|
|
|
125
130
|
For interactive, AI-assisted GenosDB documentation:
|
|
126
131
|
|
|
@@ -130,7 +135,14 @@ For interactive, AI-assisted GenosDB documentation:
|
|
|
130
135
|
|
|
131
136
|
We’ve created a collection of interactive examples to help you understand how GDB works in real-world scenarios. These examples cover everything from basic setup to advanced features like RBAC and P2P synchronization.
|
|
132
137
|
|
|
133
|
-
👉 [Explore Examples](https://github.com/estebanrfp/gdb/
|
|
138
|
+
👉 [Explore /docs/Examples.md](https://github.com/estebanrfp/gdb/blob/main/docs/EXAMPLES.md)
|
|
139
|
+
|
|
140
|
+
## Roadmap & Whitepaper
|
|
141
|
+
|
|
142
|
+
- [View Roadmap](./ROADMAP.md)
|
|
143
|
+
- [View Whitepaper](./WHITEPAPER.md)
|
|
144
|
+
|
|
145
|
+
---
|
|
134
146
|
|
|
135
147
|
### **Internal Dependencies**
|
|
136
148
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
async function E(v){try{const x=await fetch("https://text.pollinations.ai/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"system",content:"You are an assistant specialized in analyzing Oplog data."},{role:"user",content:v}],model:"openai",seed:Math.floor(Math.random()*1000),jsonMode:!0})});if(!x.ok)throw new Error(`Pollinations API error: ${x.statusText}`);const h=await x.json();try{return typeof h==="string"?JSON.parse(h):h}catch{return h}}catch(j){throw console.error("Error processing prompt with API:",j.message),j}}function J(v,j,x={}){console.log("\uD83E\uDDE0 AI Audit module loaded."),console.log(`\uD83E\uDDE0 AI Audit Prompt: \x1B[32m${x.prompt}\x1B[0m`);let h=null;function B(w){if(h)h();h=((v.map?.(({id:S,value:H,action:z})=>{if(console.log(z),z==="added"||z==="updated"||z==="initial")G(v,w)}))??{unsubscribe:()=>{}}).unsubscribe}return B(x.prompt),{stop:()=>h?.()}}var C=(v,j=500)=>{let x;return(...h)=>{clearTimeout(x),x=setTimeout(()=>v(...h),j)}},F=async(v,j="detect offensive or inappropriate language, spam [find closely spaced timestamps] or prohibited content")=>{console.log("\uD83D\uDEE1\uFE0F Audit: analizing Oplog data");const x=v.oplog.getDelta(null),h=[];for(let k of x)try{const{result:S}=await v.get(k.id);if(S&&S.value)h.push({id:k.id,timestamp:k.timestamp,type:k.type,value:S.value})}catch(S){}const B=`
|
|
2
|
+
Rules:
|
|
3
|
+
- Generate ONLY a valid JSON object whose identifiers have been proposed.
|
|
4
|
+
|
|
5
|
+
Prompt: "${j}"
|
|
6
|
+
Elements to analyze: "${JSON.stringify(h)}" (only upserted nodes)
|
|
7
|
+
|
|
8
|
+
Evaluate each task.
|
|
9
|
+
For each object:
|
|
10
|
+
- Include the object's ID in the output list **only if it meets the conditions of the audit prompt**.
|
|
11
|
+
- Do not modify the objects.
|
|
12
|
+
|
|
13
|
+
Strict JSON output format:
|
|
14
|
+
list: [
|
|
15
|
+
{ "id": "<id>" },
|
|
16
|
+
...
|
|
17
|
+
]
|
|
18
|
+
`,w=await E(B);if(w.list&&Array.isArray(w.list))for(let k of w.list){const S=k.id??k;v.remove?.(S),v.oplog?.remove?.(S),console.log(`\uD83D\uDEE1\uFE0F Audit: Node deleted by audit \u2192 ${S}`)}},G=C(F,500);export{J as init,C as debounce};
|
|
Binary file
|