oopsdb 1.2.0 → 1.5.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
@@ -4,6 +4,10 @@
4
4
 
5
5
  Auto-backup and 1-click restore for developers using Claude Code, Cursor, Windsurf, and other AI coding agents.
6
6
 
7
+ <p align="center">
8
+ <img src="website/assets/oopsdb_demo.gif" alt="OopsDB Demo Screen Recording" style="max-width: 100%; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1)">
9
+ </p>
10
+
7
11
  ---
8
12
 
9
13
  ## The Problem
@@ -78,6 +82,16 @@ oopsdb clean Remove all OopsDB data from project
78
82
  2. `oopsdb watch` runs the native dump tool (`pg_dump`, `mysqldump`, or `sqlite3 .backup`) at your chosen interval. Output is streamed through AES-256-CBC encryption directly to disk — memory usage stays flat even for large databases.
79
83
  3. `oopsdb restore` shows your snapshots with timestamps and sizes. Pick one, confirm, and your database is rolled back. It takes a safety snapshot first, so you can always undo the undo.
80
84
 
85
+ ## Quick Demo
86
+
87
+ Want to see OopsDB in action without touching your real database? We built a safe demo playground just for you.
88
+
89
+ 1. Clone or download this repository.
90
+ 2. Navigate to the `demo/` folder: `cd demo`
91
+ 3. Generate the dummy database: `sqlite3 test.db < seed.sql`
92
+ 4. Initialize OopsDB (it won't affect your global config because `.oopsdb` is gitignored here): `oopsdb init`
93
+ 5. Try running `oopsdb shield` and firing a `DROP TABLE users` against it to watch the interceptor catch the query!
94
+
81
95
  ## Requirements
82
96
 
83
97
  Your system needs the native database CLI tools:
@@ -63,11 +63,31 @@ async function secureCommand(options) {
63
63
  const fileSizeInBytes = fs.statSync(latestFile).size;
64
64
  const fileSizeMB = (fileSizeInBytes / (1024 * 1024)).toFixed(2);
65
65
  console.log(chalk_1.default.blue(` Found latest snapshot: ${fileName} (${fileSizeMB} MB)`));
66
- // Placeholder URL logic: In the future, this would fetch from the Cloudflare Pages backend
67
- // e.g. const res = await fetch('https://oopsdb.com/api/upload-url', { ... });
68
- const placeholderUploadUrl = 'https://example-bucket.s3.amazonaws.com/placeholder-url-for-mvp';
69
- console.log(chalk_1.default.gray(` Requesting secure upload token...\n`));
70
- await uploadToS3(latestFile, placeholderUploadUrl);
66
+ // In production, hit the live endpoint. If testing locally, hit the wrangler dev server.
67
+ const baseUrl = process.env.TEST_LOCAL_API ? 'http://localhost:8788' : 'https://oopsdb.com';
68
+ console.log(chalk_1.default.gray(` Requesting secure upload token from ${baseUrl}...\n`));
69
+ let actualUploadUrl = '';
70
+ try {
71
+ const res = await fetch(`${baseUrl}/api/upload-url?fileName=${fileName}`, {
72
+ headers: {
73
+ 'Authorization': 'Bearer oops_sec_9f8b2c7d4e5a1b3c8f9d0e2a5b7c8d9e'
74
+ }
75
+ });
76
+ if (!res.ok) {
77
+ const errText = await res.text();
78
+ console.log(chalk_1.default.red(` Failed to get upload token: ${res.status} ${res.statusText}`));
79
+ console.log(chalk_1.default.gray(` Details: ${errText}\n`));
80
+ return;
81
+ }
82
+ const data = await res.json();
83
+ actualUploadUrl = data.uploadUrl;
84
+ }
85
+ catch (err) {
86
+ console.log(chalk_1.default.red(` Network error reaching backend: ${err.message}\n`));
87
+ console.log(chalk_1.default.yellow(` Tip: If testing locally, ensure you ran 'npx wrangler pages dev website' first and set TEST_LOCAL_API=1\n`));
88
+ return;
89
+ }
90
+ await uploadToS3(latestFile, actualUploadUrl);
71
91
  }
72
92
  async function uploadToS3(filePath, uploadUrl) {
73
93
  const size = fs.statSync(filePath).size;
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oopsdb",
3
- "version": "1.2.0",
3
+ "version": "1.5.0",
4
4
  "description": "Don't let AI nuke your database. Auto-backup and 1-click restore for developers using Claude Code, Cursor, Windsurf, and other AI coding agents.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -54,6 +54,7 @@
54
54
  "@cloudflare/workers-types": "^4.20260310.1",
55
55
  "@types/inquirer": "^8.2.10",
56
56
  "@types/node": "^22.0.0",
57
+ "dotenv": "^17.3.1",
57
58
  "testcontainers": "^11.12.0",
58
59
  "typescript": "^5.7.0",
59
60
  "vitest": "^4.0.18"