udsl-sdk 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +218 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,218 @@
1
+ # UDSL SDK
2
+
3
+ Crash-Safe Data Recovery SDK for JavaScript and TypeScript applications.
4
+
5
+ UDSL (Universal Data Safety Layer) helps applications prevent data loss by using Write-Ahead Logging (WAL), Snapshots, Recovery, Version History, and Rollback mechanisms.
6
+
7
+ ## Why UDSL?
8
+
9
+ Applications can lose user data because of:
10
+
11
+ * Application crashes
12
+ * Power failures
13
+ * Unexpected shutdowns
14
+ * Network interruptions
15
+ * Software bugs
16
+
17
+ UDSL provides a recovery layer that ensures user data can be restored even after failures.
18
+
19
+ ---
20
+
21
+ ## Features
22
+
23
+ * Write-Ahead Logging (WAL)
24
+ * Snapshot-based recovery
25
+ * Crash recovery
26
+ * Version history
27
+ * Rollback support
28
+ * Multi-tenant architecture
29
+ * API key authentication
30
+ * Offline-first support
31
+ * TypeScript support
32
+
33
+ ---
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm install udsl-sdk
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Initialization
44
+
45
+ ```typescript
46
+ import { UDSL } from "udsl-sdk";
47
+
48
+ UDSL.init({
49
+ baseUrl: "http://localhost:3001",
50
+ apiKey: "your-api-key"
51
+ });
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Save Data
57
+
58
+ ```typescript
59
+ await UDSL.save("doc1", {
60
+ title: "Project Notes",
61
+ content: "Building a crash-safe recovery system"
62
+ });
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Read Data
68
+
69
+ ```typescript
70
+ const data = await UDSL.get("doc1");
71
+
72
+ console.log(data);
73
+ ```
74
+
75
+ ---
76
+
77
+ ## View History
78
+
79
+ ```typescript
80
+ const history = await UDSL.history("doc1");
81
+
82
+ console.log(history);
83
+ ```
84
+
85
+ ---
86
+
87
+ ## Rollback
88
+
89
+ ```typescript
90
+ await UDSL.rollback("doc1", 1);
91
+ ```
92
+
93
+ This restores the document to version 1.
94
+
95
+ ---
96
+
97
+ ## How It Works
98
+
99
+ ### Step 1
100
+
101
+ Application writes data.
102
+
103
+ ```text
104
+ Application
105
+
106
+ UDSL SDK
107
+ ```
108
+
109
+ ### Step 2
110
+
111
+ SDK sends data to the recovery engine.
112
+
113
+ ```text
114
+ SDK
115
+
116
+ Recovery Server
117
+ ```
118
+
119
+ ### Step 3
120
+
121
+ Server writes to WAL before acknowledging.
122
+
123
+ ```text
124
+ Request
125
+
126
+ WAL
127
+
128
+ Snapshot
129
+ ```
130
+
131
+ ### Step 4
132
+
133
+ If a crash occurs, recovery rebuilds the latest state.
134
+
135
+ ```text
136
+ Snapshot
137
+ +
138
+ WAL Replay
139
+
140
+ Recovered State
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Architecture
146
+
147
+ ```text
148
+ Application
149
+
150
+ UDSL SDK
151
+
152
+ Recovery API
153
+
154
+ WAL
155
+ Snapshot
156
+ History
157
+ Rollback
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Example Use Cases
163
+
164
+ ### Notes Applications
165
+
166
+ Recover user notes after crashes.
167
+
168
+ ### Form Builders
169
+
170
+ Prevent loss of partially completed forms.
171
+
172
+ ### Code Editors
173
+
174
+ Restore unsaved work automatically.
175
+
176
+ ### Enterprise Applications
177
+
178
+ Maintain audit trails and recovery history.
179
+
180
+ ### SaaS Platforms
181
+
182
+ Provide reliable data recovery for customers.
183
+
184
+ ---
185
+
186
+ ## Security
187
+
188
+ * API Key Authentication
189
+ * Tenant Isolation
190
+ * Crash-Safe Writes
191
+ * Recovery Validation
192
+
193
+ ---
194
+
195
+ ## Roadmap
196
+
197
+ * Local Offline Queue
198
+ * Background Sync Engine
199
+ * Data Encryption
200
+ * Cloud Dashboard
201
+ * Analytics
202
+ * Mobile SDK
203
+ * React SDK
204
+ * Automatic Backup System
205
+
206
+ ---
207
+
208
+ ## License
209
+
210
+ MIT License
211
+
212
+ ---
213
+
214
+ ## Author
215
+
216
+ Om Ghadage
217
+
218
+ Building reliable systems that help applications recover data after failures.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "udsl-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Crash-safe data recovery SDK (WAL + Snapshot based)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,4 +24,4 @@
24
24
  "devDependencies": {
25
25
  "typescript": "^6.0.3"
26
26
  }
27
- }
27
+ }